WordPress Disqus Pluginのエラーを修正

このblogの下の方にこんなエラーが出てコメントのフォームが出てきません.
hostのOSをDebian jessieからDebian stretchにdist-upgradeしてWordPressのVersionが上がったせいでしょう.

4.1+dfsg-1+deb8u15 → 4.7.5+dfsg-2+deb9u1

Notice: get_currentuserinfo の使用はバージョン 4.5.0 から非推奨になっています! 代わりに wp_get_current_user() を使ってくださ
い。 in /usr/share/wordpress/wp-includes/functions.php on line 3830

spamが酷くてDisqusのコメントシステムをつかっているのですがそれがコケているような感じです.
Plugin の version が古いのかと確認してみると最新の 2.87

とりえずエラーメッセージのとおり修正したら動きました.

diff

$ sudo -u www-data diff -u plugins/disqus-comment-system/disqus.php.org plugins/disqus-comment-system/disqus.php
--- plugins/disqus-comment-system/disqus.php.org        2017-10-04 06:16:02.520645362 +0900
+++ plugins/disqus-comment-system/disqus.php    2018-01-08 02:00:35.729022200 +0900
@@ -1382,7 +1382,7 @@
         return array();
     }
     global $current_user, $dsq_api;
-    get_currentuserinfo();
+    wp_get_current_user();
     if ($current_user->ID) {
         $avatar_tag = get_avatar($current_user->ID);
         $avatar_data = array();

利用者多いしDisqus公式のものなので別のもっといい方法がある気がします.

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)