今天早些时候，我更新了我们的测试网站, 在滚动更新到主整地。这涉及到更新几个插件和更换用的Jetpack的“BeforeTheDeadline”插件。完成更新后，我发现我是在仪表盘上越来越多条错误消息, 在“导入链接”仪表盘小工具, 当我试图清空W3的总缓存缓存甚至更多的错误.
Deprecated: Assigning the return value of new by reference is deprecated in …/wp-includes/class-simplepie.php
I was able to clear the errors by deactivating all plugins, and re-enabling 1 at a time to lead me to the culprit — an update to the “WP Auto Affiliate Links” plugin we use to insert links to amazon for some products. A bit more research and a comparison of the code between the old plugin and new version led me to a fix fairly swiftly — the plugin contains some code near the top which turns on PHP 错误.
[PHP]error_reporting(E_ALL & ~E_NOTICE);[/PHP]
Removing this line (or commenting it) completely resolved the problem.
As a further note — these warnings from PHP are normal for anyone running wordpress on an up-to-date PHP5 because wordpress includes lots of legacy code which uses functions which are now deprecated. The reason they aren’t normally shown is because non fatal errors are usually suppressed. It’s high time wordpress updated this legacy code, but that is a discussion for another time. In the meantime — if you start to get these errors after a plugin update you need to check the plugin code and edit out any lines that include the error_reporting() function call.
In the process of resolving this issue I also discovered something else quite useful. When I wanted to obtain the previous version of the auto affiliate links plugin I discovered that these are all archived on the wordpress.org downloads page. The current version (在写作时) 是 2.3.2 which can be downloaded from http://downloads.wordpress.org/plugin/wp-auto-affiliate-links.2.3.2.zip. My previous version was 2.2.2 — so I guessed the download link would be http://downloads.wordpress.org/plugin/wp-auto-affiliate-links.2.2.2.zip if old versions were retained. Hey presto — using that address worked perfectly, kudos to wordpress for keeping old versions.
认为我们已经错过了什么? 让我们通过下面的评论知道. 如果您想订阅，请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.