WordPress 评论显示IP归属地插件–WP-UserAgent[增强版 11.11.01]

WP-UserAgent[增强版 By obaby] 
版本号 11.11.01
更新日志:
1. 优化ipv6地址的显示

前端时间服务器开了ipv6之后,就发现评论的ip地址显示有问题。原有的分割方式会导致ipv6的地址看起来有点智障的样子。换了cdn之后以为ipv6不好使了,但是现在看来仍然是好使的,就是显示样式不太好。

优化之后的样子:

目前暂时无法获取ipv6地址的归属地信息,主要是因为接口都是收费的啦。

下载地址:

温馨提示: 此处隐藏内容需要发表评论,并且审核通过后才能查看。
(发表评论请勾选 在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。
(请仔细检查自己的昵称和评论内容,以免被识别为垃圾评论而导致无法正常审核。)

参考链接:

WordPress 评论显示IP归属地插件–WP-UserAgent[增强版]


分享文章:

猜你喜欢:

57 comments

  1. Microsoft Edge Microsoft Edge Windows Windows China辽宁省沈阳市 联通 ip address 60.16.*.*

    我挺好奇的,为什么不直接显示“归属地”?而是IP地址?是爱好吗?

    1. Google Chrome Google Chrome Mac Mac China山东省 移动 ip address 223.99.*.*

      显示ip地址的好处是后台的垃圾评论能直接看到是不是同一个ip地址发布的,方便屏蔽~~每天大约有几十条垃圾评论,屏蔽了能清净一些。 kiss
      ip

        1. Google Chrome Google Chrome Mac Mac China山东省 移动 ip address 223.99.*.*

          姐姐给你找回来了~~现在用的是第三方的过滤插件,说实话写php真不是姐姐拿手戏,写不了。 angel

          1. Microsoft Edge Microsoft Edge Windows Windows China辽宁省沈阳市 联通 ip address 60.16.*.*

            姐姐可以试试呀,其实很简单的,只要复制粘贴就可以了。

            在那个 函数.php文件 添加一下就可以了。我就是这么操作的啦。

            1. Google Chrome Google Chrome Mac Mac China山东省青岛市 移动 ip address 223.80.*.*

              嗯嗯,找时间试一下。我在想着怎么把cdn的报表加到wp的后台来~~

    1. Google Chrome Google Chrome Mac Mac China山东省 移动 ip address 223.99.*.*

      嗯嗯,主要是最近折腾的东西比较多,所以流水账比较多。周期性的,如果没什么折腾的东西那可能一个月也就那么一两篇。主要牵一发动全身,都是续费换服务器引起的。算是连锁反应吧。 smile

      1. Firefox Firefox Windows Windows China浙江省台州市 电信 ip address 123.97.*.*

        解决了,需勾选“在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。”

        1. Google Chrome Google Chrome Windows Windows China山东省青岛市 联通 ip address 112.255.*.*

          是的,需要勾选,基于cookie实现的。注意看提示哦~

  2. Microsoft Edge Microsoft Edge Windows Windows China上海市闵行区 电信 ip address 124.78.*.*

    谢谢分享,下载试试

  3. Microsoft Edge Microsoft Edge Windows Windows China上海市闵行区 电信 ip address 124.78.*.*

    谢谢分享,这次勾选试试

  4. Microsoft Edge Microsoft Edge Windows Windows China湖南省益阳市 电信 ip address 113.242.*.*

    感谢感谢,非常棒的插件,过来升级了

        1. Google Chrome Google Chrome Mac Mac China山东省青岛市 移动 ip address 223.80.*.*

          哈?这条竟然没被识别为垃圾评论,看来你转正了。哈哈哈

          1. Google Chrome Google Chrome Windows Windows China北京市 联通 ip address 111.197.*.*

            终于不拦截我,这个评论插件太老六了,我只要开启国家和IP这两个选项,前台就报错,不过用图片就没问题,不知道什么情况。

  5. Google Chrome Google Chrome Windows Windows China北京市 联通 ip address 111.197.*.*

    不清楚是不是,老的插件应该是直接覆盖掉才对,没别的类似插件。也没事我只用图标显示,就正常显示。Warning: Undefined variable $ip1num in /www/wwwroot/www.jeffer.xyz/wp-content/plugins/wp-useragent/show-useragent/ip2c-text.php on line 18

    Warning: Undefined variable $ip2num in /www/wwwroot/www.jeffer.xyz/wp-content/plugins/wp-useragent/show-useragent/ip2c-text.php on line 18

    Warning: Undefined variable $ipAddr2 in /www/wwwroot/www.jeffer.xyz/wp-content/plugins/wp-useragent/show-useragent/ip2c-text.php on line 84

    Warning: Undefined variable $ipAddr1 in /www/wwwroot/www.jeffer.xyz/wp-content/plugins/wp-useragent/show-useragent/ip2c-text.php on line 88

    1. Google Chrome Google Chrome Mac Mac China山东省 移动 ip address 223.99.*.*

      这个是报警,你是不是开启了wp的调试模式?
      把wp-config.php中的这两个改为false
      define( ‘WP_DEBUG’, false );
      define( ‘WP_DEBUG_LOG’, false );

        1. Google Chrome Google Chrome Mac Mac China山东省青岛市 移动 ip address 223.80.*.*

          看了下文件,那段代码确实有问题。
          修改/www/wwwroot/www.jeffer.xyz/wp-content/plugins/wp-useragent/show-useragent/ip2c-text.php 这个文件下面的代码,
          function convertip($ip) {
          $dat_path = dirname(__FILE__).'/ip2c-qqwry.dat'; //*数据库路径*//

          改为:
          function convertip($ip) {
          //*https://www.likecs.com/show-307719622.html*//
          $ip1num = 0;
          $ip2num = 0;
          $ipAddr1 ="";
          $ipAddr2 ="";
          $dat_path = dirname(__FILE__).'/ip2c-qqwry.dat'; //*数据库路径*//

          或者等我发布个新版,嘿嘿。抄的代码,之前没保存也没仔细看。

  6. WebView WebView Android Android China北京市 移动 ip address 223.72.*.*

    这生产力,生产队都没这效率,周一更新下,周末开始全力带娃中。

    1. Google Chrome Google Chrome Windows Windows China山东省青岛市 联通 ip address 39.65.*.*

      哈哈哈,强迫症你懂吗,就是知道有问题,不搞好他总感觉有点别扭~~

        1. Google Chrome Google Chrome Mac Mac China山东省青岛市 移动 ip address 223.80.*.*

          又插件冲突了吗?你的评论挂了
          TypeError thrown
          Unsupported operand types: string * int

          1. Google Chrome Google Chrome Windows Windows China北京市 联通 ip address 111.197.*.*

            我测试了下,开启归属地和IP就冲突,不知道啥原因,我把归属地和IP关了,现在可以评论了。

            1. Google Chrome Google Chrome Mac Mac China山东省 移动 ip address 223.99.*.*

              你还装了其他的插件吧?还有什么插件?我这里插件很多,但是没这个问题啊。
              缓存插件推荐litespeed cache。

              1. Google Chrome Google Chrome Windows Windows China北京市 联通 ip address 111.197.*.*

                不是AP插件,我禁用测试了,缓存用的supercache,只要开启归属地就这样,关掉就没事。不知道啥情况

                1. Google Chrome Google Chrome Mac Mac China山东省青岛市 移动 ip address 223.80.*.*

                  那应该还是插件问题吧,不好排查。哈哈哈。不然supercache禁了试试~~

                  1. Google Chrome Google Chrome Windows Windows China北京市 联通 ip address 111.197.*.*

                    哈哈哈哈,累了,等会挨个试试,还是不行就用图标不开归属地了。WP的插件t太杂了,用多了脑子疼。

                    1. Google Chrome Google Chrome Mac Mac China山东省青岛市 移动 ip address 223.80.*.*

                      0 => 'akismet/akismet.php',
                      1 => 'all-in-one-seo-pack-pro/all_in_one_seo_pack.php',
                      2 => 'better-recent-comments/better-recent-comments.php',
                      3 => 'buddypress/bp-loader.php',
                      4 => 'child-theme-generator/child-theme-generator.php',
                      5 => 'classic-editor/classic-editor.php',
                      6 => 'clean-archives-reloaded/clean-archives-reloaded.php',
                      7 => 'comment-approved-notifier-extended/comment-approved-notifier-extended.php',
                      8 => 'comment-approved/comment-approved.php',
                      9 => 'comment-reply-email-notification/cren_plugin.php',
                      10 => 'cssigniter-updater/cssigniter-updater.php',
                      11 => 'darklooks-dark-mode-switcher/darklooks.php',
                      12 => 'easy-watermark/easy-watermark.php',
                      13 => 'enlighter/Enlighter.php',
                      14 => 'envira-gallery1.8.9.2/envira-gallery.php',
                      15 => 'filester/ninja-file-manager.php',
                      16 => 'github-embed/github-embed.php',
                      17 => 'html5-cumulus/html5-cumulus.php',
                      18 => 'jetpack/jetpack.php',
                      19 => 'kama-wp-smile/kama_wp_smiles.php',
                      20 => 'litespeed-cache/litespeed-cache.php',
                      22 => 'loginpress-limit-login-attempts/loginpress-limit-login-attempts.php',
                      23 => 'loginpress-pro/loginpress-pro.php',
                      24 => 'loginpress/loginpress.php',
                      25 => 'oss-aliyun/aliyun-oss-wordpress.php',
                      26 => 'recent-posts-widget-with-thumbnails/recent-posts-widget-with-thumbnails.php',
                      27 => 'sassy-social-share/sassy-social-share.php',
                      28 => 'simple-microblogging/simple-microblogging.php',
                      29 => 'tinymce-advanced/tinymce-advanced.php',
                      30 => 'wp-mail-smtp-pro/wp_mail_smtp.php',
                      31 => 'wp-posturl/wp-posturl.php',
                      32 => 'wp-useragent/wp-useragent.php',
                      33 => 'yet-another-related-posts-plugin/yarpp.php',

                      我启用的这些你可以排除掉,哈哈哈。如果还有问题,那可能是主题问题?? rofl

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注