WordPress.org

Plugin Directory

Changeset 608575


Ignore:
Timestamp:
10/05/12 16:20:27 (19 months ago)
Author:
ramon fincken
Message:

Version 1,6, with submap support

Location:
warm-cache
Files:
8 added
4 edited

Legend:

Unmodified
Added
Removed
  • warm-cache/trunk/mijnpress_plugin_framework.php

    r394366 r608575  
    2525 * Submenu, credits, get plugin url, show main/sidebar 
    2626 *  
    27  * 1.1 
    28  * Changed: $all_plugins as var 
    29  * Added: mijnpress_plugin_framework_showcredits_framework 
    30  * Added: Info comments at top of file, with extend option info 
    31  *  
    32  * 1.2 
    33  * Added: is_admin() 
    34  *  
    35  * 1.3 
    36  * Added: get_plugin_url : $file = __FILE__ 
    37  * > To fix when multiple plugins use this framework. 
    38  * Added: 'See attachments' 
    3927 *  
    4028 * 1.3.1 
     
    5038 * 1.4 
    5139 * Changed: is_admin as this gives problems on multisite installs 
     40 *  
     41 * 1.4.1 
     42 * Added: New plugins 
     43 *  
     44 * 1.5 
     45 * Changed: credits 
     46 *  
     47 * 1.5.1 
     48 * Added: return functions 
    5249 * ------------------------------------------------------------------ 
    5350 *  
     
    6259    var $showcredits = true; 
    6360    var $showcredits_fordevelopers = true; 
    64     var $all_plugins = array('Admin renamer extended','Find replace','Simple add pages or posts','Force apply terms and conditions','GTmetrix website performance','Antispam for all fields','Mass Delete Tags','Auto Prune Posts','Warm cache','See attachments','Automatic Comment Scheduler','Register plus redux export users','Subscribe2 widget','Define Constants'); 
     61    var $all_plugins = array('Admin renamer extended','Find replace','Simple add pages or posts','Force apply terms and conditions','GTmetrix website performance','Antispam for all fields','Mass Delete Tags','Auto Prune Posts','Warm cache','See attachments','Automatic Comment Scheduler','Register plus redux export users','Subscribe2 widget','Define Constants','Mass Delete Unused Tags','Prevent core update','WPML flag in menu', 'WPsc MijnPress','Autoptimize admin bar fix'); 
    6562     
    6663    /** 
     
    8683        } 
    8784        return $links; 
     85    } 
     86     
     87    // To implement later 
     88    function refresh_rewrite() 
     89    { 
     90        if(isset($_GET['rwflush'])) 
     91        { 
     92            global $wp_rewrite; 
     93            $wp_rewrite->flush_rules(); 
     94        }        
    8895    } 
    8996 
     
    137144    function content_end() 
    138145    { 
     146        if($this->showcredits) 
     147        { 
     148            echo '<br/><br/>Do you like this plugin? <a href="http://donate.ramonfincken.com/">PayPal Donations</a> (even as small as $1,- or &euro;1,)- are welcome!.'; 
     149        } 
    139150        echo '</div>'; 
    140151        echo '<div style="width:20%; float: right; margin-right: 10px;">'; 
    141152        $this->showcredits(); 
    142153        echo '</div>'; 
     154         
    143155        echo '<div style="clear: both;"></div>'; 
    144156    } 
    145157 
     158    function return_zero() 
     159    { 
     160        return 0; 
     161    } 
     162     
     163    function return_false() 
     164    { 
     165        return false; 
     166    } 
     167     
     168    function return_true() 
     169    { 
     170        return true; 
     171    }     
     172     
    146173    /** 
    147174     * Shows credits or info for developers 
     
    211238He likes to create WordPress websites and plugins (currently only Dutch customers) and he is co-admin at the <a href="http://www.linkedin.com/groups?about=&gid=1644947&trk=anet_ug_grppro">Dutch LinkedIn WordPress group</a>.<br/><br/>Visit his WordPress website at: <a href="http://www.mijnpress.nl">MijnPress.nl</a><br/> 
    212239If you are a coder, you might like to visit <a href="http://www.ramonfincken.com/tag/wordpress.html">his WordPress blogposts</a>. 
    213 <br/><br/><a href="http://pluginsupport.mijnpress.nl">Is this plugin broken? Report it here</a> 
    214 <br/><br/><a href="http://donate.ramonfincken.com/">PayPal Donations</a> (even as small as $1,- or &euro;1,- are welcome!. 
    215              
     240<br/><br/><a href="http://pluginsupport.mijnpress.nl">Is this plugin broken? Report it here</a>             
    216241        </div> 
    217242    </div> 
  • warm-cache/trunk/readme.txt

    r394366 r608575  
    11=== Warm Cache === 
    22Contributors: ramon fincken 
    3 Tags: cache, warm, keep, xml, sitemap, load, speed, quick, tag, w3tc, optimize, page cache 
     3Tags: cache, warm, keep, xml, sitemap, load, speed, quick, tag, w3tc, optimize, page cache, preload, google, pagespeed, webmaster 
    44Requires at least: 2.3 
    5 Tested up to: 3.1.3 
    6 Stable tag: 1.5 
     5Tested up to: 3.4.2 
     6Stable tag: 1.6 
    77 
    88Crawls your website-pages based on google XML sitemap (google-sitemap-generator). If you have a caching plugin this will keep your cache warm. Speeds up your site. 
     
    4343== Changelog == 
    4444 
     45= 1.6 = 
     46Added: Support for sub-sitemaps using < sitemap > format (as used in Beta of Google XML sitemaps). Thanks to Pascal90.de! 
     47 
    4548= 1.1.2 = 
    4649Changed: Random password call as mentioned by swanzai http://wordpress.org/support/topic/plugin-warm-cache-how-to-call-this-plugin-correctly 
  • warm-cache/trunk/warm-cache.php

    r394366 r608575  
    44Plugin URI: http://www.mijnpress.nl 
    55Description: Crawls your website-pages based on google XML sitemap (google-sitemap-generator). If you have a caching plugin this wil keep your cache warm. Speeds up your site. 
    6 Version: 1.5 
     6Version: 1.6 
    77Author: Ramon Fincken 
    88Author URI: http://www.mijnpress.nl 
  • warm-cache/trunk/warm_cache_crawl.php

    r313917 r608575  
    55*/ 
    66if(defined('CALLED')) 
    7 { 
     7{    
    88    $warm_cache = new warm_cache(); 
    99    $warm_cache->google_sitemap_generator_options = get_option("sm_options"); 
     
    1313    $mtime = $mtime[1] + $mtime[0]; 
    1414    $starttime = $mtime; 
     15     
     16    @set_time_limit(0); 
    1517     
    1618    if (extension_loaded('zlib')) { 
     
    2931    // Get url 
    3032    $sitemap_url = $warm_cache->get_sitemap_url(); 
     33    // Override here if needed 
    3134 
    3235    // For stats 
     
    5255    $newvalue['url'] = $sitemap_url; 
    5356    $newvalue['time_start'] = $newtime; 
    54  
    55     $xmldata = wp_remote_retrieve_body(wp_remote_get($sitemap_url)); 
    56     $xml = simplexml_load_string($xmldata); 
    57  
    5857    $newvalue['pages'] = array(); 
    59     $cnt = count($xml->url); 
    60     for($i = 0;$i < $cnt;$i++){ 
    61         $page = (string)$xml->url[$i]->loc; 
    62         echo '<br>Busy with: '.$page; 
    63         $newvalue['pages'][$i] = $page; 
    64         $tmp = wp_remote_get($page); 
     58     
     59    function mp_process_sitemap($sitemap_url) 
     60    { 
     61        global $newvalue; 
     62        $xmldata = wp_remote_retrieve_body(wp_remote_get($sitemap_url)); 
     63        $xml = simplexml_load_string($xmldata); 
     64     
     65        $cnt = count($xml->url); 
     66        if($cnt > 0) 
     67        { 
     68            for($i = 0;$i < $cnt;$i++){ 
     69                $page = (string)$xml->url[$i]->loc; 
     70                echo '<br/>Busy with: '.$page; 
     71                $newvalue['pages'][] = $page; 
     72                $tmp = wp_remote_get($page); 
     73            } 
     74        } 
     75        else 
     76        { 
     77            // Sub sitemap? 
     78            $cnt = count($xml->sitemap); 
     79            if($cnt > 0) 
     80            { 
     81                for($i = 0;$i < $cnt;$i++){ 
     82                    $sub_sitemap_url = (string)$xml->sitemap[$i]->loc; 
     83                    echo "<br/>Start with submap: ".$sub_sitemap_url; 
     84                    mp_process_sitemap($sub_sitemap_url); 
     85                }                
     86            } 
     87        } 
    6588    } 
     89    // GOGOGO! 
     90    mp_process_sitemap($sitemap_url); 
     91     
     92     
    6693    echo '<br><br><strong>Done!</strong>'; 
     94     
    6795 
    6896    $mtime = microtime(); 
     
    7199    $endtime = $mtime; 
    72100    $totaltime = ($endtime - $starttime); 
     101    $cnt = count($newvalue['pages']); 
    73102    $returnstring = 'Crawled '.$cnt. ' pages in ' .$totaltime. ' seconds.'; 
    74103    echo '<br>'. $returnstring; 
Note: See TracChangeset for help on using the changeset viewer.