Skip to content
WordPress plugin to combine and minify enqueued CSS and JavaScript files
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
exopite-combiner-minifier
LICENSE
README.md

README.md

Exopite Combiner and Minifier

WordPress Plugin

Author link: http://www.joeszalai.org
Tags: combine, minify, enqueued CSS, enqueued JavaScript, SEO, search engline optimization
Requires at least: 4.8.0
Tested up to: 5.0.3
Stable tag: 5.0.3
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Version: 20190213

Suggestions and feedback are welcome


Combine and minify enqueued CSS and JavaScript files for SEO (site speed).

I wrote this plugin, because I tried several plugins promised to minify and combine my resources. Unfortunately non of them did that without JavaScript and/or CSS errors. This plugin still in early phase, I will do more tests and probably make a few corrections as well.

DESCRIPTION

External CSS and JavaScript files will be ignored.
I think, plugin and theme developers use CDN (or other external soruce) for a reason.

jQuery and jQuery migrate will be also ignored.
Some plugin and theme developers sometimes enqueue they JavaScript and CSS files in the footer and in this case, those scripts are enqueued very late, they can not be catched earlier. If jQuery has processed, could cause depency issues.

Process JavaScript and CSS file automatically if no exist or one of the resource file is modified based on the last modified time.

Convert relatvie url('../..') src-s to absolute in css files.

The plugin has two methods:

  • First method work with the enqueued list from WordPress, it can be also done, to process the source code after output buffering, but sometimes plugin and theme developers use a conditional to enqueue resources only on some pages. In this case, the plugin will be run every time on the different page, and that would be more time, what we otherwise gain,

  • Second method process the HTML source after WordPress render them and before sent to browser. It will create a separate Css/JS file for each page, make sure, all "in the footer" enqueued scripts are correctly processed. This method uses PHP Simple HTML DOM Parser and Output Buffering.

NOTE

Methode 1: The combined JavaScript file will be enqueued in the footer. This could cause depency issues, if some very late enqueued JavaScript file has an earlier JavaScript depency. I think, this is very rear, you could remove the file via exopite-combiner-minifier-skip-wp_scripts filter. (You could use as array( 'jquery', ... ))

ACTION HOOKS

exopite-combiner-minifier-styles-before-process
exopite-combiner-minifier-styles-after-process
exopite-combiner-minifier-scripts-before-process
exopite-combiner-minifier-scripts-after-process

FILTER HOOKS

exopite-combiner-minifier-process-styles
exopite-combiner-minifier-process-scripts
exopite-combiner-minifier-skip-wp_scripts
exopite-combiner-minifier-skip-wp_styles
exopite-combiner-minifier-wp_scripts-process-wp_includes
exopite-combiner-minifier-wp_styles-process-wp_includes
exopite-combiner-minifier-wp_scripts-ignore-external
exopite-combiner-minifier-wp_styles-ignore-external
exopite-combiner-minifier-enqueued-scripts-list
exopite-combiner-minifier-enqueued-styles-list
exopite-combiner-minifier-enqueued-scripts-contents
exopite-combiner-minifier-enqueued-styles-contents
exopite-combiner-minifier-scripts-file-path
exopite-combiner-minifier-styles-file-path
exopite-combiner-minifier-force-generate-scripts
exopite-combiner-minifier-force-generate-styles
exopite-combiner-minifier-scripts-last-modified
exopite-combiner-minifier-styles-last-modified
exopite-combiner-minifier-styles-file-url
exopite-combiner-minifier-scripts-file-url

USAGE

Install and activate.

No additional settings are required but you can change them in plguin options.

INSTALLATION

  1. Upload exopite-combiner-minifier to the /wp-content/plugins/exopite-combiner-minifier/ directory

OR

  1. Install plugin from WordPress repository (not yet)

  2. Activate the plugin through the 'Plugins' menu in WordPress

CHANGELOG

= 20190213 - 2019-02-13 = Major rewrite.

  • Replace PHP Simple HTML DOM Parser with DomDocument for performace gain.
  • Added: new HTML, CSS and JavaScript minifier.
  • Added: include first level @import to css.
  • Added: option to insert CSS to header insed of using a file. (slower)
  • Added: removing source map URLs in js files to avoid breaking.

= 20181123 - 2018-11-23 =

  • Update: Update Exopite Simple Options Framework

= 20181103 - 2018-11-03 =

  • Update: Exopite Simple Options Framework
  • Add: option to turn "try catch" block for JavaScript on or off

= 20180817 - 2018-08-17 =

  • Change: update url to new website

= 20180624 - 2018-06-24 = This is a realative big update.

  • Added: try catch for JavaScript to prevent broken script(s) break execution
  • Added: inlcude style added by wp_add_inline_style
  • Replaced: New minificator class from minifier.org. Better minify, less errors, faster and smaller file size
  • Fixed: url() replacement in css typo

= 20180509 - 2018-05-09 =

  • Added: Option to combine only
  • Improvement: Add semicolon to JavaScript file end if not exist

= 20180113 - 2018-01-13 =

  • Added: if enqueued file list changed, regenerate
  • Fixed: hooks for method-2

= 20180107 - 2018-01-07 =

  • Added: new options menu.
  • Added: remove cached files.
  • Added: method 2 to process the HTML source after WordPress render them and before sent to browser to prevent dependency issues if/for scripts enqueued in footer.
  • Changed: replace JShrink with JSMinPlus

= 20171224 - 2017-12-24 =

  • Fix scripts data collection.
  • Do not run in admin area.

= 20171223 - 2017-12-23 =

  • Initial release.

LICENSE DETAILS

The GPL license of Exopite Multifilter grants you the right to use, study, share (copy), modify and (re)distribute the software, as long as these license terms are retained.

DISCLAMER

NO WARRANTY OF ANY KIND! USE THIS SOFTWARES AND INFORMATIONS AT YOUR OWN RISK! READ DISCLAMER.TXT!
License: GNU General Public License v3

You can’t perform that action at this time.