修复wordpress插件Login With Ajax 4.1版本出现的错误提醒
login-with-ajax是wordpress 侧栏登录框插件,可以避开wordpress正常的登录和注册页,直接在网站文章的侧栏添加login-with-ajax 小工具,即可实现不刷新页面就能登录网站账户,效果很平滑舒服。主编很喜欢这个插件,在本站用的是login-with-ajax 的3.X版本,倒也平安无事。但是随着wordpress提示插件更新,我也就更新了。但是更新之后,发现侧栏login-with-ajax登录框显示这样的问题:
Warning: is_dir(): open_basedir restriction in effect. File(/plugin-templates/login-with-ajax/) is not within the allowed path(s): (/www/wwwroot/uwexp.com/:/tmp/) in /www/wwwroot/uwexp.com/wp-content/plugins/login-with-ajax/login-with-ajax.php on line 693
Warning: is_dir(): open_basedir restriction in effect. File(/plugin-templates/login-with-ajax/) is not within the allowed path(s): (/www/wwwroot/uwexp.com/:/tmp/) in /www/wwwroot/uwexp.com/wp-content/plugins/login-with-ajax/login-with-ajax.php on line 723
搜索相关问题的中文页面没有相似问题的解决办法,只是搜索英文网页,结果一个外国朋友提出了解决方案,就是在插件下的
login-with-ajax.php的第692行,即下面的这行代码:
$wp_content_folder = path_join( WP_CONTENT_DIR , “/plugin-templates/login-with-ajax/”);
修改为:$wp_content_folder = path_join( WP_CONTENT_DIR , “plugin-templates/login-with-ajax/”);
也就是将WP_CONTENT_DIR 后面的英文引号框里的”/plugin-templates/login-with-ajax/”,删去“/”,改为”plugin-templates/login-with-ajax/”。这样插件功能就正常了。
希望插件作者尽快修复这个错误。在更新的版本更新之前,大家可以用编辑器修改此login-with-ajax.php里面的第692行代码,使login-with-ajax插件正常工作,不再显示错误。

