Changeset 2831507
- Timestamp:
- 12/10/2022 12:16:03 PM (3 years ago)
- Location:
- wc-checkoutplus
- Files:
-
- 16 edited
- 1 copied
-
tags/0.1.7 (copied) (copied from wc-checkoutplus/trunk)
-
tags/0.1.7/README.txt (modified) (1 diff)
-
tags/0.1.7/includes/Checkout.php (modified) (5 diffs)
-
tags/0.1.7/includes/Fields.php (modified) (5 diffs)
-
tags/0.1.7/vendor/autoload.php (modified) (1 diff)
-
tags/0.1.7/vendor/composer/autoload_real.php (modified) (2 diffs)
-
tags/0.1.7/vendor/composer/autoload_static.php (modified) (2 diffs)
-
tags/0.1.7/vendor/composer/installed.php (modified) (2 diffs)
-
tags/0.1.7/wc-checkoutplus.php (modified) (3 diffs)
-
trunk/README.txt (modified) (1 diff)
-
trunk/includes/Checkout.php (modified) (5 diffs)
-
trunk/includes/Fields.php (modified) (5 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/wc-checkoutplus.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-checkoutplus/tags/0.1.7/README.txt
r2831320 r2831507 7 7 Requires PHP: 7.4 8 8 Tested up to: 6.1 9 Stable tag: 0.1. 69 Stable tag: 0.1.7 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
wc-checkoutplus/tags/0.1.7/includes/Checkout.php
r2713778 r2831507 86 86 */ 87 87 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'] ) ) ) { 89 90 return $checkout_fields; 90 91 } … … 100 101 */ 101 102 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'] ) ) ) { 103 105 return $checkout_fields; 104 106 } … … 116 118 */ 117 119 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'] ) ) ) { 119 122 return $checkout_fields; 120 123 } 121 124 122 if ( $additional_fields = get_option( 'wc_fields_additional' ) ) { 125 $additional_fields = get_option( 'wc_fields_additional' ); 126 127 if ( $additional_fields ) { 123 128 $checkout_fields['order'] = $additional_fields + $checkout_fields['order']; 124 129 … … 168 173 'shipping_postcode', 169 174 'order_comments', 170 ) 175 ), 176 true 171 177 ) ) { 172 178 continue; … … 218 224 } 219 225 220 if ( 'html' != $args['type'] ) {226 if ( 'html' !== $args['type'] ) { 221 227 if ( $args['required'] ) { 222 228 $args['class'][] = 'validate-required'; -
wc-checkoutplus/tags/0.1.7/includes/Fields.php
r2713778 r2831507 185 185 'shipping_postcode', 186 186 'order_comments', 187 ) 187 ), 188 true 188 189 ) ) { 189 190 $field['label'] = $checkout_fields[ $key ]['label']; … … 286 287 287 288 // 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'] ) { 289 290 if ( in_array( $field['name'], self::$reserved_fields, true ) ) { 290 291 $field['name'] = $value . '_' . strtolower( wp_generate_password( 5, false ) ); … … 356 357 357 358 // 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'] ) ); 363 364 364 365 if ( ! wp_verify_nonce( $nonce, 'wcfb_save_data' ) ) { … … 367 368 368 369 // 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 ) : []; 370 371 if ( ! $data ) { // return if data is null for example 371 372 return; … … 376 377 $list = is_array( $data['list'] ) && isset( $data['list'] ) ? $data['list'] : array(); 377 378 379 // Bail if it's not array or empty array 378 380 if ( empty( $fields ) || empty( $list ) ) { 379 381 return; -
wc-checkoutplus/tags/0.1.7/vendor/autoload.php
r2831320 r2831507 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb::getLoader();25 return ComposerAutoloaderInite2375e13723472a28499d599dc86128a::getLoader(); -
wc-checkoutplus/tags/0.1.7/vendor/composer/autoload_real.php
r2831320 r2831507 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb5 class ComposerAutoloaderInite2375e13723472a28499d599dc86128a 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInite2375e13723472a28499d599dc86128a::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
wc-checkoutplus/tags/0.1.7/vendor/composer/autoload_static.php
r2831320 r2831507 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb7 class ComposerStaticInite2375e13723472a28499d599dc86128a 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 33 33 { 34 34 return \Closure::bind(function () use ($loader) { 35 $loader->prefixLengthsPsr4 = ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::$prefixLengthsPsr4;36 $loader->prefixDirsPsr4 = ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::$prefixDirsPsr4;37 $loader->classMap = ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::$classMap;35 $loader->prefixLengthsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixLengthsPsr4; 36 $loader->prefixDirsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixDirsPsr4; 37 $loader->classMap = ComposerStaticInite2375e13723472a28499d599dc86128a::$classMap; 38 38 39 39 }, null, ClassLoader::class); -
wc-checkoutplus/tags/0.1.7/vendor/composer/installed.php
r2831320 r2831507 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'wordpress-plugins', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 26 26 'type' => 'wordpress-plugins', 27 27 'install_path' => __DIR__ . '/../../', -
wc-checkoutplus/tags/0.1.7/wc-checkoutplus.php
r2831320 r2831507 11 11 * Plugin URI: https://pluginette.com 12 12 * Description: The easiest way to manage WooCommerce checkout fields 13 * Version: 0.1. 613 * Version: 0.1.7 14 14 * Requires at least: 5.2 15 15 * Requires PHP: 7.4 … … 31 31 * Rename this for your plugin and update it as you release new versions. 32 32 */ 33 define( 'CHECKOUTPLUS_VERSION', '0.1. 6' );33 define( 'CHECKOUTPLUS_VERSION', '0.1.7' ); 34 34 define( 'CHECKOUTPLUS_DIR_PATH', plugin_dir_path( __FILE__ ) ); 35 35 define( 'CHECKOUTPLUS_DIR_URL', plugin_dir_url( __FILE__ ) ); … … 49 49 require CHECKOUTPLUS_DIR_PATH . '/includes/Helper.php'; 50 50 51 $ plugin= new CheckoutPlus\Core();51 $wc_checkoutplus = new CheckoutPlus\Core(); 52 52 53 register_activation_hook( __FILE__, array( $ plugin, 'activate_checkoutplus' ) );54 register_deactivation_hook( __FILE__, array( $ plugin, 'deactivate_checkoutplus' ) );53 register_activation_hook( __FILE__, array( $wc_checkoutplus, 'activate_checkoutplus' ) ); 54 register_deactivation_hook( __FILE__, array( $wc_checkoutplus, 'deactivate_checkoutplus' ) ); 55 55 56 $ plugin->register();56 $wc_checkoutplus->register(); -
wc-checkoutplus/trunk/README.txt
r2831320 r2831507 7 7 Requires PHP: 7.4 8 8 Tested up to: 6.1 9 Stable tag: 0.1. 69 Stable tag: 0.1.7 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
wc-checkoutplus/trunk/includes/Checkout.php
r2713778 r2831507 86 86 */ 87 87 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'] ) ) ) { 89 90 return $checkout_fields; 90 91 } … … 100 101 */ 101 102 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'] ) ) ) { 103 105 return $checkout_fields; 104 106 } … … 116 118 */ 117 119 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'] ) ) ) { 119 122 return $checkout_fields; 120 123 } 121 124 122 if ( $additional_fields = get_option( 'wc_fields_additional' ) ) { 125 $additional_fields = get_option( 'wc_fields_additional' ); 126 127 if ( $additional_fields ) { 123 128 $checkout_fields['order'] = $additional_fields + $checkout_fields['order']; 124 129 … … 168 173 'shipping_postcode', 169 174 'order_comments', 170 ) 175 ), 176 true 171 177 ) ) { 172 178 continue; … … 218 224 } 219 225 220 if ( 'html' != $args['type'] ) {226 if ( 'html' !== $args['type'] ) { 221 227 if ( $args['required'] ) { 222 228 $args['class'][] = 'validate-required'; -
wc-checkoutplus/trunk/includes/Fields.php
r2713778 r2831507 185 185 'shipping_postcode', 186 186 'order_comments', 187 ) 187 ), 188 true 188 189 ) ) { 189 190 $field['label'] = $checkout_fields[ $key ]['label']; … … 286 287 287 288 // 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'] ) { 289 290 if ( in_array( $field['name'], self::$reserved_fields, true ) ) { 290 291 $field['name'] = $value . '_' . strtolower( wp_generate_password( 5, false ) ); … … 356 357 357 358 // 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'] ) ); 363 364 364 365 if ( ! wp_verify_nonce( $nonce, 'wcfb_save_data' ) ) { … … 367 368 368 369 // 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 ) : []; 370 371 if ( ! $data ) { // return if data is null for example 371 372 return; … … 376 377 $list = is_array( $data['list'] ) && isset( $data['list'] ) ? $data['list'] : array(); 377 378 379 // Bail if it's not array or empty array 378 380 if ( empty( $fields ) || empty( $list ) ) { 379 381 return; -
wc-checkoutplus/trunk/vendor/autoload.php
r2831320 r2831507 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb::getLoader();25 return ComposerAutoloaderInite2375e13723472a28499d599dc86128a::getLoader(); -
wc-checkoutplus/trunk/vendor/composer/autoload_real.php
r2831320 r2831507 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb5 class ComposerAutoloaderInite2375e13723472a28499d599dc86128a 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInite 686f88cafc9bff0b46af2567bb83eeb', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInite2375e13723472a28499d599dc86128a', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInite2375e13723472a28499d599dc86128a::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
wc-checkoutplus/trunk/vendor/composer/autoload_static.php
r2831320 r2831507 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb7 class ComposerStaticInite2375e13723472a28499d599dc86128a 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 33 33 { 34 34 return \Closure::bind(function () use ($loader) { 35 $loader->prefixLengthsPsr4 = ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::$prefixLengthsPsr4;36 $loader->prefixDirsPsr4 = ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::$prefixDirsPsr4;37 $loader->classMap = ComposerStaticInite 686f88cafc9bff0b46af2567bb83eeb::$classMap;35 $loader->prefixLengthsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixLengthsPsr4; 36 $loader->prefixDirsPsr4 = ComposerStaticInite2375e13723472a28499d599dc86128a::$prefixDirsPsr4; 37 $loader->classMap = ComposerStaticInite2375e13723472a28499d599dc86128a::$classMap; 38 38 39 39 }, null, ClassLoader::class); -
wc-checkoutplus/trunk/vendor/composer/installed.php
r2831320 r2831507 2 2 'root' => array( 3 3 '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', 7 7 'type' => 'wordpress-plugins', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 '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', 26 26 'type' => 'wordpress-plugins', 27 27 'install_path' => __DIR__ . '/../../', -
wc-checkoutplus/trunk/wc-checkoutplus.php
r2831320 r2831507 11 11 * Plugin URI: https://pluginette.com 12 12 * Description: The easiest way to manage WooCommerce checkout fields 13 * Version: 0.1. 613 * Version: 0.1.7 14 14 * Requires at least: 5.2 15 15 * Requires PHP: 7.4 … … 31 31 * Rename this for your plugin and update it as you release new versions. 32 32 */ 33 define( 'CHECKOUTPLUS_VERSION', '0.1. 6' );33 define( 'CHECKOUTPLUS_VERSION', '0.1.7' ); 34 34 define( 'CHECKOUTPLUS_DIR_PATH', plugin_dir_path( __FILE__ ) ); 35 35 define( 'CHECKOUTPLUS_DIR_URL', plugin_dir_url( __FILE__ ) ); … … 49 49 require CHECKOUTPLUS_DIR_PATH . '/includes/Helper.php'; 50 50 51 $ plugin= new CheckoutPlus\Core();51 $wc_checkoutplus = new CheckoutPlus\Core(); 52 52 53 register_activation_hook( __FILE__, array( $ plugin, 'activate_checkoutplus' ) );54 register_deactivation_hook( __FILE__, array( $ plugin, 'deactivate_checkoutplus' ) );53 register_activation_hook( __FILE__, array( $wc_checkoutplus, 'activate_checkoutplus' ) ); 54 register_deactivation_hook( __FILE__, array( $wc_checkoutplus, 'deactivate_checkoutplus' ) ); 55 55 56 $ plugin->register();56 $wc_checkoutplus->register();
Note: See TracChangeset
for help on using the changeset viewer.