Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
2.1k views
in Q2A Core by
I just notice that several of the plugins are locked and will not let me disabale them I cant un check them any ideal what can cause that ?
Q2A version: 1.88 upgrade
by
That's right, I also wonder why this is the case!!
by
Well atleast  iam not the only one having the problem
by
Just change Metadata Json
by
reshown by
Do  not understand what you mean?
by
Still waiting for a fix to this problem

1 Answer

+3 votes
by
If you go to the folder of a plugin and take a look at the metadata.json file, you see that some have the option "load_order" "after_db_init". Plugins without this option are always loaded and cannot be disabled. So, if you want to change the behavior you have to set this values in the metadata.json
by
edited by
Do I have to do that for all the plugins not letting me un check ?
by
+1
Alternatively just remove the respective plugins from the plugin directory, if you don't want them loaded in the first place.
by
@ ddemuth✊
Thank you for your detailed explanation. I have made the necessary modifications as you indicated and now all the old plugins can be activated or deactivated from admin banel .☺️
by
Note that some plugins require initialization before DB init, in order to work.
If that's the case, you'd be better off by creating a sub-option that serves as a plugin activator/deactivator, and wrap the plugin's code like this. (Some coding will be required):

if(qa_opt('is_my_plugin_active')) {
    // The plugin's code goes here..
}

Here's an example, in a plugin, where this is implemented:
https://github.com/GATEOverflow/q2a-qnumbering/blob/ce2be0dc4207e39a931ccf72aba489a394316df4/qa-qnumbering-layer.php#L8
...