Plugin Directory

Changeset 2708027


Ignore:
Timestamp:
04/11/2022 12:18:58 PM (4 years ago)
Author:
smsapi
Message:

version 2.0.2

Location:
newsletter-sms-smsapi
Files:
56 edited
1 copied

Legend:

Unmodified
Added
Removed
  • newsletter-sms-smsapi/tags/2.0.2/classes/SmsapiPsrClient.php

    r2513083 r2708027  
    66use Psr\Http\Message\ResponseInterface;
    77
     8require_once SMSAPI_PLUGIN_PATH . '/classes/RequestFailedException.php';
     9
    810class SmsapiPsrClient implements ClientInterface
    911{
    10 
    1112    public function sendRequest(RequestInterface $request): ResponseInterface
    1213    {
     
    9394        }
    9495
     96        $this->checkErrors($response);
     97
    9598        $responseCode = wp_remote_retrieve_response_code($response);
    9699        $responseHeaders = wp_remote_retrieve_headers($response);
     
    99102        return new Response($responseCode, $responseHeaders->getAll(), $responseBody);
    100103    }
     104
     105    private function checkErrors($response)
     106    {
     107        if (is_wp_error($response)) {
     108            /**
     109             * @var WP_Error $response
     110             */
     111            throw new RequestFailedException($response->get_error_message());
     112        }
     113    }
    101114}
  • newsletter-sms-smsapi/tags/2.0.2/classes/SmsapiUtils.php

    r2512085 r2708027  
    22
    33use Smsapi\Client\Feature\Contacts\Data\Contact;
     4use Smsapi\Client\Service\SmsapiComService;
    45use Smsapi\Client\SmsapiHttpClient;
    56
     
    4546    }
    4647
    47     private static function getService($token)
     48    private static function getService($token): SmsapiComService
    4849    {
    4950        $client = new SmsapiHttpClient(
  • newsletter-sms-smsapi/tags/2.0.2/readme.txt

    r2619465 r2708027  
    44Requires at least: 4.2.3
    55Tested up to: 5.8.1
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    5454== Changelog ==
    5555
     56= 2.0.2 =
     57* Add request error handling
     58* Update vendor smsapi-php-client library
     59
    5660= 2.0.1 =
    5761* Fix security issues
  • newsletter-sms-smsapi/tags/2.0.2/smsapi.php

    r2619465 r2708027  
    33 * Plugin Name: Newsletter SMS - SMSAPI
    44 * Description: Plugin which allows you to create Newsletter which will collect clients phone numbers and allow you to send SMS messages to them. Database is synchronized with SMSAPI account so messages can be sent from SMSAPI panel as well.
    5  * Version: 2.0.1
     5 * Version: 2.0.2
    66 * Author: SMSAPI
    77 * Author URI: http://smsapi.com/
  • newsletter-sms-smsapi/tags/2.0.2/vendor/composer/ClassLoader.php

    r2512085 r2708027  
    6161    {
    6262        if (!empty($this->prefixesPsr0)) {
    63             return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
     63            return call_user_func_array('array_merge', $this->prefixesPsr0);
    6464        }
    6565
  • newsletter-sms-smsapi/tags/2.0.2/vendor/composer/LICENSE

    r2512085 r2708027  
    1 
    21Copyright (c) Nils Adermann, Jordi Boggiano
    32
     
    1918OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    2019THE SOFTWARE.
    21 
  • newsletter-sms-smsapi/tags/2.0.2/vendor/composer/installed.json

    r2512085 r2708027  
    323323    {
    324324        "name": "smsapi/php-client",
    325         "version": "v3.0.2",
    326         "version_normalized": "3.0.2.0",
     325        "version": "v3.0.6",
     326        "version_normalized": "3.0.6.0",
    327327        "source": {
    328328            "type": "git",
    329329            "url": "https://github.com/smsapi/smsapi-php-client.git",
    330             "reference": "dd5955b4cc497bc6b4f3315b82fb96d766233602"
    331         },
    332         "dist": {
    333             "type": "zip",
    334             "url": "https://api.github.com/repos/smsapi/smsapi-php-client/zipball/dd5955b4cc497bc6b4f3315b82fb96d766233602",
    335             "reference": "dd5955b4cc497bc6b4f3315b82fb96d766233602",
     330            "reference": "499af0b02cb8e07aa4774d85cc295a66141b69a4"
     331        },
     332        "dist": {
     333            "type": "zip",
     334            "url": "https://api.github.com/repos/smsapi/smsapi-php-client/zipball/499af0b02cb8e07aa4774d85cc295a66141b69a4",
     335            "reference": "499af0b02cb8e07aa4774d85cc295a66141b69a4",
    336336            "shasum": ""
    337337        },
     
    342342            "psr/http-factory": "^1",
    343343            "psr/http-message": "^1",
    344             "psr/log": "^1"
     344            "psr/log": "^1 || ^2 || ^3"
    345345        },
    346346        "require-dev": {
     
    358358            "guzzlehttp/psr7": "To use Curl HttpClient and HTTP message factories"
    359359        },
    360         "time": "2021-01-29T12:46:06+00:00",
     360        "time": "2022-03-28T09:58:20+00:00",
    361361        "type": "library",
    362362        "installation-source": "dist",
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/.gitignore

    r2512085 r2708027  
    44/phpunit.xml
    55/composer.phar
     6.phpunit.result.cache
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/CHANGELOG.md

    r2512085 r2708027  
    33
    44The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
     5
     6## [3.0.6] - 2022-03-28
     7### Fixed
     8- HTTP headers parsing, PSR-7 compliant
     9
     10## [3.0.5] - 2022-03-23
     11### Fixed
     12- HTTP headers parsing, `HttpClient` issue
     13
     14## [3.0.4] - 2022-01-17
     15### Added
     16- `psr/log` v2, v3 support
     17
     18## [3.0.3] - 2021-07-21
     19### Fixed
     20- Guzzle PSR7 incompatible URI paths, `The path of a URI with an authority must start with a slash "/" or be empty`
    521
    622## [3.0.2] - 2021-01-29
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/Makefile

    r2512085 r2708027  
    22
    33help:
    4     @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
     4    @grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
     5    | sort \
     6    | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
     7
     8
     9include Makefile.php8
     10
    511
    612.DEFAULT_GOAL := help
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/README.md

    r2512085 r2708027  
    119119```
    120120
    121 ## How to use a service with custom URI?
     121### How to use *SMSAPI.SE* or *SMSAPI.BG* services?
    122122
    123123```php
     
    136136
    137137$apiToken = '0000000000000000000000000000000000000000';
    138 $uri = 'http://example.com';
     138$uri = 'https://smsapi.io/';
    139139
    140140$service = $client->smsapiComServiceWithUri($apiToken, $uri);
     
    269269```
    270270
    271 ## Test package
    272 1. Download package: `composer create-project smsapi/php-client`
    273 2. Execute tests: `./vendor/bin/phpunit --configuration phpunit.dist.xml`
     271## How to test package
     272
     273Copy `phpunit.dist.xml` to `phpunit.xml`. You may adjust it to your needs then.
     274
     275Copy `tests-resources/config/config.dist.yml` to `tests-resources/config/config.yml`. Fill in SMSAPI service connection data.
     276
     277### How to run unit tests
     278
     279Unit tests are included into package build process and run against its current version on every commit (see `.travis.yml`).
     280You can run those tests locally with ease using provided Docker configuration, simply run:
     281
     282```shell
     283make test-suite SUITE="unit"
     284```
     285
     286### How to run integration tests
     287
     288Note that integration test works within an account you have configured in `tests-resources/config/config.yml`.
     289Although those test have been written to self-cleanup on exit, in case of failure some trash data may stay.
     290Use it with caution.
     291
     292```shell
     293make test-suite SUITE="integration"
     294```
     295
     296### How to run feature tests
     297
     298Feature test groups are defined in `phpunit.dist.xml`. To run tests execute:
     299
     300```shell
     301make test-suite SUITE="feature-contacts"
     302```
     303
     304### How to run tests against PHP8
     305
     306To run any of mentioned above against PHP8 use make targets with `php8` suffix. See `Makefile.php8`.
    274307
    275308## Docs & Infos
    276309* [SMSAPI.COM API documentation](https://www.smsapi.com/docs)
    277310* [SMSAPI.PL API documentation](https://www.smsapi.pl/docs)
     311* [SMSAPI.SE API documentation](https://www.smsapi.se/docs)
     312* [SMSAPI.BG API documentation](https://www.smsapi.bg/docs)
     313* [SMSAPI.COM web page](https://smsapi.com)
     314* [SMSAPI.PL web page](https://smsapi.pl)
     315* [SMSAPI.SE web page](https://smsapi.se)
     316* [SMSAPI.BG web page](https://smsapi.bg)
    278317* [Repository on GitHub](https://github.com/smsapi/smsapi-php-client)
    279318* [Package on Packagist](https://packagist.org/packages/smsapi/php-client)
    280 * [SMSAPI.COM web page](https://smsapi.com)
    281 * [SMSAPI.PL web page](https://smsapi.pl)
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/composer.json

    r2512085 r2708027  
    1919        "php": "^7 || ^8.0",
    2020        "ext-json": "*",
    21         "psr/log": "^1",
     21        "psr/log": "^1 || ^2 || ^3",
    2222        "psr/http-message": "^1",
    2323        "psr/http-client": "^1",
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/docker-compose.yml

    r2512085 r2708027  
    88    network_mode: host
    99
     10  php8:
     11    build:
     12      context: .
     13      dockerfile: Dockerfile.php8
     14    volumes:
     15      - .:/app
     16    network_mode: host
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/phpunit.dist.xml

    r2512085 r2708027  
    6868        </testsuite>
    6969    </testsuites>
     70
     71    <php>
     72        <ini name="error_reporting" value="E_ALL"/>
     73        <ini name="display_errors" value="1"/>
     74    </php>
     75
    7076</phpunit>
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/src/Curl/HttpClient.php

    r2512085 r2708027  
    8989        $headerSize = curl_getinfo($httpClient, CURLINFO_HEADER_SIZE);
    9090        $headerString = substr($response, 0, $headerSize);
    91         $headers = array_filter(explode("\n", $headerString), 'trim');
     91        $headers = HttpHeadersParser::parse($headerString);
    9292
    9393        $body = substr($response, $headerSize);
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/src/Curl/SmsapiHttpClient.php

    r2512085 r2708027  
    55namespace Smsapi\Client\Curl;
    66
     7use Psr\Log\LoggerAwareTrait;
    78use Psr\Log\LoggerInterface;
    89use Smsapi\Client\Curl\Discovery\CurlDiscovery;
     
    1718class SmsapiHttpClient implements SmsapiClient
    1819{
     20    use LoggerAwareTrait;
     21
    1922    private $httpClient;
    2023
     
    3134    }
    3235
    33     public function setLogger(LoggerInterface $logger)
    34     {
    35         $this->httpClient->setLogger($logger);
    36     }
    37 
    3836    public function smsapiPlService(string $apiToken): SmsapiPlService
    3937    {
    40         return $this->httpClient->smsapiPlService($apiToken);
     38        return $this->httpClient()->smsapiPlService($apiToken);
    4139    }
    4240
    4341    public function smsapiPlServiceWithUri(string $apiToken, string $uri): SmsapiPlService
    4442    {
    45         return $this->httpClient->smsapiPlServiceWithUri($apiToken, $uri);
     43        return $this->httpClient()->smsapiPlServiceWithUri($apiToken, $uri);
    4644    }
    4745
    4846    public function smsapiComService(string $apiToken): SmsapiComService
    4947    {
    50         return $this->httpClient->smsapiComService($apiToken);
     48        return $this->httpClient()->smsapiComService($apiToken);
    5149    }
    5250
    5351    public function smsapiComServiceWithUri(string $apiToken, string $uri): SmsapiComService
    5452    {
    55         return $this->httpClient->smsapiComServiceWithUri($apiToken, $uri);
     53        return $this->httpClient()->smsapiComServiceWithUri($apiToken, $uri);
     54    }
     55
     56    private function httpClient(): \Smsapi\Client\SmsapiHttpClient
     57    {
     58        if ($this->logger instanceof LoggerInterface) {
     59            $this->httpClient->setLogger($this->logger);
     60        }
     61
     62        return $this->httpClient;
    5663    }
    5764}
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/src/Infrastructure/HttpClient/Decorator/BaseUriDecorator.php

    r2512085 r2708027  
    3838        $scheme = $baseUriParts['scheme'] ?? '';
    3939        $host = $baseUriParts['host'] ?? '';
    40         $path = $baseUriParts['path'] ?? '';
     40        $basePath = $baseUriParts['path'] ?? '';
     41        $basePath = rtrim($basePath, '/');
    4142
     43        $uri = $uri->withPath($basePath . '/' . $uri->getPath());
     44        $uri = $uri->withHost($host);
    4245        $uri = $uri->withScheme($scheme);
    43         $uri = $uri->withHost($host);
    44         $uri = $uri->withPath($path . $uri->getPath());
    4546
    4647        return $request->withUri($uri);
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/src/Infrastructure/HttpClient/Decorator/LoggerDecorator.php

    r2512085 r2708027  
    2727    {
    2828        $this->logger->info('Request', [
     29            'request' => $request,
    2930            'method' => $request->getMethod(),
    3031            'uri' => $request->getUri(),
     32            'headers' => $request->getHeaders(),
     33            'body' => $request->getBody()->getContents(),
    3134        ]);
    3235
    3336        $response = $this->client->sendRequest($request);
    3437
    35         $this->logger->info('Response', ['response' => $response]);
     38        $this->logger->info('Response', [
     39            'response' => $response,
     40            'headers' => $response->getHeaders(),
     41            'body' => $response->getBody()->getContents(),
     42        ]);
    3643
    3744        return $response;
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/src/Infrastructure/RequestAssembler/RequestAssembler.php

    r2512085 r2708027  
    3434            $request = $request->withHeader($header, $value);
    3535        }
     36
    3637        $request = $request->withBody($this->streamFactory->createStream($requestDTO->getBody()));
    3738
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/src/SmsapiClient.php

    r2512085 r2708027  
    1313interface SmsapiClient extends LoggerAwareInterface
    1414{
    15     const VERSION = '3.0.2';
     15    const VERSION = '3.0.6';
    1616
    1717    public function smsapiPlService(string $apiToken): SmsapiPlService;
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/tests-resources/config/config.dist.yml

    r2512085 r2708027  
    11Service name: SMSAPI.PL
    22API URI: https://api.smsapi.pl
    3 logger: false
     3API token: 0000000000000000000000000000000000000000
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/tests-resources/config/config.yml.example

    r2512085 r2708027  
    22API token: 40-characters length string generated in SMSAPI Panel
    33API URI: "https://api.smsapi.pl", "https://api.smsapi.com", "https://api2.smsapi.pl" or "https://api2.smsapi.com"
    4 logger: true
  • newsletter-sms-smsapi/tags/2.0.2/vendor/smsapi/php-client/tests/SmsapiClientIntegrationTestCase.php

    r2512085 r2708027  
    3434        $smsapiHttpClient = new SmsapiHttpClient();
    3535
    36         if (Config::get('logger')) {
    37             $smsapiHttpClient->setLogger(new TestLogger());
    38         }
    39 
    4036        $serviceName = Config::get('Service name');
    4137        if ($serviceName === ServiceName::SMSAPI_PL) {
  • newsletter-sms-smsapi/tags/2.0.2/views/admin/gateway/index.php

    r2619465 r2708027  
    2020
    2121                    <?php if (smsapi_array_safe_get($errors, 'sendername')): ?>
    22                         <div class="text-danger"><?php echo smsapi_array_safe_get($errors, 'sendername'); ?></div>
     22                        <div class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'sendername')); ?></div>
    2323                    <?php endif; ?>
    2424                </td>
     
    3535
    3636                    <?php if (smsapi_array_safe_get($errors, 'recipients_type')): ?>
    37                         <div class="text-danger"><?php echo smsapi_array_safe_get($errors, 'recipients_type'); ?></div>
     37                        <div class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'recipients_type')); ?></div>
    3838                    <?php endif; ?>
    3939
     
    5454
    5555                    <?php if (smsapi_array_safe_get($errors, 'message')): ?>
    56                         <div class="text-danger"><?php echo smsapi_array_safe_get($errors, 'message'); ?></div>
     56                        <div class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'message')); ?></div>
    5757                    <?php endif; ?>
    5858                </td>
  • newsletter-sms-smsapi/tags/2.0.2/views/admin/settings/general.php

    r2619465 r2708027  
    4242
    4343                    <?php if (smsapi_array_safe_get($errors, 'phonebook_group')): ?>
    44                         <p class="text-danger"><?php echo smsapi_array_safe_get($errors, 'phonebook_group'); ?></p>
     44                        <p class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'phonebook_group')); ?></p>
    4545                    <?php endif; ?>
    4646
     
    7676
    7777                    <?php if (smsapi_array_safe_get($errors, 'api_sendername')): ?>
    78                         <p class="text-danger"><?php echo smsapi_array_safe_get($errors, 'api_sendername'); ?></p>
     78                        <p class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'api_sendername')); ?></p>
    7979                    <?php endif; ?>
    8080
  • newsletter-sms-smsapi/tags/2.0.2/views/admin/settings/login.php

    r2617806 r2708027  
    99                    <input type="text" class="regular-text" name="api_token" id="api_token" autocomplete="off"
    1010                           maxlength="50"
    11                            value="<?php echo smsapi_array_safe_get($config, 'api_token', ''); ?>"/>
     11                           value="<?php echo esc_attr(smsapi_array_safe_get($config, 'api_token', '')); ?>"/>
    1212
    1313                    <p class="description"><?php _e('Enter token information', 'newsletter-sms-smsapi'); ?></p>
    1414
    1515                    <?php if (smsapi_array_safe_get($errors, 'api_token')): ?>
    16                         <span class="text-danger"><?php echo smsapi_array_safe_get($errors, 'api_token'); ?></span>
     16                        <span class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'api_token')); ?></span>
    1717                    <?php endif; ?>
    1818                </td>
  • newsletter-sms-smsapi/tags/2.0.2/views/admin/settings/notifications.php

    r2617806 r2708027  
    1616
    1717                    <div>
    18                         <textarea name="subscription_notification_content" id="subscription-notification-content"><?php echo smsapi_array_safe_get($config, 'subscription_notification_content', ''); ?></textarea>
     18                        <textarea name="subscription_notification_content" id="subscription-notification-content">
     19                            <?php echo esc_textarea(smsapi_array_safe_get($config, 'subscription_notification_content', '')); ?>
     20                        </textarea>
    1921
    2022                        <p class="description"><?php _e('Message content', 'newsletter-sms-smsapi'); ?></p>
  • newsletter-sms-smsapi/tags/2.0.2/views/admin/subscribers/form.php

    r2619465 r2708027  
    1818                        <input class="smsapi-input" type="text" name="phonenumber" id="smsapi-input-phonenumber"
    1919                               value="<?php echo esc_attr($subscriber->phoneNumber); ?>" />
    20                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'phonenumber'); ?></span>
     20                        <span class="smsapi-input-error">
     21                            <?php echo esc_attr(smsapi_array_safe_get($errors, 'phonenumber')); ?>
     22                        </span>
    2123                    </td>
    2224                </tr>
     
    3133                               value="<?php echo esc_attr($subscriber->firstName); ?>" />
    3234
    33                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'firstname'); ?></span>
     35                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'firstname')); ?></span>
    3436                    </td>
    3537                </tr>
     
    4446                               value="<?php echo esc_attr($subscriber->lastName); ?>" />
    4547
    46                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'lastname'); ?></span>
     48                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'lastname')); ?></span>
    4749                    </td>
    4850                </tr>
     
    5759                               value="<?php echo esc_attr($subscriber->email); ?>" />
    5860
    59                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'email'); ?></span>
     61                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'email')); ?></span>
    6062                    </td>
    6163                </tr>
     
    7072                               value="<?php echo esc_attr($subscriber->city); ?>" />
    7173
    72                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'city'); ?></span>
     74                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'city')); ?></span>
    7375                    </td>
    7476                </tr>
     
    8385                               value="<?php echo !empty($subscriber->birthdayDate) ? date('Y-m-d', strtotime($subscriber->birthdayDate)) : ''; ?>" />
    8486
    85                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'birthdate'); ?></span>
     87                        <span class="smsapi-input-error">
     88                            <?php echo esc_attr(smsapi_array_safe_get($errors, 'birthdate')); ?>
     89                        </span>
    8690
    8791                        <p class="description"><?php _e('Date in year-month-day format, ex: 1971-01-01', 'newsletter-sms-smsapi'); ?></p>
  • newsletter-sms-smsapi/trunk/classes/SmsapiPsrClient.php

    r2513083 r2708027  
    66use Psr\Http\Message\ResponseInterface;
    77
     8require_once SMSAPI_PLUGIN_PATH . '/classes/RequestFailedException.php';
     9
    810class SmsapiPsrClient implements ClientInterface
    911{
    10 
    1112    public function sendRequest(RequestInterface $request): ResponseInterface
    1213    {
     
    9394        }
    9495
     96        $this->checkErrors($response);
     97
    9598        $responseCode = wp_remote_retrieve_response_code($response);
    9699        $responseHeaders = wp_remote_retrieve_headers($response);
     
    99102        return new Response($responseCode, $responseHeaders->getAll(), $responseBody);
    100103    }
     104
     105    private function checkErrors($response)
     106    {
     107        if (is_wp_error($response)) {
     108            /**
     109             * @var WP_Error $response
     110             */
     111            throw new RequestFailedException($response->get_error_message());
     112        }
     113    }
    101114}
  • newsletter-sms-smsapi/trunk/classes/SmsapiUtils.php

    r2512085 r2708027  
    22
    33use Smsapi\Client\Feature\Contacts\Data\Contact;
     4use Smsapi\Client\Service\SmsapiComService;
    45use Smsapi\Client\SmsapiHttpClient;
    56
     
    4546    }
    4647
    47     private static function getService($token)
     48    private static function getService($token): SmsapiComService
    4849    {
    4950        $client = new SmsapiHttpClient(
  • newsletter-sms-smsapi/trunk/readme.txt

    r2619465 r2708027  
    44Requires at least: 4.2.3
    55Tested up to: 5.8.1
    6 Stable tag: 2.0.1
     6Stable tag: 2.0.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    5454== Changelog ==
    5555
     56= 2.0.2 =
     57* Add request error handling
     58* Update vendor smsapi-php-client library
     59
    5660= 2.0.1 =
    5761* Fix security issues
  • newsletter-sms-smsapi/trunk/smsapi.php

    r2619465 r2708027  
    33 * Plugin Name: Newsletter SMS - SMSAPI
    44 * Description: Plugin which allows you to create Newsletter which will collect clients phone numbers and allow you to send SMS messages to them. Database is synchronized with SMSAPI account so messages can be sent from SMSAPI panel as well.
    5  * Version: 2.0.1
     5 * Version: 2.0.2
    66 * Author: SMSAPI
    77 * Author URI: http://smsapi.com/
  • newsletter-sms-smsapi/trunk/vendor/composer/ClassLoader.php

    r2512085 r2708027  
    6161    {
    6262        if (!empty($this->prefixesPsr0)) {
    63             return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
     63            return call_user_func_array('array_merge', $this->prefixesPsr0);
    6464        }
    6565
  • newsletter-sms-smsapi/trunk/vendor/composer/LICENSE

    r2512085 r2708027  
    1 
    21Copyright (c) Nils Adermann, Jordi Boggiano
    32
     
    1918OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    2019THE SOFTWARE.
    21 
  • newsletter-sms-smsapi/trunk/vendor/composer/installed.json

    r2512085 r2708027  
    323323    {
    324324        "name": "smsapi/php-client",
    325         "version": "v3.0.2",
    326         "version_normalized": "3.0.2.0",
     325        "version": "v3.0.6",
     326        "version_normalized": "3.0.6.0",
    327327        "source": {
    328328            "type": "git",
    329329            "url": "https://github.com/smsapi/smsapi-php-client.git",
    330             "reference": "dd5955b4cc497bc6b4f3315b82fb96d766233602"
    331         },
    332         "dist": {
    333             "type": "zip",
    334             "url": "https://api.github.com/repos/smsapi/smsapi-php-client/zipball/dd5955b4cc497bc6b4f3315b82fb96d766233602",
    335             "reference": "dd5955b4cc497bc6b4f3315b82fb96d766233602",
     330            "reference": "499af0b02cb8e07aa4774d85cc295a66141b69a4"
     331        },
     332        "dist": {
     333            "type": "zip",
     334            "url": "https://api.github.com/repos/smsapi/smsapi-php-client/zipball/499af0b02cb8e07aa4774d85cc295a66141b69a4",
     335            "reference": "499af0b02cb8e07aa4774d85cc295a66141b69a4",
    336336            "shasum": ""
    337337        },
     
    342342            "psr/http-factory": "^1",
    343343            "psr/http-message": "^1",
    344             "psr/log": "^1"
     344            "psr/log": "^1 || ^2 || ^3"
    345345        },
    346346        "require-dev": {
     
    358358            "guzzlehttp/psr7": "To use Curl HttpClient and HTTP message factories"
    359359        },
    360         "time": "2021-01-29T12:46:06+00:00",
     360        "time": "2022-03-28T09:58:20+00:00",
    361361        "type": "library",
    362362        "installation-source": "dist",
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/.gitignore

    r2512085 r2708027  
    44/phpunit.xml
    55/composer.phar
     6.phpunit.result.cache
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/CHANGELOG.md

    r2512085 r2708027  
    33
    44The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
     5
     6## [3.0.6] - 2022-03-28
     7### Fixed
     8- HTTP headers parsing, PSR-7 compliant
     9
     10## [3.0.5] - 2022-03-23
     11### Fixed
     12- HTTP headers parsing, `HttpClient` issue
     13
     14## [3.0.4] - 2022-01-17
     15### Added
     16- `psr/log` v2, v3 support
     17
     18## [3.0.3] - 2021-07-21
     19### Fixed
     20- Guzzle PSR7 incompatible URI paths, `The path of a URI with an authority must start with a slash "/" or be empty`
    521
    622## [3.0.2] - 2021-01-29
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/Makefile

    r2512085 r2708027  
    22
    33help:
    4     @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
     4    @grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
     5    | sort \
     6    | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
     7
     8
     9include Makefile.php8
     10
    511
    612.DEFAULT_GOAL := help
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/README.md

    r2512085 r2708027  
    119119```
    120120
    121 ## How to use a service with custom URI?
     121### How to use *SMSAPI.SE* or *SMSAPI.BG* services?
    122122
    123123```php
     
    136136
    137137$apiToken = '0000000000000000000000000000000000000000';
    138 $uri = 'http://example.com';
     138$uri = 'https://smsapi.io/';
    139139
    140140$service = $client->smsapiComServiceWithUri($apiToken, $uri);
     
    269269```
    270270
    271 ## Test package
    272 1. Download package: `composer create-project smsapi/php-client`
    273 2. Execute tests: `./vendor/bin/phpunit --configuration phpunit.dist.xml`
     271## How to test package
     272
     273Copy `phpunit.dist.xml` to `phpunit.xml`. You may adjust it to your needs then.
     274
     275Copy `tests-resources/config/config.dist.yml` to `tests-resources/config/config.yml`. Fill in SMSAPI service connection data.
     276
     277### How to run unit tests
     278
     279Unit tests are included into package build process and run against its current version on every commit (see `.travis.yml`).
     280You can run those tests locally with ease using provided Docker configuration, simply run:
     281
     282```shell
     283make test-suite SUITE="unit"
     284```
     285
     286### How to run integration tests
     287
     288Note that integration test works within an account you have configured in `tests-resources/config/config.yml`.
     289Although those test have been written to self-cleanup on exit, in case of failure some trash data may stay.
     290Use it with caution.
     291
     292```shell
     293make test-suite SUITE="integration"
     294```
     295
     296### How to run feature tests
     297
     298Feature test groups are defined in `phpunit.dist.xml`. To run tests execute:
     299
     300```shell
     301make test-suite SUITE="feature-contacts"
     302```
     303
     304### How to run tests against PHP8
     305
     306To run any of mentioned above against PHP8 use make targets with `php8` suffix. See `Makefile.php8`.
    274307
    275308## Docs & Infos
    276309* [SMSAPI.COM API documentation](https://www.smsapi.com/docs)
    277310* [SMSAPI.PL API documentation](https://www.smsapi.pl/docs)
     311* [SMSAPI.SE API documentation](https://www.smsapi.se/docs)
     312* [SMSAPI.BG API documentation](https://www.smsapi.bg/docs)
     313* [SMSAPI.COM web page](https://smsapi.com)
     314* [SMSAPI.PL web page](https://smsapi.pl)
     315* [SMSAPI.SE web page](https://smsapi.se)
     316* [SMSAPI.BG web page](https://smsapi.bg)
    278317* [Repository on GitHub](https://github.com/smsapi/smsapi-php-client)
    279318* [Package on Packagist](https://packagist.org/packages/smsapi/php-client)
    280 * [SMSAPI.COM web page](https://smsapi.com)
    281 * [SMSAPI.PL web page](https://smsapi.pl)
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/composer.json

    r2512085 r2708027  
    1919        "php": "^7 || ^8.0",
    2020        "ext-json": "*",
    21         "psr/log": "^1",
     21        "psr/log": "^1 || ^2 || ^3",
    2222        "psr/http-message": "^1",
    2323        "psr/http-client": "^1",
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/docker-compose.yml

    r2512085 r2708027  
    88    network_mode: host
    99
     10  php8:
     11    build:
     12      context: .
     13      dockerfile: Dockerfile.php8
     14    volumes:
     15      - .:/app
     16    network_mode: host
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/phpunit.dist.xml

    r2512085 r2708027  
    6868        </testsuite>
    6969    </testsuites>
     70
     71    <php>
     72        <ini name="error_reporting" value="E_ALL"/>
     73        <ini name="display_errors" value="1"/>
     74    </php>
     75
    7076</phpunit>
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/src/Curl/HttpClient.php

    r2512085 r2708027  
    8989        $headerSize = curl_getinfo($httpClient, CURLINFO_HEADER_SIZE);
    9090        $headerString = substr($response, 0, $headerSize);
    91         $headers = array_filter(explode("\n", $headerString), 'trim');
     91        $headers = HttpHeadersParser::parse($headerString);
    9292
    9393        $body = substr($response, $headerSize);
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/src/Curl/SmsapiHttpClient.php

    r2512085 r2708027  
    55namespace Smsapi\Client\Curl;
    66
     7use Psr\Log\LoggerAwareTrait;
    78use Psr\Log\LoggerInterface;
    89use Smsapi\Client\Curl\Discovery\CurlDiscovery;
     
    1718class SmsapiHttpClient implements SmsapiClient
    1819{
     20    use LoggerAwareTrait;
     21
    1922    private $httpClient;
    2023
     
    3134    }
    3235
    33     public function setLogger(LoggerInterface $logger)
    34     {
    35         $this->httpClient->setLogger($logger);
    36     }
    37 
    3836    public function smsapiPlService(string $apiToken): SmsapiPlService
    3937    {
    40         return $this->httpClient->smsapiPlService($apiToken);
     38        return $this->httpClient()->smsapiPlService($apiToken);
    4139    }
    4240
    4341    public function smsapiPlServiceWithUri(string $apiToken, string $uri): SmsapiPlService
    4442    {
    45         return $this->httpClient->smsapiPlServiceWithUri($apiToken, $uri);
     43        return $this->httpClient()->smsapiPlServiceWithUri($apiToken, $uri);
    4644    }
    4745
    4846    public function smsapiComService(string $apiToken): SmsapiComService
    4947    {
    50         return $this->httpClient->smsapiComService($apiToken);
     48        return $this->httpClient()->smsapiComService($apiToken);
    5149    }
    5250
    5351    public function smsapiComServiceWithUri(string $apiToken, string $uri): SmsapiComService
    5452    {
    55         return $this->httpClient->smsapiComServiceWithUri($apiToken, $uri);
     53        return $this->httpClient()->smsapiComServiceWithUri($apiToken, $uri);
     54    }
     55
     56    private function httpClient(): \Smsapi\Client\SmsapiHttpClient
     57    {
     58        if ($this->logger instanceof LoggerInterface) {
     59            $this->httpClient->setLogger($this->logger);
     60        }
     61
     62        return $this->httpClient;
    5663    }
    5764}
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/src/Infrastructure/HttpClient/Decorator/BaseUriDecorator.php

    r2512085 r2708027  
    3838        $scheme = $baseUriParts['scheme'] ?? '';
    3939        $host = $baseUriParts['host'] ?? '';
    40         $path = $baseUriParts['path'] ?? '';
     40        $basePath = $baseUriParts['path'] ?? '';
     41        $basePath = rtrim($basePath, '/');
    4142
     43        $uri = $uri->withPath($basePath . '/' . $uri->getPath());
     44        $uri = $uri->withHost($host);
    4245        $uri = $uri->withScheme($scheme);
    43         $uri = $uri->withHost($host);
    44         $uri = $uri->withPath($path . $uri->getPath());
    4546
    4647        return $request->withUri($uri);
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/src/Infrastructure/HttpClient/Decorator/LoggerDecorator.php

    r2512085 r2708027  
    2727    {
    2828        $this->logger->info('Request', [
     29            'request' => $request,
    2930            'method' => $request->getMethod(),
    3031            'uri' => $request->getUri(),
     32            'headers' => $request->getHeaders(),
     33            'body' => $request->getBody()->getContents(),
    3134        ]);
    3235
    3336        $response = $this->client->sendRequest($request);
    3437
    35         $this->logger->info('Response', ['response' => $response]);
     38        $this->logger->info('Response', [
     39            'response' => $response,
     40            'headers' => $response->getHeaders(),
     41            'body' => $response->getBody()->getContents(),
     42        ]);
    3643
    3744        return $response;
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/src/Infrastructure/RequestAssembler/RequestAssembler.php

    r2512085 r2708027  
    3434            $request = $request->withHeader($header, $value);
    3535        }
     36
    3637        $request = $request->withBody($this->streamFactory->createStream($requestDTO->getBody()));
    3738
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/src/SmsapiClient.php

    r2512085 r2708027  
    1313interface SmsapiClient extends LoggerAwareInterface
    1414{
    15     const VERSION = '3.0.2';
     15    const VERSION = '3.0.6';
    1616
    1717    public function smsapiPlService(string $apiToken): SmsapiPlService;
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/tests-resources/config/config.dist.yml

    r2512085 r2708027  
    11Service name: SMSAPI.PL
    22API URI: https://api.smsapi.pl
    3 logger: false
     3API token: 0000000000000000000000000000000000000000
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/tests-resources/config/config.yml.example

    r2512085 r2708027  
    22API token: 40-characters length string generated in SMSAPI Panel
    33API URI: "https://api.smsapi.pl", "https://api.smsapi.com", "https://api2.smsapi.pl" or "https://api2.smsapi.com"
    4 logger: true
  • newsletter-sms-smsapi/trunk/vendor/smsapi/php-client/tests/SmsapiClientIntegrationTestCase.php

    r2512085 r2708027  
    3434        $smsapiHttpClient = new SmsapiHttpClient();
    3535
    36         if (Config::get('logger')) {
    37             $smsapiHttpClient->setLogger(new TestLogger());
    38         }
    39 
    4036        $serviceName = Config::get('Service name');
    4137        if ($serviceName === ServiceName::SMSAPI_PL) {
  • newsletter-sms-smsapi/trunk/views/admin/gateway/index.php

    r2619465 r2708027  
    2020
    2121                    <?php if (smsapi_array_safe_get($errors, 'sendername')): ?>
    22                         <div class="text-danger"><?php echo smsapi_array_safe_get($errors, 'sendername'); ?></div>
     22                        <div class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'sendername')); ?></div>
    2323                    <?php endif; ?>
    2424                </td>
     
    3535
    3636                    <?php if (smsapi_array_safe_get($errors, 'recipients_type')): ?>
    37                         <div class="text-danger"><?php echo smsapi_array_safe_get($errors, 'recipients_type'); ?></div>
     37                        <div class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'recipients_type')); ?></div>
    3838                    <?php endif; ?>
    3939
     
    5454
    5555                    <?php if (smsapi_array_safe_get($errors, 'message')): ?>
    56                         <div class="text-danger"><?php echo smsapi_array_safe_get($errors, 'message'); ?></div>
     56                        <div class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'message')); ?></div>
    5757                    <?php endif; ?>
    5858                </td>
  • newsletter-sms-smsapi/trunk/views/admin/settings/general.php

    r2619465 r2708027  
    4242
    4343                    <?php if (smsapi_array_safe_get($errors, 'phonebook_group')): ?>
    44                         <p class="text-danger"><?php echo smsapi_array_safe_get($errors, 'phonebook_group'); ?></p>
     44                        <p class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'phonebook_group')); ?></p>
    4545                    <?php endif; ?>
    4646
     
    7676
    7777                    <?php if (smsapi_array_safe_get($errors, 'api_sendername')): ?>
    78                         <p class="text-danger"><?php echo smsapi_array_safe_get($errors, 'api_sendername'); ?></p>
     78                        <p class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'api_sendername')); ?></p>
    7979                    <?php endif; ?>
    8080
  • newsletter-sms-smsapi/trunk/views/admin/settings/login.php

    r2617806 r2708027  
    99                    <input type="text" class="regular-text" name="api_token" id="api_token" autocomplete="off"
    1010                           maxlength="50"
    11                            value="<?php echo smsapi_array_safe_get($config, 'api_token', ''); ?>"/>
     11                           value="<?php echo esc_attr(smsapi_array_safe_get($config, 'api_token', '')); ?>"/>
    1212
    1313                    <p class="description"><?php _e('Enter token information', 'newsletter-sms-smsapi'); ?></p>
    1414
    1515                    <?php if (smsapi_array_safe_get($errors, 'api_token')): ?>
    16                         <span class="text-danger"><?php echo smsapi_array_safe_get($errors, 'api_token'); ?></span>
     16                        <span class="text-danger"><?php echo esc_attr(smsapi_array_safe_get($errors, 'api_token')); ?></span>
    1717                    <?php endif; ?>
    1818                </td>
  • newsletter-sms-smsapi/trunk/views/admin/settings/notifications.php

    r2617806 r2708027  
    1616
    1717                    <div>
    18                         <textarea name="subscription_notification_content" id="subscription-notification-content"><?php echo smsapi_array_safe_get($config, 'subscription_notification_content', ''); ?></textarea>
     18                        <textarea name="subscription_notification_content" id="subscription-notification-content">
     19                            <?php echo esc_textarea(smsapi_array_safe_get($config, 'subscription_notification_content', '')); ?>
     20                        </textarea>
    1921
    2022                        <p class="description"><?php _e('Message content', 'newsletter-sms-smsapi'); ?></p>
  • newsletter-sms-smsapi/trunk/views/admin/subscribers/form.php

    r2619465 r2708027  
    1818                        <input class="smsapi-input" type="text" name="phonenumber" id="smsapi-input-phonenumber"
    1919                               value="<?php echo esc_attr($subscriber->phoneNumber); ?>" />
    20                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'phonenumber'); ?></span>
     20                        <span class="smsapi-input-error">
     21                            <?php echo esc_attr(smsapi_array_safe_get($errors, 'phonenumber')); ?>
     22                        </span>
    2123                    </td>
    2224                </tr>
     
    3133                               value="<?php echo esc_attr($subscriber->firstName); ?>" />
    3234
    33                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'firstname'); ?></span>
     35                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'firstname')); ?></span>
    3436                    </td>
    3537                </tr>
     
    4446                               value="<?php echo esc_attr($subscriber->lastName); ?>" />
    4547
    46                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'lastname'); ?></span>
     48                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'lastname')); ?></span>
    4749                    </td>
    4850                </tr>
     
    5759                               value="<?php echo esc_attr($subscriber->email); ?>" />
    5860
    59                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'email'); ?></span>
     61                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'email')); ?></span>
    6062                    </td>
    6163                </tr>
     
    7072                               value="<?php echo esc_attr($subscriber->city); ?>" />
    7173
    72                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'city'); ?></span>
     74                        <span class="smsapi-input-error"><?php echo esc_attr(smsapi_array_safe_get($errors, 'city')); ?></span>
    7375                    </td>
    7476                </tr>
     
    8385                               value="<?php echo !empty($subscriber->birthdayDate) ? date('Y-m-d', strtotime($subscriber->birthdayDate)) : ''; ?>" />
    8486
    85                         <span class="smsapi-input-error"><?php echo smsapi_array_safe_get($errors, 'birthdate'); ?></span>
     87                        <span class="smsapi-input-error">
     88                            <?php echo esc_attr(smsapi_array_safe_get($errors, 'birthdate')); ?>
     89                        </span>
    8690
    8791                        <p class="description"><?php _e('Date in year-month-day format, ex: 1971-01-01', 'newsletter-sms-smsapi'); ?></p>
Note: See TracChangeset for help on using the changeset viewer.