From: Chuck Scott Date: Fri, 11 Aug 2017 20:57:21 +0000 (-0400) Subject: Updated check for all common plugin PHP files being called directly and now sending... X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=290c38c6f17fde6aac9c78aae46eb01505ac1b1d;p=WP-Plugins%2Fglm-member-db-social.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 b62c275..0ff24ae 100644 --- a/activate.php +++ b/activate.php @@ -14,21 +14,10 @@ * @link http://dev.gaslightmedia.com/ */ -/********************************************************************** - * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED - * - * Please change all references to social, Social, or SOCIAL to a name - * appropriate for your new Add-On. - * - * This file activates this add-on. Other than replacing the various - * versions of the work "Social", this code should not need editing. - * - * Remove this message before using this file in production! - **********************************************************************/ - // 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 3dbaade..9cae5a4 100644 --- a/deactivate.php +++ b/deactivate.php @@ -13,21 +13,10 @@ * @link http://dev.gaslightmedia.com/ */ -/********************************************************************** - * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED - * - * Please change all references to social, Social, or SOCIAL to a name - * appropriate for your new Add-On. - * - * This file deactivates this add-on. Other than replacing the various - * versions of the work "Social", this code should not need editing. - * - * Remove this message before using this file in production! - **********************************************************************/ - // 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 3f11017..ff051f3 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_SOCIAL_PLUGIN_NAME', 'Gaslight Media Members Database Social (social)'); diff --git a/index.php b/index.php index 059df85..6636456 100644 --- a/index.php +++ b/index.php @@ -9,22 +9,6 @@ * License: GPL2 */ -/********************************************************************** - * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED - * - * Please change all references to social, Social, or SOCIAL to a name - * appropriate for your new Add-On. - * - * This is the main file for this add-on. It is the file called by - * WordPress to run aspects of this add-on. - * - * NOTE: Versions in this file must be reset as appropriate when - * creating a new add-on. Be sure to preserve the versions listed - * for "...MIN_MEMBERS_REQUIRED_VERSION". - * - * Remove this message before using this file in production! - **********************************************************************/ - /** * Gaslight Media Members Database Social Add-On * Index @@ -38,6 +22,12 @@ * @version 1.1.0 */ +// 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 * @@ -81,12 +71,6 @@ if (GLM_MEMBERS_SOCIAL_PLUGIN_VERSION != get_option('glmMembersDatabaseSocialPlu * 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 5bc5d9b..1309703 100644 --- a/uninstall.php +++ b/uninstall.php @@ -16,18 +16,10 @@ die('uninstall not configured - See plugin uninstall.php script!'); * @link http://dev.gaslightmedia.com/ */ -/********************************************************************** - * NOTE: THIS IS A SOCIAL FILE - DO NOT USE UNMODIFIED - * - * Please change all references to social, Social, or SOCIAL to a name - * appropriate for your new Add-On. - * - * Remove this message before using this file in production! - **********************************************************************/ - // 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