From: Chuck Scott Date: Fri, 11 Aug 2017 20:33:46 +0000 (-0400) Subject: Updated check for all common plugin PHP files being called directly and now sending... X-Git-Tag: v1.2.16^2~5 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=7fd42293aa5c870b7ad945106edc40fbe9612213;p=WP-Plugins%2Fglm-member-db-packaging.git Updated check for all common plugin PHP files being called directly and now sending user to /assets/404.html --- diff --git a/activate.php b/activate.php index f58b240..d911356 100644 --- a/activate.php +++ b/activate.php @@ -16,7 +16,8 @@ // Check that we're being called by WordPress. if (!defined('ABSPATH')) { - die("Please do not call this code directly!"); + header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html"); + die(); } /* diff --git a/deactivate.php b/deactivate.php index 89fdcb9..925b0ff 100644 --- a/deactivate.php +++ b/deactivate.php @@ -15,7 +15,8 @@ // Check that we're being called by WordPress. if (!defined('ABSPATH')) { - die("Please do not call this code directly!"); + header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html"); + die(); } /* diff --git a/defines.php b/defines.php index 5bb5511..bfca4cf 100644 --- a/defines.php +++ b/defines.php @@ -5,6 +5,12 @@ * Set standard defined parameters */ +// Check that we're being called by WordPress. +if (!defined('ABSPATH')) { + header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html"); + die(); +} + // NOTE: Plugin & Database versions are defined in "/glm-member-db.php". define('GLM_MEMBERS_PACKAGING_PLUGIN_NAME', 'Gaslight Media Members Database Packaging'); diff --git a/index.php b/index.php index ccbf42f..82f3357 100644 --- a/index.php +++ b/index.php @@ -22,7 +22,13 @@ * @version 1.2.14 */ -/* +// Check that we're being called by WordPress. +if (!defined('ABSPATH')) { + header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html"); + die(); +} + + /* * Plugin and Database Versions * * Note that the database version matches the version of the last @@ -65,12 +71,6 @@ if (GLM_MEMBERS_PACKAGING_PLUGIN_VERSION != get_option('glmMembersDatabasePackag * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - -// Check that we're being called by WordPress. -if (!defined('ABSPATH')) { - die("Please do not call this code directly!"); -} - /* * Some initial setup and tests */ diff --git a/uninstall.php b/uninstall.php index fe48ebb..79f64a9 100644 --- a/uninstall.php +++ b/uninstall.php @@ -16,7 +16,8 @@ die('uninstall not configured - See plugin uninstall.php script!'); // Check that we're being called by WordPress. if (!defined('ABSPATH')) { - die("Please do not call this code directly!"); + header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html"); + die(); } //if uninstall not called from WordPress exit