Changeset 840987
- Timestamp:
- 01/18/2014 04:22:40 PM (12 years ago)
- Location:
- versionit/trunk
- Files:
-
- 4 edited
-
includes/helper-functions.php (modified) (2 diffs)
-
includes/install.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
versionit.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
versionit/trunk/includes/helper-functions.php
r596688 r840987 4 4 if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') || stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false) { 5 5 6 // Show an admin notice if .htaccess isn't writable 6 /** 7 * Show admin notice if .htaccess isn't writable 8 * @return void 9 * 10 * @since 0.1 11 */ 7 12 function vit_htaccess_writable() { 8 13 if (!is_writable(get_home_path() . '.htaccess')) { … … 14 19 add_action('admin_init', 'vit_htaccess_writable'); 15 20 16 // Add rewrite rules for auto-versioning CSS/JS files 21 /** 22 * Add rewrite rules for auto-versioning CSS/JS files 23 * @return void 24 * 25 * @since 0.1 26 */ 17 27 function vit_add_rewrites() { 18 28 global $wp_rewrite; -
versionit/trunk/includes/install.php
r596688 r840987 1 1 <?php 2 2 3 /** 4 * Flush rewrite rules on activation to trigger .htaccess additions 5 * @return void 6 * 7 * @since 0.1 8 */ 3 9 function vit_activate() { 4 10 global $wp_rewrite; -
versionit/trunk/readme.txt
r596688 r840987 3 3 Tags: js,css,resources 4 4 Requires at least: 3.3 5 Tested up to: 3. 4.26 Stable tag: 0.15 Tested up to: 3.8 6 Stable tag: 1.0 7 7 License: GPLv2 8 8 … … 11 11 Removes default version query strings from CSS/JS resources, appends the modified time to the filename, and creates the necessary .htaccess rewrites automagically. 12 12 13 _Explanation from [wshadow](http://w-shadow.com/blog/2012/07/30/automatic-versioning-of-css-js/)_ 14 15 If you’re a WordPress developer, this will probably sound familiar: you make a change to one of your scripts or style sheets, reload the page you’re working on to see the result, and… everything stays the same. 16 17 Of course, after a moment of confusion, you realise that you didn’t update the $version argument in your wp_register_script() or wp_register_style() call (you are using the dependency APIs and not outputting the <script> or <style> tags directly, right?), so the browser is still using its old, cached version of the file. So you either force-refresh the page, or go back to the source code and change the version. 18 19 This can become annoying very quickly. Worse yet, if you forget to properly version your dependencies when you ship the code to users, you can get a number of seemingly bogus bug reports caused by their browsers still using the cached scripts and styles instead of the new files. 20 21 One common solution is to append the file modification time to the URL. This will cause the browser to automatically reload the file when it changes. 22 23 _I can't even begin to tell you how much cooler this will make your site, because honestly... it won't. BUT, it sure saves some headaches!_ 13 = What's the benefit for you? = 14 When pushing up new versions of your files, you never have to worry about users seeing older versions of your site stuck in their cache! A simple helper plugin, yet crucial to keeping your sanity. 24 15 25 16 == Installation == … … 38 29 This means that either you have not saved your permalinks from the default config, or you have a permissions issue. Your host can help you with the latter. 39 30 31 = None of my CSS/JS are loading! = 32 33 Please see previous question. 34 40 35 = Can you add `feature-x`? = 41 36 … … 44 39 == Changelog == 45 40 41 = 1.0 = 42 * Tested in 3.8 43 * This puppy should be ready to go! Now considered feature-complete. 44 46 45 = 0.1 = 47 46 * Initial release -
versionit/trunk/versionit.php
r596688 r840987 4 4 Plugin Name: VersionIt 5 5 Plugin URI: http://zslabs.com 6 Description: Removes default version query strings from CSS/JS resources, appends the modified time to the filename, and creates the necessary .htaccess rewrites .7 Version: 0.16 Description: Removes default version query strings from CSS/JS resources, appends the modified time to the filename, and creates the necessary .htaccess rewrites automagically. 7 Version: 1.0 8 8 Author: ZS Labs 9 9 Author URI: http://zslabs.com
Note: See TracChangeset
for help on using the changeset viewer.