Plugin Directory

Changeset 2999526


Ignore:
Timestamp:
11/21/2023 11:31:41 AM (2 years ago)
Author:
woosms
Message:

3.0.3

Location:
woosms-sms-module-for-woocommerce/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • woosms-sms-module-for-woocommerce/trunk/readme.txt

    r2995942 r2999526  
    33Requires at least: 5.7
    44Tested up to: 6.4
    5 Stable tag: 3.0.0
     5Stable tag: 3.0.3
    66Requires PHP: 7.4
    77License: GPLv3
     
    160160
    161161== Changelog ==
     162
     163= 3.0.3 =
     164* Broken Access Control vulnerability fix
     165* OptIn Checkbox set default to off
     166* Order message mutation fix values
    162167
    163168= 3.0.2 =
  • woosms-sms-module-for-woocommerce/trunk/src/Event/Helpers.php

    r2995624 r2999526  
    99
    1010use BulkGate\{Plugin\DI\MissingServiceException, Plugin\Event\Dispatcher, Plugin\Strict, WooSms\DI\Factory};
    11 use function apply_filters, has_filter, str_replace;
     11use function apply_filters, has_filter, str_replace, current_user_can, wp_die, wp_verify_nonce;
    1212
    1313class Helpers
    1414{
    1515    use Strict;
     16
     17    public const CrossSiteRequestForgerySecurityParameter = 'security';
    1618
    1719    public static function dispatch(string $name, callable $callback): callable
     
    4951        return $statuses["wc-$status"] ?? $status;
    5052    }
     53
     54
     55    public static function checkAccess(?string $nonce): bool
     56    {
     57        if (!current_user_can('manage_options') || wp_verify_nonce($nonce ?? '') === false)
     58        {
     59            wp_die('', 403);
     60        }
     61
     62        return true;
     63    }
    5164}
  • woosms-sms-module-for-woocommerce/trunk/src/Event/OrderForm.php

    r2995624 r2999526  
    1515    use Strict;
    1616
    17     public const DefaultEnabled = true;
     17    public const DefaultEnabled = false;
    1818
    1919    private const Consent = [
  • woosms-sms-module-for-woocommerce/trunk/src/Template/Basic.php

    r2995624 r2999526  
    99
    1010use function time, date, admin_url, is_ssl, wp_print_inline_script_tag, wp_print_script_tag;
    11 use BulkGate\{Plugin\Event\Dispatcher, Plugin\IO\Url, Plugin\Settings\Settings, Plugin\Settings\Synchronizer, Plugin\Strict, Plugin\DI\Container, Plugin\User\Sign, WooSms\Utils\Escape, WooSms\Event\OrderForm, WooSms\Utils\Logo};
     11use BulkGate\{Plugin\Event\Dispatcher, Plugin\IO\Url, Plugin\Settings\Settings, Plugin\Settings\Synchronizer, Plugin\Strict, Plugin\DI\Container, Plugin\User\Sign, WooSms\Event\Helpers, WooSms\Utils\Escape, WooSms\Event\OrderForm, WooSms\Utils\Logo};
    1212
    1313class Basic
     
    2222
    2323        $ajax_url = admin_url('/admin-ajax.php', is_ssl() ? 'https' : 'http');
     24        $csfr_token = wp_create_nonce();
    2425
    2526        $proxy = [
    2627            'PROXY_LOG_IN' => [
    2728                'url' => $ajax_url,
    28                 'params' => ['action' => 'login']
     29                'params' => ['action' => 'login', Helpers::CrossSiteRequestForgerySecurityParameter => $csfr_token]
    2930            ],
    3031            'PROXY_LOG_OUT' => [
    3132                'url' => $ajax_url,
    32                 'params' => ['action' => 'logout_module']
     33                'params' => ['action' => 'logout_module', Helpers::CrossSiteRequestForgerySecurityParameter => $csfr_token]
    3334            ],
    3435            'PROXY_SAVE_MODULE_SETTINGS' => [
    3536                'url' => $ajax_url,
    36                 'params' => ['action' => 'save_module_settings']
     37                'params' => ['action' => 'save_module_settings', Helpers::CrossSiteRequestForgerySecurityParameter => $csfr_token]
    3738            ]
    3839        ];
     
    7879                                'Content-Type': "application/x-www-form-urlencoded"
    7980                            },
    80                             body: "action=authenticate",
     81                            body: {$escape_js('action=authenticate&' . Helpers::CrossSiteRequestForgerySecurityParameter . "=$csfr_token")},
    8182                        });
    8283                        let {token, redirect} = await response.json();
  • woosms-sms-module-for-woocommerce/trunk/src/Template/Init.php

    r2995756 r2999526  
    88 */
    99
    10 use BulkGate\{Plugin\Debug\Logger, Plugin\Debug\Requirements, Plugin\Eshop, Plugin\Settings\Settings, Plugin\Strict, Plugin\User\Sign, Plugin\Utils\JsonResponse, WooSms\Ajax\Authenticate, WooSms\Ajax\PluginSettingsChange, WooSms\Debug\Page, WooSms\DI\Factory, WooSms\Utils\Logo, WooSms\Utils\Meta};
     10use BulkGate\Plugin\{Debug\Logger, Debug\Requirements, Eshop, Settings\Settings, Strict, User\Sign, Utils\JsonResponse};
     11use BulkGate\WooSms\{Ajax\Authenticate, Ajax\PluginSettingsChange, Debug\Page, DI\Factory, Event\Helpers, Utils\Logo, Utils\Meta};
    1112use function method_exists, in_array;
    1213
     
    4748        });
    4849
    49         add_action('wp_ajax_authenticate', fn () => Factory::get()->getByClass(Authenticate::class)->run(admin_url('admin.php?page=bulkgate#/sign/in')));
     50        add_action('wp_ajax_authenticate', function (): void
     51        {
     52            Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && Factory::get()->getByClass(Authenticate::class)->run(admin_url('admin.php?page=bulkgate#/sign/in'));
     53        });
    5054
    51         add_action('wp_ajax_login', fn () => JsonResponse::send(Factory::get()->getByClass(Sign::class)->in(
    52             sanitize_text_field((string) ($_POST['__bulkgate']['email'] ?? '')),
    53             sanitize_text_field((string) ($_POST['__bulkgate']['password'] ?? '')),
    54             admin_url('admin.php?page=bulkgate#/dashboard')
    55         )));
     55        add_action('wp_ajax_login', function (): void
     56        {
     57            Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && JsonResponse::send(Factory::get()->getByClass(Sign::class)->in(
     58                sanitize_text_field((string)($_POST['__bulkgate']['email'] ?? '')),
     59                sanitize_text_field((string)($_POST['__bulkgate']['password'] ?? '')),
     60                admin_url('admin.php?page=bulkgate#/dashboard')
     61            ));
     62        });
    5663
    57         add_action('wp_ajax_logout_module', fn () => JsonResponse::send(Factory::get()->getByClass(Sign::class)->out(admin_url('admin.php?page=bulkgate#/sign/in'))));
    58         add_action('wp_ajax_save_module_settings', fn () => JsonResponse::send(Factory::get()->getByClass(PluginSettingsChange::class)->run($_POST['__bulkgate'] ?? [])));
     64        add_action('wp_ajax_logout_module', function (): void
     65        {
     66            Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && JsonResponse::send(Factory::get()->getByClass(Sign::class)->out(admin_url('admin.php?page=bulkgate#/sign/in')));
     67        });
     68        add_action('wp_ajax_save_module_settings', function (): void
     69        {
     70            Helpers::checkAccess($_POST[Helpers::CrossSiteRequestForgerySecurityParameter] ?? null) && JsonResponse::send(Factory::get()->getByClass(PluginSettingsChange::class)->run($_POST['__bulkgate'] ?? []));
     71        });
    5972    }
    6073}
  • woosms-sms-module-for-woocommerce/trunk/vendor/bulkgate/plugin/src/Event/Dispatcher.php

    r2995624 r2999526  
    7272        {
    7373            $language = $variables['lang_id'] ?? 'en';
    74             $store_id = $variables['store_id'] ?? 0;
     74            $shop_id = $variables['shop_id'] ?? 0;
    7575            $category = str_replace('-', '_', $category);
    7676
     
    8080            }
    8181
    82             foreach (["admin_sms-default-$store_id", "customer_sms-$language-$store_id"] as $scope)
     82            foreach (["admin_sms-default-$shop_id", "customer_sms-$language-$shop_id"] as $scope)
    8383            {
    8484                if ($category === 'order' && $endpoint === 'status_change' && isset($variables['order_status_id']))
  • woosms-sms-module-for-woocommerce/trunk/vendor/bulkgate/plugin/src/Event/Hook.php

    r2995624 r2999526  
    4141        $endpoint = str_replace('_', '-', $endpoint);
    4242
    43         $this->send("api/$this->version/eshop/$category/$endpoint", ['variables' => $variables]);
     43        $this->send("api/$this->version/eshop/$category/$endpoint", ['language' => $variables['lang_id'] ?? null, 'shop_id' => $variables['shop_id'] ?? null, 'variables' => $variables]);
    4444    }
    4545
  • woosms-sms-module-for-woocommerce/trunk/vendor/composer/installed.json

    r2995624 r2999526  
    33        {
    44            "name": "bulkgate/plugin",
    5             "version": "1.0.0-RC6",
    6             "version_normalized": "1.0.0.0-RC6",
     5            "version": "1.0.0",
     6            "version_normalized": "1.0.0.0",
    77            "source": {
    88                "type": "git",
    99                "url": "https://github.com/BulkGate/plugin.git",
    10                 "reference": "9484b1cecd9351d76ceb81b57b41cd809d46b5d8"
     10                "reference": "c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28"
    1111            },
    1212            "dist": {
    1313                "type": "zip",
    14                 "url": "https://api.github.com/repos/BulkGate/plugin/zipball/9484b1cecd9351d76ceb81b57b41cd809d46b5d8",
    15                 "reference": "9484b1cecd9351d76ceb81b57b41cd809d46b5d8",
     14                "url": "https://api.github.com/repos/BulkGate/plugin/zipball/c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28",
     15                "reference": "c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28",
    1616                "shasum": ""
    1717            },
     
    3030                "tracy/tracy": "^2.9"
    3131            },
    32             "time": "2023-11-13T15:14:11+00:00",
     32            "time": "2023-11-21T11:11:11+00:00",
    3333            "type": "library",
    3434            "installation-source": "dist",
     
    4848            "support": {
    4949                "issues": "https://github.com/BulkGate/plugin/issues",
    50                 "source": "https://github.com/BulkGate/plugin/tree/1.0.0-RC6"
     50                "source": "https://github.com/BulkGate/plugin/tree/1.0.0"
    5151            },
    5252            "install-path": "../bulkgate/plugin"
  • woosms-sms-module-for-woocommerce/trunk/vendor/composer/installed.php

    r2995624 r2999526  
    22    'root' => array(
    33        'name' => 'bulkgate/woosms',
    4         'pretty_version' => '3.0.0',
    5         'version' => '3.0.0.0',
    6         'reference' => '7f9900c9851243cf01e4ea2ec6dd982653f88795',
     4        'pretty_version' => '3.0.3',
     5        'version' => '3.0.3.0',
     6        'reference' => '0371d4f0ca9106920cf5d811833d6326370fb582',
    77        'type' => 'project',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'bulkgate/plugin' => array(
    14             'pretty_version' => '1.0.0-RC6',
    15             'version' => '1.0.0.0-RC6',
    16             'reference' => '9484b1cecd9351d76ceb81b57b41cd809d46b5d8',
     14            'pretty_version' => '1.0.0',
     15            'version' => '1.0.0.0',
     16            'reference' => 'c051c684f9fb1f1c312ec5fb3aaa35f3483e8c28',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../bulkgate/plugin',
     
    2121        ),
    2222        'bulkgate/woosms' => array(
    23             'pretty_version' => '3.0.0',
    24             'version' => '3.0.0.0',
    25             'reference' => '7f9900c9851243cf01e4ea2ec6dd982653f88795',
     23            'pretty_version' => '3.0.3',
     24            'version' => '3.0.3.0',
     25            'reference' => '0371d4f0ca9106920cf5d811833d6326370fb582',
    2626            'type' => 'project',
    2727            'install_path' => __DIR__ . '/../../',
  • woosms-sms-module-for-woocommerce/trunk/woosms-sms-module-for-woocommerce.php

    r2995942 r2999526  
    55 * Plugin URI: https://www.bulkgate.com/en/integrations/sms-plugin-for-woocommerce/
    66 * Description: Notify your customers about order status via SMS notifications.
    7  * Version: 3.0.2
     7 * Version: 3.0.3
    88 * Author: BulkGate
    99 * Author URI: https://www.bulkgate.com/
Note: See TracChangeset for help on using the changeset viewer.