首页
Web开发
Windows程序
编程语言
数据库
移动开发
系统相关
微信
其他好文
会员
首页
>
其他好文
> 详细
替换WordPress调用的Google前端库为360镜像的库
时间:
2015-04-25 00:30:24
阅读:
200
评论:
0
收藏:
0
[点我收藏+]
标签:
把 googleapis 替换成 useso 即可:
sed -i s/googleapis/useso/g `grep -rl googleapis ./wordpress`
另外在后台关闭Gravatar头像显示(设置-讨论-头像显示),免得拖慢页面加载速度.
要成倍提升WordPress速度,可以考虑使用PHP7开发版,参考:
http://my.oschina.net/eechen/blog/298027
查看哪些文件在哪些行包含了googleapis串:
grep -rn googleapis ./wordpress-4.2
./wp-admin/css/press-this-editor.css:9:
@import
url("//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,600,700");
./wp-admin/css/press-this-editor-rtl.css:9:
@import
url("//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,600,700");
./wp-includes/script-loader.php:153: $scripts->add( ‘prototype‘, ‘//ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js‘, array(), ‘1.7.1‘);
./wp-includes/script-loader.php:154: $scripts->add( ‘scriptaculous-root‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js‘, array(‘prototype‘), ‘1.9.0‘);
./wp-includes/script-loader.php:155: $scripts->add( ‘scriptaculous-builder‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/builder.js‘, array(‘scriptaculous-root‘), ‘1.9.0‘);
./wp-includes/script-loader.php:156: $scripts->add( ‘scriptaculous-dragdrop‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js‘, array(‘scriptaculous-builder‘, ‘scriptaculous-effects‘), ‘1.9.0‘);
./wp-includes/script-loader.php:157: $scripts->add( ‘scriptaculous-effects‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/effects.js‘, array(‘scriptaculous-root‘), ‘1.9.0‘);
./wp-includes/script-loader.php:158: $scripts->add( ‘scriptaculous-slider‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/slider.js‘, array(‘scriptaculous-effects‘), ‘1.9.0‘);
./wp-includes/script-loader.php:159: $scripts->add( ‘scriptaculous-sound‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/sound.js‘, array( ‘scriptaculous-root‘ ), ‘1.9.0‘ );
./wp-includes/script-loader.php:160: $scripts->add( ‘scriptaculous-controls‘, ‘//ajax.googleapis.com/ajax/libs/scriptaculous/1.9.0/controls.js‘, array(‘scriptaculous-root‘), ‘1.9.0‘);
./wp-includes/script-loader.php:650: $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";
./wp-includes/js/tinymce/plugins/compat3x/css/dialog.css:1:
@import
url(//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin-ext,latin);
./wp-content/themes/twentyfifteen/functions.php:201: ), ‘//fonts.googleapis.com/css‘ );
./wp-content/themes/twentyfifteen/genericons/example.html:6:<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
./wp-content/themes/twentythirteen/functions.php:149: $fonts_url = add_query_arg( $query_args, ‘//fonts.googleapis.com/css‘ );
./wp-content/themes/twentyfourteen/functions.php:218: $font_url = add_query_arg( $query_args, ‘//fonts.googleapis.com/css‘ );
可以考虑使用下载到本地的JS文件并且禁用在线字体:
引入字体的地方可以注释掉,变量则置为空.
JS文件则替换为本地文件:
cd wordpress && mkdir ajax
wget
ajax.useso.com/ajax/libs/prototype/1.7.1.0/prototype.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/scriptaculous.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/builder.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/dragdrop.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/effects.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/slider.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/sound.js
ajax.useso.com/ajax/libs/scriptaculous/1.9.0/controls.js
ajax.useso.com/ajax/libs/jquery/1.7.2/jquery.min.js
./wp-includes/script-loader.php 里改为:
$scripts->add( ‘prototype‘, ‘/ajax/prototype.js‘, array(), ‘1.7.1‘);
$scripts->add( ‘scriptaculous-root‘, ‘/ajax/scriptaculous.js‘, array(‘prototype‘), ‘1.9.0‘);
$scripts->add( ‘scriptaculous-builder‘, ‘/ajax/builder.js‘, array(‘scriptaculous-root‘), ‘1.9.0‘);
$scripts->add( ‘scriptaculous-dragdrop‘, ‘/ajax/dragdrop.js‘, array(‘scriptaculous-builder‘, ‘scriptaculous-effects‘), ‘1.9.0‘);
$scripts->add( ‘scriptaculous-effects‘, ‘/ajax/effects.js‘, array(‘scriptaculous-root‘), ‘1.9.0‘);
$scripts->add( ‘scriptaculous-slider‘, ‘/ajax/slider.js‘, array(‘scriptaculous-effects‘), ‘1.9.0‘);
$scripts->add( ‘scriptaculous-sound‘, ‘/ajax/sound.js‘, array( ‘scriptaculous-root‘ ), ‘1.9.0‘ );
$scripts->add( ‘scriptaculous-controls‘, ‘/ajax/controls.js‘, array(‘scriptaculous-root‘), ‘1.9.0‘);
替换WordPress调用的Google前端库为360镜像的库
标签:
原文地址:http://my.oschina.net/eechen/blog/406115
踩
(
0
)
赞
(
0
)
举报
评论
一句话评论(
0
)
登录后才能评论!
分享档案
更多>
2021年07月29日 (22)
2021年07月28日 (40)
2021年07月27日 (32)
2021年07月26日 (79)
2021年07月23日 (29)
2021年07月22日 (30)
2021年07月21日 (42)
2021年07月20日 (16)
2021年07月19日 (90)
2021年07月16日 (35)
周排行
更多
分布式事务
2021-07-29
OpenStack云平台命令行登录账户
2021-07-29
getLastRowNum()与getLastCellNum()/getPhysicalNumberOfRows()与getPhysicalNumberOfCells()
2021-07-29
【K8s概念】CSI 卷克隆
2021-07-29
vue3.0使用ant-design-vue进行按需加载原来这么简单
2021-07-29
stack栈
2021-07-29
抽奖动画 - 大转盘抽奖
2021-07-29
PPT写作技巧
2021-07-29
003-核心技术-IO模型-NIO-基于NIO群聊示例
2021-07-29
Bootstrap组件2
2021-07-29
友情链接
兰亭集智
国之画
百度统计
站长统计
阿里云
chrome插件
新版天听网
关于我们
-
联系我们
-
留言反馈
© 2014
mamicode.com
版权所有 联系我们:gaon5@hotmail.com
迷上了代码!