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公式のものなので別のもっといい方法がある気がします.

コメントを残す

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

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.