Changeset 3256094
- Timestamp:
- 03/14/2025 07:15:48 PM (13 months ago)
- Location:
- woo-2checkout
- Files:
-
- 111 added
- 57 edited
-
tags/3.1.0 (added)
-
tags/3.1.0/README.txt (added)
-
tags/3.1.0/build (added)
-
tags/3.1.0/build/convert-plus-block.asset.php (added)
-
tags/3.1.0/build/convert-plus-block.js (added)
-
tags/3.1.0/build/convert-plus-block.js.map (added)
-
tags/3.1.0/changelog.txt (added)
-
tags/3.1.0/composer.json (added)
-
tags/3.1.0/images (added)
-
tags/3.1.0/images/2checkout-dark.svg (added)
-
tags/3.1.0/images/2checkout-light.svg (added)
-
tags/3.1.0/includes (added)
-
tags/3.1.0/includes/API.php (added)
-
tags/3.1.0/includes/Common.php (added)
-
tags/3.1.0/includes/ConvertPlus (added)
-
tags/3.1.0/includes/ConvertPlus/ConvertPlus_Block.php (added)
-
tags/3.1.0/includes/ConvertPlus/ConvertPlus_Gateway.php (added)
-
tags/3.1.0/includes/Extended_Plugin_Upgrade_Notice.php (added)
-
tags/3.1.0/includes/Payment_Gateway.php (added)
-
tags/3.1.0/includes/Plugin.php (added)
-
tags/3.1.0/includes/functions.php (added)
-
tags/3.1.0/languages (added)
-
tags/3.1.0/languages/woo-2checkout.pot (added)
-
tags/3.1.0/uninstall.php (added)
-
tags/3.1.0/vendor (added)
-
tags/3.1.0/vendor/autoload.php (added)
-
tags/3.1.0/vendor/autoload_packages.php (added)
-
tags/3.1.0/vendor/automattic (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/CHANGELOG.md (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/LICENSE.txt (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/README.md (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/SECURITY.md (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/composer.json (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/AutoloadFileWriter.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/AutoloadGenerator.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/AutoloadProcessor.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/ManifestGenerator.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/autoload.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-autoloader-handler.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-autoloader-locator.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-autoloader.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-container.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-hook-manager.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-manifest-reader.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-path-processor.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-php-autoloader.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-plugin-locator.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-plugins-handler.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-shutdown-handler.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-version-loader.php (added)
-
tags/3.1.0/vendor/automattic/jetpack-autoloader/src/class-version-selector.php (added)
-
tags/3.1.0/vendor/composer (added)
-
tags/3.1.0/vendor/composer/ClassLoader.php (added)
-
tags/3.1.0/vendor/composer/InstalledVersions.php (added)
-
tags/3.1.0/vendor/composer/LICENSE (added)
-
tags/3.1.0/vendor/composer/autoload_classmap.php (added)
-
tags/3.1.0/vendor/composer/autoload_namespaces.php (added)
-
tags/3.1.0/vendor/composer/autoload_psr4.php (added)
-
tags/3.1.0/vendor/composer/autoload_real.php (added)
-
tags/3.1.0/vendor/composer/autoload_static.php (added)
-
tags/3.1.0/vendor/composer/installed.json (added)
-
tags/3.1.0/vendor/composer/installed.php (added)
-
tags/3.1.0/vendor/composer/jetpack_autoload_classmap.php (added)
-
tags/3.1.0/vendor/composer/platform_check.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-autoloader-handler.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-autoloader-locator.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-autoloader.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-container.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-hook-manager.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-latest-autoloader-guard.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-manifest-reader.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-path-processor.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-php-autoloader.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-plugin-locator.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-plugins-handler.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-shutdown-handler.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-version-loader.php (added)
-
tags/3.1.0/vendor/jetpack-autoloader/class-version-selector.php (added)
-
tags/3.1.0/vendor/storepress (added)
-
tags/3.1.0/vendor/storepress/admin-utils (added)
-
tags/3.1.0/vendor/storepress/admin-utils/README.md (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build/admin-settings-rtl.css (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build/admin-settings.asset.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build/admin-settings.css (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build/admin-settings.js (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build/storepress-utils.asset.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/build/storepress-utils.js (added)
-
tags/3.1.0/vendor/storepress/admin-utils/composer.json (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Common.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Field.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Fields.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Menu.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/REST_API.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Section.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Settings.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Updater.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/Upgrade_Notice.php (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/templates (added)
-
tags/3.1.0/vendor/storepress/admin-utils/includes/templates/classic-template.php (added)
-
tags/3.1.0/woo-2checkout.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/build/convert-plus-block.asset.php (modified) (1 diff)
-
trunk/build/convert-plus-block.js (modified) (1 diff)
-
trunk/build/convert-plus-block.js.map (added)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/composer.json (added)
-
trunk/includes/API.php (modified) (22 diffs)
-
trunk/includes/Common.php (modified) (7 diffs)
-
trunk/includes/ConvertPlus/ConvertPlus_Block.php (modified) (7 diffs)
-
trunk/includes/ConvertPlus/ConvertPlus_Gateway.php (modified) (19 diffs)
-
trunk/includes/Extended_Plugin_Upgrade_Notice.php (modified) (3 diffs)
-
trunk/includes/Payment_Gateway.php (modified) (10 diffs)
-
trunk/includes/Plugin.php (modified) (20 diffs)
-
trunk/includes/functions.php (modified) (1 diff)
-
trunk/languages/woo-2checkout.pot (modified) (3 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/autoload_packages.php (modified) (1 diff)
-
trunk/vendor/automattic/jetpack-autoloader/CHANGELOG.md (modified) (2 diffs)
-
trunk/vendor/automattic/jetpack-autoloader/README.md (modified) (2 diffs)
-
trunk/vendor/automattic/jetpack-autoloader/composer.json (modified) (3 diffs)
-
trunk/vendor/automattic/jetpack-autoloader/src/AutoloadGenerator.php (modified) (1 diff)
-
trunk/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php (modified) (2 diffs)
-
trunk/vendor/automattic/jetpack-autoloader/src/class-autoloader.php (modified) (1 diff)
-
trunk/vendor/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php (modified) (1 diff)
-
trunk/vendor/automattic/jetpack-autoloader/src/class-php-autoloader.php (modified) (1 diff)
-
trunk/vendor/automattic/jetpack-autoloader/src/class-version-loader.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.json (modified) (5 diffs)
-
trunk/vendor/composer/installed.php (modified) (4 diffs)
-
trunk/vendor/composer/jetpack_autoload_classmap.php (modified) (2 diffs)
-
trunk/vendor/composer/platform_check.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-autoloader-handler.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-autoloader-locator.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-autoloader.php (modified) (2 diffs)
-
trunk/vendor/jetpack-autoloader/class-container.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-hook-manager.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-latest-autoloader-guard.php (modified) (2 diffs)
-
trunk/vendor/jetpack-autoloader/class-manifest-reader.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-path-processor.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-php-autoloader.php (modified) (2 diffs)
-
trunk/vendor/jetpack-autoloader/class-plugin-locator.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-plugins-handler.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-shutdown-handler.php (modified) (1 diff)
-
trunk/vendor/jetpack-autoloader/class-version-loader.php (modified) (3 diffs)
-
trunk/vendor/jetpack-autoloader/class-version-selector.php (modified) (1 diff)
-
trunk/vendor/storepress/admin-utils/README.md (modified) (7 diffs)
-
trunk/vendor/storepress/admin-utils/build/admin-settings-rtl.css (modified) (1 diff)
-
trunk/vendor/storepress/admin-utils/build/admin-settings.asset.php (modified) (1 diff)
-
trunk/vendor/storepress/admin-utils/build/admin-settings.css (modified) (1 diff)
-
trunk/vendor/storepress/admin-utils/build/admin-settings.js (modified) (1 diff)
-
trunk/vendor/storepress/admin-utils/build/storepress-utils.asset.php (added)
-
trunk/vendor/storepress/admin-utils/build/storepress-utils.js (added)
-
trunk/vendor/storepress/admin-utils/composer.json (modified) (4 diffs)
-
trunk/vendor/storepress/admin-utils/includes/Common.php (modified) (4 diffs)
-
trunk/vendor/storepress/admin-utils/includes/Field.php (modified) (25 diffs)
-
trunk/vendor/storepress/admin-utils/includes/Fields.php (modified) (4 diffs)
-
trunk/vendor/storepress/admin-utils/includes/Menu.php (modified) (2 diffs)
-
trunk/vendor/storepress/admin-utils/includes/Settings.php (modified) (10 diffs)
-
trunk/vendor/storepress/admin-utils/includes/templates/classic-template.php (modified) (1 diff)
-
trunk/woo-2checkout.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-2checkout/trunk/README.txt
r3140508 r3256094 2 2 Contributors: EmranAhmed, getwooplugins 3 3 Tags: 2checkout, 2checkout for woocommerce, 2checkout payment gateway, payment gateway, woocommerce payment gateway 4 Stable tag: 3. 0.34 Stable tag: 3.1.0 5 5 Requires PHP: 7.4 6 Requires at least: 6. 17 Tested up to: 6. 56 Requires at least: 6.4 7 Tested up to: 6.7 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 14 14 15 15 === How To Set up 2Checkout Payment Gateway for WooCommerce In WordPress === 16 17 ***NOTE:** 2Checkout MUST HAVE ENABLED **Dynamic Checkout** from their end. This Plugin Doesn't support 2Checkout **2Monetize** package* 16 18 17 19 [youtube https://www.youtube.com/watch?v=zev3t0HnYyI] … … 100 102 == Changelog == 101 103 104 = 3.1.0 = 105 106 * Add: WC 9.7+ compatibility. 107 * Add: WP 6.7+ compatibility. 108 102 109 = 3.0.3 = 103 110 -
woo-2checkout/trunk/build/convert-plus-block.asset.php
r3140508 r3256094 1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => ' 3feed1c8c9f5d2c504d6');1 <?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'b62da3c50bb637134eea'); -
woo-2checkout/trunk/build/convert-plus-block.js
r3140508 r3256094 1 (()=>{"use strict";var e={20:(e,t,o)=>{var n=o(609),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty, i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,o){var n,s={},u=null,p=null;for(n in void 0!==o&&(u=""+o),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(p=t.ref),t)c.call(t,n)&&!a.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:r,type:e,key:u,ref:p,props:s,_owner:i.current}}t.Fragment=s,t.jsx=u,t.jsxs=u},848:(e,t,o)=>{e.exports=o(20)},609:e=>{e.exports=window.React}},t={};const o=window.wp.i18n,n=window.wc.wcBlocksRegistry,r=window.wp.htmlEntities,s=window.wc.wcSettings,c="woo-2checkout",i=window.wp.element;var a=function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}(848);const u=(0,s.getPaymentMethodData)(c,{}),p=(0,r.decodeEntities)(u?.title||(0,o.__)("2Checkout","woo-2checkout")),d=(0,r.decodeEntities)(u?.order_button_text||(0,o.__)("Proceed to 2Checkout","woo-2checkout")),l=u?.icon_uri,_=u?.is_demo;function w(e){const{PaymentMethodLabel:t}=e.components;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t,{text:p})," ",(0,a.jsx)("img",{alt:p,className:"woo-2checkout-gateway-pay-image",src:l})]})}function f(e){return function(e){const{eventRegistration:t,emitResponse:o}=e,{onCheckoutFail:n}=t;(0,i.useEffect)((()=>{const e=n((({processingResponse:e})=>{const{paymentDetails:t,paymentStatus:n}=e;return"failure"!==n||{type:o.responseTypes.ERROR,message:t?.messages,messageContext:o.noticeContexts.PAYMENTS,retry:!0}}));return()=>{e()}}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,o.noticeContexts.PAYMENTS,n])}(e),(0,a.jsx)(m,{})}function m(){const e=(0,r.decodeEntities)(u.description||"");return _?(0,a.jsxs)(a.Fragment,{children:[e,(0,a.jsx)("br",{}),(0,a.jsx)("strong",{children:(0,o.__)("DEMO MODE ENABLED.","woo-2checkout")})," ",(0,o.__)("Use a","woo-2checkout")," ",(0,a.jsx)("a",{target:"_blank",href:"https://verifone.cloud/docs/2checkout/Documentation/09Test_ordering_system/01Test_payment_methods",rel:"noreferrer",children:(0,o.__)("test payment cards","woo-2checkout")})]}):e}function y(){return(0,a.jsx)(m,{})}const x={name:c,label:(0,a.jsx)(w,{}),content:(0,a.jsx)(f,{}),edit:(0,a.jsx)(y,{}),canMakePayment:function(){return!0},placeOrderButtonLabel:d,icons:null,ariaLabel:p,supports:{features:u.supports}};(0,n.registerPaymentMethod)(x)})();1 (()=>{"use strict";var e={20:(e,t,o)=>{var n=o(609),r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,o){var n,s={},u=null,p=null;for(n in void 0!==o&&(u=""+o),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(p=t.ref),t)c.call(t,n)&&!i.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:r,type:e,key:u,ref:p,props:s,_owner:a.current}}t.Fragment=s,t.jsx=u,t.jsxs=u},609:e=>{e.exports=window.React},848:(e,t,o)=>{e.exports=o(20)}},t={};const o=window.wp.i18n,n=window.wc.wcBlocksRegistry,r=window.wp.htmlEntities,s=window.wc.wcSettings,c="woo-2checkout",a=window.wp.element;var i=function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,o),s.exports}(848);const u=(0,s.getPaymentMethodData)(c,{}),{icon_uri:p,is_demo:l,title:_=(0,o.__)("2Checkout","woo-2checkout"),order_button_text:d=(0,o.__)("Proceed to 2Checkout","woo-2checkout"),description:w}=u,f=(0,r.decodeEntities)(_);function m(e){const{PaymentMethodLabel:t}=e.components;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t,{text:f})," ",(0,i.jsx)("img",{alt:f,className:"woo-2checkout-gateway-pay-image",src:p})]})}function y(){return l?(0,i.jsxs)(i.Fragment,{children:[w,(0,i.jsx)("br",{}),(0,i.jsx)("strong",{children:(0,o.__)("DEMO MODE ENABLED.","woo-2checkout")})," ",(0,o.__)("Use a","woo-2checkout")," ",(0,i.jsx)("a",{target:"_blank",href:"https://verifone.cloud/docs/2checkout/Documentation/09Test_ordering_system/01Test_payment_methods",rel:"noreferrer",children:(0,o.__)("test payment cards","woo-2checkout")})]}):w}function x(e){return function(e){const{eventRegistration:t,emitResponse:o}=e,{onCheckoutFail:n}=t;(0,a.useEffect)((()=>{const e=n((({processingResponse:e})=>{const{paymentDetails:t,paymentStatus:n}=e;return"failure"!==n||{type:o.responseTypes.ERROR,message:t?.messages,messageContext:o.noticeContexts.PAYMENTS,retry:!0}}));return()=>{e()}}),[o.responseTypes.ERROR,o.responseTypes.SUCCESS,o.noticeContexts.PAYMENTS,n])}(e),(0,i.jsx)(y,{})}function h(){return(0,i.jsx)(y,{})}const g={name:c,label:(0,i.jsx)(m,{}),content:(0,i.jsx)(x,{}),edit:(0,i.jsx)(h,{}),canMakePayment:function(){return!0},placeOrderButtonLabel:d,icons:null,ariaLabel:f,supports:{features:u.supports}};(0,n.registerPaymentMethod)(g)})(); -
woo-2checkout/trunk/changelog.txt
r3140508 r3256094 1 == Payment Gateway - 2Checkout for WooCommerce == 1 *** Payment Gateway - 2Checkout for WooCommerce *** 2 2 3 = 3.0.3 - 2024-08-21 = 3 2025-03-15 - version 3.1.0 4 * Add - WC 9.7+ compatibility. 5 * Add - WP 6.7+ compatibility. 4 6 7 2024-08-21 - version 3.0.3 5 8 * Add - WC 9.1+ compatibility. 6 9 * Add - WP 6.6+ compatibility. 7 10 8 = 3.0.2 - 2024-05-05 = 9 11 2024-05-05 - version 3.0.2 10 12 * Add - WC 8.8+ compatibility. 11 13 12 = 3.0.1 - 2024-04-17 = 13 14 2024-04-17 - version 3.0.1 14 15 * Add - WC 8.7+ compatibility. 15 16 16 = 3.0.0 - 2024-02-29 = 17 17 2024-02-29 - version 3.0.0 18 18 * Add - Support WooCommerce High-performance order storage. 19 19 * Add - Support WooCommerce Checkout Block. -
woo-2checkout/trunk/includes/API.php
r3140508 r3256094 1 1 <?php 2 /** 3 * 2Checkout Payment Gateway Integration. 4 * This file contains the API class for integrating with the Verifone (2Checkout) payment gateway. 5 * It provides functionality for secure payment processing, webhook handling, and signature validation 6 * within the WordPress environment. 7 * 8 * @package \StorePress\TwoCheckoutPaymentGateway 9 * @version 1.0.0 10 * @link https://verifone.cloud/docs/2checkout/API-Integration 11 * @since 1.0.0 12 */ 13 14 declare( strict_types=1 ); 2 15 3 16 namespace StorePress\TwoCheckoutPaymentGateway; 4 17 5 18 defined( 'ABSPATH' ) || die( 'Keep Silent' ); 6 19 /** 20 * API Class for 2Checkout Payment Gateway Integration 21 * 22 * This class handles API communication with the Verifone (2Checkout) payment gateway 23 * within the WordPress environment. It handles API communication with the Verifone (2Checkout) payment gateway. 24 * Provides comprehensive functionality for payment processing, including: 25 * - JWT token generation 26 * - Signature validation 27 * - IPN (Instant Payment Notification) handling 28 * - LCN (License Change Notification) processing 29 * - Buy link generation 30 * - Security hash verification 31 * 32 * This class supports modern hashing algorithms (SHA256/SHA3-256) and maintains 33 * backwards compatibility with legacy MD5 hashing where required. 34 * 35 * @package StorePress\TwoCheckoutPaymentGateway 36 * @since 1.0.0 37 * @author StorePress 38 * @link https://verifone.cloud/docs/2checkout/API-Integration/01Start-using-the-2Checkout-API/2Checkout-API-general-information/Migration_guide_SHA2_SHA3 39 */ 7 40 class API { 8 41 9 const POST = 'POST'; 10 const GET = 'GET'; 11 const PUT = 'PUT'; 42 43 use Common; 44 45 /** 46 * HTTP POST method constant 47 * 48 * Used for creating new resources via the API. 49 * 50 * @var string 51 */ 52 const POST = 'POST'; 53 /** 54 * HTTP GET method constant 55 * 56 * Used for retrieving resources via the API. 57 * 58 * @var string 59 */ 60 const GET = 'GET'; 61 /** 62 * HTTP PUT method constant 63 * 64 * Used for updating existing resources via the API. 65 * 66 * @var string 67 */ 68 const PUT = 'PUT'; 69 /** 70 * HTTP DELETE method constant 71 * 72 * Used for removing resources via the API. 73 * 74 * @var string 75 */ 12 76 const DELETE = 'DELETE'; 13 77 14 protected $merchant_code; 15 16 protected $secret_key; 17 18 // https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/IPN_and_LCN_URL_settings 19 // https://verifone.cloud/docs/2checkout/API-Integration/01Start-using-the-2Checkout-API/2Checkout-API-general-information/Migration_guide_SHA2_SHA3 20 // protected $hashing_algorithm = 'md5'; // md5 is old and not recommended. use sha256 or sha3-256 21 22 public function __construct( $merchant_code, $secret_key ) { 78 /** 79 * Merchant code for API authentication 80 * 81 * The unique identifier provided by 2Checkout/Verifone for merchant authentication. 82 * 83 * @var string 84 * @access protected 85 */ 86 protected string $merchant_code; 87 88 /** 89 * Secret key for API authentication 90 * 91 * The secret key provided by 2Checkout/Verifone for secure API communication. 92 * 93 * @var string 94 * @access protected 95 */ 96 protected string $secret_key; 97 98 /** 99 * Initialize the API client 100 * 101 * Creates a new instance of the API client with the provided authentication credentials. 102 * This class supports modern hashing algorithms (SHA256/SHA3-256) for enhanced security, 103 * deprecating the legacy MD5 hashing method. 104 * 105 * @param string $merchant_code The merchant code provided by Verifone/2Checkout. 106 * @param string $secret_key The secret key for API authentication. 107 * 108 * @see https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/IPN_and_LCN_URL_settings 109 */ 110 public function __construct( string $merchant_code, string $secret_key ) { 23 111 $this->merchant_code = $merchant_code; 24 112 $this->secret_key = $secret_key; 25 113 } 26 114 27 public static function instance( $merchant_code, $secret_key ) { 115 /** 116 * Return singleton instance of Class. 117 * The instance will be created if it does not exist yet. 118 * 119 * @param string $merchant_code The merchant code provided by Verifone/2Checkout. 120 * @param string $secret_key The secret key for API authentication. 121 * 122 * @return self The main instance. 123 * @since 1.0.0 124 */ 125 public static function instance( string $merchant_code, string $secret_key ): self { 28 126 static $instance = null; 29 127 … … 35 133 } 36 134 37 public function get_hashing_algorithm( $data = false ) { 38 39 if ( $data && ! empty( $data['SIGNATURE_SHA2_256'] ) ) { 135 /** 136 * Get the hashing algorithm based on signature presence 137 * 138 * Determines which hashing algorithm to use based on the presence of 139 * different signature types in the provided data. 140 * 141 * @param array<string, string> $data The data array containing signature information or false. 142 * 143 * @return string The hashing algorithm to use ('sha256', 'sha3-256', or 'md5') 144 * @since 1.0.0 145 */ 146 public function get_hashing_algorithm( array $data = array() ): string { 147 148 if ( ! empty( $data['SIGNATURE_SHA2_256'] ) ) { 40 149 return 'sha256'; 41 150 } 42 151 43 if ( $data &&! empty( $data['SIGNATURE_SHA3_256'] ) ) {152 if ( ! empty( $data['SIGNATURE_SHA3_256'] ) ) { 44 153 return 'sha3-256'; 45 154 } … … 48 157 } 49 158 50 public function get_returned_hash( $data = false ) { 51 52 if ( $data && ! empty( $data['SIGNATURE_SHA2_256'] ) ) { 159 /** 160 * Get the returned hash from the data 161 * 162 * Retrieves the appropriate hash value from the data array based on 163 * available signature types. 164 * 165 * @param array<string, string> $data The data array containing hash information or false. 166 * 167 * @return string The hash value if found, null otherwise 168 * @since 1.0.0 169 */ 170 public function get_returned_hash( array $data = array() ): string { 171 172 if ( ! empty( $data['SIGNATURE_SHA2_256'] ) ) { 53 173 return $data['SIGNATURE_SHA2_256']; 54 174 } 55 175 56 if ( $data &&! empty( $data['SIGNATURE_SHA3_256'] ) ) {176 if ( ! empty( $data['SIGNATURE_SHA3_256'] ) ) { 57 177 return $data['SIGNATURE_SHA3_256']; 58 178 } … … 61 181 } 62 182 63 // https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/How-to-generate-a-JSON-Web-Token-JWT 64 public function generate_jwt_token( $merchant_id, $iat, $exp, $buy_link_secret_word ) { 183 /** 184 * Creates a JWT token using HS512 algorithm for secure API communication. 185 * The token includes header, payload, and signature components. 186 * 187 * WooCommerce "JsonWebToken" Class can only generate token using HS256 algorithm. 188 * 189 * @param string $merchant_id Merchant ID. 190 * @param int $iat issued at, must be current timestamp since the UNIX epoch. 191 * @param int $exp expiration time, must be in UNIX timestamp format from future. 192 * @param string $buy_link_secret_word Buy-link Secret Word. 193 * 194 * @return string 195 * @see: https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/How-to-generate-a-JSON-Web-Token-JWT 196 */ 197 public function generate_jwt_token( string $merchant_id, int $iat, int $exp, string $buy_link_secret_word ): string { 65 198 66 199 $header = $this->encode( … … 93 226 } 94 227 95 private function encode( $data ) { 228 /** 229 * Encode data for JWT token generation 230 * 231 * Encodes the provided data using base64 and replaces specific characters 232 * to make it URL safe. 233 * 234 * @param string $data The data to encode. 235 * 236 * @return string The encoded data. 237 * @access private 238 * @since 1.0.0 239 */ 240 private function encode( string $data ): string { 96 241 97 242 return str_replace( … … 102 247 } 103 248 104 // https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/ConvertPlus_URL_parameters 105 // https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/ConvertPlus_Buy-Links_Signature 106 public function convertplus_buy_link_signature( $params, $buy_link_secret_word ) { 249 /** 250 * Generate signature for ConvertPlus buy link parameters 251 * 252 * Creates a signature for ConvertPlus buy link parameters using SHA256. 253 * Only specific parameters are included in signature generation. 254 * 255 * @param array<string, mixed> $params Array of buy link parameters. 256 * @param string $buy_link_secret_word Secret word for signature generation. 257 * 258 * @return string Generated signature hash 259 * 260 * @link https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/ConvertPlus_URL_parameters 261 * @link https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/ConvertPlus_Buy-Links_Signature 262 */ 263 public function convertplus_buy_link_signature( array $params, string $buy_link_secret_word ): string { 107 264 108 265 // ConvertPlus parameters that require a signature. … … 110 267 'return-url', 111 268 'return-type', 112 // 'back-url',269 // 'back-url', 113 270 'expiration', 114 271 'order-ext-ref', … … 122 279 'price', 123 280 'qty', 124 // 'tangible',281 // 'tangible', 125 282 'type', 126 283 'opt', … … 145 302 } 146 303 147 public function convertplus_buy_link( $params, $merchant_code, $buy_link_secret_word ) { 304 /** 305 * Generate complete ConvertPlus buy link URL. 306 * 307 * Creates a complete checkout URL with all necessary parameters and signature. 308 * Automatically sets expiration time if not provided. 309 * 310 * @param array<string, mixed> $params Parameters for the buy link. 311 * @param string $merchant_code Merchant identifier. 312 * @param string $buy_link_secret_word Secret word for signature. 313 * 314 * @return string Complete checkout URL 315 */ 316 public function convertplus_buy_link( array $params, string $merchant_code, string $buy_link_secret_word ): string { 148 317 149 318 $pre_data = array( 'merchant' => $merchant_code ); … … 159 328 } 160 329 161 // https://knowledgecenter.2checkout.com/Documentation/07Commerce/2Checkout-ConvertPlus/How-to-use-2Checkout-Signature-Generation-API-Endpoint#PHP_23 162 public function get_signature( $params, $buy_link_secret_word ) { 330 /** 331 * Get signature from 2Checkout API 332 * 333 * Retrieves a signature from the 2Checkout API using JWT authentication. 334 * Handles error responses and notifications. 335 * 336 * @param array<string, mixed> $params Parameters to be signed. 337 * @param string $buy_link_secret_word Secret word for JWT generation. 338 * 339 * @return string|false Signature if successful, false on failure 340 * 341 * @link https://knowledgecenter.2checkout.com/Documentation/07Commerce/2Checkout-ConvertPlus/How-to-use-2Checkout-Signature-Generation-API-Endpoint#PHP_23 342 */ 343 public function get_signature( array $params, string $buy_link_secret_word ) { 163 344 164 345 $jwt_token = $this->generate_jwt_token( $this->merchant_code, time(), time() + 3600, $buy_link_secret_word ); … … 172 353 'merchant-token' => $jwt_token, 173 354 ), 174 'body' => json_encode( $params ),355 'body' => wp_json_encode( $params ), 175 356 ) 176 357 ); … … 194 375 } 195 376 196 public function convertplus_serialize( $params ) { 377 /** 378 * Serialize parameters for signature generation 379 * 380 * Creates a serialized string from parameters for signature generation. 381 * Sorts parameters by key and prepends length to values. 382 * 383 * @param array<string, mixed> $params Parameters to serialize. 384 * 385 * @return string Serialized parameter string 386 */ 387 public function convertplus_serialize( array $params ): string { 197 388 198 389 ksort( $params ); … … 200 391 $map_data = array_map( 201 392 function ( $value ) { 202 return strlen( $value ) . $value; 393 $str_value = (string) $value; 394 return strlen( $str_value ) . $str_value; 203 395 }, 204 396 $params … … 208 400 } 209 401 210 // https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/06Instant_Payment_Notification_%2528IPN%2529/Calculate-the-IPN-HASH-signature 211 public function is_valid_ipn_lcn_hash( $post_data, $secret_key ) { 402 /** 403 * Validate IPN/LCN hash signature 404 * 405 * Verifies the authenticity of IPN (Instant Payment Notification) or 406 * LCN (License Change Notification) requests. 407 * 408 * @param array<string, mixed> $post_data POST data from the notification. 409 * @param string $secret_key Secret key for hash verification. 410 * 411 * @return bool True if hash is valid, false otherwise 412 * 413 * @link https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/06Instant_Payment_Notification_%2528IPN%2529/Calculate-the-IPN-HASH-signature 414 */ 415 public function is_valid_ipn_lcn_hash( array $post_data, string $secret_key ): bool { 212 416 213 417 $ipn_hash = $this->get_returned_hash( $post_data ); … … 221 425 } 222 426 223 public function generate_base_string_for_hash( $params ) { 427 /** 428 * Generate base string for hash calculation 429 * 430 * Creates a base string from parameters for hash calculation. 431 * Handles nested arrays and excludes hash-related parameters. 432 * 433 * @param array<string, mixed> $params Parameters to process. 434 * 435 * @return string Generated base string 436 */ 437 public function generate_base_string_for_hash( array $params ): string { 224 438 225 439 $string = ''; … … 239 453 } 240 454 241 public function kses_receipt_response_allowed_html() { 455 /** 456 * Get allowed HTML tags for receipt response 457 * 458 * Defines the allowed HTML tags and their attributes for use in 459 * receipt response sanitization. 460 * 461 * @return array<string, mixed> 462 * @since 1.0.0 463 */ 464 public function kses_receipt_response_allowed_html(): array { 242 465 return array( 243 466 'epayment' => array(), … … 249 472 } 250 473 251 // https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/08License_Change_Notification_%2528LCN%2529/LCN-read-receipt-response-for-2Checkout 252 // https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/IPN_and_LCN_URL_settings 253 // https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/06Instant_Payment_Notification_%2528IPN%2529/Calculate-the-IPN-HASH-signature 254 public function ipn_receipt_response( $post_data, $secret_key = false ) { 474 /** 475 * Generate IPN receipt response 476 * 477 * Creates a receipt response for IPN notifications in XML format. 478 * Supports multiple hash algorithms (MD5, SHA256, SHA3-256). 479 * 480 * @param array<string, mixed> $post_data POST data from the IPN. 481 * @param string|bool $secret_key Optional secret key, uses instance key if false. 482 * 483 * @return string|false XML receipt response or false on failure 484 * 485 * @link https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/08License_Change_Notification_%2528LCN%2529/LCN-read-receipt-response-for-2Checkout 486 * @link https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/IPN_and_LCN_URL_settings 487 * @link https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/06Instant_Payment_Notification_%2528IPN%2529/Calculate-the-IPN-HASH-signature 488 */ 489 public function ipn_receipt_response( array $post_data, $secret_key = false ) { 255 490 // <EPAYMENT>DATE|HASH</EPAYMENT> 256 491 // <sig algo="sha256" date="DATE">HASH</sig> … … 261 496 } 262 497 263 // Response issuing date (server time) in the YmdHis format (ex: 20081117145935) 498 // Response issuing date (server time) in the YmdHis format (ex: 20081117145935). 499 264 500 $receipt_date = gmdate( 'YmdHis' ); 265 501 … … 268 504 $post_data['IPN_PNAME'][0], 269 505 $post_data['IPN_DATE'], 270 // IPN date in the YmdHis format (ex: 20081117145935) 506 // IPN date in the YmdHis format (ex: 20081117145935). 271 507 $receipt_date, 272 508 ); 273 509 274 // CUSTOM IPN AND LCN CONFIGURATIONS 510 // CUSTOM IPN AND LCN CONFIGURATIONS. 275 511 if ( ! $secret_key ) { 276 512 $secret_key = $this->secret_key; … … 296 532 } 297 533 298 // sha256 and sha3-256 .534 // sha256 and sha3-256. 299 535 return sprintf( '<sig algo="%s" date="%s">%s</sig>', $get_algo, $receipt_date, $receipt_hash ); 300 536 … … 304 540 } 305 541 306 // https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/Signature_validation_for_return_URL_via_ConvertPlus 307 // https://verifone.cloud/docs/2checkout/Documentation/07Commerce/InLine-Checkout-Guide/Signature_validation_for_return_URL_via_InLine_checkout 308 309 public function generate_return_signature( $params, $buy_link_secret_word ) { 542 /** 543 * Generate return URL signature 544 * 545 * Creates a signature for return URL validation using SHA256. 546 * 547 * @param array<string, mixed> $params Return URL parameters. 548 * @param string $buy_link_secret_word Secret word for signature. 549 * 550 * @return string|false Generated signature or false if parameters invalid. 551 * 552 * @link https://verifone.cloud/docs/2checkout/Documentation/07Commerce/2Checkout-ConvertPlus/Signature_validation_for_return_URL_via_ConvertPlus 553 * @link https://verifone.cloud/docs/2checkout/Documentation/07Commerce/InLine-Checkout-Guide/Signature_validation_for_return_URL_via_InLine_checkout 554 */ 555 public function generate_return_signature( array $params, string $buy_link_secret_word ) { 310 556 311 557 if ( empty( $params ) || empty( $params['signature'] ) ) { … … 321 567 } 322 568 323 public function is_valid_return_signature( $params, $buy_link_secret_word ) { 569 /** 570 * Validate return URL signature 571 * 572 * Verifies the authenticity of return URL signatures. 573 * 574 * @param array<string, mixed> $params Return URL parameters including signature. 575 * @param string $buy_link_secret_word Secret word for signature validation. 576 * 577 * @return bool True if signature is valid, false otherwise. 578 * 579 * @link https://verifone.cloud/docs/2checkout/Documentation/07Commerce/InLine-Checkout-Guide/Signature_validation_for_return_URL_via_InLine_checkout 580 */ 581 public function is_valid_return_signature( array $params, string $buy_link_secret_word ): bool { 324 582 325 583 if ( empty( $params ) || empty( $params['signature'] ) ) { -
woo-2checkout/trunk/includes/Common.php
r3044506 r3256094 3 3 * Common Methods for Classes. 4 4 * 5 * @package \StorePress\TwoCheckoutPaymentGateway 6 * @since 1.0.0 5 * @package StorePress/TwoCheckoutPaymentGateway 6 * @since 0.1.0 7 * @version 0.1.0 7 8 */ 8 9 10 declare( strict_types=1 ); 11 9 12 namespace StorePress\TwoCheckoutPaymentGateway; 10 13 … … 12 15 13 16 trait Common { 14 /** 15 * Return singleton instance of Class. 16 * The instance will be created if it does not exist yet. 17 * 18 * @return self The main instance. 19 * @since 1.0.0 20 */ 21 final public static function instance(): self { 22 static $instance = null; 23 if ( is_null( $instance ) ) { 24 $instance = new self(); 25 } 26 27 return $instance; 17 18 /** 19 * Get data if set, otherwise return a default value or null. Prevents notices when data is not set. 20 * 21 * @param mixed $variable Variable. 22 * @param mixed $default_value Default value. 23 * 24 * @return mixed 25 * @since 1.0.0 26 */ 27 public function get_var( $variable, $default_value = null ) { 28 return true === isset( $variable ) ? $variable : $default_value; 29 } 30 31 /** 32 * Get $_GET data if set, otherwise return a default value or null. Prevents notices when data is not set. 33 * 34 * @param string $variable Variable. 35 * @param mixed $default_value Default value. 36 * 37 * @return mixed 38 * @since 1.0.0 39 */ 40 public function http_get_var( string $variable = '', $default_value = null ) { 41 $get_data = $_GET; // phpcs:ignore WordPress.Security.NonceVerification.Recommended 42 if ( $this->is_empty_string( $variable ) ) { 43 return $this->is_empty_array( $get_data ) ? false : $get_data; 44 } 45 return $this->get_var( $get_data[ $variable ], $default_value ); 46 } 47 48 /** 49 * Get $_POST data if set, otherwise return a default value or null. Prevents notices when data is not set. 50 * 51 * @param string $variable Variable. 52 * @param mixed $default_value Default value. 53 * 54 * @return mixed 55 * @since 1.0.0 56 */ 57 public function http_post_var( string $variable = '', $default_value = null ) { 58 $post_data = $_POST; // phpcs:ignore WordPress.Security.NonceVerification.Missing 59 if ( $this->is_empty_string( $variable ) ) { 60 return $this->is_empty_array( $post_data ) ? false : $post_data; 61 } 62 return $this->get_var( $post_data[ $variable ], $default_value ); 28 63 } 29 64 … … 31 66 * Create HTML Attributes from given array 32 67 * 33 * @param array $attributes Attribute array. 34 * @param array $exclude Exclude attribute. Default array. 35 * 36 * @return string 68 * @param array<string, mixed> $attributes Attribute array. 69 * @param string[] $exclude Exclude attribute. Default array. 70 * 71 * @return string 72 * @since 1.0.0 37 73 */ 38 74 public function get_html_attributes( array $attributes, array $exclude = array() ): string { 39 40 $attrs = array_map( 41 function ( $key ) use ( $attributes, $exclude ) { 42 43 // Exclude attribute. 44 if ( in_array( $key, $exclude, true ) ) { 45 return ''; 46 } 47 48 $value = $attributes[ $key ]; 49 50 // If attribute value is null. 51 if ( is_null( $value ) ) { 52 return ''; 53 } 54 55 // If attribute value is boolean. 56 if ( is_bool( $value ) ) { 57 return $value ? $key : ''; 58 } 59 60 // If attribute value is array. 61 if ( is_array( $value ) ) { 62 $value = $this->get_css_classes( $value ); 63 } 64 65 return sprintf( '%s="%s"', esc_attr( $key ), esc_attr( $value ) ); 66 }, 67 array_keys( $attributes ) 68 ); 69 70 return implode( ' ', $attrs ); 75 $attrs = array(); 76 77 foreach ( $attributes as $attribute_name => $attribute_value ) { 78 // Exclude attribute. 79 if ( in_array( $attribute_name, $exclude, true ) ) { 80 continue; 81 } 82 83 // Skip if attribute value is blank. 84 if ( is_string( $attribute_value ) && $this->is_empty_string( $attribute_value ) ) { 85 continue; 86 } 87 88 // Skip if attribute value is null. 89 if ( is_null( $attribute_value ) ) { 90 continue; 91 } 92 93 // Skip if attribute value is boolean false. 94 if ( false === $attribute_value ) { 95 continue; 96 } 97 98 // If attribute is class and value is array. 99 if ( is_array( $attribute_value ) ) { 100 if ( 'class' === $attribute_name ) { 101 $attribute_value = $this->get_css_classes( $attribute_value ); 102 } else { 103 $attribute_value = wp_json_encode( $attribute_value ); 104 } 105 } 106 107 // If attribute is boolean true only use attribute name. 108 if ( true === $attribute_value ) { 109 $attrs[] = sprintf( '%s', esc_attr( $attribute_name ) ); 110 continue; 111 } 112 113 $attrs[] = sprintf( '%s="%s"', esc_attr( $attribute_name ), esc_attr( $attribute_value ) ); 114 } 115 116 return implode( ' ', array_unique( $attrs ) ); 71 117 } 72 118 … … 75 121 * Generate Inline Style from array 76 122 * 77 * @param array $inline_styles_array Inline style as array.78 * 79 * @return string 80 * @since 1.0.0123 * @param array<string, mixed> $inline_styles_array Inline style as array. 124 * 125 * @return string 126 * @since 1.0.0 81 127 */ 82 128 public function get_inline_styles( array $inline_styles_array = array() ): string { 83 84 129 $styles = array(); 85 130 … … 88 133 continue; 89 134 } 135 if ( is_bool( $value ) ) { 136 continue; 137 } 138 139 if ( is_array( $value ) ) { 140 continue; 141 } 142 143 if ( is_string( $value ) && $this->is_empty_string( $value ) ) { 144 continue; 145 } 146 90 147 $styles[] = sprintf( '%s: %s;', esc_attr( $property ), esc_attr( $value ) ); 91 148 } 92 149 93 return implode( ' ', $styles);150 return implode( ' ', array_unique( $styles ) ); 94 151 } 95 152 … … 97 154 * Array to css class. 98 155 * 99 * @param array $classes_array css classes array. 100 * 101 * @return string 102 * @since 1.0.0 156 * @param array<int|string, ?mixed> $classes_array css classes array. 157 * 158 * @return string 159 * @since 1.0.0 160 * @example 161 * <code> 162 * ['class-a', 'class-b'] 163 * // or 164 * ['class-a'=>true, 'class-b'=>false, 'class-c'=>'', 'class-e'=>null, 'class-d'=>'hello'] 165 * </code> 103 166 */ 104 167 public function get_css_classes( array $classes_array = array() ): string { 105 106 168 $classes = array(); 107 108 169 foreach ( $classes_array as $class_name => $should_include ) { 109 110 if ( empty( $should_include ) ) { 111 continue; 112 } 113 114 $classes[] = esc_attr( $class_name ); 170 // Is class assign by numeric array. Like: ['class-a', 'class-b']. 171 if ( is_int( $class_name ) ) { 172 if ( ! is_string( $should_include ) ) { 173 continue; 174 } 175 176 if ( $this->is_empty_string( $should_include ) ) { 177 continue; 178 } 179 180 $classes[] = $should_include; 181 continue; 182 } 183 184 if ( false === $should_include ) { 185 continue; 186 } 187 188 if ( is_string( $should_include ) && $this->is_empty_string( $should_include ) ) { 189 continue; 190 } 191 192 if ( is_null( $should_include ) ) { 193 continue; 194 } 195 196 if ( is_array( $should_include ) && $this->is_empty_array( $should_include ) ) { 197 continue; 198 } 199 200 // Is class assign by associative array. 201 // Like: ['class-a'=>true, 'class-b'=>false, class-c'=>'', 'class-d'=>'hello', 'class-x'=>null, 'class-y'=>array()]. 202 $classes[] = $class_name; 115 203 } 116 204 … … 119 207 120 208 /** 209 * Check is string is empty. 210 * 211 * @param string $check_value Check value. 212 * 213 * @return bool 214 */ 215 public function is_empty_string( string $check_value = '' ): bool { 216 return 0 === strlen( trim( $check_value ) ); 217 } 218 219 /** 220 * Check is array is all empty values. 221 * 222 * @param array<int|string, ?mixed> $items Check array. 223 * 224 * @return bool 225 */ 226 public function is_array_each_empty_value( array $items = array() ): bool { 227 $checked = array_map( 228 function ( $value ) { 229 if ( is_array( $value ) && ! $this->is_array_each_empty_value( $value ) ) { 230 return true; 231 } 232 233 if ( is_string( $value ) && ! $this->is_empty_string( $value ) ) { 234 return true; 235 } 236 237 if ( true === $value ) { 238 return true; 239 } 240 241 return false; 242 }, 243 $items 244 ); 245 246 return ! in_array( true, array_unique( $checked ), true ); 247 } 248 249 /** 250 * Check numeric array is empty. 251 * 252 * @param array<int|string, ?mixed> $items Check array. 253 * 254 * @return bool 255 */ 256 public function is_empty_array( array $items = array() ): bool { 257 return 0 === count( $items ); 258 } 259 260 /** 261 * Converts a bool to a 'yes' or 'no'. 262 * 263 * @param mixed $check_value Bool to convert. If a string is passed it will first be converted to a bool. 264 * 265 * @return string 266 * @since 1.0.0 267 */ 268 public function boolean_to_string( $check_value ): string { 269 $value = $this->string_to_boolean( $check_value ); 270 271 return true === $value ? 'yes' : 'no'; 272 } 273 274 /** 121 275 * Converts a string (e.g. 'yes' or 'no') to a bool. 122 * 123 * @param string|bool $value String to convert. If a bool is passed it will be returned as-is. 276 * Recognizing words like Yes, No, Off, On, both string and native types of true and false, 277 * and is not case-sensitive when validating strings. 278 * 279 * @param mixed $check_value String to convert. If a bool is passed it will be returned as-is. 124 280 * 125 281 * @return boolean 126 282 * @since 1.0.0 127 283 */ 128 public function string_to_boolean( $value ): bool { 129 $value = $value ?? ''; 130 131 return is_bool( $value ) ? $value : ( 'yes' === strtolower( $value ) || 1 === $value || 'true' === strtolower( $value ) || '1' === $value ); 132 } 133 134 /** 135 * Converts a bool to a 'yes' or 'no'. 136 * 137 * @param bool|string $value Bool to convert. If a string is passed it will first be converted to a bool. 138 * 139 * @return string 140 * @since 1.0.0 141 */ 142 public function boolean_to_string( $value ): string { 143 if ( ! is_bool( $value ) ) { 144 $value = $this->string_to_boolean( $value ); 145 } 146 147 return true === $value ? 'yes' : 'no'; 148 } 149 150 /** 151 * Generates a user-level error/warning/notice/deprecation message. 152 * 153 * Generates the message when `WP_DEBUG` is true. 154 * 155 * @param string $function_name The function that triggered the error. 156 * @param string $message The message explaining the error. 157 * The message can contain allowed HTML 'a' (with href), 'code', 158 * 'br', 'em', and 'strong' tags and http or https protocols. 159 * If it contains other HTML tags or protocols, the message should be escaped 160 * before passing to this function to avoid being stripped {@see wp_kses()}. 161 * 162 * @since 1.0.0 163 */ 164 public function trigger_error( string $function_name, string $message ) { 165 166 // Bail out if WP_DEBUG is not turned on. 167 if ( ! WP_DEBUG ) { 168 return; 169 } 170 171 if ( function_exists( 'wp_trigger_error' ) ) { 172 wp_trigger_error( $function_name, $message ); 173 } else { 174 175 if ( ! empty( $function_name ) ) { 176 $message = sprintf( '%s(): %s', $function_name, $message ); 177 } 178 179 $message = wp_kses( 180 $message, 181 array( 182 'a' => array( 'href' ), 183 'br', 184 'code', 185 'em', 186 'strong', 187 ), 188 array( 'http', 'https' ) 189 ); 190 191 // phpcs:ignore 192 trigger_error( $message ); 193 } 194 } 195 196 /** 197 * Prevent cloning. 198 */ 199 private function __clone() { 200 } 201 202 /** 203 * Prevent unserializing. 204 */ 205 final public function __wakeup() { 206 $this->trigger_error( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'woo-2checkout' ) ); 207 die(); 284 public function string_to_boolean( $check_value ): bool { 285 return filter_var( $check_value, FILTER_VALIDATE_BOOLEAN ); 208 286 } 209 287 } -
woo-2checkout/trunk/includes/ConvertPlus/ConvertPlus_Block.php
r3044506 r3256094 6 6 * @since 1.0.0 7 7 */ 8 9 declare( strict_types=1 ); 8 10 9 11 namespace StorePress\TwoCheckoutPaymentGateway\ConvertPlus; … … 30 32 * Selected Gateway 31 33 * 32 * @var ConvertPlus_Gateway |ConvertPlus_Gateway_ProConvert plus gateway class.34 * @var ConvertPlus_Gateway Convert plus gateway class. 33 35 */ 34 36 protected $gateway; … … 36 38 /** 37 39 * Initializes the payment method type. 40 * 41 * @return void 38 42 */ 39 43 public function initialize() { 40 44 $option = sprintf( 'woocommerce_%s_settings', $this->get_name() ); 41 45 $this->settings = get_option( $option, array() ); 42 $gateways = WC()->payment_gateways ->payment_gateways();46 $gateways = WC()->payment_gateways()->payment_gateways(); 43 47 $this->gateway = $gateways[ $this->get_name() ]; 44 48 } … … 46 50 /** 47 51 * Get gateway instance. 52 * 53 * @return ConvertPlus_Gateway 48 54 */ 49 55 public function get_gateway() { … … 63 69 * Returns an array of key=>value pairs of data made available to the payment methods script. 64 70 * 65 * @return array 71 * @return array<string, mixed> 66 72 */ 67 73 public function get_payment_method_data(): array { … … 70 76 return array( 71 77 'is_demo' => wc_string_to_bool( $this->get_setting( 'demo', 'yes' ) ), 72 // 'icon_width' => $this->get_setting( 'icon_width', '50' ),73 78 'icon_uri' => $this->get_gateway()->get_icon_url(), 74 79 'order_button_text' => $this->get_setting( 'order_button_text', esc_html__( 'Proceed to 2Checkout', 'woo-2checkout' ) ), … … 93 98 * the frontend context 94 99 * 95 * @return array100 * @return string[] 96 101 */ 97 102 public function get_payment_method_script_handles(): array { 103 98 104 $script_asset_path = woo_2checkout()->build_path() . '/convert-plus-block.asset.php'; 99 105 -
woo-2checkout/trunk/includes/ConvertPlus/ConvertPlus_Gateway.php
r3140508 r3256094 7 7 */ 8 8 9 declare( strict_types=1 ); 10 9 11 namespace StorePress\TwoCheckoutPaymentGateway\ConvertPlus; 10 12 11 13 defined( 'ABSPATH' ) || die( 'Keep Silent' ); 12 14 15 use StorePress\TwoCheckoutPaymentGateway\Common; 13 16 use StorePress\TwoCheckoutPaymentGateway\Payment_Gateway; 14 17 use WC_Order; 18 use WC_Order_Item_Product; 15 19 16 20 /** … … 20 24 * 21 25 * @class ConvertPlus_Gateway 22 * @extends Payment_Gateway23 26 */ 24 27 class ConvertPlus_Gateway extends Payment_Gateway { 25 28 29 use Common; 30 26 31 /** 27 32 * Process after gateway redirect. … … 31 36 public function process_gateway_redirect() { 32 37 33 $data = stripslashes_deep( $ _GET ); // phpcs:ignore.38 $data = stripslashes_deep( $this->http_get_var() ); 34 39 35 40 do_action( 'woo_2checkout_process_gateway_redirect', $data, $this ); … … 38 43 nocache_headers(); 39 44 40 $this->log( "Gateway Redirect Response \n" . print_r( $data, true ) ); // phpcs:ignore.45 $this->log( 'Gateway Redirect Response:', $data ); 41 46 42 47 if ( empty( $data['order-ext-ref'] ) ) { … … 54 59 } 55 60 56 $this->log( "Gateway Return Signature: \n" . print_r( // phpcs:ignore. 57 array( 58 'wc generated' => $this->get_api()->generate_return_signature( $data, $this->buy_link_secret_word ), 59 '2co returned' => $data['signature'], 60 ), true ) ); 61 $this->log( 62 'Gateway Return Signature', 63 array( 64 'wc generated' => $this->get_api()->generate_return_signature( $data, $this->buy_link_secret_word ), 65 '2co returned' => $data['signature'], 66 ) 67 ); 61 68 62 69 if ( ! $this->get_api()->is_valid_return_signature( $data, $this->buy_link_secret_word ) ) { … … 88 95 public function process_gateway_ipn_response() { 89 96 90 if ( ! $ _POST ) { // phpcs:ignore97 if ( ! $this->http_post_var() ) { 91 98 return; 92 99 } 93 100 94 101 // Don't alter any value otherwise 2checkout hash won't be matched. 95 $data = stripslashes_deep( $ _POST ); // phpcs:ignore102 $data = stripslashes_deep( $this->http_post_var() ); 96 103 97 104 do_action( 'woo_2checkout_gateway_process_ipn_response', $data, $this ); … … 104 111 $ipn_receipt = $this->get_api()->ipn_receipt_response( $data ); 105 112 106 // $this->log( "IPN Base String For Hash: \n" . print_r( $base_string_for_hash, true ) ); // phpcs:ignore 107 $this->log( "IPN Response: \n" . print_r( $data, true ), 'info' ); // phpcs:ignore 108 $this->log( "IPN receipt_response: \n" . print_r( $ipn_receipt, true ), 'info' ); // phpcs:ignore 113 $this->log( 'IPN Response:', $data ); 114 $this->log( 'IPN receipt_response:', array( 'ipn_receipt' => $ipn_receipt ) ); 109 115 110 116 if ( $ipn_receipt ) { … … 117 123 echo wp_kses( $ipn_receipt, $this->get_api()->kses_receipt_response_allowed_html() ); 118 124 do_action( 'woo_2checkout_gateway_process_ipn_response_invalid_order', $data, $this ); 119 $this->log( sprintf( 'Order# %d is not available.', $order_id ) , 'error');125 $this->log( sprintf( 'Order# %d is not available.', $order_id ) ); 120 126 exit(); 121 127 } … … 171 177 172 178 default: 173 $this->log( sprintf( "IPN Response: ORDERSTATUS = %s \n", $data['ORDERSTATUS'] ) . print_r( $data, true ), 'info' ); // phpcs:ignore179 $this->log( sprintf( "IPN Response: ORDERSTATUS = %s \n", $data['ORDERSTATUS'] ), $data ); 174 180 break; 175 181 } … … 178 184 echo wp_kses( $ipn_receipt, $this->get_api()->kses_receipt_response_allowed_html() ); 179 185 } else { 180 $this->log( 'No IPN Receipt Response Code Generated.' , 'error');186 $this->log( 'No IPN Receipt Response Code Generated.' ); 181 187 echo 'No IPN Receipt Generated.'; 182 188 } … … 189 195 * @param WC_Order $order Order. 190 196 * 191 * @return mixed|null192 */ 193 public function get_checkout_order_received_url( WC_Order $order ) {194 $order_received_url = wc_get_endpoint_url( 'downloads', $order->get_id(), wc_get_page_permalink( 'my-account' ) );197 * @return string 198 */ 199 public function get_checkout_order_received_url( WC_Order $order ): string { 200 $order_received_url = wc_get_endpoint_url( 'downloads', (string) $order->get_id(), wc_get_page_permalink( 'my-account' ) ); 195 201 196 202 if ( 'yes' === get_option( 'woocommerce_force_ssl_checkout' ) || is_ssl() ) { … … 206 212 * Get Generated ConvertPlus URL. 207 213 * 208 * @param array $parameters url params.214 * @param array<string, mixed> $parameters url params. 209 215 * 210 216 * @return string … … 219 225 * @param WC_Order $order Order. 220 226 * 221 * @return mixed|null 222 */ 223 public function payment_args( WC_Order $order ) { 224 225 $ship_to_different_address = ! empty( $_POST['ship_to_different_address'] ) && ! wc_ship_to_billing_address_only(); // phpcs:ignore. 227 * @return array<string, mixed> 228 */ 229 public function payment_args( WC_Order $order ): array { 230 231 $is_ship_to_different_address = wc_string_to_bool( $this->http_post_var( 'ship_to_different_address', false ) ); 232 233 $ship_to_different_address = $is_ship_to_different_address && ! wc_ship_to_billing_address_only(); 226 234 227 235 $args = array(); … … 259 267 260 268 if ( $order->has_billing_address() ) { 261 $args['address'] = esc_html( $order->get_billing_address_1() );262 if ( $order->get_billing_address_2() ){269 $args['address'] = esc_html( $order->get_billing_address_1() ); 270 if ( $order->get_billing_address_2() ) { 263 271 $args['address2'] = esc_html( $order->get_billing_address_2() ); 264 272 } … … 342 350 foreach ( $order->get_items() as $item ) { 343 351 344 // $item = new WC_Order_Item_Product(); // WC_Order_Item345 346 $product = $item->get_product();352 $item_id = $item->get_id(); 353 $order_item = new WC_Order_Item_Product( $item_id ); 354 $product = $order_item->get_product(); 347 355 348 356 if ( ! $product ) { … … 352 360 $product_info['prod'][] = $this->format_item_name( $item->get_name() ); 353 361 $product_info['price'][] = $this->format_item_price( $order->get_item_total( $item ) ); 354 $product_info['qty'][] = $item->get_quantity(); // get_item_total362 $product_info['qty'][] = $item->get_quantity(); 355 363 356 364 if ( $product->is_downloadable() || $product->is_virtual() ) { … … 388 396 foreach ( $order->get_fees() as $item ) { 389 397 390 // new WC_Order_Item_Fee() 398 // Item will be "new WC_Order_Item_Fee()". 399 391 400 $product_info['type'][] = 'tax'; 392 401 $product_info['prod'][] = $this->format_item_name( $item->get_name() ); … … 436 445 * @param int $order_id Order ID. 437 446 * 438 * @return array 447 * @return array<string, mixed> 439 448 */ 440 449 public function process_payment( $order_id ): array { … … 443 452 $parameters = $this->payment_args( $order ); 444 453 445 ksort( $parameters );446 447 $this->log( "PAYMENT ARGS:\n" . print_r( $parameters, true ) ); // phpcs:ignore.454 ksort( $parameters ); 455 456 $this->log( 'PAYMENT ARGS:', $parameters ); 448 457 449 458 $payment_url = $this->get_payment_url( $parameters ); 450 459 451 $this->log( "PAYMENT LINK:\n" . $payment_url ); // phpcs:ignore.460 $this->log( 'Generated PAYMENT LINK:', array( 'payment_link' => $payment_url ) ); 452 461 453 462 if ( ! empty( $payment_url ) ) { 463 454 464 return array( 455 465 'result' => 'success', -
woo-2checkout/trunk/includes/Extended_Plugin_Upgrade_Notice.php
r3044506 r3256094 6 6 * @since 1.0.0 7 7 */ 8 9 declare( strict_types=1 ); 8 10 9 11 namespace StorePress\TwoCheckoutPaymentGateway; … … 38 40 */ 39 41 public function plugin_file(): string { 40 return 'woo-2checkout-pro/woo-2checkout-pro.php';42 return woo_2checkout()->get_pro_plugin_file(); 41 43 } 42 44 … … 56 58 */ 57 59 public function deactivate_incompatible(): bool { 58 return false;60 return true; 59 61 } 60 62 -
woo-2checkout/trunk/includes/Payment_Gateway.php
r3081706 r3256094 6 6 */ 7 7 8 declare( strict_types=1 ); 9 8 10 namespace StorePress\TwoCheckoutPaymentGateway; 9 11 … … 20 22 * 21 23 * @class Payment_Gateway 22 * @extends WC_Payment_Gateway23 24 */ 24 25 class Payment_Gateway extends WC_Payment_Gateway { … … 136 137 public function hook() { 137 138 139 // @phpstan-ignore-next-line 138 140 add_action( 139 141 'woocommerce_update_options_payment_gateways_woo-2checkout', … … 211 213 $icon_url = $this->get_icon_url(); 212 214 213 return sprintf( '<img class="woo-2checkout-gateway-pay-image" alt="%s" src="%s" style="width: %d%%" />', esc_attr( $this->order_button_text ), esc_url( $icon_url ), absint( $this->icon_width ) ); 215 return sprintf( '<img class="woo-2checkout-gateway-pay-image" alt="%s" src="%s" style="width: %d%%" />', esc_attr( $this->order_button_text ), esc_url( $icon_url ), absint( $this->icon_width ) ); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage 214 216 } 215 217 … … 227 229 * 228 230 * Add an array of fields to be displayed on the gateway's settings screen. 231 * 232 * @return void 229 233 */ 230 234 public function init_form_fields() { … … 354 358 * Generate Select HTML. 355 359 * 356 * @param string $key Field key.357 * @param array $data Field data.360 * @param string $key Field key. 361 * @param array<string, mixed> $data Field data. 358 362 * 359 363 * @return string … … 381 385 <tr> 382 386 <th scope="row" class="titledesc"> 383 <label 384 for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?><?php echo $this->get_tooltip_html( $data ); // phpcs:ignore ?></label> 387 <label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?><?php echo $this->get_tooltip_html( $data ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></label> 385 388 </th> 386 389 <td class="forminp"> 387 390 <fieldset> 388 <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span> 389 </legend> 391 <legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend> 390 392 <select class="select <?php echo esc_attr( $data['class'] ); ?>" 391 393 name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" 392 style="<?php echo esc_attr( $data['css'] ); ?>" <?php echo $this->get_custom_attribute_html( $data ); // phpcs:ignore ?>>394 style="<?php echo esc_attr( $data['css'] ); ?>" <?php echo $this->get_custom_attribute_html( $data ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> 393 395 <?php foreach ( (array) $data['options'] as $option_key => $option_value ) : ?> 394 396 <option 395 <?php 396 disabled( $data['disabled'], true ); 397 ?> 397 <?php disabled( $data['disabled'] ); ?> 398 398 value="<?php echo esc_attr( $option_key ); ?>" 399 <?php 400 selected( (string) $option_key, esc_attr( $value ) ); 401 ?> 399 <?php selected( (string) $option_key, esc_attr( $value ) ); ?> 402 400 ><?php echo esc_html( $option_value ); ?></option> 403 401 <?php endforeach; ?> 404 402 </select> 405 <?php echo $this->get_description_html( $data ); // phpcs:ignore ?>403 <?php echo $this->get_description_html( $data ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> 406 404 </fieldset> 407 405 </td> … … 640 638 /** Log 641 639 * 642 * @param string $message log message. 643 * @param string $level log label. 644 * 'emergency': System is unusable. 645 * 'alert': Action must be taken immediately. 646 * 'critical': Critical conditions. 647 * 'error': Error conditions. 648 * 'warning': Warning conditions. 649 * 'notice': Normal but significant condition. 650 * 'info': Informational messages. 651 * 'debug': Debug-level messages. 652 */ 653 public function log( string $message, string $level = 'info' ) { 654 640 * @param string $title log title. 641 * @param array<string|int, mixed> $message log message. 642 * 643 * @return void 644 */ 645 public function log( string $title, array $message = array() ) { 655 646 if ( ! $this->debug ) { 656 647 return; 657 648 } 658 649 659 $context = array( 'source' => $this->get_id() ); 660 661 $this->log->log( $level, $message, $context ); 650 $context = array( 651 'source' => $this->get_id(), 652 ); 653 654 wc_get_logger()->info( $title, array_merge( $message, $context ) ); 662 655 } 663 656 … … 770 763 $secret_key = sprintf( 'woocommerce_%s_secret_key', $this->get_id() ); 771 764 $buy_link_secret_word = sprintf( 'woocommerce_%s_buy_link_secret_word', $this->get_id() ); 772 $data = stripslashes_deep( $_POST ); // phpcs:ignore 765 $data = stripslashes_deep( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing 773 766 774 767 if ( ! empty( $data[ $merchant_code ] ) && ! empty( $data[ $secret_key ] ) && ! empty( $data[ $buy_link_secret_word ] ) ) { … … 828 821 */ 829 822 public function process_gateway_ins_response() { 830 $data = stripslashes_deep( $_POST ); // phpcs:ignore 831 $this->log( "INS Response: \n" . print_r( $data, true ), 'info' ); // phpcs:ignore823 $data = stripslashes_deep( $_POST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing 824 $this->log( 'INS Response:', $data ); 832 825 do_action( 'woo_2checkout_gateway_process_ins_response', $data, $this ); 833 826 } -
woo-2checkout/trunk/includes/Plugin.php
r3140508 r3256094 6 6 * @since 1.0.0 7 7 */ 8 9 declare( strict_types=1 ); 8 10 9 11 namespace StorePress\TwoCheckoutPaymentGateway; … … 47 49 */ 48 50 protected function __construct() { 51 49 52 try { 50 53 $this->includes(); … … 52 55 $this->init(); 53 56 } catch ( Exception $e ) { 54 $this->trigger_error( __METHOD__, $e->getMessage() ); 57 58 $message = sprintf( '<strong>%s:</strong> %s', $this->name(), $e->getMessage() ); 59 add_action( 60 'admin_notices', 61 function () use ( $message ) { 62 printf( '<div class="notice notice-error"><p>%s</p></div>', wp_kses_data( $message ) ); 63 }, 64 50 65 ); 55 66 } 56 67 … … 58 69 * Action to signal that Plugin has finished loading. 59 70 * 60 * @param Plugin $ thisPlugin Object.71 * @param Plugin $instance Plugin Object. 61 72 * 62 73 * @since 1.0.0 … … 76 87 77 88 /** 89 * Plugin Absolute File for PRO Plugin. 90 * 91 * @return string 92 * @since 1.0.0 93 */ 94 public function get_pro_plugin_file(): string { 95 return woo_2checkout_pro_plugin_file(); 96 } 97 98 /** 78 99 * Get Compatible Extended Plugin Version. 79 100 * … … 82 103 */ 83 104 public function get_compatible_extended_version(): string { 84 return constant( 'STOREPRESS_TWO_CHECKOUT_COMPATIBLE_EXTENDED_VERSION');105 return woo_2checkout_compatible_pro_version(); 85 106 } 86 107 … … 101 122 } 102 123 103 104 /** 105 * Set constant if not defined and prevent reassign 106 * 107 * @param string $name Constant name. 108 * @param mixed $value Constant value. 109 * 110 * @return void. 111 * @since 1.0.0 112 */ 113 public function define( string $name, $value ) { 114 if ( ! defined( $name ) ) { 115 // phpcs:ignore 116 define( $name, $value ); 117 } 124 /** 125 * Get Plugin Name. 126 * 127 * @return string 128 * @since 1.0.0 129 */ 130 public function name(): string { 131 static $names; 132 133 if ( is_null( $names ) ) { 134 $names = get_file_data( $this->get_plugin_file(), array( 'Plugin Name' ) ); 135 } 136 137 return esc_attr( $names[0] ); 118 138 } 119 139 … … 122 142 * 123 143 * @throws Exception When class files loading fails. 144 * @return void 124 145 * @since 1.0.0 125 146 */ … … 132 153 } 133 154 134 throw new Exception( ' "vendor/autoload_packages.php" file missing. Please run `composer install`' );155 throw new Exception( '<em>vendor/autoload_packages.php</em> file missing. Please run <code>composer install</code>' ); 135 156 } 136 157 … … 139 160 * 140 161 * @since 1.0.0 162 * @return void 141 163 */ 142 164 public function init() { … … 153 175 public function hooks() { 154 176 // Register with hook. 155 add_action( 'init', array( $this, 'language' ), 1 ); 177 178 add_action( 'init', array( $this, 'load_translations' ) ); 156 179 157 180 add_filter( 'woocommerce_payment_gateways', array( $this, 'add_gateways' ) ); … … 163 186 add_filter( 'plugin_action_links_' . $this->plugin_basename(), array( $this, 'plugin_action_links' ) ); 164 187 165 add_filter( 166 'woocommerce_no_available_payment_methods_message', 167 array( 168 $this, 169 'available_payment_methods_message', 170 ) 171 ); 188 add_filter( 'woocommerce_no_available_payment_methods_message', array( $this, 'available_payment_methods_message' ) ); 189 } 190 191 /** 192 * Load Plugin Translation Files. 193 * 194 * @return void 195 */ 196 public function load_translations() { 197 load_plugin_textdomain( 'woo-2checkout', false, $this->plugin_dirname() . '/languages' ); 172 198 } 173 199 … … 189 215 190 216 /** 191 * Language192 *193 * @return void194 * @since 1.0.0195 */196 public function language() {197 load_plugin_textdomain( 'woo-2checkout', false, $this->plugin_path() . '/languages' );198 }199 200 /**201 217 * Get Plugin basename directory name 202 218 * … … 341 357 342 358 /** 343 * Generates a user-level error/warning/notice/deprecation message.344 *345 * Generates the message when `WP_DEBUG` is true.346 *347 * @param string $function_name The function that triggered the error.348 * @param string $message The message explaining the error.349 * The message can contain allowed HTML 'a' (with href), 'code',350 * 'br', 'em', and 'strong' tags and http or https protocols.351 * If it contains other HTML tags or protocols, the message should be escaped352 * before passing to this function to avoid being stripped {@see wp_kses()}.353 *354 * @since 1.0.0355 */356 public function trigger_error( string $function_name, string $message ) {357 358 // Bail out if WP_DEBUG is not turned on.359 if ( ! WP_DEBUG ) {360 return;361 }362 363 if ( function_exists( 'wp_trigger_error' ) ) {364 wp_trigger_error( $function_name, $message );365 } else {366 367 if ( ! empty( $function_name ) ) {368 $message = sprintf( '%s(): %s', $function_name, $message );369 }370 371 $message = wp_kses(372 $message,373 array(374 'a' => array( 'href' ),375 'br',376 'code',377 'em',378 'strong',379 ),380 array( 'http', 'https' )381 );382 383 // phpcs:ignore384 trigger_error( $message );385 }386 }387 388 // Add Features...389 // Happy Coding.390 391 /**392 359 * Get payment gateway class name by checkout type. 393 360 * … … 411 378 * Add gateway class name. 412 379 * 413 * @param array$methods gateway names.414 * 415 * @return array380 * @param string[] $methods gateway names. 381 * 382 * @return string[] 416 383 */ 417 384 public function add_gateways( array $methods ): array { … … 465 432 * Add new action link. 466 433 * 467 * @param array $links available action links.468 * 469 * @return array 434 * @param array<string, string> $links available action links. 435 * 436 * @return array<string, string> 470 437 */ 471 438 public function plugin_action_links( array $links ): array { … … 487 454 } 488 455 456 489 457 /** 490 458 * Get Gateway class instance. … … 494 462 public function get_gateway(): Payment_Gateway { 495 463 $gateway_id = 'woo-2checkout'; 496 $payment_gateways = WC()->payment_gateways ->payment_gateways();464 $payment_gateways = WC()->payment_gateways()->payment_gateways(); 497 465 498 466 return $payment_gateways[ $gateway_id ]; … … 501 469 /** 502 470 * Loads the dependency injection container. 471 * 472 * @return void 503 473 */ 504 474 public function register_dependencies() { … … 518 488 * Loads the dependency injection container. 519 489 * 520 * @return Container ;490 * @return Container 521 491 */ 522 492 public function container(): Container { -
woo-2checkout/trunk/includes/functions.php
r3044506 r3256094 7 7 */ 8 8 9 declare( strict_types=1 ); 10 9 11 namespace StorePress\TwoCheckoutPaymentGateway; 10 12 -
woo-2checkout/trunk/languages/woo-2checkout.pot
r3140508 r3256094 1 # Copyright (C) 202 4Emran Ahmed1 # Copyright (C) 2025 Emran Ahmed 2 2 # This file is distributed under the GPL v3 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Payment Gateway - 2Checkout for WooCommerce 3.0.3\n"6 "Report-Msgid-Bugs-To: https:// getwooplugins.com/new-ticket/\n"5 "Project-Id-Version: WC Paddle by StorePress 3.1.0\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woo-2checkout\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 8 8 "Language-Team: LANGUAGE <LL@li.org>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-08-23T18:38:11+00:00\n"12 "POT-Creation-Date: 2025-03-14T19:08:15+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" 15 "language-team: LANGUAGE <EMAIL@ADDRESS>\n"16 15 "X-Domain: woo-2checkout\n" 17 16 … … 41 40 msgstr "" 42 41 43 #: includes/Common.php:206 44 msgid "Unserializing instances of this class is forbidden." 45 msgstr "" 46 47 #: includes/ConvertPlus/ConvertPlus_Block.php:74 42 #: includes/ConvertPlus/ConvertPlus_Block.php:79 43 #: includes/Payment_Gateway.php:103 44 #: includes/Payment_Gateway.php:264 45 #: build/convert-plus-block.js:1593 46 #: src/convert-plus-block.js:22 47 #: build/convert-plus-block.js:1457 48 msgid "Proceed to 2Checkout" 49 msgstr "" 50 51 #: includes/ConvertPlus/ConvertPlus_Block.php:80 52 #: includes/Payment_Gateway.php:101 53 #: includes/Payment_Gateway.php:249 54 #: build/convert-plus-block.js:1592 55 #: src/convert-plus-block.js:21 56 #: build/convert-plus-block.js:1456 57 msgid "2Checkout" 58 msgstr "" 59 60 #: includes/ConvertPlus/ConvertPlus_Block.php:81 48 61 #: includes/Payment_Gateway.php:102 49 #: includes/Payment_Gateway.php:260 50 #: build/convert-plus-block.js:1 51 msgid "Proceed to 2Checkout" 52 msgstr "" 53 54 #: includes/ConvertPlus/ConvertPlus_Block.php:75 55 #: includes/Payment_Gateway.php:100 56 #: includes/Payment_Gateway.php:245 57 #: build/convert-plus-block.js:1 58 msgid "2Checkout" 59 msgstr "" 60 61 #: includes/ConvertPlus/ConvertPlus_Block.php:76 62 #: includes/Payment_Gateway.php:101 63 #: includes/Payment_Gateway.php:253 62 #: includes/Payment_Gateway.php:257 64 63 msgid "Pay via 2Checkout. Accept Credit Cards, PayPal and Debit Cards." 65 64 msgstr "" 66 65 67 66 #. translators: Shipping Method Name 68 #: includes/ConvertPlus/ConvertPlus_Gateway.php:4 0367 #: includes/ConvertPlus/ConvertPlus_Gateway.php:412 69 68 msgid "Shipping via %s" 70 69 msgstr "" 71 70 72 #: includes/ConvertPlus/ConvertPlus_Gateway.php:4 6071 #: includes/ConvertPlus/ConvertPlus_Gateway.php:470 73 72 msgid "Failed to Generate 2Checkout ConvertPlus URL." 74 73 msgstr "" 75 74 76 75 #. translators: 1: Extended Plugin Name. 2: Extended Plugin Version. 3: Extended Plugin Compatible Version. 77 #: includes/Extended_Plugin_Upgrade_Notice.php: 6876 #: includes/Extended_Plugin_Upgrade_Notice.php:70 78 77 msgid "You are using an incompatible version of <strong>%1$s - (%2$s)</strong>. Please upgrade to version <strong>%3$s</strong> or upper." 79 78 msgstr "" 80 79 81 #: includes/Payment_Gateway.php:9 080 #: includes/Payment_Gateway.php:91 82 81 msgid "2Checkout Payment Gateway" 83 82 msgstr "" 84 83 85 #: includes/Payment_Gateway.php:9 184 #: includes/Payment_Gateway.php:92 86 85 msgid "2Checkout accept mobile and online payments from customers worldwide." 87 86 msgstr "" 88 87 89 88 #. translators: Demo mode test payment. %s: Test payment card link. 90 #: includes/Payment_Gateway.php:11 789 #: includes/Payment_Gateway.php:118 91 90 msgid "<strong>DEMO MODE ENABLED.</strong> Use a %s" 92 91 msgstr "" 93 92 94 #: includes/Payment_Gateway.php:23 593 #: includes/Payment_Gateway.php:239 95 94 msgid "Enable/Disable" 96 95 msgstr "" 97 96 98 #: includes/Payment_Gateway.php:2 3797 #: includes/Payment_Gateway.php:241 99 98 msgid "Enable 2Checkout Payment Gateway" 100 99 msgstr "" 101 100 102 #: includes/Payment_Gateway.php:24 2101 #: includes/Payment_Gateway.php:246 103 102 msgid "Title" 104 103 msgstr "" 105 104 106 #: includes/Payment_Gateway.php:24 4105 #: includes/Payment_Gateway.php:248 107 106 msgid "This controls the title which the user sees during checkout." 108 107 msgstr "" 109 108 110 #: includes/Payment_Gateway.php:25 0109 #: includes/Payment_Gateway.php:254 111 110 msgid "Description" 112 111 msgstr "" 113 112 114 #: includes/Payment_Gateway.php:25 2113 #: includes/Payment_Gateway.php:256 115 114 msgid "This controls the description which the user sees during checkout." 116 115 msgstr "" 117 116 118 #: includes/Payment_Gateway.php:2 57117 #: includes/Payment_Gateway.php:261 119 118 msgid "Order button text" 120 119 msgstr "" 121 120 122 #: includes/Payment_Gateway.php:2 59121 #: includes/Payment_Gateway.php:263 123 122 msgid "Checkout order button text." 124 123 msgstr "" 125 124 126 #: includes/Payment_Gateway.php:26 5125 #: includes/Payment_Gateway.php:269 127 126 msgid "Read How to Setup" 128 127 msgstr "" 129 128 130 #: includes/Payment_Gateway.php:27 1129 #: includes/Payment_Gateway.php:275 131 130 msgid "Merchant Code" 132 131 msgstr "" 133 132 134 133 #. translators: Webhook URL 135 #: includes/Payment_Gateway.php:27 5134 #: includes/Payment_Gateway.php:279 136 135 msgid "Please enter 2Checkout <strong>Merchant Code</strong> from <a target=\"_blank\" href=\"%s\">Integrations > Webhooks & API > API Section</a>." 137 136 msgstr "" 138 137 139 #: includes/Payment_Gateway.php:2 79138 #: includes/Payment_Gateway.php:283 140 139 msgid "Secret Key" 141 140 msgstr "" 142 141 143 142 #. translators: Webhook URL 144 #: includes/Payment_Gateway.php:28 1143 #: includes/Payment_Gateway.php:285 145 144 msgid "Please enter 2Checkout <strong>Secret Key</strong> from <a target=\"_blank\" href=\"%s\">Integrations > Webhooks & API > API Section</a>" 146 145 msgstr "" 147 146 148 #: includes/Payment_Gateway.php:2 87147 #: includes/Payment_Gateway.php:291 149 148 msgid "Buy Link Secret Word" 150 149 msgstr "" 151 150 152 151 #. translators: Webhook URL 153 #: includes/Payment_Gateway.php:2 89152 #: includes/Payment_Gateway.php:293 154 153 msgid "Please enter 2Checkout <strong>Buy link secret word</strong> from <a target=\"_blank\" href=\"%s\">Integrations > Webhooks & API > Secret word</a> section" 155 154 msgstr "" 156 155 157 #: includes/Payment_Gateway.php:29 5156 #: includes/Payment_Gateway.php:299 158 157 msgid "Demo Mode" 159 158 msgstr "" 160 159 161 #: includes/Payment_Gateway.php: 297160 #: includes/Payment_Gateway.php:301 162 161 msgid "Enable Demo Mode" 163 162 msgstr "" 164 163 165 #: includes/Payment_Gateway.php: 299164 #: includes/Payment_Gateway.php:303 166 165 msgid "This mode allows you to test your setup to make sure everything works as expected without take real payment." 167 166 msgstr "" 168 167 169 #: includes/Payment_Gateway.php:30 3168 #: includes/Payment_Gateway.php:307 170 169 msgid "Debug Log" 171 170 msgstr "" 172 171 173 #: includes/Payment_Gateway.php:30 5172 #: includes/Payment_Gateway.php:309 174 173 msgid "Enable Logging" 175 174 msgstr "" 176 175 177 176 #. translators: WooCommerce Log URL 178 #: includes/Payment_Gateway.php:3 07177 #: includes/Payment_Gateway.php:311 179 178 msgid "Log 2Checkout events, <strong>DON'T ALWAYS ENABLE THIS.</strong> You can check this log in %s." 180 179 msgstr "" 181 180 182 181 #. translators: WooCommerce Log URL 183 #: includes/Payment_Gateway.php:3 07182 #: includes/Payment_Gateway.php:311 184 183 msgid "System Status > Logs" 185 184 msgstr "" 186 185 187 #: includes/Payment_Gateway.php:31 1186 #: includes/Payment_Gateway.php:315 188 187 msgid "Gateway Icon Style" 189 188 msgstr "" 190 189 191 #: includes/Payment_Gateway.php:31 4190 #: includes/Payment_Gateway.php:318 192 191 msgid "Choose Gateway a Icon Style" 193 192 msgstr "" 194 193 195 #: includes/Payment_Gateway.php:3 16194 #: includes/Payment_Gateway.php:320 196 195 msgid "Dark" 197 196 msgstr "" 198 197 199 #: includes/Payment_Gateway.php:3 17198 #: includes/Payment_Gateway.php:321 200 199 msgid "Light" 201 200 msgstr "" 202 201 203 #: includes/Payment_Gateway.php:32 3202 #: includes/Payment_Gateway.php:327 204 203 msgid "Gateway Icon Width" 205 204 msgstr "" 206 205 207 #: includes/Payment_Gateway.php:32 5206 #: includes/Payment_Gateway.php:329 208 207 msgid "Gateway Icon Width in %. Limit: 1-100" 209 208 msgstr "" 210 209 211 #: includes/Payment_Gateway.php:3 36212 #: includes/Payment_Gateway.php:3 39210 #: includes/Payment_Gateway.php:340 211 #: includes/Payment_Gateway.php:343 213 212 msgid "Choose checkout type" 214 213 msgstr "" 215 214 216 #: includes/Payment_Gateway.php:34 1215 #: includes/Payment_Gateway.php:345 217 216 msgid "Standard Checkout ( Process on 2Checkout Site )" 218 217 msgstr "" 219 218 220 #: includes/Payment_Gateway.php:34 2219 #: includes/Payment_Gateway.php:346 221 220 msgid "Popup After Checkout - Inline Checkout - PRO FEATURE" 222 221 msgstr "" 223 222 224 #: includes/Payment_Gateway.php:34 3223 #: includes/Payment_Gateway.php:347 225 224 msgid "Popup During Checkout - Inline Checkout - PRO FEATURE" 226 225 msgstr "" 227 226 228 #: includes/Payment_Gateway.php:34 4227 #: includes/Payment_Gateway.php:348 229 228 msgid "On Page Credit Card Only - PRO FEATURE" 230 229 msgstr "" 231 230 232 231 #. translators: %s: WebHook link. 233 #: includes/Payment_Gateway.php:4 21232 #: includes/Payment_Gateway.php:419 234 233 msgid "<strong>Webhook endpoint: </strong> <code style=\"background-color:#ddd;\">%s</code> to your <a href=\"https://secure.2checkout.com/cpanel/ipn_settings.php\" target=\"_blank\">2Checkout IPN settings</a>" 235 234 msgstr "" 236 235 237 #: includes/Payment_Gateway.php:7 46236 #: includes/Payment_Gateway.php:739 238 237 msgid "Item" 239 238 msgstr "" 240 239 241 #: includes/Payment_Gateway.php:77 8240 #: includes/Payment_Gateway.php:771 242 241 msgid "Payment Gateway - 2Checkout for WooCommerce disabled" 243 242 msgstr "" 244 243 245 #: includes/Payment_Gateway.php:77 8244 #: includes/Payment_Gateway.php:771 246 245 msgid "You must fill the \"Merchant Code\" and the \"Secret Key\" and \"Buy Link Secret Word\" fields." 247 246 msgstr "" 248 247 249 #: includes/Payment_Gateway.php:78 7248 #: includes/Payment_Gateway.php:780 250 249 msgid "Billing Currency not supported. Payment Gateway - 2Checkout for WooCommerce disabled" 251 250 msgstr "" 252 251 253 #: includes/Payment_Gateway.php:78 7252 #: includes/Payment_Gateway.php:780 254 253 msgid "2Checkout does not support your store currency." 255 254 msgstr "" 256 255 257 #: includes/Payment_Gateway.php:8 12256 #: includes/Payment_Gateway.php:805 258 257 msgid "Should override on child class." 259 258 msgstr "" 260 259 261 #: includes/Plugin.php: 181260 #: includes/Plugin.php:207 262 261 msgid "Payment Gateway - 2Checkout for WooCommerce - Pro " 263 262 msgstr "" 264 263 265 264 #. translators: %s: Pro version link. 266 #: includes/Plugin.php: 185265 #: includes/Plugin.php:211 267 266 msgid "Upgrade to %s to get WooCommerce Subscriptions payments, issue refunds from wp admin, inline popup checkout and more." 268 267 msgstr "" 269 268 270 #: includes/Plugin.php:4 84269 #: includes/Plugin.php:451 271 270 msgid "Settings" 272 271 msgstr "" 273 272 274 #: woo-2checkout.php:82 275 msgid "WooCommerce" 276 msgstr "" 277 278 #: woo-2checkout.php:94 279 msgid "<strong>Payment Gateway - 2Checkout for WooCommerce</strong> is an add-on of " 280 msgstr "" 281 282 #: build/convert-plus-block.js:1 273 #: build/convert-plus-block.js:1621 274 #: src/convert-plus-block.js:57 275 #: build/convert-plus-block.js:1492 283 276 msgid "DEMO MODE ENABLED." 284 277 msgstr "" 285 278 286 #: build/convert-plus-block.js:1 279 #: build/convert-plus-block.js:1622 280 #: src/convert-plus-block.js:59 281 #: build/convert-plus-block.js:1494 287 282 msgid "Use a" 288 283 msgstr "" 289 284 290 #: build/convert-plus-block.js:1 285 #: build/convert-plus-block.js:1626 286 #: src/convert-plus-block.js:66 287 #: build/convert-plus-block.js:1501 291 288 msgid "test payment cards" 292 289 msgstr "" -
woo-2checkout/trunk/vendor/autoload.php
r3140508 r3256094 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit fbd493a17f366db9959bbabb6910870d::getLoader();25 return ComposerAutoloaderInit5791497c48068042a99c211c9c489769::getLoader(); -
woo-2checkout/trunk/vendor/autoload_packages.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/CHANGELOG.md
r3140508 r3256094 5 5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) 6 6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 8 ## [5.0.3] - 2025-03-12 9 ### Changed 10 - Internal updates. 11 12 ## [5.0.2] - 2025-02-24 13 ### Changed 14 - Internal updates. 15 16 ## [5.0.1] - 2025-01-20 17 ### Changed 18 - Code: Use function-style exit() and die() with a default status code of 0. [#41167] 19 20 ## [5.0.0] - 2024-11-25 21 ### Removed 22 - Drop support for Composer <2.2. [#40297] 23 - Remove support for WordPress 6.5 and earlier. [#40200] 24 25 ## [4.0.0] - 2024-11-14 26 ### Removed 27 - General: Update minimum PHP version to 7.2. [#40147] 28 29 ## [3.1.3] - 2024-11-04 30 ### Added 31 - Enable test coverage. [#39961] 32 33 ## [3.1.2] - 2024-10-15 34 ### Changed 35 - Internal updates. 36 37 ## [3.1.1] - 2024-10-10 38 ### Changed 39 - Internal updates. 40 41 ## [3.1.0] - 2024-09-06 42 ### Added 43 - Add logic for debugging issues caused by conflicting Composer autoloaders, enabled by setting the `JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS` constant. [#38995] 44 - Add logic for debugging issues caused by early class loads, enabled by setting the `JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS` constant. [#38995] 45 46 ## [3.0.10] - 2024-08-26 47 ### Changed 48 - Updated package dependencies. [#39004] 7 49 8 50 ## [3.0.9] - 2024-07-10 … … 369 411 - Add Custom Autoloader 370 412 413 [5.0.3]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.2...v5.0.3 414 [5.0.2]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.1...v5.0.2 415 [5.0.1]: https://github.com/Automattic/jetpack-autoloader/compare/v5.0.0...v5.0.1 416 [5.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v4.0.0...v5.0.0 417 [4.0.0]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.3...v4.0.0 418 [3.1.3]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.2...v3.1.3 419 [3.1.2]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.1...v3.1.2 420 [3.1.1]: https://github.com/Automattic/jetpack-autoloader/compare/v3.1.0...v3.1.1 421 [3.1.0]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.10...v3.1.0 422 [3.0.10]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.9...v3.0.10 371 423 [3.0.9]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.8...v3.0.9 372 424 [3.0.8]: https://github.com/Automattic/jetpack-autoloader/compare/v3.0.7...v3.0.8 -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/README.md
r3140508 r3256094 47 47 48 48 49 Autoloader Limitations and Caveats 50 ----- 51 52 ### Plugin Updates 53 54 When moving a package class file, renaming a package class file, or changing a package class namespace, make sure that the class will not be loaded after a plugin update. 55 56 The autoloader builds the in memory classmap as soon as the autoloader is loaded. The package class file paths in the map are not updated after a plugin update. If a plugins's package class files are moved during a plugin update and a moved file is autoloaded after the update, an error will occur. 57 58 ### Moving classes to a different package 59 60 Jetpack Autoloader determines the hierarchy of class versions by package version numbers. It can cause problems if a class is moved to a newer package with a lower version number, it will get overshadowed by the old package. 61 62 For instance, if your newer version of a class comes from a new package versioned 0.1.0, and the older version comes from a different package with a greater version number 2.0.1, the newer class will not get loaded. 63 64 ### Jetpack Autoloader uses transient cache 65 66 This is a caveat to be aware of when dealing with issues. The JP Autoloader uses transients to cache a list of available plugins to speed up the lookup process. This can sometimes mask problems that arise when loading code too early. See the [Debugging](#debugging) section for more information on how to detect situations like this. 67 68 Debugging 69 ----- 70 71 A common cause of confusing errors is when a plugin autoloads classes during the plugin load, before the 'plugins_loaded' hook. If that plugin has an older version of the class, that older version may be loaded before a plugin providing the newer version of the class has a chance to register. Even more confusingly, this will likely be intermittent, only showing up when the autoloader's plugin cache is invalidated. To debug this situation, you can set the `JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS` constant to true. 72 73 Another common cause of confusing errors is when a plugin registers its own autoloader at a higher priority than the Jetpack Autoloader, and that autoloader would load packages that should be handled by the Jetpack Autoloader. Setting the `JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS` constant to true will check for standard Composer autoloaders with such a conflict. 74 75 49 76 Autoloading Standards 50 77 ---- … … 64 91 Supports PSR-4 autoloading. PSR-0 namespaces are converted to classmaps. 65 92 66 67 Autoloader Limitations68 -----69 70 Plugin Updates71 72 When moving a package class file, renaming a package class file, or changing a package class namespace, make sure that the class will not be loaded after a plugin update.73 74 The autoloader builds the in memory classmap as soon as the autoloader is loaded. The package class file paths in the map are not updated after a plugin update. If a plugins's package class files are moved during a plugin update and a moved file is autoloaded after the update, an error will occur.75 -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/composer.json
r3140508 r3256094 13 13 ], 14 14 "require": { 15 "php": ">=7. 0",16 "composer-plugin-api": "^ 1.1 || ^2.0"15 "php": ">=7.2", 16 "composer-plugin-api": "^2.2" 17 17 }, 18 18 "require-dev": { 19 "composer/composer": "^1.1 || ^2.0", 20 "yoast/phpunit-polyfills": "1.1.0", 21 "automattic/jetpack-changelogger": "^4.2.5" 19 "composer/composer": "^2.2", 20 "yoast/phpunit-polyfills": "^1.1.1", 21 "automattic/jetpack-changelogger": "^6.0.1", 22 "automattic/phpunit-select-config": "^1.0.0" 22 23 }, 23 24 "autoload": { … … 31 32 "scripts": { 32 33 "phpunit": [ 33 "./vendor/phpunit/phpunit/phpunit --colors=always" 34 "phpunit-select-config phpunit.#.xml.dist --colors=always" 35 ], 36 "test-coverage": [ 37 "php -dpcov.directory=. ./vendor/bin/phpunit-select-config phpunit.#.xml.dist --coverage-php \"./tests/php/tmp/coverage-report.php\"", 38 "php ./tests/php/bin/test-coverage.php \"$COVERAGE_DIR/php.cov\"" 34 39 ], 35 40 "test-php": [ … … 50 55 }, 51 56 "branch-alias": { 52 "dev-trunk": " 3.0.x-dev"57 "dev-trunk": "5.0.x-dev" 53 58 } 54 59 } -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/src/AutoloadGenerator.php
r3140508 r3256094 22 22 class AutoloadGenerator { 23 23 24 const VERSION = ' 3.0.9';24 const VERSION = '5.0.3'; 25 25 26 26 /** -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php
r3140508 r3256094 105 105 $this->io->writeError( 'The project\'s composer.json or composer environment set a non-default vendor directory.', true ); 106 106 $this->io->writeError( 'The default composer vendor directory must be used.</error>', true ); 107 exit( );107 exit( 0 ); 108 108 } 109 109 … … 175 175 if ( empty( $requires ) ) { 176 176 $this->io->writeError( "\n<error>The package is not required and this should never happen?</error>", true ); 177 exit( );177 exit( 0 ); 178 178 } 179 179 -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/src/class-autoloader.php
r3140508 r3256094 78 78 $hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) ); 79 79 80 // Register a plugins_loaded handler to check for conflicting autoloaders. 81 $hook_manager->add_action( 'plugins_loaded', array( $guard, 'check_for_conflicting_autoloaders' ), 1 ); 82 80 83 // phpcs:enable Generic.Commenting.DocComment.MissingShort 81 84 } -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php
r3140508 r3256094 76 76 return false; 77 77 } 78 79 /** 80 * Check for conflicting autoloaders. 81 * 82 * A common source of strange and confusing problems is when another plugin 83 * registers a Composer autoloader at a higher priority that us. If enabled, 84 * check for this problem and warn about it. 85 * 86 * Called from the plugins_loaded hook. 87 * 88 * @since 3.1.0 89 * @return void 90 */ 91 public function check_for_conflicting_autoloaders() { 92 if ( ! defined( 'JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS' ) || ! JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS ) { 93 return; 94 } 95 96 global $jetpack_autoloader_loader; 97 if ( ! isset( $jetpack_autoloader_loader ) ) { 98 return; 99 } 100 $prefixes = array(); 101 foreach ( ( $jetpack_autoloader_loader->get_class_map() ?? array() ) as $classname => $data ) { 102 $parts = explode( '\\', trim( $classname, '\\' ) ); 103 array_pop( $parts ); 104 while ( $parts ) { 105 $prefixes[ implode( '\\', $parts ) . '\\' ] = true; 106 array_pop( $parts ); 107 } 108 } 109 foreach ( ( $jetpack_autoloader_loader->get_psr4_map() ?? array() ) as $prefix => $data ) { 110 $parts = explode( '\\', trim( $prefix, '\\' ) ); 111 while ( $parts ) { 112 $prefixes[ implode( '\\', $parts ) . '\\' ] = true; 113 array_pop( $parts ); 114 } 115 } 116 117 $autoload_chain = spl_autoload_functions(); 118 if ( ! $autoload_chain ) { 119 return; 120 } 121 122 foreach ( $autoload_chain as $autoloader ) { 123 // No need to check anything after us. 124 if ( is_array( $autoloader ) && is_string( $autoloader[0] ) && substr( $autoloader[0], 0, strlen( __NAMESPACE__ ) + 1 ) === __NAMESPACE__ . '\\' ) { 125 break; 126 } 127 128 // We can check Composer autoloaders easily enough. 129 if ( is_array( $autoloader ) && $autoloader[0] instanceof \Composer\Autoload\ClassLoader && is_callable( array( $autoloader[0], 'getPrefixesPsr4' ) ) ) { 130 $composer_autoloader = $autoloader[0]; 131 foreach ( $composer_autoloader->getClassMap() as $classname => $path ) { 132 if ( $jetpack_autoloader_loader->find_class_file( $classname ) ) { 133 $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the classes we handle (e.g. $classname => $path). This may cause strange and confusing problems."; 134 wp_trigger_error( '', $msg ); 135 continue 2; 136 } 137 } 138 foreach ( $composer_autoloader->getPrefixesPsr4() as $prefix => $paths ) { 139 if ( isset( $prefixes[ $prefix ] ) ) { 140 $path = array_pop( $paths ); 141 $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; 142 wp_trigger_error( '', $msg ); 143 continue 2; 144 } 145 } 146 foreach ( $composer_autoloader->getPrefixes() as $prefix => $paths ) { 147 if ( isset( $prefixes[ $prefix ] ) ) { 148 $path = array_pop( $paths ); 149 $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; 150 wp_trigger_error( '', $msg ); 151 continue 2; 152 } 153 } 154 } 155 } 156 } 78 157 } -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/src/class-php-autoloader.php
r3140508 r3256094 80 80 } 81 81 82 // A common source of strange and confusing problems is when a vendor 83 // file is autoloaded before all plugins have had a chance to register 84 // with the autoloader. Detect that, if a development constant is set. 85 if ( defined( 'JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS' ) && JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS && 86 ( strpos( $file, '/vendor/' ) !== false || strpos( $file, '/jetpack_vendor/' ) !== false ) && 87 is_callable( 'did_action' ) && ! did_action( 'plugins_loaded' ) 88 ) { 89 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_wp_debug_backtrace_summary -- This is a debug log message. 90 $msg = "Jetpack Autoloader: Autoloading `$class_name` before the plugins_loaded hook may cause strange and confusing problems. " . wp_debug_backtrace_summary( '', 1 ); 91 wp_trigger_error( '', $msg ); 92 } 93 82 94 require $file; 83 95 return true; -
woo-2checkout/trunk/vendor/automattic/jetpack-autoloader/src/class-version-loader.php
r3140508 r3256094 48 48 $this->psr4_map = $psr4_map; 49 49 $this->filemap = $filemap; 50 } 51 52 /** 53 * Fetch the classmap. 54 * 55 * @since 3.1.0 56 * @return array<string, array> 57 */ 58 public function get_class_map() { 59 return $this->classmap; 60 } 61 62 /** 63 * Fetch the psr-4 mappings. 64 * 65 * @since 3.1.0 66 * @return array<string, array> 67 */ 68 public function get_psr4_map() { 69 return $this->psr4_map; 50 70 } 51 71 … … 116 136 */ 117 137 private function find_psr4_file( $class_name ) { 118 if ( ! isset( $this->psr4_map ) ) {138 if ( empty( $this->psr4_map ) ) { 119 139 return null; 120 140 } -
woo-2checkout/trunk/vendor/composer/autoload_real.php
r3140508 r3256094 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit fbd493a17f366db9959bbabb6910870d5 class ComposerAutoloaderInit5791497c48068042a99c211c9c489769 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit fbd493a17f366db9959bbabb6910870d', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit5791497c48068042a99c211c9c489769', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit fbd493a17f366db9959bbabb6910870d', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit5791497c48068042a99c211c9c489769', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit fbd493a17f366db9959bbabb6910870d::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit5791497c48068042a99c211c9c489769::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
woo-2checkout/trunk/vendor/composer/autoload_static.php
r3140508 r3256094 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit fbd493a17f366db9959bbabb6910870d7 class ComposerStaticInit5791497c48068042a99c211c9c489769 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 62 62 { 63 63 return \Closure::bind(function () use ($loader) { 64 $loader->prefixLengthsPsr4 = ComposerStaticInit fbd493a17f366db9959bbabb6910870d::$prefixLengthsPsr4;65 $loader->prefixDirsPsr4 = ComposerStaticInit fbd493a17f366db9959bbabb6910870d::$prefixDirsPsr4;66 $loader->classMap = ComposerStaticInit fbd493a17f366db9959bbabb6910870d::$classMap;64 $loader->prefixLengthsPsr4 = ComposerStaticInit5791497c48068042a99c211c9c489769::$prefixLengthsPsr4; 65 $loader->prefixDirsPsr4 = ComposerStaticInit5791497c48068042a99c211c9c489769::$prefixDirsPsr4; 66 $loader->classMap = ComposerStaticInit5791497c48068042a99c211c9c489769::$classMap; 67 67 68 68 }, null, ClassLoader::class); -
woo-2checkout/trunk/vendor/composer/installed.json
r3140508 r3256094 3 3 { 4 4 "name": "automattic/jetpack-autoloader", 5 "version": "v 3.0.9",6 "version_normalized": " 3.0.9.0",5 "version": "v5.0.3", 6 "version_normalized": "5.0.3.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/Automattic/jetpack-autoloader.git", 10 "reference": " a571038214fc3e142e10f38d1bb97e470fa7b0ec"10 "reference": "108cc708cfc7b7a0e730b2bf12f389593f56f0a5" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/ a571038214fc3e142e10f38d1bb97e470fa7b0ec",15 "reference": " a571038214fc3e142e10f38d1bb97e470fa7b0ec",14 "url": "https://api.github.com/repos/Automattic/jetpack-autoloader/zipball/108cc708cfc7b7a0e730b2bf12f389593f56f0a5", 15 "reference": "108cc708cfc7b7a0e730b2bf12f389593f56f0a5", 16 16 "shasum": "" 17 17 }, 18 18 "require": { 19 "composer-plugin-api": "^ 1.1 || ^2.0",20 "php": ">=7. 0"19 "composer-plugin-api": "^2.2", 20 "php": ">=7.2" 21 21 }, 22 22 "require-dev": { 23 "automattic/jetpack-changelogger": "^4.2.5", 24 "composer/composer": "^1.1 || ^2.0", 25 "yoast/phpunit-polyfills": "1.1.0" 23 "automattic/jetpack-changelogger": "^6.0.1", 24 "automattic/phpunit-select-config": "^1.0.0", 25 "composer/composer": "^2.2", 26 "yoast/phpunit-polyfills": "^1.1.1" 26 27 }, 27 "time": "202 4-07-10T07:51:07+00:00",28 "time": "2025-03-12T19:15:00+00:00", 28 29 "type": "composer-plugin", 29 30 "extra": { 31 "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin", 30 32 "autotagger": true, 31 "class": "Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin",32 33 "mirror-repo": "Automattic/jetpack-autoloader", 34 "branch-alias": { 35 "dev-trunk": "5.0.x-dev" 36 }, 33 37 "changelogger": { 34 38 "link-template": "https://github.com/Automattic/jetpack-autoloader/compare/v${old}...v${new}" … … 36 40 "version-constants": { 37 41 "::VERSION": "src/AutoloadGenerator.php" 38 },39 "branch-alias": {40 "dev-trunk": "3.0.x-dev"41 42 } 42 43 }, … … 64 65 ], 65 66 "support": { 66 "source": "https://github.com/Automattic/jetpack-autoloader/tree/v 3.0.9"67 "source": "https://github.com/Automattic/jetpack-autoloader/tree/v5.0.3" 67 68 }, 68 69 "install-path": "../automattic/jetpack-autoloader" … … 70 71 { 71 72 "name": "storepress/admin-utils", 72 "version": "1.8. 8",73 "version_normalized": "1.8. 8.0",73 "version": "1.8.10", 74 "version_normalized": "1.8.10.0", 74 75 "source": { 75 76 "type": "git", 76 77 "url": "https://github.com/EmranAhmed/storepress-admin-utils.git", 77 "reference": " 69b5cb4b5a2b4625dbdb2a6bd3344c5e35fa5837"78 "reference": "ec593e9e23a4fbed90acee384b61b9846cb9d968" 78 79 }, 79 80 "dist": { 80 81 "type": "zip", 81 "url": "https://api.github.com/repos/EmranAhmed/storepress-admin-utils/zipball/ 69b5cb4b5a2b4625dbdb2a6bd3344c5e35fa5837",82 "reference": " 69b5cb4b5a2b4625dbdb2a6bd3344c5e35fa5837",82 "url": "https://api.github.com/repos/EmranAhmed/storepress-admin-utils/zipball/ec593e9e23a4fbed90acee384b61b9846cb9d968", 83 "reference": "ec593e9e23a4fbed90acee384b61b9846cb9d968", 83 84 "shasum": "" 84 85 }, 85 86 "require-dev": { 86 "automattic/vipwpcs": "^3.0 ",87 "php-stubs/woocommerce-stubs": "^ 9.0",87 "automattic/vipwpcs": "^3.0.1", 88 "php-stubs/woocommerce-stubs": "^v9.5.0", 88 89 "phpcompatibility/phpcompatibility-wp": "^2.1.5", 89 "phpstan/extension-installer": "^1.4 ",90 "phpstan/phpstan-strict-rules": "^1.6 ",91 "szepeviktor/phpstan-wordpress": "^ 1.3",90 "phpstan/extension-installer": "^1.4.3", 91 "phpstan/phpstan-strict-rules": "^1.6.1", 92 "szepeviktor/phpstan-wordpress": "^v1.3.5", 92 93 "woocommerce/woocommerce-sniffs": "^1.0.0", 93 "wp-cli/i18n-command": "^v2.6. 0",94 "wp-cli/i18n-command": "^v2.6.3", 94 95 "wp-coding-standards/wpcs": "^3.1.0" 95 96 }, 96 "time": "2024- 07-01T12:29:55+00:00",97 "time": "2024-12-26T18:43:48+00:00", 97 98 "type": "library", 98 99 "installation-source": "dist", … … 125 126 "support": { 126 127 "issues": "https://github.com/EmranAhmed/storepress-admin-utils/issues", 127 "source": "https://github.com/EmranAhmed/storepress-admin-utils/tree/1.8. 8"128 "source": "https://github.com/EmranAhmed/storepress-admin-utils/tree/1.8.10" 128 129 }, 129 130 "install-path": "../storepress/admin-utils" -
woo-2checkout/trunk/vendor/composer/installed.php
r3140508 r3256094 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' be918cf066aec0cb8d530068b20d3f1ec069e8a8',6 'reference' => '0c594ebe19edf55472ff16a0323e94cff99b909e', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 12 12 'versions' => array( 13 13 'automattic/jetpack-autoloader' => array( 14 'pretty_version' => 'v 3.0.9',15 'version' => ' 3.0.9.0',16 'reference' => ' a571038214fc3e142e10f38d1bb97e470fa7b0ec',14 'pretty_version' => 'v5.0.3', 15 'version' => '5.0.3.0', 16 'reference' => '108cc708cfc7b7a0e730b2bf12f389593f56f0a5', 17 17 'type' => 'composer-plugin', 18 18 'install_path' => __DIR__ . '/../automattic/jetpack-autoloader', … … 21 21 ), 22 22 'storepress/admin-utils' => array( 23 'pretty_version' => '1.8. 8',24 'version' => '1.8. 8.0',25 'reference' => ' 69b5cb4b5a2b4625dbdb2a6bd3344c5e35fa5837',23 'pretty_version' => '1.8.10', 24 'version' => '1.8.10.0', 25 'reference' => 'ec593e9e23a4fbed90acee384b61b9846cb9d968', 26 26 'type' => 'library', 27 27 'install_path' => __DIR__ . '/../storepress/admin-utils', … … 32 32 'pretty_version' => 'dev-master', 33 33 'version' => 'dev-master', 34 'reference' => ' be918cf066aec0cb8d530068b20d3f1ec069e8a8',34 'reference' => '0c594ebe19edf55472ff16a0323e94cff99b909e', 35 35 'type' => 'wordpress-plugin', 36 36 'install_path' => __DIR__ . '/../../', -
woo-2checkout/trunk/vendor/composer/jetpack_autoload_classmap.php
r3140508 r3256094 8 8 return array( 9 9 'Autoloader' => array( 10 'version' => ' 3.0.9',10 'version' => '5.0.3', 11 11 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader.php' 12 12 ), 13 13 'Autoloader_Handler' => array( 14 'version' => ' 3.0.9',14 'version' => '5.0.3', 15 15 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-handler.php' 16 16 ), 17 17 'Autoloader_Locator' => array( 18 'version' => ' 3.0.9',18 'version' => '5.0.3', 19 19 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-autoloader-locator.php' 20 20 ), 21 21 'Automattic\\Jetpack\\Autoloader\\AutoloadFileWriter' => array( 22 'version' => ' 3.0.9',22 'version' => '5.0.3', 23 23 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadFileWriter.php' 24 24 ), 25 25 'Automattic\\Jetpack\\Autoloader\\AutoloadGenerator' => array( 26 'version' => ' 3.0.9',26 'version' => '5.0.3', 27 27 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadGenerator.php' 28 28 ), 29 29 'Automattic\\Jetpack\\Autoloader\\AutoloadProcessor' => array( 30 'version' => ' 3.0.9',30 'version' => '5.0.3', 31 31 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/AutoloadProcessor.php' 32 32 ), 33 33 'Automattic\\Jetpack\\Autoloader\\CustomAutoloaderPlugin' => array( 34 'version' => ' 3.0.9',34 'version' => '5.0.3', 35 35 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php' 36 36 ), 37 37 'Automattic\\Jetpack\\Autoloader\\ManifestGenerator' => array( 38 'version' => ' 3.0.9',38 'version' => '5.0.3', 39 39 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/ManifestGenerator.php' 40 40 ), 41 41 'Container' => array( 42 'version' => ' 3.0.9',42 'version' => '5.0.3', 43 43 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-container.php' 44 44 ), 45 45 'Hook_Manager' => array( 46 'version' => ' 3.0.9',46 'version' => '5.0.3', 47 47 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-hook-manager.php' 48 48 ), 49 49 'Latest_Autoloader_Guard' => array( 50 'version' => ' 3.0.9',50 'version' => '5.0.3', 51 51 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-latest-autoloader-guard.php' 52 52 ), 53 53 'Manifest_Reader' => array( 54 'version' => ' 3.0.9',54 'version' => '5.0.3', 55 55 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-manifest-reader.php' 56 56 ), 57 57 'PHP_Autoloader' => array( 58 'version' => ' 3.0.9',58 'version' => '5.0.3', 59 59 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-php-autoloader.php' 60 60 ), 61 61 'Path_Processor' => array( 62 'version' => ' 3.0.9',62 'version' => '5.0.3', 63 63 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-path-processor.php' 64 64 ), 65 65 'Plugin_Locator' => array( 66 'version' => ' 3.0.9',66 'version' => '5.0.3', 67 67 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugin-locator.php' 68 68 ), 69 69 'Plugins_Handler' => array( 70 'version' => ' 3.0.9',70 'version' => '5.0.3', 71 71 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugins-handler.php' 72 72 ), 73 73 'Shutdown_Handler' => array( 74 'version' => ' 3.0.9',74 'version' => '5.0.3', 75 75 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-shutdown-handler.php' 76 76 ), 77 77 'StorePress\\AdminUtils\\Common' => array( 78 'version' => '1.8. 8.0',78 'version' => '1.8.10.0', 79 79 'path' => $vendorDir . '/storepress/admin-utils/includes/Common.php' 80 80 ), 81 81 'StorePress\\AdminUtils\\Field' => array( 82 'version' => '1.8. 8.0',82 'version' => '1.8.10.0', 83 83 'path' => $vendorDir . '/storepress/admin-utils/includes/Field.php' 84 84 ), 85 85 'StorePress\\AdminUtils\\Fields' => array( 86 'version' => '1.8. 8.0',86 'version' => '1.8.10.0', 87 87 'path' => $vendorDir . '/storepress/admin-utils/includes/Fields.php' 88 88 ), 89 89 'StorePress\\AdminUtils\\Menu' => array( 90 'version' => '1.8. 8.0',90 'version' => '1.8.10.0', 91 91 'path' => $vendorDir . '/storepress/admin-utils/includes/Menu.php' 92 92 ), 93 93 'StorePress\\AdminUtils\\REST_API' => array( 94 'version' => '1.8. 8.0',94 'version' => '1.8.10.0', 95 95 'path' => $vendorDir . '/storepress/admin-utils/includes/REST_API.php' 96 96 ), 97 97 'StorePress\\AdminUtils\\Section' => array( 98 'version' => '1.8. 8.0',98 'version' => '1.8.10.0', 99 99 'path' => $vendorDir . '/storepress/admin-utils/includes/Section.php' 100 100 ), 101 101 'StorePress\\AdminUtils\\Settings' => array( 102 'version' => '1.8. 8.0',102 'version' => '1.8.10.0', 103 103 'path' => $vendorDir . '/storepress/admin-utils/includes/Settings.php' 104 104 ), 105 105 'StorePress\\AdminUtils\\Updater' => array( 106 'version' => '1.8. 8.0',106 'version' => '1.8.10.0', 107 107 'path' => $vendorDir . '/storepress/admin-utils/includes/Updater.php' 108 108 ), 109 109 'StorePress\\AdminUtils\\Upgrade_Notice' => array( 110 'version' => '1.8. 8.0',110 'version' => '1.8.10.0', 111 111 'path' => $vendorDir . '/storepress/admin-utils/includes/Upgrade_Notice.php' 112 112 ), … … 140 140 ), 141 141 'Version_Loader' => array( 142 'version' => ' 3.0.9',142 'version' => '5.0.3', 143 143 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-loader.php' 144 144 ), 145 145 'Version_Selector' => array( 146 'version' => ' 3.0.9',146 'version' => '5.0.3', 147 147 'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-version-selector.php' 148 148 ), -
woo-2checkout/trunk/vendor/composer/platform_check.php
r3140508 r3256094 5 5 $issues = array(); 6 6 7 if (!(PHP_VERSION_ID >= 70 000)) {8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7. 0.0". You are running ' . PHP_VERSION . '.';7 if (!(PHP_VERSION_ID >= 70200)) { 8 $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.'; 9 9 } 10 10 -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-autoloader-handler.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-autoloader-locator.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-autoloader.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore … … 86 86 $hook_manager->add_action( 'shutdown', new Shutdown_Handler( $plugins_handler, $cached_plugins, $was_included_by_autoloader ) ); 87 87 88 // Register a plugins_loaded handler to check for conflicting autoloaders. 89 $hook_manager->add_action( 'plugins_loaded', array( $guard, 'check_for_conflicting_autoloaders' ), 1 ); 90 88 91 // phpcs:enable Generic.Commenting.DocComment.MissingShort 89 92 } -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-container.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-hook-manager.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-latest-autoloader-guard.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore … … 84 84 return false; 85 85 } 86 87 /** 88 * Check for conflicting autoloaders. 89 * 90 * A common source of strange and confusing problems is when another plugin 91 * registers a Composer autoloader at a higher priority that us. If enabled, 92 * check for this problem and warn about it. 93 * 94 * Called from the plugins_loaded hook. 95 * 96 * @since 3.1.0 97 * @return void 98 */ 99 public function check_for_conflicting_autoloaders() { 100 if ( ! defined( 'JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS' ) || ! JETPACK_AUTOLOAD_DEBUG_CONFLICTING_LOADERS ) { 101 return; 102 } 103 104 global $jetpack_autoloader_loader; 105 if ( ! isset( $jetpack_autoloader_loader ) ) { 106 return; 107 } 108 $prefixes = array(); 109 foreach ( ( $jetpack_autoloader_loader->get_class_map() ?? array() ) as $classname => $data ) { 110 $parts = explode( '\\', trim( $classname, '\\' ) ); 111 array_pop( $parts ); 112 while ( $parts ) { 113 $prefixes[ implode( '\\', $parts ) . '\\' ] = true; 114 array_pop( $parts ); 115 } 116 } 117 foreach ( ( $jetpack_autoloader_loader->get_psr4_map() ?? array() ) as $prefix => $data ) { 118 $parts = explode( '\\', trim( $prefix, '\\' ) ); 119 while ( $parts ) { 120 $prefixes[ implode( '\\', $parts ) . '\\' ] = true; 121 array_pop( $parts ); 122 } 123 } 124 125 $autoload_chain = spl_autoload_functions(); 126 if ( ! $autoload_chain ) { 127 return; 128 } 129 130 foreach ( $autoload_chain as $autoloader ) { 131 // No need to check anything after us. 132 if ( is_array( $autoloader ) && is_string( $autoloader[0] ) && substr( $autoloader[0], 0, strlen( __NAMESPACE__ ) + 1 ) === __NAMESPACE__ . '\\' ) { 133 break; 134 } 135 136 // We can check Composer autoloaders easily enough. 137 if ( is_array( $autoloader ) && $autoloader[0] instanceof \Composer\Autoload\ClassLoader && is_callable( array( $autoloader[0], 'getPrefixesPsr4' ) ) ) { 138 $composer_autoloader = $autoloader[0]; 139 foreach ( $composer_autoloader->getClassMap() as $classname => $path ) { 140 if ( $jetpack_autoloader_loader->find_class_file( $classname ) ) { 141 $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the classes we handle (e.g. $classname => $path). This may cause strange and confusing problems."; 142 wp_trigger_error( '', $msg ); 143 continue 2; 144 } 145 } 146 foreach ( $composer_autoloader->getPrefixesPsr4() as $prefix => $paths ) { 147 if ( isset( $prefixes[ $prefix ] ) ) { 148 $path = array_pop( $paths ); 149 $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; 150 wp_trigger_error( '', $msg ); 151 continue 2; 152 } 153 } 154 foreach ( $composer_autoloader->getPrefixes() as $prefix => $paths ) { 155 if ( isset( $prefixes[ $prefix ] ) ) { 156 $path = array_pop( $paths ); 157 $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; 158 wp_trigger_error( '', $msg ); 159 continue 2; 160 } 161 } 162 } 163 } 164 } 86 165 } -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-manifest-reader.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-path-processor.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-php-autoloader.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore … … 88 88 } 89 89 90 // A common source of strange and confusing problems is when a vendor 91 // file is autoloaded before all plugins have had a chance to register 92 // with the autoloader. Detect that, if a development constant is set. 93 if ( defined( 'JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS' ) && JETPACK_AUTOLOAD_DEBUG_EARLY_LOADS && 94 ( strpos( $file, '/vendor/' ) !== false || strpos( $file, '/jetpack_vendor/' ) !== false ) && 95 is_callable( 'did_action' ) && ! did_action( 'plugins_loaded' ) 96 ) { 97 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_wp_debug_backtrace_summary -- This is a debug log message. 98 $msg = "Jetpack Autoloader: Autoloading `$class_name` before the plugins_loaded hook may cause strange and confusing problems. " . wp_debug_backtrace_summary( '', 1 ); 99 wp_trigger_error( '', $msg ); 100 } 101 90 102 require $file; 91 103 return true; -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-plugin-locator.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-plugins-handler.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-shutdown-handler.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-version-loader.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore … … 56 56 $this->psr4_map = $psr4_map; 57 57 $this->filemap = $filemap; 58 } 59 60 /** 61 * Fetch the classmap. 62 * 63 * @since 3.1.0 64 * @return array<string, array> 65 */ 66 public function get_class_map() { 67 return $this->classmap; 68 } 69 70 /** 71 * Fetch the psr-4 mappings. 72 * 73 * @since 3.1.0 74 * @return array<string, array> 75 */ 76 public function get_psr4_map() { 77 return $this->psr4_map; 58 78 } 59 79 … … 124 144 */ 125 145 private function find_psr4_file( $class_name ) { 126 if ( ! isset( $this->psr4_map ) ) {146 if ( empty( $this->psr4_map ) ) { 127 147 return null; 128 148 } -
woo-2checkout/trunk/vendor/jetpack-autoloader/class-version-selector.php
r3140508 r3256094 6 6 */ 7 7 8 namespace Automattic\Jetpack\Autoloader\jp fbd493a17f366db9959bbabb6910870d\al3_0_9;8 namespace Automattic\Jetpack\Autoloader\jp5791497c48068042a99c211c9c489769\al5_0_3; 9 9 10 10 // phpcs:ignore -
woo-2checkout/trunk/vendor/storepress/admin-utils/README.md
r3140508 r3256094 44 44 'settings_updated_message_text' => 'Settings Saved', 45 45 'settings_deleted_message_text' => 'Settings Reset', 46 'settings_error_message_text' => 'Settings Not saved.', 46 47 ); 47 48 } … … 61 62 } 62 63 */ 63 64 65 64 public function menu_title(): string { 66 65 return 'Plugin A Menu'; … … 106 105 return 'v2'; 107 106 } 107 108 // Adding custom scripts. 109 public function enqueue_scripts() { 110 parent::enqueue_scripts(); 111 if ( $this->has_field_type( 'wc-enhanced-select' ) ) { 112 wp_enqueue_style( 'woocommerce_admin_styles' ); 113 wp_enqueue_script( 'wc-enhanced-select' ); 114 } 115 } 116 117 118 // Adding Custom TASK: 119 120 public function get_custom_action_uri(): string { 121 return wp_nonce_url( $this->get_settings_uri( array( 'action' => 'custom-action' ) ), $this->get_nonce_action() ); 122 } 123 124 // Task: 02 125 public function process_actions($current_action){ 126 127 parent::process_actions($current_action); 128 129 if ( 'custom-action' === $current_action ) { 130 $this->process_action_custom(); 131 } 132 } 133 134 135 // Task: 03 136 public function process_action_custom(){ 137 check_admin_referer( $this->get_nonce_action() ); 138 139 140 141 // Process your task. 142 143 144 145 wp_safe_redirect( $this->get_action_uri( array( 'message' => 'custom-action-done' ) ) ); 146 exit; 147 } 148 149 // Task: 04 150 public function settings_messages(){ 151 152 parent::settings_messages(); 153 154 $message = $this->get_message_query_arg_value(); 155 156 if ( 'custom-action-done' === $message ) { 157 $this->add_settings_message( 'Custom action done successfully.' ); 158 } 159 160 if ( 'custom-action-fail' === $message ) { 161 $this->add_settings_message( 'Custom action failed.', 'error' ); 162 } 163 } 108 164 } 109 165 ``` … … 153 209 'description' => 'Input desc of 01', 154 210 'placeholder' => 'Abcd', 155 'default' => 'ok' 211 'default' => 'ok', 212 'html_datalist'=>array('yes','no'), 156 213 ), 157 214 array( … … 314 371 array( 315 372 'id' => 'input3', // Field ID. 316 'type' => 'text', // text, code, small-text, tiny-text, large-text, textarea, email, url, number, color, select, select2, radio, checkbox373 'type' => 'text', // text, toggle, code, small-text, tiny-text, large-text, textarea, email, url, number, color, select, wc-enhanced-select, radio, checkbox 317 374 'title' => 'Input Label', 318 375 … … 326 383 'placeholder' => '' // Placeholder 327 384 'suffix' => '' // Field suffix. 328 'html_attributes' => array('min'=>10) // Field suffix. 385 'html_attributes' => array('min' => 10) // Custom html attributes. 386 'html_datalist' => array('value 1', 'value 2') // HTML Datalist for suggestion. 329 387 'required' => true, // If field is required and cannot be empty. 330 388 'private' => true, // Private field does not delete from db during reset all action trigger. … … 341 399 'y' => 'Home Y', 342 400 'z' => 'Home Z', 401 'new' => array( 402 'label' => 'New', 403 'description' => 'New Item', 404 ), 343 405 ) 344 406 ), -
woo-2checkout/trunk/vendor/storepress/admin-utils/build/admin-settings-rtl.css
r3140508 r3256094 1 .select2-results__option--highlighted{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.select2-results__option--highlighted{--wp-admin-border-width-focus:1.5px}}[data-gwp_dependency]:not(.dependency-show){display:none!important}.storepress-settings-wrapper h2{font-size:1.3em;margin-bottom:10px}.storepress-settings-wrapper .nav-tab-wrapper{clear:both;display:flex;margin-block-start:20px;padding:0}.storepress-settings-wrapper .nav-tab{align-items:center;display:flex;gap:5px;justify-content:center}.storepress-settings-wrapper .storepress-settings-content-wrapper{border-bottom:1px solid #c3c4c7;display:flex;gap:10px;padding-block:20px}.storepress-settings-wrapper .storepress-settings-main{box-sizing:border-box;flex-basis:auto;flex-grow:9999}.storepress-settings-wrapper .storepress-settings-sidebar{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;flex-basis:20%;flex-grow:1;padding:10px}@media screen and (max-width:960px){.storepress-settings-wrapper .storepress-settings-sidebar{display:none}}.storepress-settings-wrapper .storepress-admin-form-table{background:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);margin:0;position:relative}.storepress-settings-wrapper .storepress-admin-form-table.has-section{margin:15px 0 0}.storepress-settings-wrapper .storepress-admin-form-table tr{border-bottom:1px solid #eee;display:table-row;vertical-align:top}.storepress-settings-wrapper .storepress-admin-form-table th{min-width:280px;padding:20px}.storepress-settings-wrapper .storepress-admin-form-table td{padding:20px}.storepress-settings-wrapper .storepress-admin-form-table tr:nth-child(2n){background:#fcfcfc}.storepress-settings-wrapper .storepress-admin-form-table label{cursor:pointer}.storepress-settings-wrapper .group-input-wrapper{align-items:flex-start;display:flex;flex-direction:column;gap:1.5rem}.storepress-settings-wrapper .group-input-wrapper .input-wrapper{align-items:center;display:flex;gap:.5rem;margin:0}.storepress-settings-wrapper .help-tip{color:#666;cursor:help;display:inline-block;font-size:1.1em;font-style:normal;height:16px;line-height:1;margin:0 5px;padding:0;position:relative;vertical-align:middle;width:16px}.storepress-settings-wrapper .help-tip:after{font-family:dashicons;speak:never;font-variant:normal;font-weight:400;line-height:1;text-transform:none;-webkit-font-smoothing:antialiased;content:"";cursor:help;height:100%;right:0;margin:0;position:absolute;text-align:center;text-indent:0;top:0;width:100%}.storepress-settings-wrapper td [for*=__group]{min-width:10em;vertical-align:baseline}.storepress-settings-wrapper input.large-text,.storepress-settings-wrapper textarea.large-text{width:90%}1 .select2-results__option--highlighted{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.select2-results__option--highlighted{--wp-admin-border-width-focus:1.5px}}[data-gwp_dependency]:not(.dependency-show){display:none!important}.storepress-settings-wrapper h2{font-size:1.3em;margin-bottom:10px}.storepress-settings-wrapper .nav-tab-wrapper{clear:both;display:flex;margin-block-start:20px;padding:0}.storepress-settings-wrapper .nav-tab{align-items:center;display:flex;gap:5px;justify-content:center}.storepress-settings-wrapper .storepress-settings-content-wrapper{border-bottom:1px solid #c3c4c7;display:flex;gap:10px;padding-block:20px}.storepress-settings-wrapper .storepress-settings-main{box-sizing:border-box;flex-basis:auto;flex-grow:9999}.storepress-settings-wrapper .storepress-settings-sidebar{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;flex-basis:20%;flex-grow:1;padding:10px}@media(max-width:960px){.storepress-settings-wrapper .storepress-settings-sidebar{display:none}}.storepress-settings-wrapper .storepress-admin-form-table{background:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);margin:0;position:relative}.storepress-settings-wrapper .storepress-admin-form-table.has-section{margin:15px 0 0}.storepress-settings-wrapper .storepress-admin-form-table tr{border-bottom:1px solid #eee;display:table-row;vertical-align:top}.storepress-settings-wrapper .storepress-admin-form-table th{min-width:280px;padding:20px}.storepress-settings-wrapper .storepress-admin-form-table td{padding:20px}.storepress-settings-wrapper .storepress-admin-form-table tr:nth-child(2n){background:#fcfcfc}.storepress-settings-wrapper .storepress-admin-form-table label{cursor:pointer}.storepress-settings-wrapper .input-label-wrapper{align-items:center;display:flex;gap:4px}.storepress-settings-wrapper .group-input-wrapper{align-items:flex-start;display:flex;flex-direction:column;gap:1.5rem}.storepress-settings-wrapper .group-input-wrapper .input-wrapper{align-items:center;display:flex;gap:.5rem;margin:0}.storepress-settings-wrapper .help-modal{margin-right:auto}.storepress-settings-wrapper .help-tooltip{color:#666;cursor:help;display:flex;font-size:1.1rem;font-style:normal;line-height:1;padding:0;position:relative;vertical-align:middle}.storepress-settings-wrapper .help-tooltip:after{font-family:dashicons;speak:never;font-variant:normal;font-weight:400;line-height:1;text-transform:none;-webkit-font-smoothing:antialiased;content:"";cursor:help;height:100%;margin:0;position:relative;text-align:center;text-indent:0;width:100%}.storepress-settings-wrapper td [for*=__group]{min-width:10em;vertical-align:baseline}.storepress-settings-wrapper input{line-height:normal}.storepress-settings-wrapper input.large-text,.storepress-settings-wrapper textarea.large-text{width:90%}.storepress-settings-wrapper input.toggle{--_width:2.5em;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #8c8f94;border-radius:1em;box-sizing:content-box;color:inherit;font-size:inherit;height:calc(var(--_width)/2);margin:auto;position:relative;vertical-align:middle;width:var(--_width)}.storepress-settings-wrapper input.toggle:disabled{opacity:.4}.storepress-settings-wrapper input.toggle:before{background-color:#2f2f2f;border:1px solid #fff;border-radius:50%;box-sizing:border-box;content:"";height:calc(var(--_width)/2);right:0;margin:0;position:absolute;left:auto;top:50%;transform:translateY(-50%);width:calc(var(--_width)/2)}.storepress-settings-wrapper input.toggle:checked{background-color:#3682c4;border-color:#3682c4}.storepress-settings-wrapper input.toggle:checked:before{background-color:#fff;border-color:#3682c4;right:auto;left:0}.storepress-settings-wrapper input.toggle+span{margin-inline-start:5px}@media(max-width:782px){.storepress-settings-wrapper input.toggle{--_width:3.5em}}.storepress-settings-wrapper.has-rtl input.toggle:before{right:auto;left:0}.storepress-settings-wrapper.has-rtl input.toggle:checked:before{right:0;left:auto}.storepress-settings-wrapper input[type=color]{border-radius:50%;--_width:2.1rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;block-size:var(--_width);border:1px solid #999;inline-size:var(--_width);padding:3px}@media(max-width:782px){.storepress-settings-wrapper input[type=color]{--_width:3rem}}.storepress-settings-wrapper input[type=color]::-webkit-color-swatch-wrapper{padding:1px}.storepress-settings-wrapper input[type=color]::-webkit-color-swatch{border-radius:50%}.storepress-settings-wrapper input[type=color]::-moz-color-swatch{border-radius:50%}.storepress-settings-wrapper .input-container{align-items:center;display:flex;gap:0}.storepress-settings-wrapper:not(.has-rtl) .input-container.has-suffix input{border-bottom-left-radius:0;border-left:0;border-top-left-radius:0;margin-left:0}.storepress-settings-wrapper:not(.has-rtl) .input-container.has-suffix .input-suffix{background-color:#dcdcde;border:1px solid #8c8f94;border-radius:4px 0 0 4px;box-shadow:0 0 0 transparent;color:#2c3338;line-height:2;padding:0 8px}.storepress-settings-wrapper.has-rtl .input-container.has-suffix input{border-bottom-right-radius:0;border-right:0;border-top-right-radius:0;margin-right:0}.storepress-settings-wrapper.has-rtl .input-container.has-suffix .input-suffix{background-color:#dcdcde;border:1px solid #8c8f94;border-radius:0 4px 4px 0;box-shadow:0 0 0 transparent;color:#2c3338;line-height:2;padding:0 8px}span[data-storepress-tooltip]{--tooltip-edge:20px}[data-storepress-tooltip]{font-weight:400}[dir=rtl] [data-storepress-tooltip]{--_arrow-x:50%;--_content-x:calc(50% + var(--_tooltip-position))}[data-storepress-tooltip]{--_arrow-x:-50%;--_content-x:calc(-50% + var(--_tooltip-position));position:relative;--tooltip-angle:5px;--tooltip-font-size:0.8rem;--tooltip-text-color:#fff;--tooltip-background-color:#333;--tooltip-max-width:150px;--tooltip-min-height:35px;--tooltip-padding:10px;--tooltip-offset:5px;--tooltip-edge:2px;--_tooltip-position:0px}[data-storepress-tooltip]:after,[data-storepress-tooltip]:before{box-sizing:border-box;display:none;opacity:0;position:absolute;transition-behavior:allow-discrete;transition-duration:.5s;transition-property:opacity,display;z-index:999}@media(prefers-reduced-motion:reduce){[data-storepress-tooltip]:after,[data-storepress-tooltip]:before{transition-behavior:unset;transition-duration:0s;transition-property:none}}[data-storepress-tooltip]:focus-visible:after,[data-storepress-tooltip]:focus-visible:before,[data-storepress-tooltip]:hover:after,[data-storepress-tooltip]:hover:before{display:block;opacity:1}@starting-style{[data-storepress-tooltip]:focus-visible:after,[data-storepress-tooltip]:focus-visible:before,[data-storepress-tooltip]:hover:after,[data-storepress-tooltip]:hover:before{display:block;opacity:0}}[data-storepress-tooltip]:before{background-color:var(--tooltip-background-color);border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2);color:var(--tooltip-text-color);content:attr(data-storepress-tooltip);font-size:var(--tooltip-font-size);max-width:var(--tooltip-max-width);min-height:var(--tooltip-min-height);padding:var(--tooltip-padding);text-align:center;width:-moz-max-content;width:max-content;--x:var(--_content-x);--y:calc((100% + var(--tooltip-angle) + var(--tooltip-offset))*-1);right:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip]:after{border-top-color:transparent;content:"";--x:var(--_arrow-x);--y:calc((var(--tooltip-angle) + var(--tooltip-offset))*-1);border:var(--tooltip-angle) solid transparent;border-top:var(--tooltip-angle) solid var(--tooltip-background-color);right:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-top:before{--x:var(--_content-x);--y:calc((100% + var(--tooltip-angle) + var(--tooltip-offset))*-1);right:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-top:after{--x:var(--_arrow-x);--y:calc((var(--tooltip-angle) + var(--tooltip-offset))*-1);border-top-color:var(--tooltip-background-color);right:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-bottom:before{--x:var(--_content-x);--y:calc(100% + var(--tooltip-angle) + var(--tooltip-offset));bottom:0;right:50%;top:auto;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-bottom:after{--x:var(--_arrow-x);--y:calc(var(--tooltip-angle) + var(--tooltip-offset));border-bottom-color:var(--tooltip-background-color);border-top-color:transparent;bottom:0;right:50%;top:auto;translate:var(--x) var(--y)} -
woo-2checkout/trunk/vendor/storepress/admin-utils/build/admin-settings.asset.php
r3140508 r3256094 1 <?php return array('dependencies' => array( ), 'version' => '108721bec6926dc56a3c');1 <?php return array('dependencies' => array('storepress-utils', 'wp-dom-ready'), 'version' => '69751bf50127a8de8b24'); -
woo-2checkout/trunk/vendor/storepress/admin-utils/build/admin-settings.css
r3140508 r3256094 1 .select2-results__option--highlighted{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.select2-results__option--highlighted{--wp-admin-border-width-focus:1.5px}}[data-gwp_dependency]:not(.dependency-show){display:none!important}.storepress-settings-wrapper h2{font-size:1.3em;margin-bottom:10px}.storepress-settings-wrapper .nav-tab-wrapper{clear:both;display:flex;margin-block-start:20px;padding:0}.storepress-settings-wrapper .nav-tab{align-items:center;display:flex;gap:5px;justify-content:center}.storepress-settings-wrapper .storepress-settings-content-wrapper{border-bottom:1px solid #c3c4c7;display:flex;gap:10px;padding-block:20px}.storepress-settings-wrapper .storepress-settings-main{box-sizing:border-box;flex-basis:auto;flex-grow:9999}.storepress-settings-wrapper .storepress-settings-sidebar{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;flex-basis:20%;flex-grow:1;padding:10px}@media screen and (max-width:960px){.storepress-settings-wrapper .storepress-settings-sidebar{display:none}}.storepress-settings-wrapper .storepress-admin-form-table{background:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);margin:0;position:relative}.storepress-settings-wrapper .storepress-admin-form-table.has-section{margin:15px 0 0}.storepress-settings-wrapper .storepress-admin-form-table tr{border-bottom:1px solid #eee;display:table-row;vertical-align:top}.storepress-settings-wrapper .storepress-admin-form-table th{min-width:280px;padding:20px}.storepress-settings-wrapper .storepress-admin-form-table td{padding:20px}.storepress-settings-wrapper .storepress-admin-form-table tr:nth-child(2n){background:#fcfcfc}.storepress-settings-wrapper .storepress-admin-form-table label{cursor:pointer}.storepress-settings-wrapper .group-input-wrapper{align-items:flex-start;display:flex;flex-direction:column;gap:1.5rem}.storepress-settings-wrapper .group-input-wrapper .input-wrapper{align-items:center;display:flex;gap:.5rem;margin:0}.storepress-settings-wrapper .help-tip{color:#666;cursor:help;display:inline-block;font-size:1.1em;font-style:normal;height:16px;line-height:1;margin:0 5px;padding:0;position:relative;vertical-align:middle;width:16px}.storepress-settings-wrapper .help-tip:after{font-family:dashicons;speak:never;font-variant:normal;font-weight:400;line-height:1;text-transform:none;-webkit-font-smoothing:antialiased;content:"";cursor:help;height:100%;left:0;margin:0;position:absolute;text-align:center;text-indent:0;top:0;width:100%}.storepress-settings-wrapper td [for*=__group]{min-width:10em;vertical-align:baseline}.storepress-settings-wrapper input.large-text,.storepress-settings-wrapper textarea.large-text{width:90%}1 .select2-results__option--highlighted{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.select2-results__option--highlighted{--wp-admin-border-width-focus:1.5px}}[data-gwp_dependency]:not(.dependency-show){display:none!important}.storepress-settings-wrapper h2{font-size:1.3em;margin-bottom:10px}.storepress-settings-wrapper .nav-tab-wrapper{clear:both;display:flex;margin-block-start:20px;padding:0}.storepress-settings-wrapper .nav-tab{align-items:center;display:flex;gap:5px;justify-content:center}.storepress-settings-wrapper .storepress-settings-content-wrapper{border-bottom:1px solid #c3c4c7;display:flex;gap:10px;padding-block:20px}.storepress-settings-wrapper .storepress-settings-main{box-sizing:border-box;flex-basis:auto;flex-grow:9999}.storepress-settings-wrapper .storepress-settings-sidebar{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);box-sizing:border-box;flex-basis:20%;flex-grow:1;padding:10px}@media(max-width:960px){.storepress-settings-wrapper .storepress-settings-sidebar{display:none}}.storepress-settings-wrapper .storepress-admin-form-table{background:#fff;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.07),0 1px 1px rgba(0,0,0,.04);margin:0;position:relative}.storepress-settings-wrapper .storepress-admin-form-table.has-section{margin:15px 0 0}.storepress-settings-wrapper .storepress-admin-form-table tr{border-bottom:1px solid #eee;display:table-row;vertical-align:top}.storepress-settings-wrapper .storepress-admin-form-table th{min-width:280px;padding:20px}.storepress-settings-wrapper .storepress-admin-form-table td{padding:20px}.storepress-settings-wrapper .storepress-admin-form-table tr:nth-child(2n){background:#fcfcfc}.storepress-settings-wrapper .storepress-admin-form-table label{cursor:pointer}.storepress-settings-wrapper .input-label-wrapper{align-items:center;display:flex;gap:4px}.storepress-settings-wrapper .group-input-wrapper{align-items:flex-start;display:flex;flex-direction:column;gap:1.5rem}.storepress-settings-wrapper .group-input-wrapper .input-wrapper{align-items:center;display:flex;gap:.5rem;margin:0}.storepress-settings-wrapper .help-modal{margin-left:auto}.storepress-settings-wrapper .help-tooltip{color:#666;cursor:help;display:flex;font-size:1.1rem;font-style:normal;line-height:1;padding:0;position:relative;vertical-align:middle}.storepress-settings-wrapper .help-tooltip:after{font-family:dashicons;speak:never;font-variant:normal;font-weight:400;line-height:1;text-transform:none;-webkit-font-smoothing:antialiased;content:"";cursor:help;height:100%;margin:0;position:relative;text-align:center;text-indent:0;width:100%}.storepress-settings-wrapper td [for*=__group]{min-width:10em;vertical-align:baseline}.storepress-settings-wrapper input{line-height:normal}.storepress-settings-wrapper input.large-text,.storepress-settings-wrapper textarea.large-text{width:90%}.storepress-settings-wrapper input.toggle{--_width:2.5em;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border:1px solid #8c8f94;border-radius:1em;box-sizing:content-box;color:inherit;font-size:inherit;height:calc(var(--_width)/2);margin:auto;position:relative;vertical-align:middle;width:var(--_width)}.storepress-settings-wrapper input.toggle:disabled{opacity:.4}.storepress-settings-wrapper input.toggle:before{background-color:#2f2f2f;border:1px solid #fff;border-radius:50%;box-sizing:border-box;content:"";height:calc(var(--_width)/2);left:0;margin:0;position:absolute;right:auto;top:50%;transform:translateY(-50%);width:calc(var(--_width)/2)}.storepress-settings-wrapper input.toggle:checked{background-color:#3682c4;border-color:#3682c4}.storepress-settings-wrapper input.toggle:checked:before{background-color:#fff;border-color:#3682c4;left:auto;right:0}.storepress-settings-wrapper input.toggle+span{margin-inline-start:5px}@media(max-width:782px){.storepress-settings-wrapper input.toggle{--_width:3.5em}}.storepress-settings-wrapper.has-rtl input.toggle:before{left:auto;right:0}.storepress-settings-wrapper.has-rtl input.toggle:checked:before{left:0;right:auto}.storepress-settings-wrapper input[type=color]{border-radius:50%;--_width:2.1rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;block-size:var(--_width);border:1px solid #999;inline-size:var(--_width);padding:3px}@media(max-width:782px){.storepress-settings-wrapper input[type=color]{--_width:3rem}}.storepress-settings-wrapper input[type=color]::-webkit-color-swatch-wrapper{padding:1px}.storepress-settings-wrapper input[type=color]::-webkit-color-swatch{border-radius:50%}.storepress-settings-wrapper input[type=color]::-moz-color-swatch{border-radius:50%}.storepress-settings-wrapper .input-container{align-items:center;display:flex;gap:0}.storepress-settings-wrapper:not(.has-rtl) .input-container.has-suffix input{border-bottom-right-radius:0;border-right:0;border-top-right-radius:0;margin-right:0}.storepress-settings-wrapper:not(.has-rtl) .input-container.has-suffix .input-suffix{background-color:#dcdcde;border:1px solid #8c8f94;border-radius:0 4px 4px 0;box-shadow:0 0 0 transparent;color:#2c3338;line-height:2;padding:0 8px}.storepress-settings-wrapper.has-rtl .input-container.has-suffix input{border-bottom-left-radius:0;border-left:0;border-top-left-radius:0;margin-left:0}.storepress-settings-wrapper.has-rtl .input-container.has-suffix .input-suffix{background-color:#dcdcde;border:1px solid #8c8f94;border-radius:4px 0 0 4px;box-shadow:0 0 0 transparent;color:#2c3338;line-height:2;padding:0 8px}span[data-storepress-tooltip]{--tooltip-edge:20px}[data-storepress-tooltip]{font-weight:400}[dir=rtl] [data-storepress-tooltip]{--_arrow-x:50%;--_content-x:calc(50% + var(--_tooltip-position))}[data-storepress-tooltip]{--_arrow-x:-50%;--_content-x:calc(-50% + var(--_tooltip-position));position:relative;--tooltip-angle:5px;--tooltip-font-size:0.8rem;--tooltip-text-color:#fff;--tooltip-background-color:#333;--tooltip-max-width:150px;--tooltip-min-height:35px;--tooltip-padding:10px;--tooltip-offset:5px;--tooltip-edge:2px;--_tooltip-position:0px}[data-storepress-tooltip]:after,[data-storepress-tooltip]:before{box-sizing:border-box;display:none;opacity:0;position:absolute;transition-behavior:allow-discrete;transition-duration:.5s;transition-property:opacity,display;z-index:999}@media(prefers-reduced-motion:reduce){[data-storepress-tooltip]:after,[data-storepress-tooltip]:before{transition-behavior:unset;transition-duration:0s;transition-property:none}}[data-storepress-tooltip]:focus-visible:after,[data-storepress-tooltip]:focus-visible:before,[data-storepress-tooltip]:hover:after,[data-storepress-tooltip]:hover:before{display:block;opacity:1}@starting-style{[data-storepress-tooltip]:focus-visible:after,[data-storepress-tooltip]:focus-visible:before,[data-storepress-tooltip]:hover:after,[data-storepress-tooltip]:hover:before{display:block;opacity:0}}[data-storepress-tooltip]:before{background-color:var(--tooltip-background-color);border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.2);color:var(--tooltip-text-color);content:attr(data-storepress-tooltip);font-size:var(--tooltip-font-size);max-width:var(--tooltip-max-width);min-height:var(--tooltip-min-height);padding:var(--tooltip-padding);text-align:center;width:-moz-max-content;width:max-content;--x:var(--_content-x);--y:calc((100% + var(--tooltip-angle) + var(--tooltip-offset))*-1);left:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip]:after{border-top-color:transparent;content:"";--x:var(--_arrow-x);--y:calc((var(--tooltip-angle) + var(--tooltip-offset))*-1);border:var(--tooltip-angle) solid transparent;border-top:var(--tooltip-angle) solid var(--tooltip-background-color);left:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-top:before{--x:var(--_content-x);--y:calc((100% + var(--tooltip-angle) + var(--tooltip-offset))*-1);left:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-top:after{--x:var(--_arrow-x);--y:calc((var(--tooltip-angle) + var(--tooltip-offset))*-1);border-top-color:var(--tooltip-background-color);left:50%;top:0;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-bottom:before{--x:var(--_content-x);--y:calc(100% + var(--tooltip-angle) + var(--tooltip-offset));bottom:0;left:50%;top:auto;translate:var(--x) var(--y)}[data-storepress-tooltip].storepress-tooltip-position-bottom:after{--x:var(--_arrow-x);--y:calc(var(--tooltip-angle) + var(--tooltip-offset));border-bottom-color:var(--tooltip-background-color);border-top-color:transparent;bottom:0;left:50%;top:auto;translate:var(--x) var(--y)} -
woo-2checkout/trunk/vendor/storepress/admin-utils/build/admin-settings.js
r3140508 r3256094 1 ( {init(){this.promptBeforeExit()},handleBeforeTabSwitch:e=>(e.preventDefault(),StorePressAdminUtilsSettingsParams.unsaved_warning_text),promptBeforeExit(){let e=!1;document.querySelectorAll('input:not(.ignore-change):not([type="hidden"]):not([type="submit"]), select:not(.ignore-change), textarea:not(.ignore-change)').forEach((t=>{t.addEventListener("input",(()=>{e||(e=!0,window.addEventListener("beforeunload",this.handleBeforeTabSwitch))}))})),document.querySelectorAll('input[type="submit"], .storepress-settings-reset-action-link').forEach((e=>{e.addEventListener("click",(e=>{if(window.removeEventListener("beforeunload",this.handleBeforeTabSwitch),e.target.classList.contains("storepress-settings-reset-action-link")&&!window.confirm(StorePressAdminUtilsSettingsParams.reset_warning_text))return e.preventDefault(),!1}))}))}}).init();1 (()=>{"use strict";var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};(()=>{const e=window.StorePress.Utils;function o(t){const e=()=>{this.$element.style.removeProperty("--_tooltip-position"),this.$element.classList.remove("storepress-tooltip-position-top","storepress-tooltip-position-bottom");const t=this.$element.getBoundingClientRect(),e=window.getComputedStyle(this.$element),o=window.getComputedStyle(this.$element,"before"),n=parseInt(o.getPropertyValue("width"),10),s=parseInt(o.getPropertyValue("height"),10),i=parseInt(e.getPropertyValue("--tooltip-angle"),10),r=parseInt(e.getPropertyValue("--tooltip-edge"),10),l=s+i+r+parseInt(e.getPropertyValue("--tooltip-offset"),10)+parseInt(e.getPropertyValue("--tooltip-padding"),10);this.$element.classList.toggle("storepress-tooltip-position-bottom",t.top<l),this.$element.classList.toggle("storepress-tooltip-position-top",t.top>l);const p=n/2,a=t.left+t.width/2,d=p-a,c=p>a,m=p+a,u=document.body.clientWidth<m,h=document.body.clientWidth-m;c&&this.$element.style.setProperty("--_tooltip-position",`${d+r}px`),u&&this.$element.style.setProperty("--_tooltip-position",h-r+"px")},o=()=>{this.$element.addEventListener("focusin",e),this.$element.addEventListener("pointerenter",e)},n=()=>{this.$element.style.removeProperty("--_tooltip-position"),this.$element.classList.remove("storepress-tooltip-position-top","storepress-tooltip-position-bottom"),this.$element.removeEventListener("focusin",e),this.$element.removeEventListener("pointerenter",e)},s=()=>{n()};return(()=>(this.$element=t,o(),{unregister:s}))()}function n(){const t={getInstance:t=>(0,e.createPluginInstance)(t,!1,o),initWith(t="[data-storepress-tooltip]"){for(const{element:e,unregister:o}of this.getInstance(t))e.addEventListener("destroy",o)},init(){for(const{element:t,unregister:e}of this.getInstance("[data-storepress-tooltip]"))t.addEventListener("destroy",e)},destroy(){for(const{destroy:t}of this.getInstance("[data-storepress-tooltip]"))t()},destroyWith(t="[data-storepress-tooltip]"){for(const{destroy:e}of this.getInstance(t))e()}};document.addEventListener("storepress_tooltip_init",(()=>{t.init()})),document.addEventListener("storepress_tooltip_destroy",(()=>{t.destroy()})),document.addEventListener("storepress_tooltip_init_with",(e=>{const o=e.detail?.element;t.initWith(o)})),document.addEventListener("storepress_tooltip_destroy_with",(e=>{const o=e.detail?.element;t.destroyWith(o)}))}document.addEventListener("DOMContentLoaded",(()=>{n(),(0,e.triggerEvent)(document,"storepress_tooltip_init")}));const s=n,i=window.wp.domReady;var r=t.n(i);const l={init(){this.promptBeforeExit(),this.initTooltip()},handleBeforeTabSwitch:t=>(t.preventDefault(),t.returnValue=StorePressAdminUtilsSettingsParams.unsaved_warning_text,StorePressAdminUtilsSettingsParams.unsaved_warning_text),promptBeforeExit(){let t=!1;document.querySelectorAll('input:not(.ignore-change):not([type="hidden"]):not([type="submit"]), select:not(.ignore-change), textarea:not(.ignore-change)').forEach((e=>{e.addEventListener("input",(()=>{t||(t=!0,window.addEventListener("beforeunload",this.handleBeforeTabSwitch))}))})),document.querySelectorAll('input[type="submit"], .storepress-settings-reset-action-link').forEach((t=>{t.addEventListener("click",(t=>{if(window.removeEventListener("beforeunload",this.handleBeforeTabSwitch),t.target.classList.contains("storepress-settings-reset-action-link")&&!window.confirm(StorePressAdminUtilsSettingsParams.reset_warning_text))return t.preventDefault(),!1}))}))},initTooltip(){s()}};r()((function(){l.init()}))})()})(); -
woo-2checkout/trunk/vendor/storepress/admin-utils/composer.json
r3140508 r3256094 2 2 "name" : "storepress/admin-utils", 3 3 "description" : "Utility Classes for WordPress Plugin Projects.", 4 "version" : "1.8. 8",4 "version" : "1.8.10", 5 5 "license" : "GPL-2.0-or-later", 6 6 "type" : "library", … … 21 21 ], 22 22 "homepage" : "https://github.com/EmranAhmed/storepress-admin-utils#readme", 23 "minimum-stability" : " dev",23 "minimum-stability" : "stable", 24 24 "require-dev" : { 25 "automattic/vipwpcs" : "^3.0 ",25 "automattic/vipwpcs" : "^3.0.1", 26 26 "phpcompatibility/phpcompatibility-wp" : "^2.1.5", 27 27 "woocommerce/woocommerce-sniffs" : "^1.0.0", 28 "wp-cli/i18n-command" : "^v2.6. 0",28 "wp-cli/i18n-command" : "^v2.6.3", 29 29 "wp-coding-standards/wpcs" : "^3.1.0", 30 "php-stubs/woocommerce-stubs" : "^ 9.0",31 "phpstan/extension-installer" : "^1.4 ",32 "phpstan/phpstan-strict-rules" : "^1.6 ",33 "szepeviktor/phpstan-wordpress" : "^ 1.3"30 "php-stubs/woocommerce-stubs" : "^v9.5.0", 31 "phpstan/extension-installer" : "^1.4.3", 32 "phpstan/phpstan-strict-rules" : "^1.6.1", 33 "szepeviktor/phpstan-wordpress" : "^v1.3.5" 34 34 }, 35 35 "autoload" : { … … 39 39 }, 40 40 "config" : { 41 "lock" : false, 41 42 "optimize-autoloader" : true, 42 43 "sort-packages" : true, … … 48 49 "scripts" : { 49 50 "phpstan" : "./vendor/bin/phpstan analyse . --memory-limit=2G -vvv", 50 "phpstan-report" : "./vendor/bin/phpstan analyse . --memory-limit=2G -vvv > phpstan .report.txt",51 "phpstan-report" : "./vendor/bin/phpstan analyse . --memory-limit=2G -vvv > phpstan-report.txt", 51 52 "format" : "./vendor/bin/phpcbf --standard=phpcs.xml", 52 "lint" : "./vendor/bin/phpcs --standard=phpcs.xml --warning-severity=6 --report-summary --report-source --ignore-annotations --report-full=phpcs-report.txt" 53 "lint-report" : "./vendor/bin/phpcs --standard=phpcs.xml --warning-severity=6 --report-summary --report-source --ignore-annotations --report-full=phpcs-report.txt", 54 "lint" : "./vendor/bin/phpcs --standard=phpcs.xml --warning-severity=6 --report-summary --report-source" 53 55 } 54 56 } -
woo-2checkout/trunk/vendor/storepress/admin-utils/includes/Common.php
r3140508 r3256094 35 35 36 36 // Skip if attribute value is blank. 37 if ( is_string( $attribute_value ) 38 && $this->is_empty_string( $attribute_value ) 39 ) { 37 if ( is_string( $attribute_value ) && $this->is_empty_string( $attribute_value ) ) { 40 38 continue; 41 39 } … … 261 259 $defaults = wp_kses_allowed_html( 'post' ); 262 260 263 $allowed_attributes = array( ' disabled', 'type', 'width', 'size', 'id', 'class', 'style', 'checked', 'selected', 'multiple', 'name', 'required', 'label', 'aria-label', 'aria-describedby', 'value', 'step', 'mix', 'max', 'placeholder' );261 $allowed_attributes = array( 'list', 'disabled', 'type', 'width', 'size', 'id', 'class', 'style', 'checked', 'selected', 'multiple', 'name', 'required', 'label', 'aria-label', 'aria-describedby', 'value', 'step', 'mix', 'max', 'placeholder' ); 264 262 $tags = array( 265 263 'input' => $allowed_attributes, … … 268 266 'option' => $allowed_attributes, 269 267 'select' => $allowed_attributes, 268 'datalist' => $allowed_attributes, 270 269 ); 271 270 … … 279 278 ); 280 279 281 return array_merge( $defaults, $allowed_args, $args ); 280 $extra_args = array_reduce( 281 array_keys( $args ), 282 function ( $carry, $tag ) use ( $args ) { 283 $carry[ $tag ] = array_fill_keys( $args[ $tag ], true ); 284 return $carry; 285 }, 286 array() 287 ); 288 289 290 return array_merge( $defaults, $allowed_args, $extra_args ); 282 291 } 283 292 -
woo-2checkout/trunk/vendor/storepress/admin-utils/includes/Field.php
r3140508 r3256094 155 155 * Get default value. 156 156 * 157 * @return string|string[]|bool|numeric|null157 * @return bool|string|numeric|string[]|null 158 158 */ 159 159 public function get_default_value() { … … 337 337 338 338 /** 339 * Get datalist id. 340 * 341 * @return string 342 */ 343 public function get_datalist_id(): string { 344 return sprintf( '%s-datalist', $this->get_id() ); 345 } 346 347 /** 339 348 * Get available field sizes. 340 349 * … … 404 413 return $this->get_attribute( 'suffix' ); 405 414 } 415 /** 416 * Has field suffix. 417 * 418 * @return bool 419 */ 420 public function has_suffix(): bool { 421 return $this->has_attribute( 'suffix' ); 422 } 406 423 407 424 /** … … 478 495 */ 479 496 public function group_inputs(): array { 480 return array( 'radio', 'checkbox', ' group' );497 return array( 'radio', 'checkbox', 'toggle', 'group' ); 481 498 } 482 499 … … 490 507 */ 491 508 public function get_input_attributes( array $attrs, array $additional_attrs = array() ): string { 492 493 509 $attributes = wp_parse_args( $additional_attrs, $attrs ); 494 495 510 return $this->get_html_attributes( $attributes ); 496 511 } … … 510 525 511 526 $message = sprintf( 'Field: "%s" not implemented. Please add "Settings::custom_field" method to implement.', $type ); 512 wp_trigger_error( '', $message );527 wp_trigger_error( __METHOD__, $message ); 513 528 514 529 return ''; … … 537 552 } 538 553 554 if ( 'color' === $raw_type ) { 555 $system_class[] = 'color'; 556 } 557 539 558 $attributes = array( 540 559 'id' => $id, … … 545 564 ); 546 565 566 if ( $this->has_attribute( 'html_datalist' ) ) { 567 $attributes['list'] = $this->get_datalist_id(); 568 } 569 547 570 if ( $this->has_attribute( 'description' ) ) { 548 571 $attributes['aria-describedby'] = sprintf( '%s-description', $id ); … … 557 580 } 558 581 559 return sprintf( '< input %s /> %s', $this->get_input_attributes( $attributes, $additional_attributes ), $this->get_suffix() );582 return sprintf( '<div class="input-container %s"><span class="input-field"><input %s /></span><span class="input-suffix">%s</span></div>', ( $this->has_suffix() ? 'has-suffix' : '' ), $this->get_input_attributes( $attributes, $additional_attributes ), $this->get_suffix() ); 560 583 } 561 584 … … 606 629 public function check_input(): string { 607 630 608 $id = $this->get_id(); 609 $type = $this->get_type(); 610 $title = $this->get_title(); 611 $name = $this->get_name(); 612 $value = $this->get_value(); 613 $options = $this->get_options(); 631 $id = $this->get_id(); 632 $type = $this->get_type(); 633 $title = $this->get_title(); 634 $name = $this->get_name(); 635 $value = $this->get_value(); 636 $options = $this->get_options(); 637 $raw_type = $this->get_raw_type(); 638 639 $is_toggle = 'toggle' === $raw_type; 640 $is_checkbox = 'checkbox' === $type; 614 641 615 642 // Group checkbox. Options will be an array. 616 if ( 'checkbox' === $type&& count( $options ) > 1 ) {643 if ( $is_checkbox && count( $options ) > 1 ) { 617 644 $name = $this->get_name( true ); 618 645 } 619 646 620 647 // Single checkbox. Option will be string. 621 if ( 'checkbox' === $type&& $this->is_empty_array( $options ) ) {648 if ( $is_checkbox && $this->is_empty_array( $options ) ) { 622 649 $options = array( 'yes' => $title ); 623 650 } … … 626 653 if ( 'radio' === $type && $this->is_empty_array( $options ) ) { 627 654 $message = sprintf( 'Input Field: "%s". Title: "%s" need options to choose. "option"=>["key"=>"value"]', $id, $title ); 628 wp_trigger_error( '', $message );655 wp_trigger_error( __METHOD__, $message ); 629 656 630 657 return ''; … … 649 676 ); 650 677 651 $inputs[] = sprintf( '<label for="%s"><input %s /><span>%s</span></label>', esc_attr( $uniq_id ), $this->get_input_attributes( $attributes ), esc_html( $option_value ) ); 678 $option_description = ''; 679 if ( is_array( $option_value ) && isset( $option_value['label'] ) && isset( $option_value['description'] ) ) { 680 681 $option_description = sprintf( '<p class="description" id="%s-description">%s</p>', $uniq_id, $option_value['description'] ); 682 $option_value = $option_value['label']; 683 } 684 685 686 687 if ( $is_toggle ) { 688 $attributes['class'] = array( 'toggle' ); 689 } 690 691 $inputs[] = sprintf( '<label for="%s"><input %s /><span>%s</span></label> %s', esc_attr( $uniq_id ), $this->get_input_attributes( $attributes ), esc_html( $option_value ), wp_kses_post( $option_description ) ); 652 692 } 653 693 … … 679 719 } 680 720 721 if ( 'wc-enhanced-select' === $raw_type ) { 722 $system_class[] = 'wc-enhanced-select'; 723 } 724 681 725 $attributes = array( 682 726 'id' => $id, 683 'type' => 'select',727 // 'type' => 'select', 684 728 'name' => $name, 685 729 'class' => $this->prepare_classes( $class, $system_class ), … … 830 874 $field_title = $field->get_title(); 831 875 $field_type = $field->get_type(); 876 $raw_field_type = $field->get_raw_type(); 832 877 $field_name = $field->get_name(); 833 878 $field_options = $field->get_options(); … … 850 895 ); 851 896 897 $is_toggle = 'toggle' === $raw_field_type; 898 $is_checkbox = ( 'checkbox' === $field_type ); 899 900 if ( $is_checkbox ) { 901 $attributes['type'] = 'checkbox'; 902 } 903 852 904 // Group checkbox name. 853 if ( 'checkbox' === $field_type&& count( $field_options ) > 1 ) {905 if ( $is_checkbox && count( $field_options ) > 1 ) { 854 906 $attributes['name'] = $field->get_name( true ); 855 907 } … … 860 912 861 913 // Single checkbox. 862 if ( 'checkbox' === $field_type&& $this->is_empty_array( $field_options ) ) {914 if ( $is_checkbox && $this->is_empty_array( $field_options ) ) { 863 915 $attributes['value'] = 'yes'; 864 916 $attributes['checked'] = 'yes' === $field_value; 917 918 if ( $is_toggle ) { 919 $attributes['class'][] = 'toggle'; 920 } 865 921 866 922 $inputs[] = sprintf( '<p class="input-wrapper"><label for="%s"><input %s /><span>%s</span></label></p>', esc_attr( $uniq_id ), $this->get_input_attributes( $attributes ), esc_html( $field_title ) ); … … 881 937 $attributes['checked'] = is_array( $field_value ) ? in_array( $option_key, $field_value, true ) : $option_key == $field_value; 882 938 $attributes['id'] = $uniq_id; 883 $inputs[] = sprintf( '<li><label for="%s"><input %s /><span>%s</span></label></li>', esc_attr( $uniq_id ), $this->get_input_attributes( $attributes ), esc_html( $option_value ) ); 939 940 if ( $is_toggle ) { 941 $attributes['class'][] = 'toggle'; 942 } 943 944 $inputs[] = sprintf( '<li><label for="%s"><input %s /><span>%s</span></label></li>', esc_attr( $uniq_id ), $this->get_input_attributes( $attributes ), esc_html( $option_value ) ); 884 945 } 885 946 $inputs[] = '</ul>'; 886 947 887 948 } elseif ( 'textarea' === $field_type ) { 888 // Input box.949 // Input box. 889 950 $attributes['value'] = false; 890 951 $inputs[] = sprintf( '<p class="input-wrapper"><label for="%s"><span>%s</span></label> <textarea %s>%s</textarea></p>', esc_attr( $uniq_id ), esc_html( $field_title ), $this->get_input_attributes( $attributes, $field_attributes ), $field_value ); 891 952 } else { 892 $inputs[] = sprintf( '<p class="input-wrapper"><label for="%s"><span>%s</span></label> <input %s /> %s</p>', esc_attr( $uniq_id ), esc_html( $field_title ), $this->get_input_attributes( $attributes, $field_attributes ), esc_html( $field_suffix ) ); 953 954 $datalist_markup = ''; 955 if ( $field->has_attribute( 'html_datalist' ) ) { 956 957 $datalist_id = sprintf( '%s-datalist', $uniq_id ); 958 $attributes['list'] = $datalist_id; 959 960 $datalist_markup = sprintf( '<datalist id="%s">', $datalist_id ); 961 foreach ( $field->get_attribute( 'html_datalist' ) as $value ) { 962 $datalist_markup .= sprintf( '<option value="%s"></option>', $value ); 963 } 964 $datalist_markup .= '</datalist>'; 965 } 966 967 968 // @todo: add has suffix class 969 $inputs[] = sprintf( '<p class="input-wrapper"><label for="%s"><span>%s</span></label> <span class="input-container %s"><span class="input-field"><input %s /></span><span class="input-suffix">%s</span></span>%s</p>', esc_attr( $uniq_id ), esc_html( $field_title ), ( $field->has_suffix() ? 'has-suffix' : '' ), $this->get_input_attributes( $attributes, $field_attributes ), esc_html( $field_suffix ), $datalist_markup ); 893 970 } 894 971 } … … 926 1003 case 'number': 927 1004 return 'number'; 1005 case 'toggle': 928 1006 case 'checkbox': 929 1007 return $is_single ? 'string' : 'array'; 930 1008 case 'select2': 931 1009 case 'select': 1010 case 'wc-enhanced-select': 932 1011 return $is_multiple ? 'array' : 'string'; 933 1012 case 'group': … … 946 1025 public function get_label_markup(): string { 947 1026 948 $id = $this->get_id(); 949 $title = $this->get_title(); 950 $type = $this->get_type(); 1027 $id = $this->get_id(); 1028 $title = sprintf( '<span class="input-label">%s</span>', $this->get_title() ); 1029 $type = $this->get_type(); 1030 $tooltip_markup = $this->get_tooltip_markup(); 951 1031 952 1032 if ( in_array( $type, $this->group_inputs(), true ) ) { 953 return $title; 954 } 955 $required_markup = ''; 956 if ( $this->has_attribute( 'required' ) ) { 957 $required_markup = '<span class="required">*</span>'; 958 } 959 960 return sprintf( '<label for="%s">%s %s</label>', esc_attr( $id ), esc_html( $title ), $required_markup ); 1033 return sprintf( '<span class="input-label-wrapper">%s %s</span>', $title, $tooltip_markup ); 1034 } 1035 1036 $required_markup = $this->get_required_markup(); 1037 1038 1039 return sprintf( '<label for="%s"><span class="input-label-wrapper">%s %s %s</span></label>', esc_attr( $id ), $title, $required_markup, $tooltip_markup ); 961 1040 } 962 1041 … … 969 1048 970 1049 return array( 971 'tiny-text' => 'text', 972 'small-text' => 'text', 973 'regular-text' => 'text', 974 'large-text' => 'text', 975 'code' => 'text', 976 'select2' => 'select', 1050 'tiny-text' => 'text', 1051 'small-text' => 'text', 1052 'regular-text' => 'text', 1053 'large-text' => 'text', 1054 'code' => 'text', 1055 'select2' => 'select', 1056 'wc-enhanced-select' => 'select', 1057 'toggle' => 'checkbox', 977 1058 ); 978 1059 } … … 984 1065 * @todo Add More Fields 985 1066 * @see Settings::sanitize_fields() 986 * @example: input, code, textarea, select, select2, regular-text, small-text, tiny-text, large-text, color1067 * @example: text, range, search, url, color, number, code, textarea, select, select2, wc-enhanced-select, regular-text, small-text, tiny-text, large-text, color 987 1068 */ 988 1069 public function get_input_markup(): string { … … 993 1074 case 'regular-text': 994 1075 case 'code': 1076 case 'range': 1077 case 'search': 1078 case 'url': 995 1079 return $this->text_input(); 996 1080 case 'color': … … 1004 1088 case 'radio': 1005 1089 case 'checkbox': 1090 case 'toggle': 1006 1091 return $this->check_input(); 1007 1092 case 'select': 1008 1093 case 'select2': 1094 case 'wc-enhanced-select': 1009 1095 return $this->select_input(); 1010 1096 case 'group': … … 1027 1113 return $this->has_attribute( 'description' ) ? sprintf( '<p class="description" id="%s-description">%s</p>', esc_attr( $id ), wp_kses_post( $this->get_attribute( 'description' ) ) ) : ''; 1028 1114 } 1115 /** 1116 * Get field tooltip markup. 1117 * 1118 * @return string 1119 */ 1120 public function get_tooltip_markup(): string { 1121 return $this->has_attribute( 'tooltip' ) ? sprintf( '<span data-storepress-tooltip="%s"><span class="help-tooltip"></span></span>', esc_html( $this->get_attribute( 'tooltip' ) ) ) : ''; 1122 } 1123 /** 1124 * Get field required markup. 1125 * 1126 * @return string 1127 */ 1128 public function get_required_markup(): string { 1129 return $this->has_attribute( 'required' ) ? '<span class="required">*</span>' : ''; 1130 } 1131 /** 1132 * Get field description markup. 1133 * 1134 * @return string 1135 */ 1136 public function get_datalist_markup(): string { 1137 1138 $type = $this->get_type(); 1139 1140 if ( in_array( $type, array( 'select', 'checkbox', 'radio' ), true ) ) { 1141 return ''; 1142 } 1143 1144 $datalist_id = $this->get_datalist_id(); 1145 $datalist_attributes = $this->get_attribute( 'html_datalist', array() ); 1146 1147 $datalist_markup = ''; 1148 if ( ! $this->is_empty_array( $datalist_attributes ) ) { 1149 $datalist_markup = sprintf( '<datalist id="%s">', $datalist_id ); 1150 foreach ( $datalist_attributes as $value ) { 1151 $datalist_markup .= sprintf( '<option value="%s"></option>', $value ); 1152 } 1153 $datalist_markup .= '</datalist>'; 1154 } 1155 1156 return $datalist_markup; 1157 } 1029 1158 1030 1159 /** … … 1037 1166 $description = $this->get_description_markup(); 1038 1167 $input = $this->get_input_markup(); 1039 1040 $full_width = $this->get_attribute( 'full_width', false ); 1041 1042 // <span class="help-tip"></span> 1168 $full_width = $this->get_attribute( 'full_width', false ); 1169 $datalist = $this->get_datalist_markup(); 1170 1171 // <span class="help-tooltip"></span> 1172 // <span class="help-modal"></span> 1043 1173 if ( $full_width ) { 1044 return sprintf( '<tr><td colspan="2" class="td-full">%s %s </td></tr>', $input, $description );1045 } 1046 1047 return sprintf( '<tr><th scope="row">%s </th><td>%s %s</td></tr>', $label, $input, $description );1174 return sprintf( '<tr><td colspan="2" class="td-full">%s %s %s</td></tr>', $input, $datalist, $description ); 1175 } 1176 1177 return sprintf( '<tr><th scope="row">%s</th><td>%s %s %s</td></tr>', $label, $input, $datalist, $description ); 1048 1178 } 1049 1179 } -
woo-2checkout/trunk/vendor/storepress/admin-utils/includes/Fields.php
r3140508 r3256094 25 25 26 26 /** 27 * Setting. 28 * 29 * @var Settings 30 */ 31 private Settings $settings; 32 33 /** 27 34 * Sections. 28 35 * … … 44 51 */ 45 52 public function __construct( array $fields, Settings $settings ) { 53 54 $this->settings = $settings; 46 55 47 56 /** … … 81 90 } 82 91 } 92 } 93 94 /** 95 * Get Settings 96 * 97 * @return Settings 98 */ 99 public function get_settings(): Settings { 100 return $this->settings; 83 101 } 84 102 … … 141 159 public function display() { 142 160 143 $allowed_input_html = $this->get_kses_allowed_input_html(); 161 $allowed_input_html = $this->get_kses_allowed_input_html( $this->get_settings()->allowed_tags() ); 162 144 163 /** 145 164 * Section Instance. -
woo-2checkout/trunk/vendor/storepress/admin-utils/includes/Menu.php
r3140508 r3256094 132 132 return; 133 133 } 134 135 134 $this->settings_page_init(); 136 135 } … … 159 158 'admin_init', 160 159 function () { 161 162 160 // Process Settings Actions. 163 161 $this->settings_actions(); -
woo-2checkout/trunk/vendor/storepress/admin-utils/includes/Settings.php
r3140508 r3256094 160 160 public function register_admin_scripts() { 161 161 162 if ( $this->is_admin_page() ) { 163 $plugin_dir_url = untrailingslashit( plugin_dir_url( $this->get_plugin_file() ) ); 164 $plugin_dir_path = untrailingslashit( plugin_dir_path( $this->get_plugin_file() ) ); 165 166 $script_src_url = $plugin_dir_url . '/vendor/storepress/admin-utils/build/admin-settings.js'; 167 $style_src_url = $plugin_dir_url . '/vendor/storepress/admin-utils/build/admin-settings.css'; 168 $script_asset_file = $plugin_dir_path . '/vendor/storepress/admin-utils/build/admin-settings.asset.php'; 169 $script_assets = include $script_asset_file; 170 171 wp_register_script( 'storepress-admin-settings', $script_src_url, $script_assets['dependencies'], $script_assets['version'], true ); 172 wp_register_style( 'storepress-admin-settings', $style_src_url, array(), $script_assets['version'] ); 173 wp_localize_script( 'storepress-admin-settings', 'StorePressAdminUtilsSettingsParams', $this->localize_strings() ); 174 } 162 if ( ! $this->is_admin_page() ) { 163 return; 164 } 165 166 $plugin_dir_url = untrailingslashit( plugin_dir_url( $this->get_plugin_file() ) ); 167 $plugin_dir_path = untrailingslashit( plugin_dir_path( $this->get_plugin_file() ) ); 168 169 $admin_settings_script_url = $plugin_dir_url . '/vendor/storepress/admin-utils/build/admin-settings.js'; 170 $admin_settings_style_url = $plugin_dir_url . '/vendor/storepress/admin-utils/build/admin-settings.css'; 171 $admin_settings_script_asset_file = $plugin_dir_path . '/vendor/storepress/admin-utils/build/admin-settings.asset.php'; 172 $admin_settings_script_assets = include $admin_settings_script_asset_file; 173 174 175 $storepress_utils_script_url = $plugin_dir_url . '/vendor/storepress/admin-utils/build/storepress-utils.js'; 176 wp_register_script( 'storepress-utils', $storepress_utils_script_url, array(), $admin_settings_script_assets['version'], true ); 177 178 wp_register_script( 'storepress-admin-settings', $admin_settings_script_url, $admin_settings_script_assets['dependencies'], $admin_settings_script_assets['version'], true ); 179 wp_register_style( 'storepress-admin-settings', $admin_settings_style_url, array(), $admin_settings_script_assets['version'] ); 180 wp_localize_script( 'storepress-admin-settings', 'StorePressAdminUtilsSettingsParams', $this->localize_strings() ); 175 181 } 176 182 … … 183 189 wp_enqueue_script( 'storepress-admin-settings' ); 184 190 wp_enqueue_style( 'storepress-admin-settings' ); 191 192 if ( $this->has_field_type( 'wc-enhanced-select' ) ) { 193 wp_enqueue_style( 'woocommerce_admin_styles' ); 194 wp_enqueue_script( 'wc-enhanced-select' ); 195 } 185 196 } 186 197 … … 340 351 $page_fn_name = sprintf( $this->page_callback_fn_name_convention, $current_tab ); 341 352 $message = sprintf( 'Should return fields array from "<strong>%s()</strong>". Or For custom page create "<strong>%s()</strong>"', $fields_fn_name, $page_fn_name ); 342 wp_trigger_error( '', $message );353 wp_trigger_error( __METHOD__, $message ); 343 354 } 344 355 } … … 484 495 continue; 485 496 } 497 486 498 $_field = ( new Field( $field ) )->add_settings( $this ); 487 499 … … 492 504 493 505 return $all_fields; 506 } 507 508 /** 509 * Get Field Types 510 * 511 * @return string[] 512 */ 513 public function get_registered_field_types(): array { 514 $tabs = $this->get_tabs(); 515 516 $all_types = array(); 517 518 foreach ( $tabs as $tab ) { 519 520 $fields_callback = $tab['fields_callback']; 521 522 if ( is_callable( $fields_callback ) ) { 523 $fields = call_user_func( $fields_callback ); 524 foreach ( $fields as $field ) { 525 $all_types[] = $field['type']; 526 } 527 } 528 } 529 530 return array_unique( $all_types ); 494 531 } 495 532 … … 749 786 750 787 /** 788 * Get message query argument value. 789 * 790 * @return false|string 791 */ 792 final public function get_message_query_arg_value() { 793 // We are just checking message query args request from uri redirect. 794 if ( ! isset( $_GET['message'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended 795 return false; 796 } 797 798 return sanitize_text_field( $_GET['message'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 799 } 800 801 /** 751 802 * Settings messages 752 803 * … … 759 810 760 811 // We are just checking message request from uri redirect. 761 if ( ! isset( $_GET['message'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended812 if ( ! $this->get_message_query_arg_value() ) { 762 813 return; 763 814 } … … 765 816 $strings = $this->localize_strings(); 766 817 767 $message = sanitize_text_field( $_GET['message'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended818 $message = $this->get_message_query_arg_value(); 768 819 769 820 if ( 'updated' === $message ) { … … 904 955 * @return Field|null 905 956 */ 906 p rivatefunction get_field( string $field_id ): ?Field {957 public function get_field( string $field_id ): ?Field { 907 958 $fields = $this->get_all_fields(); 908 959 909 960 return $fields[ $field_id ] ?? null; 961 } 962 963 /** 964 * Get field. 965 * 966 * @param string $field_type Field Type. 967 * 968 * @return bool 969 */ 970 public function has_field_type( string $field_type ): bool { 971 $types = $this->get_registered_field_types(); 972 return in_array( $field_type, $types, true ); 910 973 } 911 974 … … 1170 1233 return ( is_admin() && isset( $_GET['page'] ) && $this->get_current_page_slug() === $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended 1171 1234 } 1235 1236 /** 1237 * Add new allowed tag on Fields markup 1238 * 1239 * @return array<string, mixed> 1240 */ 1241 public function allowed_tags(): array { 1242 return array(); 1243 } 1172 1244 } 1173 1245 } -
woo-2checkout/trunk/vendor/storepress/admin-utils/includes/templates/classic-template.php
r3140508 r3256094 10 10 11 11 defined( 'ABSPATH' ) || die( 'Keep Silent' ); 12 13 $storepress_rtl_class = is_rtl() ? 'has-rtl' : ''; 12 14 ?> 13 <div class="wrap storepress-settings-wrapper ">15 <div class="wrap storepress-settings-wrapper <?php echo esc_attr( $storepress_rtl_class ); ?>"> 14 16 <h1><?php echo esc_html( get_admin_page_title() ); ?></h1> 15 17 -
woo-2checkout/trunk/woo-2checkout.php
r3140508 r3256094 10 10 * Description: 2Checkout Payment Gateway for WooCommerce. 11 11 * Author: Emran Ahmed 12 * Version: 3. 0.312 * Version: 3.1.0 13 13 * Requires PHP: 7.4 14 * Requires at least: 6. 115 * Tested up to: 6. 614 * Requires at least: 6.4 15 * Tested up to: 6.7 16 16 * WC requires at least: 8.1 17 * WC tested up to: 9. 217 * WC tested up to: 9.7 18 18 * Text Domain: woo-2checkout 19 19 * Author URI: https://getwooplugins.com/ … … 23 23 */ 24 24 25 declare( strict_types=1 ); 26 25 27 defined( 'ABSPATH' ) || die( 'Keep Silent' ); 26 28 27 29 use StorePress\TwoCheckoutPaymentGateway\Plugin; 30 use StorePress\TwoCheckoutPaymentGateway\Plugin_Extended; 28 31 29 32 if ( ! defined( 'STOREPRESS_TWO_CHECKOUT_PLUGIN_FILE' ) ) { … … 32 35 33 36 if ( ! defined( 'STOREPRESS_TWO_CHECKOUT_COMPATIBLE_EXTENDED_VERSION' ) ) { 34 define( 'STOREPRESS_TWO_CHECKOUT_COMPATIBLE_EXTENDED_VERSION', '3.0.0' ); 35 } 36 37 // Include the Plugin class. 38 if ( ! class_exists( '\StorePress\TwoCheckoutPaymentGateway\Plugin' ) ) { 39 require_once plugin_dir_path( __FILE__ ) . 'includes/Plugin.php'; 37 define( 'STOREPRESS_TWO_CHECKOUT_COMPATIBLE_EXTENDED_VERSION', '3.1.0' ); 40 38 } 41 39 … … 50 48 51 49 /** 50 * Get Pro Plugin File 51 * 52 * @return string 53 */ 54 function woo_2checkout_pro_plugin_file(): string { 55 return defined( 'STOREPRESS_TWO_CHECKOUT_PRO_PLUGIN_FILE' ) ? constant( 'STOREPRESS_TWO_CHECKOUT_PRO_PLUGIN_FILE' ) : 'woo-2checkout-pro/woo-2checkout-pro.php'; 56 } 57 58 /** 52 59 * The main function that returns the Plugin class 53 60 * 54 * @return Plugin| false55 * @since 2.1.061 * @return Plugin|Plugin_Extended 62 * @since 1.0.0 56 63 */ 57 64 function woo_2checkout() { 58 // Include the main class. 59 60 if ( ! class_exists( 'WooCommerce' ) ) { 61 return false; 65 // Include the Plugin class. 66 if ( ! class_exists( '\StorePress\TwoCheckoutPaymentGateway\Plugin' ) ) { 67 require_once plugin_dir_path( __FILE__ ) . 'includes/Plugin.php'; 62 68 } 63 69 64 if ( function_exists( 'woo_2checkout_pro' ) ) {70 if ( function_exists( 'woo_2checkout_pro' ) && function_exists( 'woo_2checkout_pro_is_compatible' ) && woo_2checkout_pro_is_compatible() ) { 65 71 return woo_2checkout_pro(); 66 72 } … … 69 75 } 70 76 71 // Get the plugin running.72 add_action( 'plugins_loaded', 'woo_2checkout' );73 74 77 /** 75 * Admin Notice for required plugin.78 * Init to hook. 76 79 * 77 80 * @return void 78 81 */ 79 function woo_2checkout_requirements_notice() { 80 if ( ! class_exists( 'WooCommerce' ) ) { 81 82 $text = esc_html__( 'WooCommerce', 'woo-2checkout' ); 83 84 $plugin_args = array( 85 'tab' => 'plugin-information', 86 'plugin' => 'woocommerce', 87 'TB_iframe' => 'true', 88 'width' => '640', 89 'height' => '500', 90 ); 91 92 $link = add_query_arg( $plugin_args, admin_url( 'plugin-install.php' ) ); 93 94 $message = __( '<strong>Payment Gateway - 2Checkout for WooCommerce</strong> is an add-on of ', 'woo-2checkout' ); 95 96 printf( '<div class="%1$s"><p>%2$s <a class="thickbox open-plugin-details-modal" href="%3$s"><strong>%4$s</strong></a></p></div>', 'notice notice-error', wp_kses_post( $message ), esc_url( $link ), esc_html( $text ) ); 97 } 82 function woo_2checkout_init() { 83 woo_2checkout(); 98 84 } 99 85 100 add_action( 'admin_notices', 'woo_2checkout_requirements_notice' ); 101 102 // Deactivate too old extended plugin. 103 add_action( 104 'admin_init', 105 function () { 106 107 $plugin_file = 'woo-2checkout-pro/woo-2checkout-pro.php'; 108 109 $file = wp_normalize_path( $plugin_file ); 110 $plugin = plugin_basename( $file ); 111 112 $abs_file = trailingslashit( WP_PLUGIN_DIR ) . $plugin; 113 114 if ( ! file_exists( $abs_file ) ) { 115 return; 116 } 117 118 $data = get_plugin_data( $abs_file ); 119 $required_version = woo_2checkout_compatible_pro_version(); 120 $current_version = sanitize_text_field( $data['Version'] ); 121 122 if ( is_plugin_inactive( $plugin_file ) ) { 123 return; 124 } 125 126 // Yes. Compatible. 127 if ( version_compare( $current_version, $required_version, '>=' ) ) { 128 return; 129 } 130 131 // Deactivate the plugin silently, Prevent deactivation hooks from running. 132 deactivate_plugins( $plugin_file, true ); 133 }, 134 12 135 ); 86 // Get the plugin running. 87 add_action( 'plugins_loaded', 'woo_2checkout_init' );
Note: See TracChangeset
for help on using the changeset viewer.