Title: Dependency Minification
Author: Weston Ruter
Published: <strong>07 Avqust 2013</strong>
Last modified: 25 Fevral 2015

---

Qoşmaları axtar

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/dependency-minification.svg)

# Dependency Minification

 By [Weston Ruter](https://profiles.wordpress.org/westonruter/)

[Download](https://downloads.wordpress.org/plugin/dependency-minification.zip)

 * [Details](https://az.wordpress.org/plugins/dependency-minification/#description)
 * [Reviews](https://az.wordpress.org/plugins/dependency-minification/#reviews)
 * [Development](https://az.wordpress.org/plugins/dependency-minification/#developers)

 [Dəstək](https://wordpress.org/support/plugin/dependency-minification/)

## Description

This plugin takes all scripts and stylesheets that have been added via `wp_enqueue_script`
and `wp_enqueue_style`
 and _automatically_ concatenates and minifies them into 
logical groups. For example, scripts in the footer get grouped together and styles
with the same media (e.g. `print`) get minified together. Minification is done via
WP-Cron in order to prevent race conditions and to ensure that the minification 
process does not slow down page responses.

This is a reincarnation and rewrite of the [Optimize Scripts](https://wordpress.org/plugins/optimize-scripts/)
plugin,
 which this plugin now supersedes.

**Features:**

 * Minified sources are stored in the WP Options table so no special filesystem 
   access is required.
 * Endpoint for minified requests is at `/_minified`, which can be configured.
 * Admin page for taking inventory of minified scripts and stylesheets, with methods
   for expiring or purging the cached data.
 * Dependencies which must not be minified may be excluded via the `dependency_minification_excluded`
   filter.
 * Dependencies hosted on other domains are by default excluded, but this behavior
   can be changed by filtering the `default_exclude_remote_dependencies` option 
   via the `dependency_minification_options` filter, or on a case-by-case basis 
   via the filter previously mentioned.
 * By default excludes external scripts from being concatenated and minified, but
   they can be opted in via the `dependency_minification_excluded` filter.
 * The length of time that a minified source is cached defaults to 1 month, but 
   can be configured via the `cache_control_max_age_cache` option.
 * If a minified source is not available yet, the page source will note that the
   dependency minification process is pending.
 * Any errors that occur during minification will be shown on the frontend in comments
   if the `show_error_messages` option is enabled; such errors are enabled by default
   if `WP_DEBUG`.
 * If the minification process errors out, the original unminified sources are served
   and the error is cached for 1 hour (by default, configured via `cache_control_max_age_error`)
   to prevent back-to-back crons from continually attempting to minify in perpetuity.
 * Cached minified sources are served with `Last-Modified` and `ETag` responses 
   headers and requests will honor `If-None-Match` and `If-Modified-Since` to return`
   304 Not Modified` responses (configurable via the `allow_not_modified_responses`
   option).
 * Data attached to scripts (e.g. via `wp_localize_script`) is also concatenated
   together and attached to the newly-minified script.
 * WP-Cron is utilized to initiate the minification process in order to prevent 
   race conditions, and to ensure that page responses aren’t slowed down.
 * Stale minified scripts and stylesheets remain until replaced by refreshed ones;
   this ensures that full-page caches which reference stale minified sources won’t
   result in any 404s.
 * Can serve compressed responses with `gzip` or `deflate`.
 * Transforms relatives paths in stylesheets (e.g. background-images) to absolute
   ones, so that they don’t 404.

**Development of this plugin is done [on GitHub](https://github.com/x-team/wp-dependency-minification).
Pull requests welcome. Please see [issues](https://github.com/x-team/wp-dependency-minification/issues)
reported there before going to the plugin forum.**

If you are using Nginx with the default Varying Vagrant Vagrants config, you’ll 
want to remove `css|js` from this rule in `nginx-wp-common.conf` (or remove the 
rule altogether):

    ```
    # Handle all static assets by serving the file directly. Add directives 
    # to send expires headers and turn off 404 error logging.
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires 24h;
        log_not_found off;
    }
    ```

## Reviews

![](https://secure.gravatar.com/avatar/3d171d7cacb334020cf7ff32d147cc6ca5401516ee9ace9499bf2ebcdd8579fe?
s=60&d=retro&r=g)

### 󠀁[Almost crashed my site on 4.5.2](https://wordpress.org/support/topic/almost-crashed-my-site-on-452/)󠁿

 [vlasterx](https://profiles.wordpress.org/vlasterx/) 03 Sentyabr 2016

Don’t use with this version of wordpress. Too bad it doesn’t work.

![](https://secure.gravatar.com/avatar/01ecddc41aa74134ce7815fd24cde797712a792ae6d25e9751d8de2d08438676?
s=60&d=retro&r=g)

### 󠀁[Very Effective](https://wordpress.org/support/topic/very-effective-37/)󠁿

 [andben](https://profiles.wordpress.org/andben/) 03 Sentyabr 2016

It improved a lot the speed of my site, with google page speed from around 75/77
to a steady 85/88. I run a wordpress+woocommerce on a small droplet in Digital Ocean.
The theme is very feature rich and has been since the start a bit slow, I did first
optimize the droplet and the wp htaccess, nevertheless because I was not able to
move from the header the many scripts I always got mixed results in testing and 
a medium speed. Using this plugin together with wp super cache seems that gave a
big boost. Thank you.

 [ Read all 11 reviews ](https://wordpress.org/support/plugin/dependency-minification/reviews/)

## Contributors & Developers

“Dependency Minification” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Weston Ruter ](https://profiles.wordpress.org/westonruter/)
 *   [ XWP ](https://profiles.wordpress.org/xwp/)
 *   [ Frankie Jarrett ](https://profiles.wordpress.org/fjarrett/)
 *   [ Dzikri Aziz ](https://profiles.wordpress.org/kucrut/)
 *   [ Shadi Sharaf ](https://profiles.wordpress.org/shadyvb/)
 *   [ Nashwan D ](https://profiles.wordpress.org/alex-ye/)
 *   [ Chris Olbekson ](https://profiles.wordpress.org/c3mdigital/)
 *   [ lkraav ](https://profiles.wordpress.org/lkraav/)

[Translate “Dependency Minification” into your language.](https://translate.wordpress.org/projects/wp-plugins/dependency-minification)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/dependency-minification/),
check out the [SVN repository](https://plugins.svn.wordpress.org/dependency-minification/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/dependency-minification/)
by [RSS](https://plugins.trac.wordpress.org/log/dependency-minification/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 0.9.8

 * Fix rewrite rule broken by filtering home_url ([#49](https://github.com/x-team/wp-dependency-minification/pull/49)).
   Props [c3mdigital](https://profiles.wordpress.org/c3mdigital/).
 * Switch from JSMin to JSMinPlus due to repeated issues with JSMin causing execution
   timeouts.
 * Update plugin to indicate WordPress 3.8 compatibility.
 * Fix expire and purge links.

#### 0.9.7

Improve how the plugin guesses the sources’ absolute paths ([#34](https://github.com/x-team/wp-dependency-minification/pull/34)).
Props [alex-ye](https://profiles.wordpress.org/alex-ye/).

#### 0.9.6

Improve network activation and deactivation ([#37](https://github.com/x-team/wp-dependency-minification/pull/37)).
Props [kucrut](https://profiles.wordpress.org/kucrut/).

#### 0.9.5

Fix wp_localize_script data lost in minification ([#28](https://github.com/x-team/wp-dependency-minification/issues/28)).
Props [lkraav](https://profiles.wordpress.org/lkraav/).

#### 0.9.4

Issue warning if pretty permalinks are not enabled ([#16](https://github.com/x-team/wp-dependency-minification/issues/16)).
Props [shadyvb](https://profiles.wordpress.org/shadyvb/).

#### 0.9.3

Prevent default built-in scripts from breaking minification groups ([#9](https://github.com/x-team/wp-dependency-minification/issues/9)).
Props [shadyvb](https://profiles.wordpress.org/shadyvb/).

#### 0.9.2

Show alert if WP_DEBUG is disabling dependency minification ([#12](https://github.com/x-team/wp-dependency-minification/issues/12)).
Props [c3mdigital](https://profiles.wordpress.org/c3mdigital/).

#### 0.9.1

Add a settings link to the list of plugin action links ([#13](https://github.com/x-team/wp-dependency-minification/issues/13)).
Props [fjarrett](https://profiles.wordpress.org/fjarrett/).

#### 0.9 beta

First Release

## Meta

 *  Version **0.9.8**
 *  Last updated **11 il öncə**
 *  Active installations **30+**
 *  WordPress version ** 3.5 or higher **
 *  Tested up to **3.7.41**
 *  Language
 * [English (US)](https://wordpress.org/plugins/dependency-minification/)
 * Tags
 * [compress](https://az.wordpress.org/plugins/tags/compress/)[concatenate](https://az.wordpress.org/plugins/tags/concatenate/)
   [dependencies](https://az.wordpress.org/plugins/tags/dependencies/)[minify](https://az.wordpress.org/plugins/tags/minify/)
   [performance](https://az.wordpress.org/plugins/tags/performance/)
 *  [Advanced View](https://az.wordpress.org/plugins/dependency-minification/advanced/)

## Reytinqlər

 4 out of 5 stars.

 *  [  8 5-star reviews     ](https://wordpress.org/support/plugin/dependency-minification/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/dependency-minification/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/dependency-minification/reviews/?filter=3)
 *  [  1 2-star review     ](https://wordpress.org/support/plugin/dependency-minification/reviews/?filter=2)
 *  [  2 1-star reviews     ](https://wordpress.org/support/plugin/dependency-minification/reviews/?filter=1)

[Add my review](https://wordpress.org/support/plugin/dependency-minification/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/dependency-minification/reviews/)

## Contributors

 *   [ Weston Ruter ](https://profiles.wordpress.org/westonruter/)
 *   [ XWP ](https://profiles.wordpress.org/xwp/)
 *   [ Frankie Jarrett ](https://profiles.wordpress.org/fjarrett/)
 *   [ Dzikri Aziz ](https://profiles.wordpress.org/kucrut/)
 *   [ Shadi Sharaf ](https://profiles.wordpress.org/shadyvb/)
 *   [ Nashwan D ](https://profiles.wordpress.org/alex-ye/)
 *   [ Chris Olbekson ](https://profiles.wordpress.org/c3mdigital/)
 *   [ lkraav ](https://profiles.wordpress.org/lkraav/)

## Dəstək

Şərhiniz varmı? Yardım lazımdırmı?

 [Dəstək forumuna bax](https://wordpress.org/support/plugin/dependency-minification/)