Plugin Directory

Changeset 2831507


Ignore:
Timestamp:
12/10/2022 12:16:03 PM (3 years ago)
Author:
davexpression
Message:

Update to version 0.1.7 from GitHub

Location:
wc-checkoutplus
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • wc-checkoutplus/tags/0.1.7/README.txt

    r2831320 r2831507  
    77Requires PHP: 7.4
    88Tested up to: 6.1
    9 Stable tag: 0.1.6
     9Stable tag: 0.1.7
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • wc-checkoutplus/tags/0.1.7/includes/Checkout.php

    r2713778 r2831507  
    8686     */
    8787    public function prepare_billing_fields( $checkout_fields ) {
    88         if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' == $_GET['page'] ) {
     88        // phpcs:ignore
     89        if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {
    8990            return $checkout_fields;
    9091        }
     
    100101     */
    101102    public function prepare_shipping_fields( $checkout_fields ) {
    102         if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' == $_GET['page'] ) {
     103        // phpcs:ignore
     104        if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {
    103105            return $checkout_fields;
    104106        }
     
    116118     */
    117119    public function prepare_order_fields( $checkout_fields ) {
    118         if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' == $_GET['page'] ) {
     120        // phpcs:ignore
     121        if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {
    119122            return $checkout_fields;
    120123        }
    121124
    122         if ( $additional_fields = get_option( 'wc_fields_additional' ) ) {
     125        $additional_fields = get_option( 'wc_fields_additional' );
     126
     127        if ( $additional_fields ) {
    123128            $checkout_fields['order'] = $additional_fields + $checkout_fields['order'];
    124129
     
    168173                    'shipping_postcode',
    169174                    'order_comments',
    170                 )
     175                ),
     176                true
    171177            ) ) {
    172178                continue;
     
    218224        }
    219225
    220         if ( 'html' != $args['type'] ) {
     226        if ( 'html' !== $args['type'] ) {
    221227            if ( $args['required'] ) {
    222228                $args['class'][] = 'validate-required';
  • wc-checkoutplus/tags/0.1.7/includes/Fields.php

    r2713778 r2831507  
    185185                        'shipping_postcode',
    186186                        'order_comments',
    187                     )
     187                    ),
     188                    true
    188189                ) ) {
    189190                    $field['label'] = $checkout_fields[ $key ]['label'];
     
    286287
    287288            // replace field name if present in reserved field names
    288             if ( isset( $field['custom'] ) && true == $field['custom'] ) {
     289            if ( isset( $field['custom'] ) && true === $field['custom'] ) {
    289290                if ( in_array( $field['name'], self::$reserved_fields, true ) ) {
    290291                    $field['name'] = $value . '_' . strtolower( wp_generate_password( 5, false ) );
     
    356357
    357358        // Do a nonce security check, bail if fails
    358         if ( ! isset( $_POST['wcfb_form_nonce'] ) || '' === $_POST['wcfb_form_nonce'] ) {
    359             return;
    360         }
    361 
    362         $nonce = $_POST['wcfb_form_nonce'];
     359        if ( ! isset( $_POST['wcfb_form_nonce'] ) ) {
     360            return;
     361        }
     362
     363        $nonce = sanitize_text_field( wp_unslash( $_POST['wcfb_form_nonce'] ) );
    363364
    364365        if ( ! wp_verify_nonce( $nonce, 'wcfb_save_data' ) ) {
     
    367368
    368369        // Get data and sanitize array
    369         $data = json_decode( wp_unslash( $_POST['wcfb_data'] ), true );
     370        $data = isset($_POST['wcfb_data']) ? json_decode( wp_kses_post( wp_unslash( $_POST['wcfb_data'] ) ), true ) : [];
    370371        if ( ! $data ) { // return if data is null for example
    371372            return;
     
    376377        $list   = is_array( $data['list'] ) && isset( $data['list'] ) ? $data['list'] : array();
    377378
     379        // Bail if it's not array or empty array
    378380        if ( empty( $fields ) || empty( $list ) ) {
    379381            return;
  • wc-checkoutplus/tags/0.1.7/vendor/autoload.php

    r2831320 r2831507  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb::getLoader();
     25return ComposerAutoloaderInite2375e13723472a28499d599dc86128a::getLoader();
  • wc-checkoutplus/tags/0.1.7/vendor/composer/autoload_real.php

    r2831320 r2831507  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb
     5class ComposerAutoloaderInite2375e13723472a28499d599dc86128a
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInite2375e13723472a28499d599dc86128a::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • wc-checkoutplus/tags/0.1.7/vendor/composer/autoload_static.php

    r2831320 r2831507  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb
     7class ComposerStaticInite2375e13723472a28499d599dc86128a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3333    {
    3434        return \Closure::bind(function () use ($loader) {
    35             $loader->prefixLengthsPsr4 = ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::$prefixLengthsPsr4;
    36             $loader->prefixDirsPsr4 = ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::$prefixDirsPsr4;
    37             $loader->classMap = ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::$classMap;
     35            $loader->prefixLengthsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixLengthsPsr4;
     36            $loader->prefixDirsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixDirsPsr4;
     37            $loader->classMap = ComposerStaticInite2375e13723472a28499d599dc86128a::$classMap;
    3838
    3939        }, null, ClassLoader::class);
  • wc-checkoutplus/tags/0.1.7/vendor/composer/installed.php

    r2831320 r2831507  
    22    'root' => array(
    33        'name' => 'figarts/checkoutplus',
    4         'pretty_version' => '0.1.6',
    5         'version' => '0.1.6.0',
    6         'reference' => 'c6d4738c7a26cae3de8663326684830886b5e76c',
     4        'pretty_version' => '0.1.7',
     5        'version' => '0.1.7.0',
     6        'reference' => 'e1d3f38862f4ed093bcd78c6103e57ea7240fd71',
    77        'type' => 'wordpress-plugins',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'figarts/checkoutplus' => array(
    23             'pretty_version' => '0.1.6',
    24             'version' => '0.1.6.0',
    25             'reference' => 'c6d4738c7a26cae3de8663326684830886b5e76c',
     23            'pretty_version' => '0.1.7',
     24            'version' => '0.1.7.0',
     25            'reference' => 'e1d3f38862f4ed093bcd78c6103e57ea7240fd71',
    2626            'type' => 'wordpress-plugins',
    2727            'install_path' => __DIR__ . '/../../',
  • wc-checkoutplus/tags/0.1.7/wc-checkoutplus.php

    r2831320 r2831507  
    1111 * Plugin URI:        https://pluginette.com
    1212 * Description:       The easiest way to manage WooCommerce checkout fields
    13  * Version:           0.1.6
     13 * Version:           0.1.7
    1414 * Requires at least: 5.2
    1515 * Requires PHP:      7.4
     
    3131 * Rename this for your plugin and update it as you release new versions.
    3232 */
    33 define( 'CHECKOUTPLUS_VERSION', '0.1.6' );
     33define( 'CHECKOUTPLUS_VERSION', '0.1.7' );
    3434define( 'CHECKOUTPLUS_DIR_PATH', plugin_dir_path( __FILE__ ) );
    3535define( 'CHECKOUTPLUS_DIR_URL', plugin_dir_url( __FILE__ ) );
     
    4949require CHECKOUTPLUS_DIR_PATH . '/includes/Helper.php';
    5050
    51 $plugin = new CheckoutPlus\Core();
     51$wc_checkoutplus = new CheckoutPlus\Core();
    5252
    53 register_activation_hook( __FILE__, array( $plugin, 'activate_checkoutplus' ) );
    54 register_deactivation_hook( __FILE__, array( $plugin, 'deactivate_checkoutplus' ) );
     53register_activation_hook( __FILE__, array( $wc_checkoutplus, 'activate_checkoutplus' ) );
     54register_deactivation_hook( __FILE__, array( $wc_checkoutplus, 'deactivate_checkoutplus' ) );
    5555
    56 $plugin->register();
     56$wc_checkoutplus->register();
  • wc-checkoutplus/trunk/README.txt

    r2831320 r2831507  
    77Requires PHP: 7.4
    88Tested up to: 6.1
    9 Stable tag: 0.1.6
     9Stable tag: 0.1.7
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • wc-checkoutplus/trunk/includes/Checkout.php

    r2713778 r2831507  
    8686     */
    8787    public function prepare_billing_fields( $checkout_fields ) {
    88         if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' == $_GET['page'] ) {
     88        // phpcs:ignore
     89        if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {
    8990            return $checkout_fields;
    9091        }
     
    100101     */
    101102    public function prepare_shipping_fields( $checkout_fields ) {
    102         if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' == $_GET['page'] ) {
     103        // phpcs:ignore
     104        if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {
    103105            return $checkout_fields;
    104106        }
     
    116118     */
    117119    public function prepare_order_fields( $checkout_fields ) {
    118         if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' == $_GET['page'] ) {
     120        // phpcs:ignore
     121        if ( is_admin() && isset( $_GET['page'] ) && 'checkoutplus_fields' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) {
    119122            return $checkout_fields;
    120123        }
    121124
    122         if ( $additional_fields = get_option( 'wc_fields_additional' ) ) {
     125        $additional_fields = get_option( 'wc_fields_additional' );
     126
     127        if ( $additional_fields ) {
    123128            $checkout_fields['order'] = $additional_fields + $checkout_fields['order'];
    124129
     
    168173                    'shipping_postcode',
    169174                    'order_comments',
    170                 )
     175                ),
     176                true
    171177            ) ) {
    172178                continue;
     
    218224        }
    219225
    220         if ( 'html' != $args['type'] ) {
     226        if ( 'html' !== $args['type'] ) {
    221227            if ( $args['required'] ) {
    222228                $args['class'][] = 'validate-required';
  • wc-checkoutplus/trunk/includes/Fields.php

    r2713778 r2831507  
    185185                        'shipping_postcode',
    186186                        'order_comments',
    187                     )
     187                    ),
     188                    true
    188189                ) ) {
    189190                    $field['label'] = $checkout_fields[ $key ]['label'];
     
    286287
    287288            // replace field name if present in reserved field names
    288             if ( isset( $field['custom'] ) && true == $field['custom'] ) {
     289            if ( isset( $field['custom'] ) && true === $field['custom'] ) {
    289290                if ( in_array( $field['name'], self::$reserved_fields, true ) ) {
    290291                    $field['name'] = $value . '_' . strtolower( wp_generate_password( 5, false ) );
     
    356357
    357358        // Do a nonce security check, bail if fails
    358         if ( ! isset( $_POST['wcfb_form_nonce'] ) || '' === $_POST['wcfb_form_nonce'] ) {
    359             return;
    360         }
    361 
    362         $nonce = $_POST['wcfb_form_nonce'];
     359        if ( ! isset( $_POST['wcfb_form_nonce'] ) ) {
     360            return;
     361        }
     362
     363        $nonce = sanitize_text_field( wp_unslash( $_POST['wcfb_form_nonce'] ) );
    363364
    364365        if ( ! wp_verify_nonce( $nonce, 'wcfb_save_data' ) ) {
     
    367368
    368369        // Get data and sanitize array
    369         $data = json_decode( wp_unslash( $_POST['wcfb_data'] ), true );
     370        $data = isset($_POST['wcfb_data']) ? json_decode( wp_kses_post( wp_unslash( $_POST['wcfb_data'] ) ), true ) : [];
    370371        if ( ! $data ) { // return if data is null for example
    371372            return;
     
    376377        $list   = is_array( $data['list'] ) && isset( $data['list'] ) ? $data['list'] : array();
    377378
     379        // Bail if it's not array or empty array
    378380        if ( empty( $fields ) || empty( $list ) ) {
    379381            return;
  • wc-checkoutplus/trunk/vendor/autoload.php

    r2831320 r2831507  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb::getLoader();
     25return ComposerAutoloaderInite2375e13723472a28499d599dc86128a::getLoader();
  • wc-checkoutplus/trunk/vendor/composer/autoload_real.php

    r2831320 r2831507  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb
     5class ComposerAutoloaderInite2375e13723472a28499d599dc86128a
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInite686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInite2375e13723472a28499d599dc86128a::getInitializer($loader));
    3333
    3434        $loader->register(true);
  • wc-checkoutplus/trunk/vendor/composer/autoload_static.php

    r2831320 r2831507  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb
     7class ComposerStaticInite2375e13723472a28499d599dc86128a
    88{
    99    public static $prefixLengthsPsr4 = array (
     
    3333    {
    3434        return \Closure::bind(function () use ($loader) {
    35             $loader->prefixLengthsPsr4 = ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::$prefixLengthsPsr4;
    36             $loader->prefixDirsPsr4 = ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::$prefixDirsPsr4;
    37             $loader->classMap = ComposerStaticInite686f88cafc9bff0b46af2567bb83eeb::$classMap;
     35            $loader->prefixLengthsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixLengthsPsr4;
     36            $loader->prefixDirsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixDirsPsr4;
     37            $loader->classMap = ComposerStaticInite2375e13723472a28499d599dc86128a::$classMap;
    3838
    3939        }, null, ClassLoader::class);
  • wc-checkoutplus/trunk/vendor/composer/installed.php

    r2831320 r2831507  
    22    'root' => array(
    33        'name' => 'figarts/checkoutplus',
    4         'pretty_version' => '0.1.6',
    5         'version' => '0.1.6.0',
    6         'reference' => 'c6d4738c7a26cae3de8663326684830886b5e76c',
     4        'pretty_version' => '0.1.7',
     5        'version' => '0.1.7.0',
     6        'reference' => 'e1d3f38862f4ed093bcd78c6103e57ea7240fd71',
    77        'type' => 'wordpress-plugins',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        'figarts/checkoutplus' => array(
    23             'pretty_version' => '0.1.6',
    24             'version' => '0.1.6.0',
    25             'reference' => 'c6d4738c7a26cae3de8663326684830886b5e76c',
     23            'pretty_version' => '0.1.7',
     24            'version' => '0.1.7.0',
     25            'reference' => 'e1d3f38862f4ed093bcd78c6103e57ea7240fd71',
    2626            'type' => 'wordpress-plugins',
    2727            'install_path' => __DIR__ . '/../../',
  • wc-checkoutplus/trunk/wc-checkoutplus.php

    r2831320 r2831507  
    1111 * Plugin URI:        https://pluginette.com
    1212 * Description:       The easiest way to manage WooCommerce checkout fields
    13  * Version:           0.1.6
     13 * Version:           0.1.7
    1414 * Requires at least: 5.2
    1515 * Requires PHP:      7.4
     
    3131 * Rename this for your plugin and update it as you release new versions.
    3232 */
    33 define( 'CHECKOUTPLUS_VERSION', '0.1.6' );
     33define( 'CHECKOUTPLUS_VERSION', '0.1.7' );
    3434define( 'CHECKOUTPLUS_DIR_PATH', plugin_dir_path( __FILE__ ) );
    3535define( 'CHECKOUTPLUS_DIR_URL', plugin_dir_url( __FILE__ ) );
     
    4949require CHECKOUTPLUS_DIR_PATH . '/includes/Helper.php';
    5050
    51 $plugin = new CheckoutPlus\Core();
     51$wc_checkoutplus = new CheckoutPlus\Core();
    5252
    53 register_activation_hook( __FILE__, array( $plugin, 'activate_checkoutplus' ) );
    54 register_deactivation_hook( __FILE__, array( $plugin, 'deactivate_checkoutplus' ) );
     53register_activation_hook( __FILE__, array( $wc_checkoutplus, 'activate_checkoutplus' ) );
     54register_deactivation_hook( __FILE__, array( $wc_checkoutplus, 'deactivate_checkoutplus' ) );
    5555
    56 $plugin->register();
     56$wc_checkoutplus->register();
Note: See TracChangeset for help on using the changeset viewer.