Disqus – matoken's blog https://matoken.org/blog Is there no plan B? Tue, 09 Jan 2018 10:30:59 +0000 ja hourly 1 https://wordpress.org/?v=7.0 https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9-32x32.jpeg Disqus – matoken's blog https://matoken.org/blog 32 32 WordPress Disqus Pluginのエラーを修正 https://matoken.org/blog/2018/01/09/fix-wordpress-disqus-plugin-erro/ https://matoken.org/blog/2018/01/09/fix-wordpress-disqus-plugin-erro/#respond Tue, 09 Jan 2018 14:16:05 +0000 http://matoken.org/blog/?p=1759

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

]]>
https://matoken.org/blog/2018/01/09/fix-wordpress-disqus-plugin-erro/feed/ 0