Plugin Directory

Changeset 700897


Ignore:
Timestamp:
04/21/2013 01:00:05 AM (13 years ago)
Author:
Bit51
Message:

Version 0.0.2

Location:
better-wp-varnish
Files:
24 added
4 edited

Legend:

Unmodified
Added
Removed
  • better-wp-varnish/trunk/better-wp-varnish.php

    r642939 r700897  
    44    Plugin URI: http://bit51.com/software/better-wp-varnish/
    55    Description: A better solution for clearing Varnish cache with WordPress
    6     Version: Dev
     6    Version: 0.0.2
    77    Text Domain: better-wp-varnish
    88    Domain Path: /languages
    9     Author: Bit51.com
     9    Author: Bit51
    1010    Author URI: http://bit51.com
    1111    License: GPLv2
     
    2121    class bit51_bwpv extends Bit51 {
    2222   
    23         public $pluginversion   = '0001'; //current plugin version
     23        public $pluginversion   = '0002'; //current plugin version
    2424   
    2525        //important plugin information
     
    111111                ) );
    112112
    113                 if ( is_page() || is_single() ) {
     113                if ( isset( $post->ID ) && $post->ID ) {
    114114                    $id = $post->ID;
    115                 } elseif ( is_home() ) {
    116                     $id = 'front';
    117115                } else {
    118116                    $id = false;
     
    194192           
    195193            $url = get_permalink( $postid );
    196             $link = str_replace( get_bloginfo( 'wpurl' ), '', $url );
     194            $link = str_replace( home_url(), '', $url );
    197195           
    198196            $success = $this->purgeVarnish( $link );
  • better-wp-varnish/trunk/inc/admin.php

    r642939 r700897  
    8080                } else {
    8181
    82                     $bit51bwpv->purgePost( filter_var( $_GET['ID'], FILTER_SANITIZE_STRING ) );                 
     82                    $bit51bwpv->purgePost( filter_var( $_GET['id'], FILTER_SANITIZE_STRING ) );                 
    8383
    8484                }
  • better-wp-varnish/trunk/lib/bit51/bit51.php

    r642939 r700897  
    1111    abstract class Bit51 {
    1212   
    13         var $feed = 'http://feeds.feedburner.com/Bit51'; //current address of Bit51.com feed
     13        var $feed = 'http://bit51.com/feed'; //current address of Bit51.com feed
    1414   
    1515        /**
     
    350350           
    351351            $feed = fetch_feed( $this->feed ); //get the feed
    352            
    353             $feeditems = $feed->get_items( 0, $feed->get_item_quantity( 5 ) ); //narrow feed to last 5 items
    354            
    355             $content = '<ul>'; //start list
    356            
    357             if ( ! $feeditems ) {
    358            
    359                 $content .= '<li class="bit51">' . __( 'No news items, feed might be broken...', $this->hook ) . '</li>';
     352
     353            if ( ! isset( $feed->errors ) ) {
     354
     355                $feeditems = $feed->get_items( 0, $feed->get_item_quantity( 5 ) ); //narrow feed to last 5 items
     356           
     357                $content = '<ul>'; //start list
     358           
     359                if ( ! $feeditems ) {
     360           
     361                    $content .= '<li class="bit51">' . __( 'No news items, feed might be broken...', $this->hook ) . '</li>';
    360362               
     363                } else {
     364           
     365                    foreach ( $feeditems as $item ) {
     366                       
     367                        $url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls = null, 'display' ) );
     368                       
     369                        $content .= '<li class="bit51"><a class="rsswidget" href="' . $url . '" target="_blank">'. esc_html( $item->get_title() ) .'</a></li>';
     370                       
     371                    }
     372                   
     373                }   
     374                                   
     375                $content .= '</ul>'; //end list
     376
    361377            } else {
    362            
    363                 foreach ( $feeditems as $item ) {
    364                    
    365                     $url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink(), $protocolls = null, 'display' ) );
    366                    
    367                     $content .= '<li class="bit51"><a class="rsswidget" href="' . $url . '" target="_blank">'. esc_html( $item->get_title() ) .'</a></li>';
    368                    
    369                 }
    370                
    371             }   
    372                                
    373             $content .= '</ul>'; //end list
     378                $content = __( 'It appears as if the feed is currently down. Please try again later', $this->hook );
     379            }
    374380           
    375381            $this->postbox( 'bit51posts' , __( 'The Latest from Bit51', $this->hook ), $content ); //set up postbox
     
    385391        function donate() {
    386392       
    387             $content = __( 'Have you found this plugin useful? Please help support it\'s continued development with a donation of $20, $50, or $100!', $this->hook );
     393            $content = __( 'Have you found this plugin useful? Please help support it\'s continued development with a donation of $20, $50, or even $100.', $this->hook );
    388394           
    389395            $content .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="' . $this->paypalcode . '"><input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></form>';
  • better-wp-varnish/trunk/readme.txt

    r642939 r700897  
    66Tags: varnish, cache, performance
    77Requires at least: 3.5
    8 Tested up to: 3.5
    9 Stable tag: 0.0.1
     8Tested up to: 3.5.1
     9Stable tag: 0.0.2
    1010
    1111The easiest way to maintain your varnish cache.
     
    5353== Changelog ==
    5454
     55= 0.0.2 =
     56* Fixed Bit51 feed with improved error handling
     57* Various bugfixes per <a href="http://bradt.ca/" target="_blank">Brad Touesnard</a>
     58
    5559= 0.0.1 =
    5660
Note: See TracChangeset for help on using the changeset viewer.