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

index 3a0069e..d554fc7 100644 (file)
@@ -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
index 4d58bf5..22c2502 100644 (file)
@@ -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'];
index d0397b0..352e8f0 100644 (file)
@@ -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
index 204f41f..b3bd2c5 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_SITE_TITLE', get_bloginfo( 'name' ));
index b3aeebc..87c7433 100644 (file)
--- a/index.php
+++ b/index.php
  * @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
index 876dcc5..306fa64 100644 (file)
@@ -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