Changeset 2784650
- Timestamp:
- 09/14/2022 01:51:32 PM (3 years ago)
- Location:
- cache-purge-helper
- Files:
-
- 2 added
- 6 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
cache-purge-helper/tags/0.1.5a/README.md
r2698432 r2784650 4 4 # Install 5 5 ## WordPress Plugin Directory 6 I've published this to the WordPress Plugin Directory https:// github.com/jordantrizz/cache-purge-helper6 I've published this to the WordPress Plugin Directory https://wordpress.org/plugins/cache-purge-helper/ 7 7 ## Manual Install 8 ======= 9 >>>>>>> dev 8 10 1. Extract the zip file. 9 11 2. Upload them to `/wp-content/plugins/` directory on your WordPress installation. 10 12 3. Then activate the Plugin from Plugins page. 13 14 # Documentation 15 * https://managingwp.io/ 11 16 12 17 # Contributions … … 17 22 # Support/Sponsor 18 23 * Facebook Page - https://www.facebook.com/groups/managingwordpress 19 * Sponsor - https:// wpinfo.net/sponsor/20 * WP Info - https:// wpinfo.net24 * Sponsor - https://managingwp.io/sponsor/ 25 * WP Info - https://managingwp.io/ 21 26 * WP Guide - https://wpguide.io 22 27 -
cache-purge-helper/tags/0.1.5a/cache-purge-helper.php
r2647555 r2784650 3 3 /** 4 4 * Plugin Name: Cache Purge Helper 5 * Plugin URI: https:// wpinfo.net5 * Plugin URI: https://managingwp.io 6 6 * Description: Adding additional hooks to trigger nginx-helper or lscache plugin purges 7 * Version: 0.1. 37 * Version: 0.1.4 8 8 * Author: Paul Stoute, Jordan Trask, Jeff Cleverley 9 9 * Author URI: https://github.com/jordantrizz/cache-purge-helper … … 61 61 } 62 62 63 /** Log to WordPress Debug Log Function 63 /** 64 * 65 * The rtCamp/nginx-helper plugin doesn't work with GridPane's FastCGI Cache. 66 * This is suppose to help, but you should install https://github.com/JeffCleverley/NginxFastCGICachePurger 67 * 68 */ 69 70 function cphp_gridpane_purgeall() { 71 72 $site = get_site_url(); 73 $find = [ 'http://', 'https://' ]; 74 $replace = ''; 75 $host = str_replace( $find, $replace, $site); 76 77 if ( is_ssl() ) { 78 79 $purgeurl = $site . '/purgeall' ; 80 $curl = curl_init( $purgeurl ); 81 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE" ); 82 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 83 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 84 curl_setopt($curl, CURLOPT_RESOLVE, array( $host . ":443:127.0.0.1" )); 85 86 $response = curl_exec($curl); 87 88 if ($response === false) { 89 90 $response = curl_errno($curl) .': '. curl_error($curl); 91 92 } 93 94 curl_close($curl); 95 96 } else { 97 98 $curl = curl_init( "http://127.0.0.1/purgeall" ); 99 curl_setopt($curl, CURLOPT_HTTPHEADER, array('Host:' . $host )); 100 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE" ); 101 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); 102 103 $response = curl_exec($curl); 104 105 curl_close($curl); 106 107 } 108 109 cphp_write_log("cph_gridpane_purge: response: $response"); 110 } 111 112 /** 113 * Log to WordPress Debug Log Function 64 114 * 65 115 * Log to PHP error_log if WP_DEBUG and CPH_DEBUG are set! … … 77 127 } 78 128 79 /************* /129 /**************************************************/ 80 130 81 // Plugin Update Hooks 131 /** 132 * WordPress core hooks. 133 */ 134 82 135 cphp_write_log('cphp - Loading WordPress core hooks'); 83 84 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After plugins have been updated 136 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After a plugin, theme or core has been updated. 85 137 add_action( 'activated_plugin', 'cphp_purge', 10, 0); // After a plugin has been activated 86 138 add_action( 'deactivated_plugin', 'cphp_purge', 10, 0); // After a plugin has been deactivated 87 139 add_action( 'switch_theme', 'cphp_purge', 10, 0); // After a theme has been changed 140 141 /** 142 * Page builder hooks. 143 */ 88 144 89 145 // Beaver Builder … … 93 149 add_action( 'fl_builder_after_save_layout', 'cphp_purge', 10, 3 ); 94 150 add_action( 'fl_builder_after_save_user_template', 'cphp_purge', 10, 3 ); 95 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 3 );96 151 } 97 152 … … 104 159 } 105 160 106 // AutoOptimizer107 if ( defined( 'AUTOPTIMIZE_PLUGIN_DIR' ) ) {108 cphp_write_log('cphp - Autoptimize hooks enabled');109 add_action( 'autoptimize_action_cachepurged','cphp_purge', 10, 3 ); // Need to document this.110 }111 112 161 // Oxygen 113 162 if ( defined( 'CT_VERSION' ) ) { … … 118 167 } 119 168 120 // EOF 169 /** 170 * Optimization and caching plugin hooks. 171 */ 172 173 // Autoptimizer 174 if ( defined( 'AUTOPTIMIZE_PLUGIN_DIR' ) ) { 175 cphp_write_log('cphp - Autoptimize hooks enabled'); 176 add_action( 'autoptimize_action_cachepurged','cphp_purge', 10, 3 ); // Need to document this. 177 } 178 179 // WP Optimize Hooks 180 if ( defined ('WPO_VERSION') ){ 181 cphp_write_log('cphp - WP Optimize hooks enabled'); 182 add_filter('wpo_purge_all_cache_on_update', '__return_true'); 183 } 184 -
cache-purge-helper/tags/0.1.5a/readme.txt
r2698432 r2784650 5 5 Requires at least: 5.8 6 6 Tested up to: 5.8 7 Stable tag: 0.1. 37 Stable tag: 0.1.4 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 62 62 Enabling Debug Mode 63 63 64 Simply add `define('CPHP_DEBUG',true);` to your wp-config.php to see debug messages in your PHP error_log 64 Enable [WordPress debug](https://wordpress.org/support/article/debugging-in-wordpress/) and add `define('CPHP_DEBUG',true);` to your wp-config.php to see debug messages in your PHP error_log. 65 66 For any issues, open up a Github issue at https://github.com/managingwp/cache-purge-helper 65 67 66 68 ## Frequently Asked Questions -
cache-purge-helper/trunk/README.md
r2698432 r2784650 4 4 # Install 5 5 ## WordPress Plugin Directory 6 I've published this to the WordPress Plugin Directory https:// github.com/jordantrizz/cache-purge-helper6 I've published this to the WordPress Plugin Directory https://wordpress.org/plugins/cache-purge-helper/ 7 7 ## Manual Install 8 ======= 9 >>>>>>> dev 8 10 1. Extract the zip file. 9 11 2. Upload them to `/wp-content/plugins/` directory on your WordPress installation. 10 12 3. Then activate the Plugin from Plugins page. 13 14 # Documentation 15 * https://managingwp.io/ 11 16 12 17 # Contributions … … 17 22 # Support/Sponsor 18 23 * Facebook Page - https://www.facebook.com/groups/managingwordpress 19 * Sponsor - https:// wpinfo.net/sponsor/20 * WP Info - https:// wpinfo.net24 * Sponsor - https://managingwp.io/sponsor/ 25 * WP Info - https://managingwp.io/ 21 26 * WP Guide - https://wpguide.io 22 27 -
cache-purge-helper/trunk/cache-purge-helper.php
r2647555 r2784650 3 3 /** 4 4 * Plugin Name: Cache Purge Helper 5 * Plugin URI: https:// wpinfo.net5 * Plugin URI: https://managingwp.io 6 6 * Description: Adding additional hooks to trigger nginx-helper or lscache plugin purges 7 * Version: 0.1. 37 * Version: 0.1.4 8 8 * Author: Paul Stoute, Jordan Trask, Jeff Cleverley 9 9 * Author URI: https://github.com/jordantrizz/cache-purge-helper … … 61 61 } 62 62 63 /** Log to WordPress Debug Log Function 63 /** 64 * 65 * The rtCamp/nginx-helper plugin doesn't work with GridPane's FastCGI Cache. 66 * This is suppose to help, but you should install https://github.com/JeffCleverley/NginxFastCGICachePurger 67 * 68 */ 69 70 function cphp_gridpane_purgeall() { 71 72 $site = get_site_url(); 73 $find = [ 'http://', 'https://' ]; 74 $replace = ''; 75 $host = str_replace( $find, $replace, $site); 76 77 if ( is_ssl() ) { 78 79 $purgeurl = $site . '/purgeall' ; 80 $curl = curl_init( $purgeurl ); 81 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE" ); 82 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 83 curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 84 curl_setopt($curl, CURLOPT_RESOLVE, array( $host . ":443:127.0.0.1" )); 85 86 $response = curl_exec($curl); 87 88 if ($response === false) { 89 90 $response = curl_errno($curl) .': '. curl_error($curl); 91 92 } 93 94 curl_close($curl); 95 96 } else { 97 98 $curl = curl_init( "http://127.0.0.1/purgeall" ); 99 curl_setopt($curl, CURLOPT_HTTPHEADER, array('Host:' . $host )); 100 curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE" ); 101 curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE); 102 103 $response = curl_exec($curl); 104 105 curl_close($curl); 106 107 } 108 109 cphp_write_log("cph_gridpane_purge: response: $response"); 110 } 111 112 /** 113 * Log to WordPress Debug Log Function 64 114 * 65 115 * Log to PHP error_log if WP_DEBUG and CPH_DEBUG are set! … … 77 127 } 78 128 79 /************* /129 /**************************************************/ 80 130 81 // Plugin Update Hooks 131 /** 132 * WordPress core hooks. 133 */ 134 82 135 cphp_write_log('cphp - Loading WordPress core hooks'); 83 84 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After plugins have been updated 136 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After a plugin, theme or core has been updated. 85 137 add_action( 'activated_plugin', 'cphp_purge', 10, 0); // After a plugin has been activated 86 138 add_action( 'deactivated_plugin', 'cphp_purge', 10, 0); // After a plugin has been deactivated 87 139 add_action( 'switch_theme', 'cphp_purge', 10, 0); // After a theme has been changed 140 141 /** 142 * Page builder hooks. 143 */ 88 144 89 145 // Beaver Builder … … 93 149 add_action( 'fl_builder_after_save_layout', 'cphp_purge', 10, 3 ); 94 150 add_action( 'fl_builder_after_save_user_template', 'cphp_purge', 10, 3 ); 95 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 3 );96 151 } 97 152 … … 104 159 } 105 160 106 // AutoOptimizer107 if ( defined( 'AUTOPTIMIZE_PLUGIN_DIR' ) ) {108 cphp_write_log('cphp - Autoptimize hooks enabled');109 add_action( 'autoptimize_action_cachepurged','cphp_purge', 10, 3 ); // Need to document this.110 }111 112 161 // Oxygen 113 162 if ( defined( 'CT_VERSION' ) ) { … … 118 167 } 119 168 120 // EOF 169 /** 170 * Optimization and caching plugin hooks. 171 */ 172 173 // Autoptimizer 174 if ( defined( 'AUTOPTIMIZE_PLUGIN_DIR' ) ) { 175 cphp_write_log('cphp - Autoptimize hooks enabled'); 176 add_action( 'autoptimize_action_cachepurged','cphp_purge', 10, 3 ); // Need to document this. 177 } 178 179 // WP Optimize Hooks 180 if ( defined ('WPO_VERSION') ){ 181 cphp_write_log('cphp - WP Optimize hooks enabled'); 182 add_filter('wpo_purge_all_cache_on_update', '__return_true'); 183 } 184 -
cache-purge-helper/trunk/readme.txt
r2698432 r2784650 5 5 Requires at least: 5.8 6 6 Tested up to: 5.8 7 Stable tag: 0.1. 37 Stable tag: 0.1.4 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 62 62 Enabling Debug Mode 63 63 64 Simply add `define('CPHP_DEBUG',true);` to your wp-config.php to see debug messages in your PHP error_log 64 Enable [WordPress debug](https://wordpress.org/support/article/debugging-in-wordpress/) and add `define('CPHP_DEBUG',true);` to your wp-config.php to see debug messages in your PHP error_log. 65 66 For any issues, open up a Github issue at https://github.com/managingwp/cache-purge-helper 65 67 66 68 ## Frequently Asked Questions
Note: See TracChangeset
for help on using the changeset viewer.