• Hi Donncha,

    I have a question about this function in the Bad Behaviour plugin for WP Super Cache:

    function wp_supercache_badbehaviour_include() {
    	$bbfile = get_bb_file_loc();
    	if( !$bbfile )
    		require_once( $bbfile );
    }

    Is it just me, or would this function never include the functions of the Bad Behaviour plugin proper? If the Bad Behaviour plugin can’t be found where WP Super Cache expects it, as I understand it, get_bb_file_loc() returns false. The condition is met, though ($bbfile is not true), and the script tries to include the false of $bbfile. However, if get_bb_file_loc() returns the path to the plugin file, the condition is not met ($bbfile is set/not false), so nothing is included? Shouldn’t the third line in this rather read

    if( $bbfile )

    ? I’m confused.

    The thing is, I had programmed a custom plugin for myself that checks visitors’ IPs against a blacklist of the IPs of spambots that are currently peeving me. If the IP is found on the list, a 403 header is sent and further page generation is terminated. This of course doesn’t work for chached files, which are always served, so I was looking into forking the Bad Behaviour plugin and modifying it to do my blacklist check before a cache is served. However, even with changing the variable names and the plugin proper’s file location variable to my plugin, caches still get served to regular offenders. I can upload the code to Github or so if you need to have a look at it to get a better idea.

    https://wordpress.org/plugins/wp-super-cache/

Viewing 1 replies (of 1 total)
  • Thread Starter carbeck

    (@carbeck)

    For what it’s worth, even after deleting the exclamation mark in my modified version of WP Super Cache’s plugin for Bad Behaviour, caches are still served.

Viewing 1 replies (of 1 total)

The topic ‘Question about Bad Behaviour plugin function wp_supercache_badbehaviour_include’ is closed to new replies.