Plugin Directory

Changeset 2962817


Ignore:
Timestamp:
09/05/2023 07:06:03 AM (2 years ago)
Author:
omise
Message:

Update to version 5.3.1 from GitHub

Location:
omise
Files:
2 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • omise/tags/5.3.1/CHANGELOG.md

    r2957621 r2962817  
    11# CHANGELOG
     2
     3### [v5.3.1 _(Sep 05, 2023)_](https://github.com/omise/omise-woocommerce/releases/tag/v5.3.1)
     4- Fixed capabilities api calling on every pages. (PR [#398](https://github.com/omise/omise-woocommerce/pull/398))
    25
    36### [v5.3.0 _(Aug 23, 2023)_](https://github.com/omise/omise-woocommerce/releases/tag/v5.3.0)
  • omise/tags/5.3.1/includes/class-omise-capabilities.php

    r2912289 r2962817  
    3636    public static function retrieve($pKey = null, $sKey = null)
    3737    {
     38        if ( !self::shouldCallApi() ) {
     39            return null;
     40        }
     41
    3842        $keys = self::getKeys($pKey, $sKey);
    3943
     
    6872        return self::$instance;
    6973    }
     74
     75    /**
     76     * @return boolean
     77     */
     78    public static function shouldCallApi() {
     79        $omiseSettingPages = [ 'omise' ];
     80        $currentAdminPage = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : '';
     81        // If page is omise setting page from admin panel.
     82        $isOmiseSettingPage = is_admin() && in_array( $currentAdminPage, $omiseSettingPages );
     83
     84        // If page is checkout page but not thank you page.
     85        // By default thank you page is also part of checkout pages
     86        // and we do not need to call capabilities on thank you page.
     87        // If endpoint url is `order-received`, it mean thank you page.
     88        $isPaymentPage = is_checkout() && !is_wc_endpoint_url( 'order-received' );
     89
     90        return $isPaymentPage || $isOmiseSettingPage;
     91    }
     92
    7093
    7194    /**
  • omise/tags/5.3.1/omise-woocommerce.php

    r2957621 r2962817  
    55 * Plugin URI:  https://www.omise.co/woocommerce
    66 * Description: Opn Payments is a WordPress plugin designed specifically for WooCommerce. The plugin adds support for Opn Payments Payment Gateway's payment methods to WooCommerce.
    7  * Version:     5.3.0
     7 * Version:     5.3.1
    88 * Author:      Opn Payments and contributors
    99 * Author URI:  https://github.com/omise/omise-woocommerce/graphs/contributors
     
    2323     * @var string
    2424     */
    25     public $version = '5.3.0';
     25    public $version = '5.3.1';
    2626
    2727    /**
  • omise/tags/5.3.1/readme.txt

    r2957621 r2962817  
    44Requires at least: 4.3.1
    55Tested up to: 6.0.2
    6 Stable tag: 5.3.0
     6Stable tag: 5.3.1
    77License: MIT
    88License URI: https://opensource.org/licenses/MIT
     
    3434
    3535== Changelog ==
     36
     37= 5.3.1 =
     38
     39- Fixed capabilities api calling on every pages. (PR [#398](https://github.com/omise/omise-woocommerce/pull/398))
    3640
    3741= 5.3.0 =
  • omise/tags/5.3.1/tests/unit/includes/backends/class-omise-backend-installment-test.php

    r2852769 r2962817  
    248248    }
    249249}
    250 
    251 /**
    252  * Mock Omise_Capabilities class.
    253  * NOTE: This might not be an ideal way to mock a class,
    254  *       feel free to enhance the test or the core code.
    255  *
    256  * @see includes/class-omise-capabilities
    257  */
    258 class Omise_Capabilities
    259 {
    260     /**
    261      * @var self
    262      */
    263     protected static $the_instance = null;
    264 
    265     public static function retrieve()
    266     {
    267         self::$the_instance = self::$the_instance ?: new self();
    268         return self::$the_instance;
    269     }
    270 
    271     public function is_zero_interest()
    272     {
    273         return false;
    274     }
    275 }
  • omise/tags/5.3.1/tests/unit/includes/gateway/class-omise-offsite-test.php

    r2957621 r2962817  
    22
    33use PHPunit\Framework\TestCase;
    4 use Mockery;
    54
    65abstract class Offsite_Test extends TestCase
  • omise/tags/5.3.1/tests/unit/omise-woocommerce-test.php

    r2946870 r2962817  
    11<?php
    22
    3 use Omise;
    4 use Mockery;
    53use PHPUnit\Framework\TestCase;
    64
  • omise/trunk/CHANGELOG.md

    r2957621 r2962817  
    11# CHANGELOG
     2
     3### [v5.3.1 _(Sep 05, 2023)_](https://github.com/omise/omise-woocommerce/releases/tag/v5.3.1)
     4- Fixed capabilities api calling on every pages. (PR [#398](https://github.com/omise/omise-woocommerce/pull/398))
    25
    36### [v5.3.0 _(Aug 23, 2023)_](https://github.com/omise/omise-woocommerce/releases/tag/v5.3.0)
  • omise/trunk/includes/class-omise-capabilities.php

    r2912289 r2962817  
    3636    public static function retrieve($pKey = null, $sKey = null)
    3737    {
     38        if ( !self::shouldCallApi() ) {
     39            return null;
     40        }
     41
    3842        $keys = self::getKeys($pKey, $sKey);
    3943
     
    6872        return self::$instance;
    6973    }
     74
     75    /**
     76     * @return boolean
     77     */
     78    public static function shouldCallApi() {
     79        $omiseSettingPages = [ 'omise' ];
     80        $currentAdminPage = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : '';
     81        // If page is omise setting page from admin panel.
     82        $isOmiseSettingPage = is_admin() && in_array( $currentAdminPage, $omiseSettingPages );
     83
     84        // If page is checkout page but not thank you page.
     85        // By default thank you page is also part of checkout pages
     86        // and we do not need to call capabilities on thank you page.
     87        // If endpoint url is `order-received`, it mean thank you page.
     88        $isPaymentPage = is_checkout() && !is_wc_endpoint_url( 'order-received' );
     89
     90        return $isPaymentPage || $isOmiseSettingPage;
     91    }
     92
    7093
    7194    /**
  • omise/trunk/omise-woocommerce.php

    r2957621 r2962817  
    55 * Plugin URI:  https://www.omise.co/woocommerce
    66 * Description: Opn Payments is a WordPress plugin designed specifically for WooCommerce. The plugin adds support for Opn Payments Payment Gateway's payment methods to WooCommerce.
    7  * Version:     5.3.0
     7 * Version:     5.3.1
    88 * Author:      Opn Payments and contributors
    99 * Author URI:  https://github.com/omise/omise-woocommerce/graphs/contributors
     
    2323     * @var string
    2424     */
    25     public $version = '5.3.0';
     25    public $version = '5.3.1';
    2626
    2727    /**
  • omise/trunk/readme.txt

    r2957621 r2962817  
    44Requires at least: 4.3.1
    55Tested up to: 6.0.2
    6 Stable tag: 5.3.0
     6Stable tag: 5.3.1
    77License: MIT
    88License URI: https://opensource.org/licenses/MIT
     
    3434
    3535== Changelog ==
     36
     37= 5.3.1 =
     38
     39- Fixed capabilities api calling on every pages. (PR [#398](https://github.com/omise/omise-woocommerce/pull/398))
    3640
    3741= 5.3.0 =
  • omise/trunk/tests/unit/includes/backends/class-omise-backend-installment-test.php

    r2852769 r2962817  
    248248    }
    249249}
    250 
    251 /**
    252  * Mock Omise_Capabilities class.
    253  * NOTE: This might not be an ideal way to mock a class,
    254  *       feel free to enhance the test or the core code.
    255  *
    256  * @see includes/class-omise-capabilities
    257  */
    258 class Omise_Capabilities
    259 {
    260     /**
    261      * @var self
    262      */
    263     protected static $the_instance = null;
    264 
    265     public static function retrieve()
    266     {
    267         self::$the_instance = self::$the_instance ?: new self();
    268         return self::$the_instance;
    269     }
    270 
    271     public function is_zero_interest()
    272     {
    273         return false;
    274     }
    275 }
  • omise/trunk/tests/unit/includes/gateway/class-omise-offsite-test.php

    r2957621 r2962817  
    22
    33use PHPunit\Framework\TestCase;
    4 use Mockery;
    54
    65abstract class Offsite_Test extends TestCase
  • omise/trunk/tests/unit/omise-woocommerce-test.php

    r2946870 r2962817  
    11<?php
    22
    3 use Omise;
    4 use Mockery;
    53use PHPUnit\Framework\TestCase;
    64
Note: See TracChangeset for help on using the changeset viewer.