Plugin Directory

Changeset 1558558


Ignore:
Timestamp:
12/20/2016 07:15:53 PM (9 years ago)
Author:
MailChimp
Message:

Fix timeout. Force re-authentication. Make API param optional.

Location:
mailchimp
Files:
449 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • mailchimp/trunk/lib/mailchimp/mailchimp.php

    r1525961 r1558558  
    1919    }
    2020
    21     public function get($endpoint, $count=10, $fields) {
     21    public function get($endpoint, $count = 10, $fields = [])
     22    {
    2223        $url = $this->api_url . $endpoint;
    2324
    24         if($count) {
     25        if ($count) {
    2526            $query_params = 'count=' . $count . '&';
    2627        }
    2728
    28         if(!empty($fields)) {
    29             foreach($fields as $field => $value) {
     29        if (!empty($fields)) {
     30            foreach ($fields as $field => $value) {
    3031                $query_params .= $field . '=' . $value . '&';
    3132            }
    3233        }
    3334
    34         if($query_params){
     35        if ($query_params) {
    3536            $url .= "?{$query_params}";
    3637        }
     
    4041            'redirection' => 5,
    4142            'httpversion' => '1.1',
    42             'user-agent'  => 'MailChimp WordPress Plugin/' . get_bloginfo( 'url' ),
     43            'user-agent'  => 'MailChimp WordPress Plugin/' . get_bloginfo('url'),
    4344            'headers'     => array("Authorization" => 'apikey ' . $this->key)
    4445        );
     
    4647        $request = wp_remote_get($url, $args);
    4748
    48         if(is_array($request) && $request['response']['code'] == 200) {
     49        if (is_array($request) && $request['response']['code'] == 200) {
    4950            return json_decode($request['body'], true);
    50         } elseif(is_array($request) && $request['response']['code']) {
     51        } elseif (is_array($request) && $request['response']['code']) {
    5152            $error = json_decode($request['body'], true);
    5253            $error = new WP_Error('mailchimp-get-error', $error['detail']);
     
    5758    }
    5859
    59     public function post($endpoint, $body, $method='POST') {
     60    public function post($endpoint, $body, $method = 'POST') {
    6061        $url = $this->api_url . $endpoint;
    6162       
  • mailchimp/trunk/mailchimp.php

    r1525961 r1558558  
    44Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/
    55Description: The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list.
    6 Version: 1.5.3
     6Version: 1.5.5
    77Author: MailChimp
    88Author URI: https://mailchimp.com/
     
    2626
    2727// Version constant for easy CSS refreshes
    28 define('MCSF_VER', '1.5.3');
     28define('MCSF_VER', '1.5.5');
    2929
    3030// What's our permission (capability) threshold
     
    6060    load_textdomain('mailchimp_i18n', MCSF_LANG_DIR.$textdomain.'-'.$locale.'.mo');
    6161
    62     // Check for mc_api_key or sopresto key and continue if neither
    63     mailchimpSF_migrate_sopresto();
     62    // Remove Sopresto check. If user does not have API key, make them authenticate.
    6463
    6564    if (get_option('mc_list_id') && get_option('mc_merge_field_migrate') != true && mailchimpSF_get_api() !== false) {
  • mailchimp/trunk/readme.txt

    r1525961 r1558558  
    44Requires at least: 2.8
    55Tested up to: 4.5
    6 Stable tag: 1.5.3
     6Stable tag: 1.5.5
    77
    88== Description ==
     
    9494== Upgrade Notice ==
    9595
     96= 1.5.5 =
     97If you are updating from v1.4.x, you will need to re-authorize with an API key.
     98
    9699= 1.5 =
    97100Updates the MailChimp API version, adds double/single opt-in toggle.
     
    127130
    128131== Changelog ==
     132
     133= 1.5.5 =
     134* Fix timeout error on activation.
     135
     136= 1.5.4 =
     137* Set optional value for API wrapper.
    129138
    130139= 1.5.3 =
Note: See TracChangeset for help on using the changeset viewer.