WP JS Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
This plugin will GZIP and JSMIN your JavaScript files as well as allowing the ability to put JavaScript files into a single file at the client’s end. Cache expiry time can also be set in the admin page.
NEW:
* SECURITY PATCH – please update the plugin. (Thanks to Dario Caregnato)
* Will now work with Child Themes (Thanks to Wupperpirat)
Now in version 2.0 you can add JavaScript files to a specific page or post and putting all of them into one file.
Version 2.0
- Ability to add JavaScript files to specific page/post
- Improved security
- Reduced URL outputted
Example
<script src="<?php wp_js('path/to/js/file.js'); ?>" type="text/javascript"></script>
OR you can also concatenate the JavaScript files (comma separated)
<script src="<?php wp_js('path/to/js/file.js, path/to/js/file2.js, path/to/js/file3.js'); ?>" type="text/javascript"></script>
Visit the WP JS site for more information: http://www.halmatferello.com/lab/wp-js/
Try the CSS version of the this plugin: https://wordpress.org/extend/plugins/wp-css/
Screenshots
-
Tests were measured using a Firefox plugin called Firebug. Firefox was run a Mac Pro (2008) using OS X 10.5.3. Eight files were included in this test: builder.js, controls.js, dragdrop.js, effects.js, prototype.js, scriptaculous.js, slider.js and sound.js – all taken from the script.aculo.us website.
-
The default behaviour is to specify one file for WP JS to JSMIN and GZIP.
<script src="<?php wp_js('/javascript/global.js') ?>" type="text/javascript" charset="utf-8"></script>
-
However it is also possible to combine several files together. It is very easy and only requires that you comma separate files inside the string parameter.
<script src="<?php wp_js('/javascript/sifr-addons.js,/javascript/sifr.js') ?>" type="text/javascript" charset="utf-8"></script>
-
The admin section
-
Adding a JavaScript file to a specifc post