Role Scoper Conflict with WP Security Scan Plugin

Saturday’s localhost/agnet “File Not Found” error was due to a conflict between Role Scoper and the WP Security Scan plugin.

WP Security Scan hides the WP version number, even down to changing the internal global variable $wp_version to ‘abc’ That throws off Role Scoper’s multiple WP version support, which must be operative even for anonymous users. The next Role Scoper revision will include the workaround of alternate version detection if a bogus wp_version is set. Until then, you have two options to make the plugins work together:

  • In plugins/wp-security-scan/securityscan.php, comment out the following line:
    add_action("init", mrt_remove_wp_version,1);
  • OR (for WP 2.5 users) in plugins/role-scoper/lib/agapetry_wp_lib.php, change
    return version_compare($wp_version, $wp_ver_requirement, '>=');

    to

    if ( ! version_compare($wp_version, '0', '>=') )
    	return true;
    else
    	return version_compare($wp_version, $wp_ver_requirement, '>=');