Plugin Directory

Changeset 2373992


Ignore:
Timestamp:
09/02/2020 03:16:52 PM (6 years ago)
Author:
sparkpost
Message:

Release v3.2.3

Location:
sparkpost/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sparkpost/trunk/.travis.yml

    r1582798 r2373992  
    11language: php
     2
     3services:
     4  - mysql
    25
    36notifications:
     
    1114
    1215php:
    13   - 5.6
    1416  - 7.0
    1517
    1618env:
    17   - WP_VERSION=latest WP_MULTISITE=0
    18   - WP_VERSION=4.3 WP_MULTISITE=0
    19   - WP_VERSION=4.4 WP_MULTISITE=0
    20   - WP_VERSION=4.5 WP_MULTISITE=0
    21   - WP_VERSION=4.6 WP_MULTISITE=0
    22   - WP_VERSION=4.7 WP_MULTISITE=0
     19  - WP_VERSION=5.5 WP_MULTISITE=0
    2320
    2421before_script:
  • sparkpost/trunk/mailer.http.class.php

    r2372398 r2373992  
    124124            // stored template
    125125            $substitution_data = $this->get_template_substitutes($sender, $replyTo);
    126             if (sizeof($attachments) > 0) { //get template preview data and then send it as inline
     126            if (sizeof($attachments) > 0) { // get template preview data and then send it as inline
    127127                $preview_contents = $this->template->preview($template_id, $substitution_data);
    128128                if ($preview_contents === false) {
     
    134134                );
    135135
     136                if(!empty($content_headers)) {
     137                    $body['content']['headers'] = $content_headers;
     138                }
     139
    136140                if (property_exists($preview_contents, 'text')) {
    137141                    $body['content']['text'] = $preview_contents->text;
     
    146150                }
    147151
    148             } else { // simply subsititute template tags
     152            } else { // simply substitute template tags
    149153                $body['content']['template_id'] = $template_id;
    150154                $body['substitution_data'] = $substitution_data;
     
    156160                'subject' => $this->Subject
    157161            );
     162
     163            if(!empty($content_headers)) {
     164                $body['content']['headers'] = $content_headers;
     165            }
    158166
    159167            if ($replyTo) {
     
    175183        }
    176184
    177         if(!empty($content_headers)) {
    178             $body['content']['headers'] = $content_headers;
    179         }
    180 
    181185        if (sizeof($attachments)) {
    182186            $body['content']['attachments'] = $attachments;
  • sparkpost/trunk/readme.txt

    r2372398 r2373992  
    44Requires at least: 5.5
    55Tested up to: 5.5
    6 Stable tag: 3.2.2
     6Stable tag: 3.2.3
    77License: GPLv2 or later
    88
     
    1515
    1616**Requirements**
    17 - PHP 5.4 or later
     17- PHP 7.0 or later
    1818- WordPress 5.5 or later
    1919
     
    5252
    5353== Changelog ==
     54
     55= 3.2.3 =
     56- Fixed broken SparkPost logo on settings page ([157](https://github.com/SparkPost/wordpress-sparkpost/pull/157))
    5457
    5558= 3.2.2 =
  • sparkpost/trunk/tests/bin/install-wp-tests.sh

    r1582798 r2373992  
    119119
    120120    # create database
    121     mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA
     121    mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS" $EXTRA
    122122}
    123123
  • sparkpost/trunk/tests/specs/test-mailer.http.class.php

    r1626130 r2373992  
    2626    $stub->shouldReceive('sparkpost_send')->andReturn('woowoo');
    2727
    28     $this->assertTrue(NSA::invokeMethod($stub, 'mailSend', null, null) == 'woowoo');
     28    $this->assertEquals(NSA::invokeMethod($stub, 'mailSend', null, null), 'woowoo');
    2929  }
    3030
    3131  function test_mailer_is_a_mailer_instance() {
    32     $this->assertTrue( $this->mailer instanceof \PHPMailer );
     32    $this->assertTrue( $this->mailer instanceof \PHPMailer\PHPMailer\PHPMailer );
    3333  }
    3434
     
    4040    );
    4141
    42     $this->assertTrue(NSA::invokeMethod($this->mailer, 'get_sender') == $sender);
     42    $this->assertEquals(NSA::invokeMethod($this->mailer, 'get_sender'), $sender);
    4343  }
    4444
     
    4949    );
    5050
    51     $this->assertTrue(NSA::invokeMethod($this->mailer, 'get_sender') == $sender);
     51    $this->assertEquals(NSA::invokeMethod($this->mailer, 'get_sender'), $sender);
    5252  }
    5353
     
    5858      'Authorization' => ''
    5959    );
    60     $this->assertTrue(NSA::invokeMethod($this->mailer, 'get_request_headers') == $expected);
     60    $this->assertEquals(NSA::invokeMethod($this->mailer, 'get_request_headers'), $expected);
    6161
    6262    NSA::setProperty($this->mailer, 'settings', array('password' => 'abcd1234'));
     
    6666      'Authorization' => 'abcd1234'
    6767    );
    68     $this->assertTrue(NSA::invokeMethod($this->mailer, 'get_request_headers') == $expected);
     68    $this->assertEquals(NSA::invokeMethod($this->mailer, 'get_request_headers'), $expected);
    6969  }
    7070
     
    7676      'Authorization' => 'abcd'.str_repeat('*', 36)
    7777    );
    78     $this->assertTrue(NSA::invokeMethod($this->mailer, 'get_request_headers', true) == $expected);
     78
     79    $this->assertEquals(NSA::invokeMethod($this->mailer, 'get_request_headers', true), $expected);
    7980  }
    8081
    8182  function test_get_headers() {
    82     $raw_headers = "Date: Wed, 26 Oct 2016 23:45:32 +0000
    83     To: undisclosed-recipients:;
    84     From: Root User <root@localhost>
    85     Subject: Hello
    86     Reply-To: [email protected]
    87     Message-ID: <[email protected]>
    88     MIME-Version: 1.0
    89     Content-Type: text/plain; charset=iso-8859-1
    90     Content-Transfer-Encoding: 8bit";
     83    $stub = Mockery::mock($this->mailer);
     84    $raw_headers = join(
     85      NSA::getProperty($stub, 'LE'),
     86      array(
     87        'Date: Wed, 26 Oct 2016 23:45:32 +0000',
     88        'To: undisclosed-recipients:;',
     89        'From: Root User <root@localhost>',
     90        'Subject: Hello',
     91        'Reply-To: [email protected]',
     92        'Message-ID: <[email protected]>',
     93        'MIME-Version: 1.0',
     94        'Content-Type: text/plain; charset=iso-8859-1',
     95        'Content-Transfer-Encoding: 8bit'
     96      )
     97    );
     98    $stub->shouldReceive('createHeader')->andReturn($raw_headers);
     99    $formatted_headers = NSA::invokeMethod($stub, 'get_headers');
    91100
    92101    $expected = array(
     
    94103      'Date' => 'Wed, 26 Oct 2016 23:45:32 +0000'
    95104    );
     105
     106    $this->assertEquals($formatted_headers, $expected);
     107  }
     108
     109
     110  function test_get_headers_should_include_cc_if_exists() {
    96111    $stub = Mockery::mock($this->mailer);
     112    $raw_headers = join(
     113      NSA::getProperty($stub, 'LE'),
     114      array(
     115        'Date: Wed, 26 Oct 2016 23:45:32 +0000',
     116        'Reply-To: [email protected]'
     117      )
     118    );
    97119    $stub->shouldReceive('createHeader')->andReturn($raw_headers);
     120    $stub->addCc('[email protected]');
     121    $stub->addCc('[email protected]', 'Name');
     122
    98123    $formatted_headers = NSA::invokeMethod($stub, 'get_headers');
    99 
    100     $this->assertTrue($formatted_headers == $expected);
    101   }
    102 
    103 
    104   function test_get_headers_should_include_cc_if_exists() {
    105     $raw_headers = "Date: Wed, 26 Oct 2016 23:45:32 +0000
    106     Reply-To: [email protected]";
    107124
    108125    $expected = array(
     
    110127      'CC' => '[email protected],Name <[email protected]>'
    111128    );
    112     $stub = Mockery::mock($this->mailer);
    113     $stub->shouldReceive('createHeader')->andReturn($raw_headers);
    114     $stub->addCc('[email protected]');
    115     $stub->addCc('[email protected]', 'Name');
    116 
    117     $formatted_headers = NSA::invokeMethod($stub, 'get_headers');
    118 
    119     $this->assertTrue($formatted_headers == $expected);
     129
     130    $this->assertEquals($formatted_headers, $expected);
    120131  }
    121132
     
    173184
    174185    $recipients = NSA::invokeMethod($this->mailer, 'get_recipients');
    175     $this->assertTrue($recipients == $expected);
     186    $this->assertEquals($recipients, $expected);
    176187  }
    177188
     
    191202    // test if isMail sets correct mailer
    192203    $this->mailer->Mailer = 'abc';
    193     $this->assertTrue($this->mailer->Mailer === 'abc');
     204    $this->assertEquals($this->mailer->Mailer, 'abc');
    194205    $this->mailer->isMail();
    195     $this->assertTrue($this->mailer->Mailer === 'sparkpost');
     206    $this->assertEquals($this->mailer->Mailer, 'sparkpost');
    196207  }
    197208
     
    251262    // alternative is to stub get_headers which isn't working expectedly
    252263    $actual['content']['headers'] = [];
    253     $this->assertTrue($expected_request_body == $actual);
     264    $this->assertEquals($expected_request_body, $actual);
    254265
    255266    //INCLUDE REPLYTO
     
    259270    $actual['content']['headers'] = []; //see note above
    260271    $expected_request_body['content']['reply_to'] = 'reply-to <[email protected]>';
    261     $this->assertTrue($expected_request_body == $actual);
     272    $this->assertEquals($expected_request_body, $actual);
    262273  }
    263274
     
    280291    $body = NSA::invokeMethod($this->mailer, 'get_request_body');
    281292    remove_filter('wpsp_template_id', $callback);
    282     $this->assertTrue($body['content']['template_id'] == 'test-template');
     293    $this->assertEquals($body['content']['template_id'], 'test-template');
    283294  }
    284295
     
    334345
    335346    $actual = NSA::invokeMethod($this->mailer, 'get_request_body');
    336     $this->assertTrue($expected_request_body == $actual);
     347    $this->assertEquals($expected_request_body, $actual);
    337348
    338349    //INCLUDE REPLYTO
     
    341352    $actual = NSA::invokeMethod($this->mailer, 'get_request_body');
    342353    $expected_request_body['substitution_data']['reply_to'] = 'reply-to <[email protected]>';
    343     $this->assertTrue($expected_request_body == $actual);
     354    $this->assertEquals($expected_request_body, $actual);
    344355  }
    345356
     
    421432    $actual = NSA::invokeMethod($mailer, 'get_request_body');
    422433    unset($actual['content']['headers']); //to simplify assertion
    423     $this->assertTrue($expected_request_body == $actual);
     434    $this->assertEquals($expected_request_body, $actual);
    424435  }
    425436
     
    520531
    521532    $body = NSA::invokeMethod($mailer, 'get_request_body');
    522     $this->assertTrue($body['options']['sandbox'] == true);
     533    $this->assertTrue($body['options']['sandbox']);
    523534  }
    524535
     
    659670      ->getMock();
    660671
    661     $this->assertTrue($mailer->check_permission_error($response, 'test_perm') === true);
     672    $this->assertTrue($mailer->check_permission_error($response, 'test_perm'));
    662673
    663674    $response['response']['code'] = 200;
    664     $this->assertTrue($mailer->check_permission_error($response, 'test_perm') === false);
     675    $this->assertFalse($mailer->check_permission_error($response, 'test_perm'));
    665676  }
    666677
  • sparkpost/trunk/wordpress-sparkpost.php

    r2372398 r2373992  
    66Plugin URI: http://sparkpost.com/
    77Description: Send all your email from Wordpress through SparkPost, the world's most advanced email delivery service.
    8 Version: 3.2.2
     8Version: 3.2.3
    99Author: SparkPost
    1010Author URI: http://sparkpost.com
     
    1919define('WPSP_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2020define('WPSP_PLUGIN_PATH', WPSP_PLUGIN_DIR . basename(__FILE__));
    21 define('WPSP_PLUGIN_VERSION', '3.2.2');
     21define('WPSP_PLUGIN_VERSION', '3.2.3');
    2222
    2323require_once(WPSP_PLUGIN_DIR . 'sparkpost.class.php');
Note: See TracChangeset for help on using the changeset viewer.