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

index 1c1e4cb..7a90d11 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();
 }
 
 /*
index 30247e8..ff0c734 100644 (file)
@@ -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();
 }
 
 /*
index 773aee9..b710590 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_SEARCH_PLUGIN_NAME', 'Gaslight Media Members Database Search (Search)');
index 9d6e3eb..04b1f5e 100644 (file)
--- a/index.php
+++ b/index.php
  * @version 1.2.2
  */
 
+// 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
  *
@@ -65,12 +71,6 @@ if (GLM_MEMBERS_SEARCH_PLUGIN_VERSION != get_option('glmMembersDatabaseSearchPlu
  * 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 31bf90a..fdbfed0 100644 (file)
@@ -18,7 +18,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