Skip to main content

Prevent updating when this is not allowed

I would like MainWP to implement the filemodallowed filter to stop installing themes, plugins and core.The items should still show as updates-available, just not installable like the behavior in WordPress.The reason we want this are;It is bad practice to update production sites without first verifying the updates on a test environment. We want to enforce this within our MainWP installationAll our plugins and themes are managed in git and installed using composer. We automatically deploy staging sites with updates and deploy to production sites once approved.This behavior was first partly available in MainWP but after #90 1 this is changed. But I don’t agree on this change. The correct solution to something like that I think would be something like:addfilter('filemodallowed', function($allowed, $context) { if($context == 'mainwp') return true; return $allowed;});And MainWP implementing the filemodallowed filter.You can see similar functionality in the WordPress automatic updater where you would add a similar code to allow auto-updates when DISALLOWFILEMODS is set to true. public function allowupdaterfilemod( $allowed, $context ){
if( $context == 'automatic_updater' ) return true;
return $allowed;
}

Log in to comment and vote

No comments yet

Be the first to share your thoughts.