AI Verified
Disable Specific Plugins on Production Environments [SnipSnip.pro]
<p>Disables the specified plugins on non-production environments (based on the site URL). You can specific which plugins you want deactivated by placing the plugin's slug in the `PLUGINS_TO_DEACTIVATE` array. By default it will assume this is a production site, unless the URL contains dev, staging, test, etc. (you can add your own staging values to the `$envKeywords` array). And if you need to test it, you can change `$alwaysRunDeactivations` to true and it will skip the environment check. For more info, visit here: <a href="https://snipsnip.pro/s/825" target="_blank" rel="noopener">https://snipsnip.pro/s/825</a></p>
PHP
Voted: 0 by 0 user(s)
For me, this was used to solve a critical error that kept happening when a particular plugin was active on our Production site. If you're just using it for performance or as a reminder to deactivate, then you could set this to Admin Only and just have it run when you login to the WP Admin. And if you need the reverse functionality (having plugins deactivated everywhere except production) then see here: https://snipsnip.pro/s/827
The author has provided the following URL that may be helpful to setting up or using this snippet:
https://snipsnip.pro/s/825Scroll down to see more snippets from this codevault.
The author has indicated that this snippet is compatable up to wordpress version: 6.4
Our AI bot has checked this snippet is compatable up to wordpress version: 6.1
Free & Pro
Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.
Pro Only (Coming Soon)
You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.
Last modified:
29/01/2024
This snippet has the following status:
AI Verified
This snippet has been tested by our AI bot, see any comments below.
AI Bot Comments:
Found 0 vulnerabilities
0
Please see some snippets below related to this snippet..
Performance
Unverified
Added: 8 months ago
Last Updated: 6 months ago
Convert Uploaded Images to WebP Format
Performance
AI Verified
Added: 1 year ago
Last Updated: 5 months ago
Ensure Webfont is loaded
Performance
AI Verified
Added: 7 months ago
Last Updated: 7 months ago
This "Deactivate_Plugins_On_Staging" script selectively deactivates specified plugins on your staging and non-production environments based on the site URL. Ideal for disabling plugins that are only n...
These are some popular snippets from this users codevault..
WordPress Admin
Unverified
Added: 10 months ago
Last Updated: 1 week ago
<p>Make the admin notice in Code Snippet Pro float above the editor so your page doesn't scroll away every time you save a snippet. <a href="https://snipsnip.pro/s/787" target="_blank" rel="nofollow n...
Security
Unverified
Added: 10 months ago
Last Updated: 1 week ago
<p>CHANGE TO 'ONLY RUN ONCE' – Users: Create & Delete n New Users in WP Admin [SnipSnip.pro] - <a href="https://snipsnip.pro/s/799" target="_blank" rel="nofollow noopener">https://snipsnip.pro/s/7...
WordPress Admin
AI Verified
Added: 10 months ago
Last Updated: 10 months ago
<p>Randomize a Post Publish Date in the Classic Editor. Choose between the past 1, 3, 6, 12 months... or customize it to other options. Works in the Classic Editor only for now. <a href="https://snips...
Category
Snippet Status