Role Scoper Now Reactivatates After Update

Role Scoper 1.0.3.4 solves the mystery of plugin deactivation following use of the WordPress “update automatically” feature.  More precisely, it causes Role Scoper to be successfully reactivated following that update.

For the technically curious… the failure was due to WordPress’ detection of a supplemental Role Scoper file (version_notice_rs.php) as a main plugin file.  This was due to the presence of ‘|Plugin Name:’ in version_notice_rs.php, where it is used in a regular expression match to extract the plugin name for other plugins which may have Role Scoper extensions available.  The WordPress function get_plugins()  took that as proof of a “plugin file”, and logged it ahead of role-scoper.php alphabetically.  The WordPress function wp_update_plugin() assumes that the first logged “plugin file” is the one to re-activate.  I solved this by moving version_notice_rs.php into a deeper subdirectory, as function get_plugins() only looks one level deep.

Note, the first time an auto-update is run, you may see the following nuisance error message:

The plugin role-scoper/admin/version_notice_rs.php has been deactivated due to an error: Plugin file does not exist.

Please ignore that message, which is simply a purging of the imaginary plugin out of WordPress’ memory.

Those who have already activated Role Scoper 1.0.2 or higher do not need to run this update.  The only other change is a correction to the Roles and Restrictions menu locations with WordPress 2.8.