Plugin Directory

Changeset 840987


Ignore:
Timestamp:
01/18/2014 04:22:40 PM (12 years ago)
Author:
zslabs
Message:

1.0 commit

Location:
versionit/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • versionit/trunk/includes/helper-functions.php

    r596688 r840987  
    44if (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') || stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false)  {
    55
    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     */
    712    function vit_htaccess_writable() {
    813        if (!is_writable(get_home_path() . '.htaccess')) {
     
    1419    add_action('admin_init', 'vit_htaccess_writable');
    1520
    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     */
    1727    function vit_add_rewrites() {
    1828        global $wp_rewrite;
  • versionit/trunk/includes/install.php

    r596688 r840987  
    11<?php
    22
     3/**
     4 * Flush rewrite rules on activation to trigger .htaccess additions
     5 * @return void
     6 *
     7 * @since  0.1
     8 */
    39function vit_activate() {
    410    global $wp_rewrite;
  • versionit/trunk/readme.txt

    r596688 r840987  
    33Tags: js,css,resources
    44Requires at least: 3.3
    5 Tested up to: 3.4.2
    6 Stable tag: 0.1
     5Tested up to: 3.8
     6Stable tag: 1.0
    77License: GPLv2
    88
     
    1111Removes default version query strings from CSS/JS resources, appends the modified time to the filename, and creates the necessary .htaccess rewrites automagically.
    1212
    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? =
     14When 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.
    2415
    2516== Installation ==
     
    3829This 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.
    3930
     31= None of my CSS/JS are loading! =
     32
     33Please see previous question.
     34
    4035= Can you add `feature-x`? =
    4136
     
    4439== Changelog ==
    4540
     41= 1.0 =
     42* Tested in 3.8
     43* This puppy should be ready to go! Now considered feature-complete.
     44
    4645= 0.1 =
    4746* Initial release
  • versionit/trunk/versionit.php

    r596688 r840987  
    44Plugin Name: VersionIt
    55Plugin 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.1
     6Description: Removes default version query strings from CSS/JS resources, appends the modified time to the filename, and creates the necessary .htaccess rewrites automagically.
     7Version: 1.0
    88Author: ZS Labs
    99Author URI: http://zslabs.com
Note: See TracChangeset for help on using the changeset viewer.