userpro 中文版优化加速、以及去掉后台和前台注册提示框

userpro 中文版优化加速、以及去掉后台和前台注册提示框


标签: 

正在查看 7 个帖子:1-7 (共 7 个帖子)
  • 作者
    帖子
  • 诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    UserPro提供了漂亮的前台用户资料、会员目录,以及登录和注册页面,是一个非常好的会员管理插件。

    它集成了病毒式营销、徽章系统、文件上传、照片上传功能,支持灯箱、自适应,支持关注用户、验证用户、内容限制、前台发布和公开与私人活动。它是一体化的会员管理与社交插件。

    首页

    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    首先解决掉 Google 字体的问题,说是解封了但访问速度还是慢:

    文件路径 /wp-content/plugins/userpro/functions/hooks-actions.php

    修改位置 大约在68~71行:

    将 fonts.googleapis.com 替换为 fonts.geekzu.org ,你也可以去找其他的替换源, 360 的已经失效,所以不建议使用。

    				$fonts_url = 'https://fonts.googleapis.com/css?family='.userpro_get_option('googlefont').':400,400italic,700,700italic,300italic,300';
    			} else {
    				$fonts_url = 'https://fonts.googleapis.com/css?family='.userpro_get_option('googlefont').':400,400italic,700,700italic,300italic,300';
    			}

    修改后为

    				$fonts_url = 'https://fonts.geekzu.org/css?family='.userpro_get_option('googlefont').':400,400italic,700,700italic,300italic,300';
    			} else {
    				$fonts_url = 'https://fonts.geekzu.org/css?family='.userpro_get_option('googlefont').':400,400italic,700,700italic,300italic,300';
    			}

    完全弃用 Google 字体,速度最佳,改为

    				$fonts_url = '#'.userpro_get_option('googlefont').':400,400italic,700,700italic,300italic,300';
    			} else {
    				$fonts_url = '#'.userpro_get_option('googlefont').':400,400italic,700,700italic,300italic,300';
    			}
    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    解决 Google map api 的加载问题,修改域名为 cn

    文件路径 1:/wp-content/plugins/userpro/addons/userpro-google-map/assets/js/gmap.js

    修改位置 大约在80行:

    将 maps.googleapis.com 修改为 http://www.google.cn

    	    type: "GET",
    	    dataType: "json",
    	    url: "https://maps.googleapis.com/maps/api/geocode/json",
    	    data: {'address': address},

    修改后

    	    type: "GET",
    	    dataType: "json",
    	    url: "https://www.google.cn/maps/api/geocode/json",
    	    data: {'address': address},

    完全弃用 Google map,速度最佳,改为

    	    type: "GET",
    	    dataType: "json",
    	    url: "#",
    	    data: {'address': address},

    文件路径 2:/wp-content/plugins/userpro/addons/userpro-google-map/userpro-google-map.php

    			wp_enqueue_script('jquery');
    			wp_enqueue_script('up_google_map_script','https://maps.googleapis.com/maps/api/js?key='.userpro_gmap_get_option('userpro_gmap_key'));
    			wp_register_script('gmap_js', UPGMAP_URL. 'assets/js/gmap.js', array('up_google_map_script'),'',true);

    修改后

    			wp_enqueue_script('jquery');
    			wp_enqueue_script('up_google_map_script','https://www.google.cn/maps/api/js?key='.userpro_gmap_get_option('userpro_gmap_key'));
    			wp_register_script('gmap_js', UPGMAP_URL. 'assets/js/gmap.js', array('up_google_map_script'),'',true);

    完全弃用 Google map,改为

    			wp_enqueue_script('jquery');
    			wp_enqueue_script('up_google_map_script','#'.userpro_gmap_get_option('userpro_gmap_key'));
    			wp_register_script('gmap_js', UPGMAP_URL. 'assets/js/gmap.js', array('up_google_map_script'),'',true);
    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    去掉后台的未注册提示:

    screenshot-2016-12-01-00-49-17

    You are using a trial version of UserPro plugin. If you have purchased the plugin, please enter your purchase code to enable the full version. You can enter your <a href="%s">purchase code here</a>.','userpro

    文件路径:/wp-content/plugins/userpro/admin/admin-notices.php

    大约在第 17 行 ,将

    if (current_user_can('manage_options') && get_option('userpro_trial') == 1) {

    改为
    if (current_user_can('manage_options') && get_option('userpro_trial') == 0) {

    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    去掉前台的未注册提示:

    screenshot-2016-12-01-00-46-35

    文件路径:/wp-content/plugins/userpro/functions/_trial.php

    大约在第 5 行 ,将

    if (get_option('userpro_trial') == 1) {

    改为

    if (get_option('userpro_trial') == 0) {

    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    后续有什么问题将继续添加调试方法,方便用户使用。

    诗语
    管理员
    • 文章数量: 5,858
    @feibisi
    楼主

    后台副本注册提示,因为只是一串文字,没意义,所以就不写修改方法了,毕竟程序文件能不改就不要修改。

    screenshot-2016-12-01-00-58-41

    文件路径:/wp-content/plugins/userpro/admin/admin-functions.php  大致在:30 行

    激活后的字符串为感谢词  Thank you for activating UserPro!

    Envato 账户不能共享,所以通过上面的调整方法,其实插件已经是激活成功了。

    后续的版本更新,请直接到我们的数字商城,您的账户中下载薇晓朵出品的优化版本就行。

正在查看 7 个帖子:1-7 (共 7 个帖子)
  • 哎呀,回复话题必需登录。

未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。

收藏纪念品


有奖活动

参与论坛社区问答,有机会获赠文派瓦普(Wapuu.com)手办模型。

话题信息

商业系统