Question about Bad Behaviour plugin function wp_supercache_badbehaviour_include
-
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()returnsfalse. The condition is met, though ($bbfileis nottrue), and the script tries to include thefalseof$bbfile. However, ifget_bb_file_loc()returns the path to the plugin file, the condition is not met ($bbfileis set/not false), so nothing is included? Shouldn’t the third line in this rather readif( $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.
The topic ‘Question about Bad Behaviour plugin function wp_supercache_badbehaviour_include’ is closed to new replies.