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

index b7c7de3..237a1fc 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 08d00b1..e73d494 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 edee637..c72f370 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();
+}
+
 define('GLM_SERVERSTATS_SITE_TITLE', get_bloginfo( 'name' ));
 define('GLM_SERVERSTATS_PLUGIN_NAME', 'Gaslight Media ServerStats (serverstats)');
 define('GLM_SERVERSTATS_PLUGIN_SHORT_NAME', 'ServerStats');
index e24086c..69b18d7 100644 (file)
--- a/index.php
+++ b/index.php
  * @version 1.1.1
  */
 
-define('GLM_SERVERSTATS_PLUGIN_VERSION', '1.1.1');
-
 // 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();
 }
 
+define('GLM_SERVERSTATS_PLUGIN_VERSION', '1.1.1');
 
 // Required to be able to get user capabilities when being called as a filter from the main plugin
 require_once ABSPATH . 'wp-includes/pluggable.php';
index 7f2a84e..92fda27 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