Changeset 3732177
- Timestamp:
- 10/07/2026 08:55:53 AM (3 weeks ago)
- Location:
- deny-all-firewall
- Files:
-
- 2 edited
- 4 copied
-
tags/2.0.4 (copied) (copied from deny-all-firewall/trunk )
-
tags/2.0.4/403.php (copied) (copied from deny-all-firewall/trunk/403.php )
-
tags/2.0.4/deny-all-firewall.php (copied) (copied from deny-all-firewall/trunk/deny-all-firewall.php ) (5 diffs)
-
tags/2.0.4/readme.txt (copied) (copied from deny-all-firewall/trunk/readme.txt ) (4 diffs)
-
trunk/deny-all-firewall.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
deny-all-firewall/tags/2.0.4/deny-all-firewall.php
r3722670 r3732177 2 2 /* 3 3 * Plugin Name: Deny All Firewall 4 * Version: 2.0. 34 * Version: 2.0.4 5 5 * Requires at least: 5.0 6 6 * Requires PHP: 7.0 … … 24 24 class Deny_All_Firewall { 25 25 26 const VERSION = '2.0. 3';26 const VERSION = '2.0.4'; 27 27 const CONTENT_CONDITION_UPPER_THRESHOLD = 100; 28 28 const CONTENT_CONDITION_LOWER_THRESHOLD = 75; 29 const ROBOTS_FILE_MARKER = '# Generated by Deny All Firewall from WordPress robots.txt filters.'; 29 const ROBOTS_FILE_MARKER = '# Generated by Deny All Firewall'; 30 const LEGACY_ROBOTS_FILE_MARKER = '# Generated by Deny All Firewall from WordPress robots.txt filters.'; 30 31 31 32 private $black_list = array(); … … 2799 2800 private function refresh_static_robots($replace_existing = false) { 2800 2801 2802 /** 2803 * Filters whether Deny All Firewall should create a physical robots.txt file. 2804 * Return false when robots.txt must remain dynamic, such as when its 2805 * contents vary between hostnames sharing the same document root. 2806 * 2807 * @param bool $enabled Whether static robots.txt generation is enabled. 2808 */ 2809 $enabled = (bool) apply_filters('daf_enable_static_robots_txt', true); 2810 2811 if (!$enabled) { 2812 2813 // Remove only a robots.txt file previously generated by this plugin. 2814 $this->remove_static_robots(); 2815 return true; 2816 2817 } 2818 2801 2819 global $wp_filesystem; 2802 2820 … … 2817 2835 $is_daf_file = ( 2818 2836 is_string($existing_content) && 2819 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER) 2837 ( 2838 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER . "\n") || 2839 0 === strpos($existing_content, self::LEGACY_ROBOTS_FILE_MARKER . "\n") 2840 ) 2820 2841 ); 2821 2842 … … 2878 2899 ( 2879 2900 is_string($existing_content) && 2880 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER) 2901 ( 2902 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER . "\n") || 2903 0 === strpos($existing_content, self::LEGACY_ROBOTS_FILE_MARKER . "\n") 2904 ) 2881 2905 ) 2882 2906 ) { -
deny-all-firewall/tags/2.0.4/readme.txt
r3722670 r3732177 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.0 8 Stable tag: 2.0. 38 Stable tag: 2.0.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 134 134 If the website already has a physical `robots.txt` file that Deny All Firewall did not create, it is left unchanged. 135 135 136 Sites that need WordPress to generate different `robots.txt` contents for different hostnames can disable the physical file with the `daf_enable_static_robots_txt` filter: 137 138 `add_filter('daf_enable_static_robots_txt', '__return_false');` 139 140 Refresh the firewall rules once after adding or removing this filter. When disabled, Deny All Firewall removes only a `robots.txt` file that it previously generated and leaves other physical files untouched. 141 136 142 = What information does Blocked Request Troubleshooting record? = 137 143 … … 177 183 178 184 == Changelog == 185 186 = 2.0.4 = 187 * Added the `daf_enable_static_robots_txt` filter so sites requiring hostname-specific robots.txt output can keep it dynamic 179 188 180 189 = 2.0.3 = … … 203 212 == Upgrade Notice == 204 213 205 = 2.0. 3=206 * Improves administration access reliability and adds lightweight immediate-threat detection with a rolling Dashboard summary214 = 2.0.4 = 215 * Allows sites with hostname-specific robots.txt output to disable Deny All Firewall’s static robots.txt generation -
deny-all-firewall/trunk/deny-all-firewall.php
r3722670 r3732177 2 2 /* 3 3 * Plugin Name: Deny All Firewall 4 * Version: 2.0. 34 * Version: 2.0.4 5 5 * Requires at least: 5.0 6 6 * Requires PHP: 7.0 … … 24 24 class Deny_All_Firewall { 25 25 26 const VERSION = '2.0. 3';26 const VERSION = '2.0.4'; 27 27 const CONTENT_CONDITION_UPPER_THRESHOLD = 100; 28 28 const CONTENT_CONDITION_LOWER_THRESHOLD = 75; 29 const ROBOTS_FILE_MARKER = '# Generated by Deny All Firewall from WordPress robots.txt filters.'; 29 const ROBOTS_FILE_MARKER = '# Generated by Deny All Firewall'; 30 const LEGACY_ROBOTS_FILE_MARKER = '# Generated by Deny All Firewall from WordPress robots.txt filters.'; 30 31 31 32 private $black_list = array(); … … 2799 2800 private function refresh_static_robots($replace_existing = false) { 2800 2801 2802 /** 2803 * Filters whether Deny All Firewall should create a physical robots.txt file. 2804 * Return false when robots.txt must remain dynamic, such as when its 2805 * contents vary between hostnames sharing the same document root. 2806 * 2807 * @param bool $enabled Whether static robots.txt generation is enabled. 2808 */ 2809 $enabled = (bool) apply_filters('daf_enable_static_robots_txt', true); 2810 2811 if (!$enabled) { 2812 2813 // Remove only a robots.txt file previously generated by this plugin. 2814 $this->remove_static_robots(); 2815 return true; 2816 2817 } 2818 2801 2819 global $wp_filesystem; 2802 2820 … … 2817 2835 $is_daf_file = ( 2818 2836 is_string($existing_content) && 2819 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER) 2837 ( 2838 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER . "\n") || 2839 0 === strpos($existing_content, self::LEGACY_ROBOTS_FILE_MARKER . "\n") 2840 ) 2820 2841 ); 2821 2842 … … 2878 2899 ( 2879 2900 is_string($existing_content) && 2880 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER) 2901 ( 2902 0 === strpos($existing_content, self::ROBOTS_FILE_MARKER . "\n") || 2903 0 === strpos($existing_content, self::LEGACY_ROBOTS_FILE_MARKER . "\n") 2904 ) 2881 2905 ) 2882 2906 ) { -
deny-all-firewall/trunk/readme.txt
r3722670 r3732177 6 6 Tested up to: 7.1 7 7 Requires PHP: 7.0 8 Stable tag: 2.0. 38 Stable tag: 2.0.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 134 134 If the website already has a physical `robots.txt` file that Deny All Firewall did not create, it is left unchanged. 135 135 136 Sites that need WordPress to generate different `robots.txt` contents for different hostnames can disable the physical file with the `daf_enable_static_robots_txt` filter: 137 138 `add_filter('daf_enable_static_robots_txt', '__return_false');` 139 140 Refresh the firewall rules once after adding or removing this filter. When disabled, Deny All Firewall removes only a `robots.txt` file that it previously generated and leaves other physical files untouched. 141 136 142 = What information does Blocked Request Troubleshooting record? = 137 143 … … 177 183 178 184 == Changelog == 185 186 = 2.0.4 = 187 * Added the `daf_enable_static_robots_txt` filter so sites requiring hostname-specific robots.txt output can keep it dynamic 179 188 180 189 = 2.0.3 = … … 203 212 == Upgrade Notice == 204 213 205 = 2.0. 3=206 * Improves administration access reliability and adds lightweight immediate-threat detection with a rolling Dashboard summary214 = 2.0.4 = 215 * Allows sites with hostname-specific robots.txt output to disable Deny All Firewall’s static robots.txt generation
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)