远程获取网站的 WordPress 版本号的最佳方法是什么?
我在 WordPress 下管理大量网站,我想创建一种控制面板,在其中我可以看到所有网站的列表以及它们正在运行的 WP 版本。
你会怎么做?
我应该提到的是,这些网站托管在不同的服务器上。
I manage a large number of websites under Wordpress and I'd like to create a sort of control panel on which I would be able to see a list of all sites and the WP version they are running on.
How would you do that?
I should mention that the websites are hosted on different servers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您必须创建一个包含所有数据库及其密码和服务器(以连接到其他服务器)的数据库并检索版本,或者仅在您发送一些密码时创建一个用于打印版本的 WordPress 插件从 get 或 post (出于安全原因),并将其安装到所有 WordPress 系统中,然后您只需读取插件 url。 (如果您无法直接访问 mysql,这很有用,这种情况发生在一些在封闭网络上拥有 mysql 数据库的托管公司上。)
如果我是你,我会选择选择我的第二个选项(粗体)
<强>编辑:
请在插件中使用哈希保护,或类似的东西:
您的平台端:
插件端:
You have to create a db with all databases and they passwords and servers (to connect to the other servers) and retrieve the version, or create a plugin to wordpress that prints the version only if you send some password from get or post (for security reasons), and install it into all wordpress systems, then you only have to read the plugin url. (this is usefull if you don't have direct access to the mysql, this happens on some hosting companys that have the mysql db on a closed network. )
If i were you, i would opt to choose my secound option (bolded)
EDIT:
Please in the plugin use Hash protection, or something like that:
Your Platform Side:
Plugin Side:
对于每个站点,读取生成器元标记。
For each site, read the generator meta tag.
您还可以通过 FTP 从 wp-includes/version.php 获取版本。但 CuSS 的插件建议是最好的选择,IMO。
You could also FTP in and get the version from wp-includes/version.php. But CuSS' suggestion of a plugin is the best way to go, IMO.
使用 Curl 或 TFTP 查询 serverroot/wp-includes/version.php 处的文件 version.php 更加安全,无需调用数据库或安装插件。您将需要一个包含所有登录名/密码的本地数据库。
Much more secure to use Curl or TFTP to query the file version.php at serverroot/wp-includes/version.php No need to call the database or install a plugin. You will need a local database of all logins/passwords.