這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

APH Merge Scripts

描述

Combining and minifying javascript dan stylesheet files can improve the speed the website as it will reduce the number of HTTP Request and reduce the size of the downloaded file.

This plugin helps you to do all of that. It will automatically detect and combine javascript and CSS files loaded by a page, into a single file javascript and CSS.

** Features. **

  • Easy to use.
  • Merge all CSS and Javascript files into one file – Automatically detect scripts and styles that are required on a page, and then combine them into one file.
  • There is a tool in the admin bar that makes it easy to add / manage scripts loaded by a page.
  • Support localized script.
  • Support remote scripts (Javascript and CSS files hosted on CDN). Built-in parallel download for optimum download time.
  • Support YUI Compressor. We don’t use closure compiler as it is not 100% safe. read here
  • CSS & Script files URL cleaned from query string, leverage browser cache.
  • Easy to view and manage merged files.
  • There is an option to put merged script to the header or footer
  • Automatically unload CSS and Javascript files that are not found

How To Use

While loading a page, the plugin will automatically detect the scripts and styles used on the page using WP enqueue system.

However, in certain circumstances, there are scripts and styles that are not detected automatically, such as akismet-form that usually comes late in the wp_footer

To check that kind of scripts, first, enable “Show Manage Scripts Menu on the Admin Bar” option in the plugin settings page. This option will add a menu to the admin-bar menu. This menu will appear when you open any page except for the admin page. Now, through that menu, you can choose scripts you want to merge or exclude easily.

螢幕截圖

  • Admin Settings
  • Manage scripts loaded in a page through admin bar

安裝

Install & activate the plugin. Modify some options in the settings page to suits your need.

評價

2018年5月10日
Your plugin is good, but it is not working on all pages. It store css and javascript of first page. on others pages there more some css which is not loaded.
2016年9月3日
The safer script minify compare to others without breaking site and also have a flexibility to select any needed. Thanks
2016年9月3日 1 reply
Let me just say that all the other plugins out there to minify JS & CSS either break my site or don't work at all. With this plugin I can customize which javascript files I want to minify and combine and which I can leave out. Now when you go through the settings be sure to check Show Manage Scripts Menu on the Admin Bar as it's essential to make sure this plugin works with your theme. By process of elimination you can make sure your theme is intact and the great thing about this plugin is that it does not overwrite any of your javascript or theme files. So with a simple check box you can revert everything as it was. Now my only complaint with this plugin is that still has Query Strings that won't allow my static content to cache. Also I would appreciate in the future some support with using a CDN like Amazon Cloudfront or WP Engine or MaxCDN.
閱讀全部5個評價

貢獻者及開發者

“APH Merge Scripts” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 APH Merge Scripts 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.3.1 – September 4, 2016

  • Fix chahe check issue

1.3 – September 1, 2016

  • Add support to remote scripts (Javascript and CSS files hosted on other servers or CDN)
  • Add option to manage remote files
  • Add option to 404 page
  • Fix some issues
  • Minor performance improvements

1.2 – August 21, 2016

  • Remove “File name & location” option, as now, we use predefined file name + hash to force user to download the latest merged file
  • Disable creating merged file on 404 HTTP Response, as it caused some problems when WordPress load non-existing CSS or js files
  • Use JShring as default Javascript Minifier, as it safer than the current one.
  • Fix issues on “APH Show Scripts” Menu on Admin Bar
  • Add “Show Handles” link to show handles of merged files
  • Fix other issues

1.1 – July 31, 2016

  • Add support to YUI Compressor
  • Remove query string from CSS and javascript’s file URL
  • Fix some issues
  • Add uninstall file
  • Rewrite source code to meet WordPress coding standard
  • Change admin options interface

1.0

Initial Public Release