Judege插件安装后,会有一个提示。

提示如下:

Our server cannot access your shop domain. Please note you need a working domain (no localhost) that is accessible from the internet and is not password-protected.

Note: Currently we do not support wordpress setup in a sub-directory (eg: example.com/this-is-a-sub-directory/), only root directory is supported, e.g.: yourdomain.com or shop.yourdomain.com

Check your setting, hosting or cloudflare to whitelist the /wp-json/* urls, it is needed for our system to contact your shop.

经过咨询客服,客服说需要将他们的IP加入白名单。

IP:54.173.59.114 加入白名单

官方的解决方案:https://support.judge.me/support/solutions/articles/44001923062–our-server-cannot-access-your-shop-domain-error-i-can-t-install-the-plugin-in-the-shop

CloudFlare方案

先在Wordpress后台正常安装Judge.me,如果报错,按照下述流程执行。

首先打开bots检测

然后去WordPress后台,点击Judge.me,点击10次以上

然后观察Cloudflare防火墙日志,看看是不是一直有一个相同的IP被Block,例如:

如果有这个Block记录,那么就有希望了。下一步就是配置Cloudflare的WAF,允许这个IP通过。

如何确定当前被Block的IP是不是Judge.me的呢?点击一下

Cloudflare配置防火墙

允许judge.me的IP以及URL目录通过。

IP:54.174.103.42 (这个IP和前面客服给的不一样,但是这个IP是Cloudflare Block的,WAF规则总就放你在Cloudflare Block的那个)

URI:/wp-json/judgeme/

关闭bots检测

清理所有缓存

先卸载Judge.me,然后清理所有的缓存,比如Cloudflare缓存,WP- Rocket缓存等,一切可以缓存等都清理掉。

如果安装了Memcached缓存,那么将object-cache.php文件先从/www/wwwroot/you-domain-name.com/wp-content 目录下剪切走,比如剪切到/www/wwwroot/目录下。

然后重新安装Judge.me,这个时候应该可以安装成功。

但是当我们将object-cache.php文件重新放回到/www/wwwroot/you-domain-name.com/wp-content 目录下的时候,Judge可能又打不开了,这个时候去Memcached设置中,重启改服务,然后再次去点击Judge.me,如果可以正常打开,就OK了。如果Judge打不开,那么继续重启memcached,循环几次。

成功后的状态

如果上述步骤还是不成功,试试把固定连接改为Post Name方式试试

Linode服务器添加防火墙白名单的方法:

结论:好像不行,添加完白名单以后,还是无法正常安装Judge.me

步骤#01: 打开Linode服务器

https://cloud.linode.com/firewalls

步骤#02:创建一个防火墙规则

Linode左侧,点击Firewalls,然后点击Create Firewall

Label:随意写一个,英文命名

Linodes:需要选择对应的VPS的Instance,给哪个Instance设置防火墙,就选择哪个。

添加白名单的话,属于Inbound,所以点击Inbound

添加的规则如下:

宝塔如何添加白名单

登陆宝塔后台——软件商店——输入“防火墙”,安装系统防火墙

点击系统防火墙的设置,添加规则

点击“IP规则”——添加规则,IP填写客服给的IP,然后策略是放心,备注随意写。最后提交。