最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

api - How to find out programmatically whether any cache plugin is installed in the WordPress website?

programmeradmin4浏览0评论

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
Add a comment  | 

2 Answers 2

Reset to default 0

Cache 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.

发布评论

评论列表(0)

  1. 暂无评论