Plugin Directory

Changeset 810453


Ignore:
Timestamp:
11/25/2013 09:39:10 PM (12 years ago)
Author:
shanaver
Message:

1.0.3 - Small php notice fix

Location:
cloudflare-cache-purge/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cloudflare-cache-purge/trunk/cloudflare_cachepurge.php

    r810444 r810453  
    44Plugin Name:  Cloudflare Cache Purge
    55Description:  API Integration with Cloudflare to purge your cache
    6 Version:      1.0.2
     6Version:      1.0.3
    77Author:       Bryan Shanaver @ fiftyandfifty.org
    88Author URI:   https://www.fiftyandfifty.org/
     
    1717*/
    1818
    19 define('CCPURGE_VERSION', '1.0.2');
     19define('CCPURGE_VERSION', '1.0.3');
    2020
    2121define('CCPURGE_PLUGIN_URL', plugin_dir_url( __FILE__ ));
  • cloudflare-cache-purge/trunk/lib/ccpurge.class.php

    r690167 r810453  
    1717
    1818class CCPURGE_API {
    19    
     19
    2020    var $ccpurge_endpoint         = "https://www.cloudflare.com/api_json.html";
    2121    var $ccpurge_methods              = array();
    22     var $ccpurge_options            = array(); 
     22    var $ccpurge_options            = array();
    2323    var $ccpurge_url                    = '';
    2424    var $ccpurge_suppress_debug = false;
    25        
     25
    2626    function __construct() {
    2727        $this->ccpurge_options = get_option('ccpurge_options');
    2828        isset($this->ccpurge_options['auto_purge']) || $this->ccpurge_options['auto_purge'] = false;
    29         if( $this->ccpurge_options['account'] == '' ){
     29        if( empty($this->ccpurge_options['account']) ){
    3030            $this->ccpurge_options['account'] = $this->get_wordpress_domain();
    3131            update_option('ccpurge_options', $this->ccpurge_options);
     
    3434        $this->wordpress_upload_dir = wp_upload_dir();
    3535    }
    36    
     36
    3737    function build_api_calls(){
    3838            $tkn        = isset($this->ccpurge_options['token']) ? $this->ccpurge_options['token'] : null;
     
    5555            );
    5656    }
    57    
     57
    5858    function return_json_success($data='') {
    5959        print json_encode( array("success" => 'true', "data" => $data) );
    60     }   
    61    
     60    }
     61
    6262    function return_json_error($error='') {
    6363        print json_encode( array("success" => 'false', 'error' => array("message" => $error)) );
    64     }       
    65    
     64    }
     65
    6666    function make_api_request($api_method, $extra_post_variables = null){
    6767        $headers = '';
     
    7171            return;
    7272        }
    73        
     73
    7474        if( is_array($extra_post_variables) ){
    7575            $post_variables =  array_merge( $this->api_methods[$api_method], $extra_post_variables );
     
    7878            $post_variables = $this->api_methods[$api_method];
    7979        }
    80        
     80
    8181        if( isset($this->ccpurge_options['console_calls']) && !$this->ccpurge_suppress_debug ){
    8282            ccpurge_transaction_logging("\n" . "api url: " . $this->ccpurge_endpoint . "\n" . "api post args: " . print_r($post_variables, true) . "\n", 'print_debug');
     
    8484
    8585        $results = wp_remote_post($this->ccpurge_endpoint, array( 'headers' => $headers, 'body' => $post_variables) );
    86        
     86
    8787        if( isset($this->ccpurge_options['console_details']) && !$this->ccpurge_suppress_debug ){
    8888            print_r($results);
    8989        }
    90        
     90
    9191        if( is_object($results) ){
    9292            if( get_class($results) == 'WP_Error' ){
    9393                $this->return_json_error('Wordpress Error - ' . json_encode($results));
    9494                die();
    95             }           
     95            }
    9696        }
    97        
     97
    9898        if($results['response']['code'] != '200'){
    9999            $this->return_json_error($results['response']['message']);
    100100            die();
    101101        }
    102        
     102
    103103        return json_decode($results['body']);
    104104    }
  • cloudflare-cache-purge/trunk/readme.txt

    r810444 r810453  
    4747* Multisite domain mapping support - thanks Ed Cooper
    4848
     49= 1.0.3
     50* Small php notice fix
     51
    4952== Upgrade Notice ==
    5053
Note: See TracChangeset for help on using the changeset viewer.