WordPress插件Download Monitor国内打开速度慢的解决方法

WordPress插件Download Monitor可以管理文件下载。它能记录每次文件下载,统计下载次数,支持仅供网站会员下载的权限设置,并提供许多有用的短代码(shortcode)——功能丰富,却又比较简单易用,中文支持也较好。

国内用户访问安装了Download Monitor的WordPress网站会发现打开插件时速度很慢。这是由于Download Monitor调用了ajax.googleapis.com上的jquery-ui.css文件。

解决方法

1. 先设法下载好Download Monitor调用的http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css文件,然后上传到Download Monitor插件目录的assets/css子目录。

2. 修改download-monitor/includes/admin/class-dlm-admin.php:

# diff class-dlm-admin.php.original class-dlm-admin.php
312c312
< wp_enqueue_style( 'jquery-ui-style', ( is_ssl() ) ? 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' : 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
---
> wp_enqueue_style( 'jquery-ui-style', plugins_url('/download-monitor/assets/css/jquery-ui.css') );

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.