Autover plugin will automatically version your CSS and JS files. This is especially useful when using a Content Distribution Network (CDN) for delivering static files like CSS and JavaScripts. The plugin appends to the resource URL a numeric version number generated by the filemtime() PHP function (e.g. style.css?ver=1359464809). This means the version number will be updated every time the CSS or JS file is being saved.
IMPORTANT: this plugin only works with CSS and JS files that are enqueued using the standard WordPress functions
wp_enqueue_style and
wp_enqueue_script and/or
admin_enqueue_style,
admin_enqueue_script.
Installation
- Upload
autover.zip
to the /wp-content/plugins/
directory;
- Extract the
autover.zip
archive into the /wp-content/plugins/
directory;
- 通过 WordPress 的“插件”菜单激活插件。
Alternatively go into your WordPress dashboard and click on Plugins -> Add Plugin and search for Autover. Then click on Install, then on Activate Now.
用法
Just install and activate the plugin.
The plugin will automatically start to version your CSS and JS files that are correctly enqueued into WordPress (by using
wp_enqueue_style and
wp_enqueue_script and/or
admin_enqueue_style,
admin_enqueue_script functions).
Depending on the caching mechanism used, a purge of page (html) cache might be needed.
If you want to version only CSS or only JS files, please use the constants AUTOVER_DISABLE_JS and AUTOVER_DISABLE_CSS.