Plugin Directory

Changeset 3732177


Ignore:
Timestamp:
10/07/2026 08:55:53 AM (3 weeks ago)
Author:
domainsupport
Message:

Tagging version 2.0.4

Location:
deny-all-firewall
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • deny-all-firewall/tags/2.0.4/deny-all-firewall.php

    r3722670 r3732177  
    22/*
    33 * Plugin Name: Deny All Firewall
    4  * Version: 2.0.3
     4 * Version: 2.0.4
    55 * Requires at least: 5.0
    66 * Requires PHP: 7.0
    … …  
    2424        class Deny_All_Firewall {
    2525
    26         const VERSION = '2.0.3';
     26        const VERSION = '2.0.4';
    2727        const CONTENT_CONDITION_UPPER_THRESHOLD = 100;
    2828        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.';
    3031
    3132        private $black_list = array();
    … …  
    27992800        private function refresh_static_robots($replace_existing = false) {
    28002801
     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
    28012819            global $wp_filesystem;
    28022820
    … …  
    28172835                $is_daf_file = (
    28182836                    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                    )
    28202841                );
    28212842
    … …  
    28782899                (
    28792900                    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                    )
    28812905                )
    28822906            ) {
  • deny-all-firewall/tags/2.0.4/readme.txt

    r3722670 r3732177  
    66Tested up to: 7.1
    77Requires PHP: 7.0
    8 Stable tag: 2.0.3
     8Stable tag: 2.0.4
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    134134If the website already has a physical `robots.txt` file that Deny All Firewall did not create, it is left unchanged.
    135135
     136Sites 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
     140Refresh 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
    136142= What information does Blocked Request Troubleshooting record? =
    137143
    … …  
    177183
    178184== 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
    179188
    180189= 2.0.3 =
    … …  
    203212== Upgrade Notice ==
    204213
    205 = 2.0.3 =
    206 * Improves administration access reliability and adds lightweight immediate-threat detection with a rolling Dashboard summary
     214= 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  
    22/*
    33 * Plugin Name: Deny All Firewall
    4  * Version: 2.0.3
     4 * Version: 2.0.4
    55 * Requires at least: 5.0
    66 * Requires PHP: 7.0
    … …  
    2424        class Deny_All_Firewall {
    2525
    26         const VERSION = '2.0.3';
     26        const VERSION = '2.0.4';
    2727        const CONTENT_CONDITION_UPPER_THRESHOLD = 100;
    2828        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.';
    3031
    3132        private $black_list = array();
    … …  
    27992800        private function refresh_static_robots($replace_existing = false) {
    28002801
     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
    28012819            global $wp_filesystem;
    28022820
    … …  
    28172835                $is_daf_file = (
    28182836                    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                    )
    28202841                );
    28212842
    … …  
    28782899                (
    28792900                    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                    )
    28812905                )
    28822906            ) {
  • deny-all-firewall/trunk/readme.txt

    r3722670 r3732177  
    66Tested up to: 7.1
    77Requires PHP: 7.0
    8 Stable tag: 2.0.3
     8Stable tag: 2.0.4
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    134134If the website already has a physical `robots.txt` file that Deny All Firewall did not create, it is left unchanged.
    135135
     136Sites 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
     140Refresh 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
    136142= What information does Blocked Request Troubleshooting record? =
    137143
    … …  
    177183
    178184== 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
    179188
    180189= 2.0.3 =
    … …  
    203212== Upgrade Notice ==
    204213
    205 = 2.0.3 =
    206 * Improves administration access reliability and adds lightweight immediate-threat detection with a rolling Dashboard summary
     214= 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.