From: Chuck Scott Date: Fri, 11 Aug 2017 20:20:18 +0000 (-0400) Subject: Updated check for all common plugin PHP files being called directly and now sending... X-Git-Tag: v2.10.8^2~5 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9a34101febc4351ba7323338aa796f5752ac6057;p=WP-Plugins%2Fglm-member-db.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 3a0069e8..d554fc7d 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(); } // Load glmPluginSupport class diff --git a/config.php b/config.php index 4d58bf57..22c2502b 100644 --- a/config.php +++ b/config.php @@ -5,6 +5,12 @@ * Get plugin configuration */ +// Check that we're being called by WordPress. +if (!defined('ABSPATH')) { + header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html"); + die(); +} + // Get plugin configuration $configData = parse_ini_file(GLM_MEMBERS_PLUGIN_PATH.'/config/plugin.ini', true); $config = $configData['common']; diff --git a/deactivate.php b/deactivate.php index d0397b08..352e8f06 100644 --- a/deactivate.php +++ b/deactivate.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(); } // Load glmPluginSupport class diff --git a/defines.php b/defines.php index 204f41f2..b3bd2c50 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_SITE_TITLE', get_bloginfo( 'name' )); diff --git a/index.php b/index.php index b3aeebc1..87c7433b 100644 --- a/index.php +++ b/index.php @@ -22,6 +22,12 @@ * @version 2.10.7 */ +// 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 * @@ -191,11 +197,6 @@ if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) * ******************************************************************************** */ -// 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 876dcc5c..306fa641 100644 --- a/uninstall.php +++ b/uninstall.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(); } //if uninstall not called from WordPress exit