• Hello, can you please add a setting where you can specify status codes to ignore (local old version)?

    More and more websites return a 403 forbidden error. The links are reported as broken/warning, but they always work. So I’d like to be able to specify that 403 errors should always be ignored.

    The 403 error might be caused by the user agent the plugin uses, so an option to specify a custom user agent would also be much appreciated.

    Thanks
    JP

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @jpnl

    I hope you are doing well.

    You can test different user agents with a PHP filter:

    <?php
    /**
     * Plugin Name: BLC Local User Agent
     * Description: Sends a browser user agent from the Broken Link Checker local engine.
     */
    
    add_filter(
    	'wpmudev_blc_local_ua',
    	static function () {
    		return 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
    	}
    );
    
    add_filter(
    	'http_request_args',
    	static function ( $args ) {
    		$fallback = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)';
    
    		if ( isset( $args['user-agent'] ) && $fallback === $args['user-agent'] ) {
    			$args['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
    		}
    
    		return $args;
    	}
    );

    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Unfortunately, we don’t have a filter to modify the results and ignore only specific response code. I can see how it can be helpful so I am sharing this situation with the plugin developers and I hope we can add some filters to be able to modify that as well.

    Best Regards
    Patrick Freitas

    Thank you, I will try that.

    I would love to see this as a field under Local » settings » advanced, so you don’t have to install it as a (mu) plugin.

    Same for a ‘Status code exclusion list’ field where you can enter the status codes that should be ignored and not trigger a warning.

    Thanks
    JP

    Plugin Support Fida – WPMU DEV Support

    (@fidawpmudev)

    Hello @jpnl ,

    I hope you are doing well.

    I have forwarded your request to our developers. They will check if this is something they can bring in future versions. However, I can’t promise you an ETA.

    Kind Regards,
    Fida Al Hasan

    Thanks

    Plugin Support Williams – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @jpnl

    Again, thank you for the suggestions! I would suggest subscribing to our roadmap and receiving updates about our products https://wpmudev.com/roadmap.

    That said, this was already forwarded to our developers and I am marking this thread as resolved, but if you have any additional questions, feel free to let us know.

    Best regards,
    Williams Valerio

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.