Plugin Directory

Changeset 2784650


Ignore:
Timestamp:
09/14/2022 01:51:32 PM (3 years ago)
Author:
jordantrizz
Message:

Update to version 0.1.5a from GitHub

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  
    44# Install
    55## WordPress Plugin Directory
    6 I've published this to the WordPress Plugin Directory https://github.com/jordantrizz/cache-purge-helper
     6I've published this to the WordPress Plugin Directory https://wordpress.org/plugins/cache-purge-helper/
    77## Manual Install
     8=======
     9>>>>>>> dev
    8101. Extract the zip file.
    9112. Upload them to `/wp-content/plugins/` directory on your WordPress installation.
    10123. Then activate the Plugin from Plugins page.
     13
     14# Documentation
     15* https://managingwp.io/
    1116
    1217# Contributions
     
    1722# Support/Sponsor
    1823* Facebook Page - https://www.facebook.com/groups/managingwordpress
    19 * Sponsor - https://wpinfo.net/sponsor/
    20 * WP Info - https://wpinfo.net
     24* Sponsor - https://managingwp.io/sponsor/
     25* WP Info - https://managingwp.io/
    2126* WP Guide - https://wpguide.io
    2227
  • cache-purge-helper/tags/0.1.5a/cache-purge-helper.php

    r2647555 r2784650  
    33/**
    44 * Plugin Name:       Cache Purge Helper
    5  * Plugin URI:        https://wpinfo.net
     5 * Plugin URI:        https://managingwp.io
    66 * Description:       Adding additional hooks to trigger nginx-helper or lscache plugin purges
    7  * Version:           0.1.3
     7 * Version:           0.1.4
    88 * Author:            Paul Stoute, Jordan Trask, Jeff Cleverley
    99 * Author URI:        https://github.com/jordantrizz/cache-purge-helper
     
    6161}
    6262
    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
     70function 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
    64114 *
    65115 * Log to PHP error_log if WP_DEBUG and CPH_DEBUG are set!
     
    77127}
    78128
    79 /*************/
     129/**************************************************/
    80130
    81 // Plugin Update Hooks
     131/**
     132 * WordPress core hooks.
     133 */
     134
    82135cphp_write_log('cphp - Loading WordPress core hooks');
    83 
    84 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After plugins have been updated
     136add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After a plugin, theme or core has been updated.
    85137add_action( 'activated_plugin', 'cphp_purge', 10, 0); // After a plugin has been activated
    86138add_action( 'deactivated_plugin', 'cphp_purge', 10, 0); // After a plugin has been deactivated
    87139add_action( 'switch_theme', 'cphp_purge', 10, 0); // After a theme has been changed
     140
     141/**
     142 * Page builder hooks.
     143 */
    88144
    89145// Beaver Builder
     
    93149    add_action( 'fl_builder_after_save_layout', 'cphp_purge', 10, 3 );
    94150    add_action( 'fl_builder_after_save_user_template', 'cphp_purge', 10, 3 );
    95     add_action( 'upgrader_process_complete', 'cphp_purge', 10, 3 );
    96151}
    97152
     
    104159}
    105160
    106 // AutoOptimizer
    107 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 
    112161// Oxygen
    113162if ( defined( 'CT_VERSION' ) ) {
     
    118167}
    119168
    120 // EOF       
     169/**
     170 * Optimization and caching plugin hooks.
     171 */
     172
     173// Autoptimizer
     174if ( 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
     180if ( 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  
    55Requires at least: 5.8
    66Tested up to: 5.8
    7 Stable tag: 0.1.3
     7Stable tag: 0.1.4
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    6262Enabling Debug Mode
    6363
    64 Simply add `define('CPHP_DEBUG',true);` to your wp-config.php to see debug messages in your PHP error_log
     64Enable [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
     66For any issues, open up a Github issue at https://github.com/managingwp/cache-purge-helper
    6567
    6668## Frequently Asked Questions
  • cache-purge-helper/trunk/README.md

    r2698432 r2784650  
    44# Install
    55## WordPress Plugin Directory
    6 I've published this to the WordPress Plugin Directory https://github.com/jordantrizz/cache-purge-helper
     6I've published this to the WordPress Plugin Directory https://wordpress.org/plugins/cache-purge-helper/
    77## Manual Install
     8=======
     9>>>>>>> dev
    8101. Extract the zip file.
    9112. Upload them to `/wp-content/plugins/` directory on your WordPress installation.
    10123. Then activate the Plugin from Plugins page.
     13
     14# Documentation
     15* https://managingwp.io/
    1116
    1217# Contributions
     
    1722# Support/Sponsor
    1823* Facebook Page - https://www.facebook.com/groups/managingwordpress
    19 * Sponsor - https://wpinfo.net/sponsor/
    20 * WP Info - https://wpinfo.net
     24* Sponsor - https://managingwp.io/sponsor/
     25* WP Info - https://managingwp.io/
    2126* WP Guide - https://wpguide.io
    2227
  • cache-purge-helper/trunk/cache-purge-helper.php

    r2647555 r2784650  
    33/**
    44 * Plugin Name:       Cache Purge Helper
    5  * Plugin URI:        https://wpinfo.net
     5 * Plugin URI:        https://managingwp.io
    66 * Description:       Adding additional hooks to trigger nginx-helper or lscache plugin purges
    7  * Version:           0.1.3
     7 * Version:           0.1.4
    88 * Author:            Paul Stoute, Jordan Trask, Jeff Cleverley
    99 * Author URI:        https://github.com/jordantrizz/cache-purge-helper
     
    6161}
    6262
    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
     70function 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
    64114 *
    65115 * Log to PHP error_log if WP_DEBUG and CPH_DEBUG are set!
     
    77127}
    78128
    79 /*************/
     129/**************************************************/
    80130
    81 // Plugin Update Hooks
     131/**
     132 * WordPress core hooks.
     133 */
     134
    82135cphp_write_log('cphp - Loading WordPress core hooks');
    83 
    84 add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After plugins have been updated
     136add_action( 'upgrader_process_complete', 'cphp_purge', 10, 0 ); // After a plugin, theme or core has been updated.
    85137add_action( 'activated_plugin', 'cphp_purge', 10, 0); // After a plugin has been activated
    86138add_action( 'deactivated_plugin', 'cphp_purge', 10, 0); // After a plugin has been deactivated
    87139add_action( 'switch_theme', 'cphp_purge', 10, 0); // After a theme has been changed
     140
     141/**
     142 * Page builder hooks.
     143 */
    88144
    89145// Beaver Builder
     
    93149    add_action( 'fl_builder_after_save_layout', 'cphp_purge', 10, 3 );
    94150    add_action( 'fl_builder_after_save_user_template', 'cphp_purge', 10, 3 );
    95     add_action( 'upgrader_process_complete', 'cphp_purge', 10, 3 );
    96151}
    97152
     
    104159}
    105160
    106 // AutoOptimizer
    107 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 
    112161// Oxygen
    113162if ( defined( 'CT_VERSION' ) ) {
     
    118167}
    119168
    120 // EOF       
     169/**
     170 * Optimization and caching plugin hooks.
     171 */
     172
     173// Autoptimizer
     174if ( 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
     180if ( 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  
    55Requires at least: 5.8
    66Tested up to: 5.8
    7 Stable tag: 0.1.3
     7Stable tag: 0.1.4
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    6262Enabling Debug Mode
    6363
    64 Simply add `define('CPHP_DEBUG',true);` to your wp-config.php to see debug messages in your PHP error_log
     64Enable [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
     66For any issues, open up a Github issue at https://github.com/managingwp/cache-purge-helper
    6567
    6668## Frequently Asked Questions
Note: See TracChangeset for help on using the changeset viewer.