Plugin Directory

Changeset 2429029


Ignore:
Timestamp:
11/30/2020 11:24:47 PM (5 years ago)
Author:
cynderhost
Message:

Reordered API Calls

Location:
cynderhost/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cynderhost/trunk/README.txt

    r2428940 r2429029  
    3333== Changelog ==
    3434
     35= 1.4.4 =
     36*  Fixed: Hotfix for Smart Purge bug causing pages to not be purged on first update
     37
    3538= 1.4.3 =
    3639*  Improved: Reordered API call order for better purge consistency
  • cynderhost/trunk/cynderhost.php

    r2428940 r2429029  
    99 * Plugin URI:        https://cynderhost.com
    1010 * Description:       Provides an easy interface to clear the CynderHost CDN cache, both automatically and programmatically.
    11  * Version:           1.4.3
     11 * Version:           1.4.4
    1212 * Author:            CynderHost
    1313 * Author URI:        https://profiles.wordpress.org/cynderhost/
     
    2424
    2525//Define version
    26 define('CYNDERHOST_VERSION', '1.4.3');
     26define('CYNDERHOST_VERSION', '1.4.4');
    2727
    2828/**
     
    131131    ));
    132132    //we don't know the response anyways
     133   
    133134    return true;
    134135}
     
    149150    $response = wp_remote_post("https://api.cynderhost.com/high-performance/cache/local/purge-some/", array(
    150151        'method' => 'POST',
    151         'timeout' => 10,
     152        'timeout' => 0.12,
    152153        'redirection' => 5,
    153154        'blocking' => false,
     
    158159    $response = wp_remote_post("https://api.cynderhost.com/high-performance/cache/cdn/purge-some/", array(
    159160        'method' => 'POST',
    160         'timeout' => 10,
     161        'timeout' => 0.12,
    161162        'redirection' => 5,
    162163        'blocking' => false,
     
    178179function cynderhost_comment_update_function($ns, $os, $comment)
    179180{
    180     if ($ns != "approved" && $os != "approved" ){
    181         return null;
    182     }
     181    if ($ns != "approved" && $os != "approved" ){
     182        return null;
     183    }
    183184    if ($comment->comment_parent > 0)
    184185    {
     
    282283 */
    283284function schedule_cache_cynderhost_selective_purge($postid, $post = "")
    284 {   
    285     $sh = wp_schedule_single_event(time(), 'cynderhost_purge_cron_multi', array( $postid, $post ) );
    286     spawn_cron();
     285{   
     286    if ($post->post_status == "publish" || $post->post_status == "private" || $post->post_status == "trash"){
     287        wp_schedule_single_event(time(), 'cynderhost_purge_cron_multi', array( $postid, $post ) );
     288        spawn_cron();
     289    }
    287290}
    288291
     
    321324    {
    322325        echo '<div class="notice notice-info is-dismissible">
    323                   <p>' . $v['message'] . '</p>
    324                 </div>';
     326                  <p>' . $v['message'] . '</p>
     327                </div>';
    325328    }
    326329}
     
    438441        $this->cynderhost_cdn_settings_options = get_option('cynderhost_cdn_settings_option_name'); ?>
    439442
    440         <div class="wrap">
    441             <h2>CynderHost CDN Settings</h2>
    442             <p>Configure caching purging settings for CynderHost CDN</p>
    443             <p>API key can be found in the hosting panel under CDN</p>
    444             <?php settings_errors(); ?>
    445 
    446             <form method="post" action="options.php">
    447                 <?php
     443        <div class="wrap">
     444            <h2>CynderHost CDN Settings</h2>
     445            <p>Configure caching purging settings for CynderHost CDN</p>
     446            <p>API key can be found in the hosting panel under CDN</p>
     447            <?php settings_errors(); ?>
     448
     449            <form method="post" action="options.php">
     450                <?php
    448451        settings_fields('cynderhost_cdn_settings_option_group');
    449452        do_settings_sections('cynderhost-cdn-settings-admin');
    450453        submit_button($text = "Save & Purge Cache");
    451454?>
    452             </form>
    453         </div>
    454     <?php
     455            </form>
     456        </div>
     457    <?php
    455458    }
    456459
Note: See TracChangeset for help on using the changeset viewer.