Changeset 860583
- Timestamp:
- 02/19/2014 01:23:21 AM (12 years ago)
- Location:
- cloudflare-cache-purge/trunk
- Files:
-
- 5 edited
-
cloudflare_cachepurge.php (modified) (3 diffs)
-
lib/ccpurge.class.php (modified) (1 diff)
-
lib/ccpurge.js (modified) (9 diffs)
-
lib/ccpurge_options.php (modified) (8 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cloudflare-cache-purge/trunk/cloudflare_cachepurge.php
r813970 r860583 2 2 3 3 /* 4 Plugin Name: Cloud flare Cache Purge5 Description: API Integration with Cloud flare to purge your cache4 Plugin Name: CloudFlare Cache Purge 5 Description: API Integration with CloudFlare to purge your cache 6 6 Version: 1.0.4 7 7 Author: Bryan Shanaver @ fiftyandfifty.org … … 100 100 } 101 101 102 print "<h3>Cloud flare Cache Purge Logging</h3>";102 print "<h3>CloudFlare Cache Purge Logging</h3>"; 103 103 print "<table>"; 104 104 print "<tr><th>ID</th><th>Time</th><th>Message</th></tr>"; … … 116 116 117 117 function ccpurge_activate() { 118 ccpurge_transaction_logging("Cloud flare Cache Purge - Activated");118 ccpurge_transaction_logging("CloudFlare Cache Purge - Activated"); 119 119 } 120 120 register_activation_hook(__FILE__,'ccpurge_activate'); 121 121 122 122 function ccpurge_deactivate(){ 123 ccpurge_transaction_logging('Cloud flare Cache Purge - *Deactivated*');123 ccpurge_transaction_logging('CloudFlare Cache Purge - *Deactivated*'); 124 124 } 125 125 register_deactivation_hook(__FILE__,'ccpurge_deactivate'); -
cloudflare-cache-purge/trunk/lib/ccpurge.class.php
r810453 r860583 2 2 /* 3 3 4 Description: API Integration with Cloud flare to purge your cache4 Description: API Integration with CloudFlare to purge your cache 5 5 Author: Bryan Shanaver @ fiftyandfifty.org 6 6 Author URI: https://www.fiftyandfifty.org/ -
cloudflare-cache-purge/trunk/lib/ccpurge.js
r690167 r860583 1 1 (function($){ 2 2 3 3 window.ccpurge = {}; 4 4 var ccpurge = window.ccpurge; 5 5 6 6 ccpurge.initialize = function() { 7 7 ccpurge.setElements(); … … 16 16 17 17 }; 18 18 19 19 ccpurge.setElements = function() { 20 20 ccpurge.elems = {}; … … 28 28 ccpurge.elems.purge_url_btn = jQuery('#ccpurge-purge-url'); 29 29 ccpurge.elems.logging_container = jQuery('#ccpurge_table_logging'); 30 30 31 31 ccpurge.properties = {}; 32 32 }; … … 35 35 if( status === undefined ){ status = 'success'; } 36 36 if( status == 'success' ){ 37 alert('Cloud flare API Connect: Success\n\nSee log for details');37 alert('CloudFlare API Connect: Success\n\nSee log for details'); 38 38 } 39 39 else{ 40 alert('Cloud flare API Connect: Error\n\n' + response);40 alert('CloudFlare API Connect: Error\n\n' + response); 41 41 } 42 42 ccpurge.refreshLog(0); … … 46 46 ccpurge.elems.entire_cache_btn.bind('click', function(e) { 47 47 e.preventDefault(); 48 if( confirm('It may take up to 48 hours for the cache to rebuild and optimum speed to resume\nso this function should be used sparingly\n\nAre you sure you want to continue?') ) { 48 if( confirm('It may take up to 48 hours for the cache to rebuild and optimum speed to resume\nso this function should be used sparingly\n\nAre you sure you want to continue?') ) { 49 49 jQuery.ajax({ 50 50 'type' : 'post', … … 75 75 }); 76 76 } 77 77 78 78 ccpurge.ccpurge_transaction_logging = function(message, status) { 79 79 jQuery.ajax({ … … 89 89 }); 90 90 }; 91 91 92 92 ccpurge.refreshLog = function(page) { 93 93 jQuery.ajax({ … … 102 102 }) 103 103 } 104 105 104 105 106 106 jQuery(document).ready(function() { 107 107 ccpurge.initialize(); … … 109 109 console.log('ccpurge loaded'); 110 110 }); 111 112 111 112 113 113 })(jQuery); -
cloudflare-cache-purge/trunk/lib/ccpurge_options.php
r690167 r860583 7 7 if($ccpurge_options_post){ 8 8 update_option('ccpurge_options', $ccpurge_options_post); 9 ccpurge_transaction_logging('Updated Cloud flare Purge Settings');9 ccpurge_transaction_logging('Updated CloudFlare Purge Settings'); 10 10 ccpurge_transaction_logging('email=' . $ccpurge_options_post['email'] . ' & token=' . substr($ccpurge_options_post['token'], 0, 10) . '[...]' . ' & domain=' . ( isset($ccpurge_options_post['account']) ? $ccpurge_options_post['account'] : '') . ' & auto_purge=' . ( isset($ccpurge_options_post['auto_purge']) ? $ccpurge_options_post['auto_purge'] : '') ); 11 11 } … … 44 44 45 45 <div class="wrap"> 46 <div class="icon32" id="icon-options-general"><br></div><h2>Cloud flareCache Purge</h2>46 <div class="icon32" id="icon-options-general"><br></div><h2>CloudFlare® Cache Purge</h2> 47 47 48 48 <p style="text-align: left;"> 49 Cloud flare Cache Purge clears a single file cache or the entire thing<br />49 CloudFlare Cache Purge clears a single file cache or the entire thing<br /> 50 50 </p> 51 51 52 52 <div id="ccpurge-options-form"> 53 53 54 <?php if($ccpurge_token == ''): ?> 55 <div class="updated" id="message"><p><strong>Alert!</strong> You must get an Authentication Token from Cloud flare to start<br />If you don't already have a Cloudflare Cache account, you can <a target="_blank" href="https://www.cloudflare.com/sign-up">sign up for one here</a></p></div>56 <?php elseif($ccpurge_account == ''): ?> 57 <div class="updated" id="message"><p><strong>Alert!</strong> You must identify which Cloud flare Domain to target</p></div>58 <?php endif; ?> 59 54 <?php if($ccpurge_token == ''): ?> 55 <div class="updated" id="message"><p><strong>Alert!</strong> You must get an Authentication Token from CloudFlare to start<br />If you don't already have a CloudFlare Cache account, you can <a target="_blank" href="https://www.cloudflare.com/sign-up">sign up for one here</a></p></div> 56 <?php elseif($ccpurge_account == ''): ?> 57 <div class="updated" id="message"><p><strong>Alert!</strong> You must identify which CloudFlare Domain to target</p></div> 58 <?php endif; ?> 59 60 60 <form action="" id="ccpurge-form" method="post"> 61 61 <table class="ccpurge-table"> 62 62 <tbody> 63 63 64 64 <tr> 65 <th><label for="category_base">Cloud flare Email Address</label></th>65 <th><label for="category_base">CloudFlare Email Address</label></th> 66 66 <td class="col1"></td> 67 67 <td class="col2"> … … 70 70 </tr> 71 71 <tr> 72 <th><label for="tag_base">Cloud flare API Token</label></th>72 <th><label for="tag_base">CloudFlare API Token</label></th> 73 73 <td class="col1"></td> 74 74 <td class="col2"> 75 75 <input type="text" class="regular-text code" value="<?php echo $ccpurge_token; ?>" id="ccpurge-token" name="ccpurge_options[token]"> 76 76 </td> 77 </tr> 77 </tr> 78 78 <tr> 79 <th><label for="tag_base">Cloud flare Domain</label></th>79 <th><label for="tag_base">CloudFlare Domain</label></th> 80 80 <td class="col1"></td> 81 81 <td class="col2"> 82 82 <input type="text" class="regular-text code" value="<?php echo $ccpurge_account; ?>" id="ccpurge-account" name="ccpurge_options[account]"> 83 83 </td> 84 </tr> 85 84 </tr> 85 86 86 <?php if($ccpurge_token): ?> 87 87 <tr> 88 <th><label for="category_base">Auto matically Purge on Update:</label></th>88 <th><label for="category_base">Auto Purge on Update</label></th> 89 89 <td class="col1"></td> 90 90 <td class="col2"> … … 97 97 <td class="col2"> 98 98 <input type="text" class="regular-text code" value="<?php echo $ccpurge_url; ?>" name="ccpurge_options[ccpurge_url]" id="ccpurge-url"> 99 <input type="button" value="Purge URL" id="ccpurge-purge-url" class="button-primary"/> 99 <input type="button" value="Purge URL" id="ccpurge-purge-url" class="button-primary"/> 100 100 </td> 101 101 </tr> … … 104 104 <td class="col1"></td> 105 105 <td class="col2"> 106 <input type="button" value="Purge Entire Cache" id="ccpurge-entire-cache" class="button-primary"/> 106 <input type="button" value="Purge Entire Cache" id="ccpurge-entire-cache" class="button-primary"/> 107 107 </td> 108 108 </tr> … … 112 112 <td class="col2"> 113 113 <input type="radio" name="ccpurge_options[show_debugging]" value="1" <?php checked( $show_debugging, '1' ); ?>/> Show Debugging Sections 114 <span style="width:40px;height:10px;display:inline-block"></span> 115 <input type="radio" name="ccpurge_options[show_debugging]" value="0" <?php checked( $show_debugging, '0' ); ?>/> Hide Debugging Sections 114 <span style="width:40px;height:10px;display:inline-block"></span> 115 <input type="radio" name="ccpurge_options[show_debugging]" value="0" <?php checked( $show_debugging, '0' ); ?>/> Hide Debugging Sections 116 116 </td> 117 </tr> 117 </tr> 118 118 <tr class="debugging-block"> 119 119 <th><label for="category_base">Debugging Options</label></th> … … 133 133 <input type="submit" value="Update / Save" class="button-secondary"/> 134 134 </td> 135 </tr> 135 </tr> 136 136 137 137 <tr class="debugging-block"> … … 141 141 142 142 </tbody> 143 </table> 143 </table> 144 144 </form> 145 145 146 146 <div id="spinner"></div> 147 147 148 148 <div id="ccpurge_table_logging_container" class="debugging-block"> 149 149 <div id="ccpurge_table_logging"></div> 150 </div> 150 </div> 151 151 152 152 </div><!-- ccpurge-form-wrapper --> -
cloudflare-cache-purge/trunk/readme.txt
r813970 r860583 1 === Cloud flare Cache Purge ===1 === CloudFlare Cache Purge === 2 2 Contributors: shanaver 3 Tags: cloudflare, cache purge, cache clear, API3 Tags: CloudFlare, cache purge, cache clear, API 4 4 Requires at least: 3.0.1 5 5 Tested up to: 3.5.1 … … 9 9 Author URI: http://www.fiftyandfifty.org/ 10 10 11 Purge your entire Cloud flare cache from within Wordpress.11 Purge your entire CloudFlare cache from within Wordpress. 12 12 13 13 == Description == 14 14 15 Purge your entire Cloud flare cache, or an any specific URL, manually - or automatically everytime a post has been updated!15 Purge your entire CloudFlare cache, or an any specific URL, manually - or automatically everytime a post has been updated! 16 16 17 This plugin was not built by Cloud flare, it was built by Fifty & Fifty - a humanitarian creative studio located in San Diego, California.17 This plugin was not built by CloudFlare, it was built by Fifty & Fifty - a humanitarian creative studio located in San Diego, California. 18 18 19 19 == Installation == … … 21 21 1. Upload cloudflare-cache-purge folder to the `/wp-content/plugins/` directory 22 22 1. Activate the plugin through the 'Plugins' menu in WordPress 23 1. Create a free Cloud flare account at http://www.cloudflare.com24 1. Set up 'Page Rules' in Cloud flare to start caching your site pages25 1. Enter your Cloud flare email address & API token on the plugin settings page23 1. Create a free CloudFlare account at http://www.cloudflare.com 24 1. Set up 'Page Rules' in CloudFlare to start caching your site pages 25 1. Enter your CloudFlare email address & API token on the plugin settings page 26 26 1. Enable 'Automatically Purge on Update' or click 'Purge' from the plugin settings page 27 27 28 28 == Frequently Asked Questions == 29 29 30 = Do I need to have a Cloud flare account to use this plugin =30 = Do I need to have a CloudFlare account to use this plugin = 31 31 32 Yes, setting up a Cloud flare account is free and can take less than 5 minutes.32 Yes, setting up a CloudFlare account is free and can take less than 5 minutes. 33 33 34 34 == Screenshots ==
Note: See TracChangeset
for help on using the changeset viewer.