I want to know Whether any cache plugin is installed in the WordPress website or not. At present, I get all active WordPress plugin ( Using get_option('active_plugins')) and check one by one, whether any cache plugins is active or not. I get the plugin name and check for strstr of cache.
But, I think this may not be the correct method. Is there any other method is available ?
Edit: I want to do this for 100s of websites hosted in many servers. It is not for one single website.
I want to know Whether any cache plugin is installed in the WordPress website or not. At present, I get all active WordPress plugin ( Using get_option('active_plugins')) and check one by one, whether any cache plugins is active or not. I get the plugin name and check for strstr of cache.
But, I think this may not be the correct method. Is there any other method is available ?
Edit: I want to do this for 100s of websites hosted in many servers. It is not for one single website.
Share Improve this question edited Jul 19, 2018 at 12:16 Mani asked Jul 19, 2018 at 11:46 ManiMani 1014 bronze badges 1- WPScan can list installed plugins almost always. And there are many scripts around to run WPScan in batch. – Max Yudin Commented Jul 19, 2018 at 12:21
2 Answers
Reset to default 0Cache plugins don’t necessarily all work the same way. You’ll need to find the popular ones and figure out how each one works to see how you can identify if it’s active manually.
If you’re tying to change some behaviour in your theme or plugin based on whether the site is cached, my advice would be: don’t try and be clever about it, just give the user the option to control the behaviour themselves.
This is the only method. It's all manual.
This is the way Jetpack checks for popular SEO plugins or Yoast SEO checks for other plugins and offers an import option.
There is another way, but it involves more research. Check the options table for certain options. You should have an array of possible options or plugins which you should maintain every 3 (or 6) months.