deliciousbrains / better-search-replace

A simple plugin for updating URLs or other text in a database.
https://bettersearchreplace.com
GNU General Public License v3.0
86 stars 36 forks source link

Not appearing on TEST and LIVE environments in Pantheon #48

Open carl-alberto opened 6 years ago

carl-alberto commented 6 years ago

Seems this plugin do not work because it is doing capability check for 'install_plugins' so it won't work on read only environments of Pantheon, is it feasible to use the 'manage_options' capabilities instead? If yes, are you welcome for PR of it?

carl-alberto commented 6 years ago

Upon digging up the code of this plugin, there is an undocumented filter in place to override the capability check.

Adding this in the your theme's function.php can make it work.

function better_search_replace_cap_override() {
    return 'manage_options';
}
add_filter( 'bsr_capability', 'better_search_replace_cap_override' );
matt-croft commented 5 years ago

@carl-alberto Thanks for that, helped me out :)

MacGyer commented 5 years ago

This occurs on Bedrock based projects, too. Could you please refrain from coupling the availability of BSR from install_plugins cap?

May be build in a switch to explicitely make the functionality available independent of install_plugins? In some Live-/Staging-environments it must be executable for certain cases.