Updated check for all common plugin PHP files being called directly and now sending...
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 11 Aug 2017 20:57:21 +0000 (16:57 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 11 Aug 2017 20:57:21 +0000 (16:57 -0400)
activate.php
deactivate.php
defines.php
index.php
uninstall.php

index b62c275..0ff24ae 100644 (file)
  * @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();
 }
 
 /*
index 3dbaade..9cae5a4 100644 (file)
  * @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();
 }
 
 /*
index 3f11017..ff051f3 100644 (file)
@@ -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)');
index 059df85..6636456 100644 (file)
--- 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
  * @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
 */
index 5bc5d9b..1309703 100644 (file)
@@ -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