Changeset 2473627
- Timestamp:
- 02/12/2021 10:05:56 AM (5 years ago)
- Location:
- checkoutx
- Files:
-
- 34 edited
- 1 copied
-
tags/1.1.2 (copied) (copied from checkoutx/trunk)
-
tags/1.1.2/README.txt (modified) (3 diffs)
-
tags/1.1.2/admin/class-admin.php (modified) (6 diffs)
-
tags/1.1.2/assets/js/public.js (modified) (2 diffs)
-
tags/1.1.2/changelog.txt (modified) (1 diff)
-
tags/1.1.2/checkout-x.php (modified) (6 diffs)
-
tags/1.1.2/includes/class-activator.php (modified) (1 diff)
-
tags/1.1.2/includes/class-api-controller.php (modified) (4 diffs)
-
tags/1.1.2/includes/class-api.php (modified) (1 diff)
-
tags/1.1.2/includes/class-custom-webhooks.php (modified) (11 diffs)
-
tags/1.1.2/includes/class-deactivator.php (modified) (1 diff)
-
tags/1.1.2/includes/class-i18n.php (modified) (1 diff)
-
tags/1.1.2/includes/class-loader.php (modified) (2 diffs)
-
tags/1.1.2/includes/class-main.php (modified) (10 diffs)
-
tags/1.1.2/includes/class-status-notifier.php (modified) (3 diffs)
-
tags/1.1.2/includes/class-uninstallation.php (modified) (1 diff)
-
tags/1.1.2/public/class-public.php (modified) (12 diffs)
-
tags/1.1.2/public/partials/checkout-x-public-display.php (modified) (1 diff)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/admin/class-admin.php (modified) (6 diffs)
-
trunk/assets/js/public.js (modified) (2 diffs)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/checkout-x.php (modified) (6 diffs)
-
trunk/includes/class-activator.php (modified) (1 diff)
-
trunk/includes/class-api-controller.php (modified) (4 diffs)
-
trunk/includes/class-api.php (modified) (1 diff)
-
trunk/includes/class-custom-webhooks.php (modified) (11 diffs)
-
trunk/includes/class-deactivator.php (modified) (1 diff)
-
trunk/includes/class-i18n.php (modified) (1 diff)
-
trunk/includes/class-loader.php (modified) (2 diffs)
-
trunk/includes/class-main.php (modified) (10 diffs)
-
trunk/includes/class-status-notifier.php (modified) (3 diffs)
-
trunk/includes/class-uninstallation.php (modified) (1 diff)
-
trunk/public/class-public.php (modified) (12 diffs)
-
trunk/public/partials/checkout-x-public-display.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
checkoutx/tags/1.1.2/README.txt
r2441493 r2473627 1 1 === Checkout X for WooCommerce === 2 2 Contributors: checkoutx 3 Tags: Checkout, Checkout X, checkoutx, one-page checkout, one page checkout, upsells, post-purchase upsells. automatic discounts, woocommerce, e-commerce3 Tags: checkout, one page checkout, upsell, post-purchase upsell, automatic discount, woocommerce, e-commerce, payment, abandoned cart, AOV, conversion, WooCommerce checkout 4 4 Requires at least: 5.4 5 Tested up to: 5. 5.16 Stable tag: trunk5 Tested up to: 5.6.1 6 Stable tag: 1.1.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 13 13 == Description == 14 14 15 Checkout X increases your revenue by providing a better shopper experience to your customers. Use Checkout X to dramatically improve your checkout conversion rate and average order value with minimum implementation efforts - all happens immediately and automatically - just like magic! Available for WooCommerce stores of any size. 15 [Checkout X](https://www.checkout-x.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=intro) is a complete E-Commerce checkout solution for online stores who are starting, growing, or already scaling on WooCommerce. Add Checkout X to your store to get a faster checkout that skyrockets your revenue through higher conversion rates and powerful post-purchase upsells. 16 17 == Why use Checkout X? == 18 19 Checkout X increases your revenue by providing a better shopper experience to your customers. Use Checkout X to dramatically improve your checkout conversion rate and average order value with minimum implementation efforts – all happens instantly and automatically – just like magic! 20 21 The best news is you can be a WooCommerce store of any size and scale, Checkout X will help you grow no matter how big you are right now. 16 22 17 23 Having processed over $600M in transactions across thousands of stores, we are always working on optimization and adjustments to deliver the best-in-class results. 18 24 19 == What will you get with Checkout X? == 25 [Meet Checkout X](https://www.checkout-x.com/) | [View Demo](https://www.checkout-x.com/) | [Help Center](https://help.checkout-x.com/en/) | [Community](https://www.facebook.com/groups/474196383269538) 20 26 21 - **Increase your Conversion Rates with our Frictionless Checkout** 22 - Allow shoppers to complete a purchase within 25 seconds where the industry average is 66 seconds. 23 - Reduce the checkout process to just 12 input fields where the AVG checkout has 17 input fields with our simplified UX process 24 - Reduce the user interactions to 11, where the AVG checkout has 18 thanks to a combination of IP localization, address auto-fils, and smart pre-selecting 25 - Deliver stellar results on both desktop and mobile in the increasingly mobile-driven world with our mobile-first design approach 26 - **Sell more with Post-purchase Upsells** 27 - Bring in a significant revenue boost. 1 in 2 merchants increases their revenue with over €1000. In total, upsells account for 8% of Checkout X's transaction volume. 28 - Let customers finish the original order first, offer them the upsell right after to ensure they do not drop during the checkout 29 - Post-purchase upsells can be effective in all e-commerce stores, independent of the industry. 3 out of 4 merchants who set up an upsell manage to get extra sales. 27 == Merchants love Checkout X for a few key reasons == 30 28 31 **What does Checkout X empower you to?** 29 - **Increased conversion rates.** When the customer shopping experience is enriched and simplified, shoppers start checking out more. Less friction means more conversions. Checkout X merchants see an average revenue boost of 5% - 15%. 30 - **Improved average order value.** More conversion rates means online stores increase the lifetime value of their customers, while the relevant and well-timed upsells boost the average order value of all online shoppers. 31 - **Confidence and security.** The tailored payment method integration of Checkout X gives you absolute security and the ability to use the extra features of your payment providers. 3D security shifts liability for fraud to the customer’s bank, which means you can finally stop worrying about fraud and focus on growth. 32 - **Designed & optimized for mobile.** Checkout X is fully responsive, which means the mobile-first design boosts your sales no matter the devices your customers use to shop from your WooCommerce store. 33 34 Want to ask a pre-sale question? [Get in touch](https://www.checkout-x.com/contact_us)! 35 36 == What do we do best? == 37 38 The real success of our merchants comes when they combine our high-converting frictionless checkout with the powerful post-purchase upsells that customers see after they’ve completed their purchase. 39 40 **Online shopping made effortless.** 41 Checkout X multiplies your WooCommerce revenue by introducing a high-converting, mobile-first checkout with seamless & secure payments, well-timed post-purchase upsells, and a robust set of available integrations to add extra value. 42 43 **Less abandoned carts, more revenue.** 44 With the one-page checkout experience and minimum number of input fields, Checkout X solves one of the main reasons why customers abandon carts - long and confusing checkout process. By eliminating friction and distractions, customers can check out almost instantly. 45 46 **All you need under one roof.** 47 Forget about using multiple plugins to boost your WooCommerce store’s conversion rates or struggling with code to modify the design, layout, and behavior of your checkout. With Checkout X, you get a complete plug-and-play solution you set up once and forget about it. 48 49 == Increase conversion rates with a frictionless one-page checkout == 50 51 - **[Fast checkout process](https://www.checkout-x.com/frictionless_checkout).** The industry average for most checkouts is about 66 seconds, while customers using Checkout X can finish in less than 25 seconds. 52 - **Less input fields for customers.** Eliminate all friction and distractions to reduce any chances customers can drop off due to a long and overwhelming checkout process. 53 - **One page checkout.** Instantly show customers the entire checkout and how easy it’s going to be to complete their order by showing all the fields and the simplified UI. 54 - **Auto-complete for customer info.** Give customers an even bigger speed boost by eliminating the need to input their address manually with location-based auto-fill. 55 - **Made for mobile.** Completing orders with Checkout X is fast and simple on any device to give your customers on the move a better shopping experience. 56 - **Buy Now links.** Help customers skip the cart and go straight to checkout with the product already there, ready to complete the order faster. 57 - **Abandoned cart emails.** Recover any revenue leaks by sending out personal email notifications that help shoppers pickup where they left from and complete their orders. 58 59 == Boost revenue and AOV with relevant & well-timed upsells == 60 61 Post-purchase upsells can be effective in all E-commerce stores, whatever the industry. 3 out of 4 merchants who set up an upsell manage to get extra sales. 62 63 - **[Post-purchase upsells](https://www.checkout-x.com/post_purchase_upsells).** Trigger special offers for customers after they’ve entered their payment information and confirmed their order so it’s twice as easy to increase AOV without any additional actions. 64 - **A/B testing.** Run tests between multiple triggers and upsell offers to find the highest-converting combinations that provide the most value for customers and the most revenue for your WooCommerce store. 65 66 == Promote trust, confidence, and security to increase sales == 67 68 - **[Impeccable payment security](https://www.checkout-x.com/seamless_payments).** With the tailored payment integrations, Checkout X brings the security of your payment provider and their additional features using their native API. All payment data is collected and processed directly by the payment provider and not stored within Checkout X. 69 - **3D Secure payments.** PSD2 compliant with 3D Secure payment support at no extra cost. To combine ease of use with security, 3D Secure is only invoked when required by the customer’s bank. 70 - **Fraud protection.** With 3D security, you get bank-level protection by eliminating fraud liability while shifting all of it to the customer’s bank, letting you focus on growth, instead of worrying about fraud. 71 72 == Connect and start selling in no time. No technical skills needed. == 73 74 https://www.youtube.com/watch?v=kLMvEYNf3ug 75 76 - **Easy to install & setup.** Checkout X takes less than 30 minutes to install and set up thanks to the extremely intuitive onboarding. The plugin is designed to recognize and sync your store data to get you up and selling faster. 77 - **Plug-and-play.** Checkout X doesn’t need any modifications or additional technical setup. You plug it in and it just starts working in the background without any need for regular maintenance. 78 - **Easy to customize.** The checkout page is easy to edit and customize so you can change the copy on all the fields, add your brand colors & styles, and fine-tune the customer experience with trust badges, additional custom sections, or custom scripts. 79 - **No coding required.** You don’t need any developers or technical skills to setup or work with Checkout X. It’s designed to help merchants start making more sales on auto-pilot. 80 - **Customizable Thank you page.** Enrich the customer experience even more by building a Thank you page that makes shoppers want to come back for more. 81 82 == Checkout X is an all-in-one solution == 83 84 Going with Checkout X means you’re going for a competitive advantage in your niche without the need of multiple plugins to achieve a conversion uplift. The app is designed to solve both low conversion rates and revenue while increasing AOV & LTV. 85 86 All of that happens from a sleek modern dashboard where simplicity comes together with cutting edge tech to give merchants the hassle-free intuitive experience they need to focus more on growth and less on technical struggles. 87 88 1. **Zero maintenance plugin, ready to go out of the box.** Other plugins require you to build the entire experience from scratch, while Checkout X is ready to go right away. 89 2. **Native cart recovery.** You don’t need other plugins to send out abandoned cart emails since Checkout X has a built-in functionality to help you recover lost revenue. You also have integrations for Klaviyo, Mailchimp, and SMSBump if you prefer using them. 90 3. **Post-purchase upsells.** Forget about plugins that only add upsells to your store. Checkout X gives you a simple way to quickly create multiple upsell offers. 91 4. **Integrated payments.** With Checkout X, you don’t need your WooCommerce store to have your payment provider’s plugin installed. You can simply connect to them from your Checkout X dashboard and you’re ready to roll. 92 93 Optimize your WooCommerce performance by unloading all unnecessary plugins and handle every checkout related process from Checkout X. 94 95 == What do you get with Checkout X? == 96 97 - Allow shoppers to complete a purchase within 25 seconds where the industry average is 66 seconds. 98 - Reduce the checkout process to just 12 input fields where the AVG checkout has 17 input fields with our simplified UX process. 99 - Reduce the user interactions to 11, where the AVG checkout has 18 thanks to a combination of IP localization, address auto-fils, and smart pre-selecting. 100 - Deliver stellar results on both desktop and mobile in the increasingly mobile-driven world with our mobile-first design approach. 101 - Bring in a significant revenue boost and increase AOV and LTV with well-timed and relevant post-purchase upsells. 1 in 2 merchants increases their revenue with over €1000. In total, upsells account for 8% of Checkout X’s transaction volume. 102 - Let customers finish the original order first, offer them the upsell right after to ensure they do not drop during the checkout. 103 104 == What can you do with Checkout X? == 32 105 33 106 - Convert more shoppers into customers 34 107 - Increase the AOV with post-purchase upsells 35 - Offer payment methods your customers prefer36 - Speak the language of your customer (translations available !)37 - Recover abandoned shoppingcarts38 - Integrate with tools you already use and work for you108 - Offer the payment methods your customers prefer 109 - Speak the language of your customer (translations available) 110 - Recover lost revenue from abandoned carts 111 - Integrate with your favorite tools & apps 39 112 40 Take advantage of your new Checkout on Steroids and boost your revenue today! 113 Take advantage of your new Checkout on steroids and boost your revenue today! 114 115 == Who are we? == 116 117 Checkout X is on a mission to democratize checkout technology and help SMBs compete with E-Commerce brands and giants. With us, it’s like your online store has a team of conversion pros and developers working around the clock to constantly improve your conversion rates and add new features to your favorite checkout. 118 119 == What’s coming soon? == 120 121 Our worldwide team is pushing the limits of checkout technology. Here’s what we’re currently developing and bringing to WooCommerce: 122 123 - **Apple Pay** 124 - **Google Pay** 125 126 == Screenshots == 127 128 1. One page, mobile-ready checkout 129 2. Post-purchase upsells 130 3. Modern, minimal thank you page 131 4. Manage your checkout with our app 132 5. Manage your post-purchase upsells 133 6. Checkout-X - your checkout on steroids 41 134 42 135 == Installation == … … 50 143 For automatic installation log in to your WordPress dashboard, navigate to the Plugins menu and click Add New. 51 144 52 53 == Screenshots ==54 55 1. One page, mobile-ready checkout56 2. Post-purchase upsells57 3. Modern, minimal thank you page58 4. Manage your checkout with our app59 5. Manage your post-purchase upsells60 6. Checkout-X - your checkout on steroids61 62 63 145 == Changelog == 64 146 147 = 1.1.2 - 2021-02-12 = 148 * Rename the plugin to Checkout X. 149 * Update the URL of Checkout X app. 150 * Extend the response of the plugin's API endpoints. 151 65 152 = 1.1.1 = 66 * send an event to CheckoutX on plugin activation/deactivation/uninstall153 * Send an event to Checkout X on plugin activation/deactivation/uninstall. -
checkoutx/tags/1.1.2/admin/class-admin.php
r2441493 r2473627 16 16 private $version; 17 17 18 const CHECKOUT_X_ROOT_URL = "https://www.checkout-x.com"; 18 const CHECKOUTX_APP_URL = "https://app.checkout-x.com"; 19 const CHECKOUTX_WEBSITE_URL = "https://www.checkout-x.com"; 19 20 const HELP_CENTER_URL = "https://help.checkout-x.com"; 20 21 const BASE64_APP_ICON = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aWNvbkA8L3RpdGxlPgogICAgPGcgaWQ9Imljb24iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik0yNS42MjUsMjQgQzI2LjAxNzg1NzEsMjQgMjYuMzQ1MjM4MSwyMy44NjY2NjY3IDI2LjYwNzE0MjksMjMuNiBDMjYuODY5MDQ3NiwyMy4zMzMzMzMzIDI3LDIzIDI3LDIyLjYgTDI3LDIyLjYgTDI3LDkuNCBDMjcsOSAyNi44NjkwNDc2LDguNjY2NjY2NjcgMjYuNjA3MTQyOSw4LjQgQzI2LjM0NTIzODEsOC4xMzMzMzMzMyAyNi4wMTc4NTcxLDggMjUuNjI1LDggTDI1LjYyNSw4IEw2LjM3NSw4IEM1Ljk4MjE0Mjg2LDggNS42NTQ3NjE5LDguMTMzMzMzMzMgNS4zOTI4NTcxNCw4LjQgQzUuMTMwOTUyMzgsOC42NjY2NjY2NyA1LDkgNSw5LjQgTDUsOS40IEw1LDIyLjYgQzUsMjMgNS4xMzA5NTIzOCwyMy4zMzMzMzMzIDUuMzkyODU3MTQsMjMuNiBDNS42NTQ3NjE5LDIzLjg2NjY2NjcgNS45ODIxNDI4NiwyNCA2LjM3NSwyNCBMNi4zNzUsMjQgTDI1LjYyNSwyNCBaIE0yNS4zMzQ5MzY1LDEzLjI4NTg5ODQgTDYuMzM0OTM2NDksMTMuMjg1ODk4NCBMNi4zMzQ5MzY0OSwxMC43ODU4OTg0IEM2LjQwMDkwODcxLDkuNzg1ODk4MzggNi42MTUzMTg0Myw5LjI4NTg5ODM4IDYuOTc4MTY1NjYsOS4yODU4OTgzOCBMMjQuOTQzMTc5Nyw5LjI5NDcxNDExIEMyNS4yNzY3NzYxLDkuNDczMTI0MzcgMjUuMjY4OTY0Myw5Ljc4NTg5ODM4IDI1LjMzNDkzNjUsMTAuNzg1ODk4NCBMMjUuMzM0OTM2NSwxMy4yODU4OTg0IFogTTI0LjY1NTgwODksMjIuMzQ4MDc2MiBMNi45NDIyNjcyNywyMi4zNDgwNzYyIEM2LjU3OTQyMDA1LDIyLjM0ODA3NjIgNi4zNjUwMTAzMywyMi4xNjA1NzYyIDYuMjk5MDM4MTEsMjEuNzg1NTc2MiBMNi4yOTkwMzgxMSwyMS43ODU1NzYyIEw2LjI5OTAzODExLDE2LjM0ODA3NjIgTDI1LjI5OTAzODEsMTYuMzQ4MDc2MiBMMjUuMjk5MDM4MSwyMS43ODU1NzYyIEMyNS4yMzMwNjU5LDIyLjE2MDU3NjIgMjUuMDE4NjU2MiwyMi4zNDgwNzYyIDI0LjY1NTgwODksMjIuMzQ4MDc2MiBMMjQuNjU1ODA4OSwyMi4zNDgwNzYyIFogTTE3LjI2Nzk0OTIsMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxNy44NTg2NjA5IEw3LjI2Nzk0OTE5LDE3Ljg1ODY2MDkgTDcuMjY3OTQ5MTksMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxOS4wNjk1NDIzIFogTTI0LjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwxNy44MTY5ODczIEwyMS4yNDUxOTA1LDE3LjgxNjk4NzMgTDIxLjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwyMC44MTY5ODczIFogTTExLjkwMTkyMzgsMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwxOS45NTY3MzcyIEw3LjkwMTkyMzc5LDE5Ljk1NjczNzIgTDcuOTAxOTIzNzksMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwyMS4xNjc2MTg1IFoiIGlkPSLvhJkiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYuMDAwMDAwLCAxNi4wMDAwMDApIHJvdGF0ZSgzMzAuMDAwMDAwKSB0cmFuc2xhdGUoLTE2LjAwMDAwMCwgLTE2LjAwMDAwMCkgIj48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg=="; … … 54 55 add_menu_page( 55 56 'checkout-x', 56 'Checkout X',57 'Checkout X', 57 58 'manage_options', 58 59 'checkout-x-settings', … … 64 65 add_submenu_page( 65 66 'checkout-x-settings', 66 'Checkout X settings',67 'Checkout X settings', 67 68 'General', 68 69 'manage_options', … … 73 74 add_submenu_page( 74 75 'checkout-x-settings', 75 'Checkout X help center',76 'Checkout X help center', 76 77 'Help center', 77 78 'manage_options', … … 108 109 109 110 if (!empty($shop_id)) { 110 return esc_url(self::CHECKOUT _X_ROOT_URL . "/shops/" . $shop_id . "/" . $additional_path);111 return esc_url(self::CHECKOUTX_APP_URL . "/shops/" . $shop_id . "/" . $additional_path); 111 112 } else { 112 return esc_url(self::CHECKOUT _X_ROOT_URL);113 return esc_url(self::CHECKOUTX_WEBSITE_URL); 113 114 } 114 115 } … … 116 117 public function contact_us_checkoutx_url() 117 118 { 118 return esc_url(self::CHECKOUT _X_ROOT_URL . "/contact_us");119 return esc_url(self::CHECKOUTX_WEBSITE_URL . "/contact_us"); 119 120 } 120 121 } -
checkoutx/tags/1.1.2/assets/js/public.js
r2441493 r2473627 30 30 */ 31 31 32 // exported to window object and called by storefront script 32 33 var checkoutXPlugin = { 34 // calls method on backend to empty cart and when server responds - trigger 35 // wc_fragment_refresh event to update UI 33 36 clearWoocommerceCart :function(){ 34 37 var data = { … … 49 52 }; 50 53 54 // observe changes on #checkout-x-content element. If it gets updated by 55 // wc_ajax refreshed_cart_fragments - sync cart with Checkout X 56 // TODO: move to storefront script itself 51 57 $(function() { 52 58 var observer = new MutationObserver(function() { -
checkoutx/tags/1.1.2/changelog.txt
r2441493 r2473627 1 = 1.1.2 - 2021-02-12 = 2 * Rename the plugin to Checkout X. 3 * Update the URL of Checkout X app. 4 * Extend the response of the plugin's API endpoints. 5 1 6 = 1.1.1 = 2 * send an event to CheckoutX on plugin activation/deactivation/uninstall7 * Send an event to Checkout X on plugin activation/deactivation/uninstall. 3 8 4 9 = 1.1.0 = 5 * public release6 * adds automatic shop configuration10 * Public release. 11 * Adds automatic shop configuration. 7 12 8 13 = 1.0 = 9 * closed beta launch14 * Closed beta launch. -
checkoutx/tags/1.1.2/checkout-x.php
r2441493 r2473627 5 5 * 6 6 * This file is read by WordPress to generate the plugin information in the plugin 7 * admin area. This file also includes all of the dependencies used by the plugin, 8 * registers the activation and deactivation functions, and defines a function 9 * that starts the plugin. 7 * admin area. Plugin version ready from here and set as constant. 8 * 9 * This file registers activation/deactivation and uninstall hooks for the 10 * plugin. It also includes all of the dependencies used by the plugin and defines a functionthat starts the plugin. 10 11 * 11 12 * @link https://www.checkout-x.com … … 14 15 * 15 16 * @wordpress-plugin 16 * Plugin Name: Checkout X17 * Plugin Name: Checkout X 17 18 * Plugin URI: https://www.checkout-x.com 18 * Description: C onnect CheckoutX to your shop19 * Version: 1.1. 119 * Description: Checkout X boosts your revenue with a high-converting, frictionless, mobile-first checkout experience for your WooCommerce store. Get less abandoned carts and more sales with a fast checkout that completes itself on any device to give you more conversions and average order value. 20 * Version: 1.1.2 20 21 * Author: Checkout X 21 22 * Author URI: https://www.checkout-x.com/?utm_source=partner&utm_medium=woocommerce-marketplace … … 26 27 */ 27 28 28 // If this file is called directly, abort. 29 /** 30 * If this file is called directly, abort. 31 */ 29 32 if ( ! defined( 'WPINC' ) ) { 30 33 die; 31 34 } 32 35 36 /** 37 * defines constant to be used as a root in building absolute path when other 38 * files need include/reqiure some dependency 39 */ 33 40 if ( ! defined( 'CHKX_PLUGIN_FILE' ) ) { 34 41 define( 'CHKX_PLUGIN_FILE', __FILE__ ); 35 42 } 36 43 37 // fetch plugin version from plugin data and set as constant 44 /** 45 * fetches plugin version from plugin info above and sets it as constant 46 * plugin version is sent on API status request and also used in assets 47 * filenames digest 48 */ 38 49 if ( ! defined( 'WC_CHECKOUT_X_VERSION' ) ) { 39 50 $plugin_data = get_file_data( __FILE__, array( 'Version' => 'Version' ), false ); … … 41 52 } 42 53 54 /** 55 * defines plugin name constant, used when ensuring that auto-update is enabled 56 * for the plugin 57 */ 43 58 if ( ! defined( 'WC_CHECKOUT_X_PLUGIN_NAME' ) ) { 44 59 define( 'WC_CHECKOUT_X_PLUGIN_NAME', 'checkout-x'); … … 63 78 } 64 79 80 /** 81 * The code that runs during plugin uninstall. 82 * This action is documented in includes/class-uninstallation.php 83 */ 65 84 function uninstall_Checkout_X() { 66 85 require_once plugin_dir_path(__FILE__) . 'includes/class-uninstallation.php'; … … 73 92 74 93 /** 75 * The core plugin class that is used to define internationalization,94 * The core plugin class that is used to define main logic, 76 95 * admin-specific hooks, and public-facing site hooks. 77 96 */ -
checkoutx/tags/1.1.2/includes/class-activator.php
r2441493 r2473627 16 16 { 17 17 /** 18 * Runs on plugin activation. Sends 'activated' event to CheckoutX 18 * Runs on plugin activation. Sends 'activated' event to Checkout X 19 * 20 * Uses StatusNotifier to send http query to Checkout X app 19 21 * 20 22 * @since 1.0.0 -
checkoutx/tags/1.1.2/includes/class-api-controller.php
r2441493 r2473627 1 1 <?php 2 3 /** 4 * Declares endpoints for plugin REST API extension 5 * 6 * Defines two endpoints in /wc-checkoutx/v1/ namespace: 7 * - GET /status 8 * No authentication required. Checkout X uses this endpoint to ensure that shop 9 * has plugin installed and checkcurrent version of the plugin. 10 * Returns 11 * - 200 with JSON body { "version": "<plugin version>" } 12 * 13 * 14 * - PUT /settings 15 * Requires authentcation. Only accessible by admins. 16 * Has three mandatory query params: 17 * - shop_id - Checkout X shop hashid 18 * - js_script_url - url to load Checkout X storefront script from 19 * - event_secret - secret to generate request signature when sending notifications 20 * to Checkout X ( i.e. on pludin activation / deactivation ) 21 * Updates plugin settings with values passed in request. 22 * Returns: 23 * - 200 with JSON body { "result": "success" } when shop settings 24 * successfully updated to given values or already was valid 25 * - 403 with "result": "error" and current status of each setting when any 26 * of the settings failed update 27 * 28 * All endpoints have custom header added: 29 * - X-CHECKOUT-X-PLUGIN-VERSION - contains current version of plugin 30 * 31 * @link checkout-x.com 32 * @since 1.0.0 33 * @package Checkout_X 34 * @subpackage Checkout_X/includes 35 * @author Checkout X 36 */ 37 2 38 class Checkout_X_API_Controller 3 39 { 40 /** 41 * wc- prefix here is mandatory to indicate WooCommerce that this endpoint is 42 * third-party extension of Woo REST API. All endpoints within this namespace 43 * support standard WooCommerce authentication automatically 44 */ 4 45 protected $namespace = 'wc-checkoutx'; 5 46 6 47 protected $api_version = 'v1'; 7 48 49 /** 50 * Registers endpoints and defines params, callback and permission check 51 * callback for each of them 52 */ 8 53 public function register_routes() 9 54 { … … 40 85 } 41 86 87 /** 88 * GET /status callback 89 */ 42 90 public function get_status() 43 91 { 44 $data = array('version' => WC_CHECKOUT_X_VERSION); 92 $data = array( 93 "version" => WC_CHECKOUT_X_VERSION, 94 "options" => array( 95 "js_script_url" => get_option("checkout_x_storefront_url", null), 96 ), 97 ); 45 98 return $this->wrap_response($data, 200); 46 99 } 47 100 101 /** 102 * PUT /settings callback 103 * 104 * Uses get_option first to fetch current value of the setting. Need it to 105 * respond with success when setting already had proper value. 106 * update_option returns false when called with same value as setting already 107 * has 108 * 109 * 200 when all settings successfully updated or aleady have proper value 110 * 403 when failed to update any of settings 111 */ 48 112 public function update_settings($request) 49 113 { … … 74 138 } 75 139 76 # check that current user has 'Administrator' level access 77 # https://wordpress.org/support/article/roles-and-capabilities/#administrator 140 /** 141 * checks that current user has 'Administrator' level access 142 * https://wordpress.org/support/article/roles-and-capabilities/#administrator 143 */ 78 144 public function check_is_admin() 79 145 { … … 81 147 } 82 148 149 /** 150 * Adds custom data to responses of all endpoints. Currently adds header with 151 * plugin version only. 152 */ 83 153 private function wrap_response($data, $status = HTTP_STATUS_OK, $headers = array()) 84 154 { -
checkoutx/tags/1.1.2/includes/class-api.php
r2441493 r2473627 1 1 <?php 2 2 3 /** 4 * Declares controllers for all REST API namespaces that plugin extends 5 * 6 * 7 * @link checkout-x.com 8 * @since 1.0.0 9 * @package Checkout_X 10 * @subpackage Checkout_X/includes 11 * @author Checkout X 12 */ 3 13 class Checkout_X_API 4 14 { -
checkoutx/tags/1.1.2/includes/class-custom-webhooks.php
r2441493 r2473627 1 1 <?php 2 3 2 /** 4 * The file that defines the core plugin class3 * Extends WooCommerce webhooks system with additional topics for Checkout X app 5 4 * 6 * A class definition that includes attributes and functions used across both the 7 * public-facing side of the site and the admin area. 5 * 6 * Defines following additional webhooks: 7 * - product_category.created 8 * - product_category.updated 9 * - product_category.deleted 10 * - shop.updated 8 11 * 9 12 * @link checkout-x.com 10 * @since 1.0.511 *12 * @package Checkout_X13 * @subpackage Checkout_X/includes14 */15 16 /**17 * The core plugin class.18 *19 * This is used to define internationalization, admin-specific hooks, and20 * public-facing site hooks.21 *22 * Also maintains the unique identifier of this plugin as well as the current23 * version of the plugin.24 *25 13 * @since 1.0.5 26 14 * @package Checkout_X … … 48 36 * @access protected 49 37 * @var string $plugin_name The string used to uniquely identify this plugin. 38 * @deprecated Not used in this class anymore 50 39 */ 51 40 protected $plugin_name; … … 61 50 62 51 /** 63 * Define the core functionality of the plugin. 64 * 65 * Set the plugin name and the plugin version that can be used throughout the plugin. 66 * Load the dependencies, define the locale, and set the hooks for the admin area and 67 * the public-facing side of the site. 52 * Adds hook for shop.updated and hooks for product category CRUD events 53 * 54 * Also sets plugin name ( deprecated, could be removed ) and version from 55 * contructor params 68 56 * 69 57 * @since 1.0.5 … … 78 66 } 79 67 68 /** 69 * Generates payload for product category and shop events 70 * 71 * Follow the same logic as default webhook implementationi in WooCommerce: 72 * - get webhook by ID from database 73 * - temporarily set user to owner of webhook 74 * - make a request to WooCommerce REST API, fetch value for payload and update 75 * $payload param of the method 76 * - switch back to original user 77 * 78 * Called by wooocmmerce_webhook_payload filter, it expects this method to 79 * update $payload with proper value 80 */ 80 81 public function add_custom_webhook_payload($payload, $resource, $resource_id, $webhook_id) 81 82 { … … 126 127 } 127 128 129 /** 130 * Maps webhook topic name to action name 131 * 132 * Called by `woocommerce_webhook_topic_hooks`, expected to extend 133 * dictionary of $topic_hooks 134 */ 128 135 public function add_custom_topic_hooks($topic_hooks) 129 136 { … … 145 152 } 146 153 154 /** 155 * Adds our custom events to the list of allowed events 156 * 157 * Called by `woocommerce_valid_webhook_events` filter. Extends 158 * $topic_events array with our events. 159 */ 147 160 public function add_custom_topic_events($topic_events) 148 161 { … … 157 170 } 158 171 172 /** 173 * Maps webhooks topics to webhook displayed name in admin dashboard 174 * 175 * __() method fetches localized version of the string. We don't use i18n 176 * but it's left here for consistency with default WooCommerce 177 * implementation. 178 * Called by `woocommerce_webhook_topics` 179 * 180 */ 159 181 public function add_custom_webhook_topics($topics) 160 182 { 161 // New topic array to add to the list, must match hooks being created.162 183 $new_topics = array( 163 184 'product_category.created' => __( 'Product Category Created', 'woocommerce' ), … … 170 191 } 171 192 193 /** 194 * Adds our resources ( shop & product category ) to the list of valid resources 195 * 196 * Required for WC REST API.. Function that validates webhook topic is here: wordpress/wp-content/plugins/woocommerce/includes/wc-webhook-functions.php#67 197 */ 172 198 public function extend_valid_webhook_resources($resources) 173 199 { … … 179 205 } 180 206 207 /** 208 * Triggers shop.updated webhook on any change to WooCommerce settings 209 */ 181 210 public function send_webhook_on_settings_change($setting_changed) 182 211 { … … 187 216 } 188 217 218 /** 219 * Subscribes to any Wordpress option change 220 */ 189 221 private function add_settings_hook() 190 222 { … … 192 224 } 193 225 226 227 /** 228 * Subscribes to product_cat CRUD events and trggers relevant webhook topic 229 */ 194 230 private function add_product_cat_hooks() 195 231 { -
checkoutx/tags/1.1.2/includes/class-deactivator.php
r2441493 r2473627 16 16 17 17 /** 18 * Runs on plugin deactivation. Sends 'deactivated' event to Checkout X.18 * Runs on plugin deactivation. Sends 'deactivated' event to Checkout X. 19 19 * 20 * Uses StatusNotifier to send http query to Checkout X app. 20 21 * @since 1.0.0 21 22 */ 23 22 24 public static function deactivate() { 23 25 require_once plugin_dir_path(CHKX_PLUGIN_FILE) . 'includes/class-status-notifier.php'; -
checkoutx/tags/1.1.2/includes/class-i18n.php
r2441493 r2473627 4 4 * Define the internationalization functionality 5 5 * 6 * Not used at the moment. 6 7 * Loads and defines the internationalization files for this plugin 7 8 * so that it is ready for translation. -
checkoutx/tags/1.1.2/includes/class-loader.php
r2441493 r2473627 1 1 <?php 2 3 /**4 * Register all actions and filters for the plugin5 *6 * @link checkout-x.com7 * @since 1.0.08 *9 * @package Checkout_X10 * @subpackage Checkout_X/includes11 */12 13 2 /** 14 3 * Register all actions and filters for the plugin. … … 18 7 * run function to execute the list of actions and filters. 19 8 * 9 * @link checkout-x.com 10 * @since 1.0.0 20 11 * @package Checkout_X 21 12 * @subpackage Checkout_X/includes 22 * @author Vlad <just.raeno@icloud.com>13 * @author Checkout X 23 14 */ 24 15 -
checkoutx/tags/1.1.2/includes/class-main.php
r2441493 r2473627 6 6 * A class definition that includes attributes and functions used across both the 7 7 * public-facing side of the site and the admin area. 8 * It also extends Wordpress REST API to include methods to check plugin status 9 * and update plugin settings and extends WooCommerce webhooks to include additional 10 * webhooks required by Checkout X to work properly. 8 11 * 9 12 * @link checkout-x.com … … 72 75 * - Checkout_X_Admin. Defines all hooks for the admin area. 73 76 * - Checkout_X_Public. Defines all hooks for the public side of the site. 77 * - Checkout_X_API. Registers custom REST API namespace /wc-checkoutx/v1/. 78 * - Checkout_X_API_Controller. Defines logic for REST API plugin endpoints. 79 * - Checkout_X_CustomWebhooks. Extends WooCommerce webhooks with events 80 * Checkout X needs 74 81 * 75 82 * Create an instance of the loader which will be used to register the hooks … … 100 107 101 108 /** 102 * Classes responsible for Checkout X API on top of WooCommerce API109 * Classes responsible for Checkout X API on top of WooCommerce API 103 110 */ 104 111 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-api.php'; … … 123 130 * Uses the Checkout_X_i18n class in order to set the domain and to register the hook 124 131 * with WordPress. 132 * Currently plugin has almost no text and doesn't use i18n. 125 133 * 126 134 * @since 1.0.0 … … 162 170 $plugin_public = new Checkout_X_Public($this->get_plugin_name(), $this->get_version()); 163 171 164 # uncomment this if you want to add some styles from plugin 172 # uncomment this if you want to load some styles from plugin 173 # on shop public pages ( product pages, cart, etc ) 165 174 # $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); 166 175 176 # loads plugin JS file on all shop pages 177 # more info in assets/js/public.js documentation 167 178 $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); 179 180 # adds meta tag with shop ID to <head>. Used by CHKX storefront JS. 168 181 $this->loader->add_action('wp_head', $plugin_public, 'add_resources'); 169 182 … … 179 192 } 180 193 194 /** 195 * Registers hook that extends cart_fragments JSON with DOM element that 196 * includes cart content for Checkout X storefront script 197 */ 181 198 private function define_filters() 182 199 { … … 186 203 } 187 204 205 /** 206 * Registers hook that extend WooCommerce webhooks with custom topics: 207 * - product_category CRUD 208 * - shop.updated 209 */ 188 210 private function define_custom_webhooks() 189 211 { … … 202 224 } 203 225 226 /** 227 * Registers filter that externds REST API namespaces with plugin specific /wc-checkoutx 228 */ 204 229 public function define_api() 205 230 { … … 208 233 } 209 234 235 /** 236 * Registers filter that is triggered when Wordpress check whether auto 237 * update is enabled for plugin or not 238 */ 210 239 public function configure_auto_update() 211 240 { … … 213 242 } 214 243 244 245 /** 246 * Triggered by `auto_update_plguin` filter. Returns true for our plugin to 247 * indicate that plugin should always have auto-update enabled 248 */ 215 249 public function enable_auto_update( $update, $item) 216 250 { -
checkoutx/tags/1.1.2/includes/class-status-notifier.php
r2441493 r2473627 1 1 <?php 2 2 3 /** 4 * Sends events to Checkout X when plugin state changes 5 * 6 * Currently sends three types of events: 7 * - plugin activated 8 * - plugin deactivated 9 * - plugin uninstalled 10 * 11 * Uses `wp_remote_post` behind the scenes to make POST request to Checkout X 12 * endpoint. Request body is JSON. 13 * 14 * Uses event secret stored inside of`checkout_x_event_secret` settingto generate 15 * signature and sends it as X-WC-CHECCHECKOUTX-PLUGIN-EVENT-SIGNATURE header, 16 * necessary for request authentication on Checkout X 17 * 18 * Base url for all requests id defined in CHECKOUTX_URL environment variable. 19 * If no url present, use the production URL. 20 * 21 * @link checkout-x.com 22 * @since 1.1.0 23 * @package Checkout_X 24 * @subpackage Checkout_X/includes 25 * @author Checkout X 26 */ 3 27 class Checkout_X_Status_Notifier 4 28 { 5 const DEFAULT_CHECKOUT_X_URL = 'https:// www.checkout-x.com';29 const DEFAULT_CHECKOUT_X_URL = 'https://app.checkout-x.com'; 6 30 7 31 public function plugin_activated() … … 42 66 } 43 67 68 /** 69 * Build url to send event to. 70 * 71 * Takes root url from ENV for dev/staging shops, we don't expect this environment variable 72 * to be defined on real shops and we use production URL. 73 * 74 * Also relies on `checkout_x_shop_id` to be present and uses it as part of 75 * event url. 76 * 77 */ 44 78 public function event_delivery_url() 45 79 { 46 80 $shop_id = get_option('checkout_x_shop_id'); 47 81 48 # use url from ENV for dev/staging, use default url on merchant shops49 82 $checkout_x_url = getenv('CHECKOUTX_URL') ?: self::DEFAULT_CHECKOUT_X_URL; 50 83 … … 53 86 54 87 88 /** 89 * Builds signature similar to WooCommerce webhook signature to 90 * authenticate requests from plugin on Checkout X side 91 */ 55 92 public function build_signature($payload) 56 93 { -
checkoutx/tags/1.1.2/includes/class-uninstallation.php
r2441493 r2473627 16 16 { 17 17 /** 18 * Runs on plugin uninstall. Send 'uninstall' event to CheckoutX.18 * Runs on plugin uninstall. Sends 'uninstall' event to Checkout X. 19 19 * @since 1.1.0 20 20 */ -
checkoutx/tags/1.1.2/public/class-public.php
r2441493 r2473627 2 2 3 3 /** 4 * The public-facing functionality of the plugin. 4 * Defines all logic related to shop pages and cart handling 5 * 6 * Loads public.js script on every shop page. Adds meta tag with shop hashid on 7 * every store page. 8 * 9 * Main logic of Checkout X is handled here: 10 * - we include JSON encoded cart content on the page inside script 11 * tag. This script tag is inserted every time any shop page is loaded 12 * ( product page, cart page, etc). Also we add key with scrip tag id to 13 * cart_fragments, when cart content is changed via AJAX call => script tag 14 * content is updated via `get_refreshed_fragments` flow. 15 * - JSON encoded cart content is used by Checkout X to sync cart to latest state 16 * 17 * When user goes to checkout page - we redirect him to Checkout X checkout page 18 * if proper cookie is found on the page. 19 * 20 * Also adds logic to clear cart when order on Checkout X side is completed. 5 21 * 6 22 * @link checkout-x.com 7 23 * @since 1.0.0 8 *9 24 * @package Checkout_X 10 25 * @subpackage Checkout_X/public 11 */ 12 13 /** 14 * The public-facing functionality of the plugin. 15 * 16 * Defines the plugin name, version, and two examples hooks for how to 17 * enqueue the public-facing stylesheet and JavaScript. 18 * 19 * @package Checkout_X 20 * @subpackage Checkout_X/public 21 * @author Vlad <just.raeno@icloud.com> 26 * @author Checkout X 22 27 */ 23 28 … … 87 92 } 88 93 94 /** 95 * Adds meta tag with shop ID to be used by Checkout X storefront script 96 */ 89 97 public function add_resources() 90 98 { … … 101 109 } 102 110 111 /** 112 * Fetches shop ID from settings 113 */ 103 114 public function get_shop_id() 104 115 { … … 106 117 } 107 118 119 /** 120 * Fetches Checkout X storefront script url value from settings 121 */ 108 122 public function get_storefront_script_url() 109 123 { … … 111 125 } 112 126 113 // cart content element is placed within "checkout-x-content" div to 114 // reduce amount of nodes to observe on JS side 127 /* 128 * Adds parent tag with cart content inside on the page. 129 * 130 * Cart content element is placed within "#checkout-x-content" div to 131 * reduce JS load when checking updates. We use MutationObserver 132 * and having parent element allows to observe only child elements. 133 */ 115 134 public function add_cart_json() 116 135 { … … 119 138 } 120 139 140 /* 141 * Adds cart content to cart fragments. 142 * 143 * Key here is jQuery selector of element. Value - content of element to 144 * replace found selector with. WooCommerce iterates over each key in 145 * refreshed fragments 146 */ 121 147 public function add_cart_json_fragments($fragments) 122 148 { … … 125 151 } 126 152 153 /** 154 * Loads cart from WC root function or global $woocommerce variable 155 * 156 * TODO: WC function is available from version 2.1 of WooCommerce, most probably 157 * we don't need it since we support WooCommerce version only > 4 158 */ 127 159 public function maybe_load_cart() { 128 160 129 if ( function_exists( 'WC' )) {130 if ( empty( WC()->cart )) {131 WC()->cart = new WC_Cart();132 }133 } else {134 global $woocommerce;135 if ( empty( $woocommerce->cart )) {136 $woocommerce->cart = new WC_Cart();137 } 138 }161 if (function_exists('WC')) { 162 if (empty(WC()->cart)) { 163 WC()->cart = new WC_Cart(); 164 } 165 } else { 166 global $woocommerce; 167 if (empty( $woocommerce->cart)) { 168 $woocommerce->cart = new WC_Cart(); 169 } 170 } 139 171 } 140 172 … … 147 179 } 148 180 181 /** 182 * Generates script tag with cart content encoded as JSON 183 * 184 * 185 * We also add "properties" key to each item with "product_id" entry. It's 186 * necessary for WooCommerce since Checkout X expect every checkout item to 187 * be unique and uses combination of variant_id and properties to validate 188 * uniqueness. For WooCommerce shop variant_id could be same for different 189 * products. 190 */ 149 191 private function cart_content() 150 192 { … … 169 211 } 170 212 213 /** 214 * Redirects to Checkout X checkout page if cart is not empty and user 215 * reaches /checkout page 216 */ 171 217 public function checkout_nav_menu_redirect() 172 218 { … … 182 228 } 183 229 230 /** 231 * Build checkout_url based on cookie set by Checkout X script 232 * 233 * Returns original url if cookie is not set 234 */ 184 235 public function checkoutx_checkout_url($original_url) 185 236 { … … 191 242 } 192 243 244 /** 245 * Empties WooCommerce cart. 246 * 247 * Available for public.js via wp_localize_script. Called when Checkout X API 248 * indicates that checkout is already completed. 249 */ 193 250 public function clear_cart() 194 251 { … … 202 259 echo json_encode(WC()->cart->get_cart_contents()); 203 260 261 # this method is called via AJAX so it's safe to die here 204 262 wp_die(); 205 263 } -
checkoutx/tags/1.1.2/public/partials/checkout-x-public-display.php
r2416469 r2473627 1 <h2>Checkout X Dev</h2>1 <h2>Checkout X Dev</h2> 2 2 <?php 3 3 -
checkoutx/trunk/README.txt
r2441493 r2473627 1 1 === Checkout X for WooCommerce === 2 2 Contributors: checkoutx 3 Tags: Checkout, Checkout X, checkoutx, one-page checkout, one page checkout, upsells, post-purchase upsells. automatic discounts, woocommerce, e-commerce3 Tags: checkout, one page checkout, upsell, post-purchase upsell, automatic discount, woocommerce, e-commerce, payment, abandoned cart, AOV, conversion, WooCommerce checkout 4 4 Requires at least: 5.4 5 Tested up to: 5. 5.16 Stable tag: trunk5 Tested up to: 5.6.1 6 Stable tag: 1.1.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 13 13 == Description == 14 14 15 Checkout X increases your revenue by providing a better shopper experience to your customers. Use Checkout X to dramatically improve your checkout conversion rate and average order value with minimum implementation efforts - all happens immediately and automatically - just like magic! Available for WooCommerce stores of any size. 15 [Checkout X](https://www.checkout-x.com/?utm_source=wordpress&utm_medium=plugin&utm_campaign=intro) is a complete E-Commerce checkout solution for online stores who are starting, growing, or already scaling on WooCommerce. Add Checkout X to your store to get a faster checkout that skyrockets your revenue through higher conversion rates and powerful post-purchase upsells. 16 17 == Why use Checkout X? == 18 19 Checkout X increases your revenue by providing a better shopper experience to your customers. Use Checkout X to dramatically improve your checkout conversion rate and average order value with minimum implementation efforts – all happens instantly and automatically – just like magic! 20 21 The best news is you can be a WooCommerce store of any size and scale, Checkout X will help you grow no matter how big you are right now. 16 22 17 23 Having processed over $600M in transactions across thousands of stores, we are always working on optimization and adjustments to deliver the best-in-class results. 18 24 19 == What will you get with Checkout X? == 25 [Meet Checkout X](https://www.checkout-x.com/) | [View Demo](https://www.checkout-x.com/) | [Help Center](https://help.checkout-x.com/en/) | [Community](https://www.facebook.com/groups/474196383269538) 20 26 21 - **Increase your Conversion Rates with our Frictionless Checkout** 22 - Allow shoppers to complete a purchase within 25 seconds where the industry average is 66 seconds. 23 - Reduce the checkout process to just 12 input fields where the AVG checkout has 17 input fields with our simplified UX process 24 - Reduce the user interactions to 11, where the AVG checkout has 18 thanks to a combination of IP localization, address auto-fils, and smart pre-selecting 25 - Deliver stellar results on both desktop and mobile in the increasingly mobile-driven world with our mobile-first design approach 26 - **Sell more with Post-purchase Upsells** 27 - Bring in a significant revenue boost. 1 in 2 merchants increases their revenue with over €1000. In total, upsells account for 8% of Checkout X's transaction volume. 28 - Let customers finish the original order first, offer them the upsell right after to ensure they do not drop during the checkout 29 - Post-purchase upsells can be effective in all e-commerce stores, independent of the industry. 3 out of 4 merchants who set up an upsell manage to get extra sales. 27 == Merchants love Checkout X for a few key reasons == 30 28 31 **What does Checkout X empower you to?** 29 - **Increased conversion rates.** When the customer shopping experience is enriched and simplified, shoppers start checking out more. Less friction means more conversions. Checkout X merchants see an average revenue boost of 5% - 15%. 30 - **Improved average order value.** More conversion rates means online stores increase the lifetime value of their customers, while the relevant and well-timed upsells boost the average order value of all online shoppers. 31 - **Confidence and security.** The tailored payment method integration of Checkout X gives you absolute security and the ability to use the extra features of your payment providers. 3D security shifts liability for fraud to the customer’s bank, which means you can finally stop worrying about fraud and focus on growth. 32 - **Designed & optimized for mobile.** Checkout X is fully responsive, which means the mobile-first design boosts your sales no matter the devices your customers use to shop from your WooCommerce store. 33 34 Want to ask a pre-sale question? [Get in touch](https://www.checkout-x.com/contact_us)! 35 36 == What do we do best? == 37 38 The real success of our merchants comes when they combine our high-converting frictionless checkout with the powerful post-purchase upsells that customers see after they’ve completed their purchase. 39 40 **Online shopping made effortless.** 41 Checkout X multiplies your WooCommerce revenue by introducing a high-converting, mobile-first checkout with seamless & secure payments, well-timed post-purchase upsells, and a robust set of available integrations to add extra value. 42 43 **Less abandoned carts, more revenue.** 44 With the one-page checkout experience and minimum number of input fields, Checkout X solves one of the main reasons why customers abandon carts - long and confusing checkout process. By eliminating friction and distractions, customers can check out almost instantly. 45 46 **All you need under one roof.** 47 Forget about using multiple plugins to boost your WooCommerce store’s conversion rates or struggling with code to modify the design, layout, and behavior of your checkout. With Checkout X, you get a complete plug-and-play solution you set up once and forget about it. 48 49 == Increase conversion rates with a frictionless one-page checkout == 50 51 - **[Fast checkout process](https://www.checkout-x.com/frictionless_checkout).** The industry average for most checkouts is about 66 seconds, while customers using Checkout X can finish in less than 25 seconds. 52 - **Less input fields for customers.** Eliminate all friction and distractions to reduce any chances customers can drop off due to a long and overwhelming checkout process. 53 - **One page checkout.** Instantly show customers the entire checkout and how easy it’s going to be to complete their order by showing all the fields and the simplified UI. 54 - **Auto-complete for customer info.** Give customers an even bigger speed boost by eliminating the need to input their address manually with location-based auto-fill. 55 - **Made for mobile.** Completing orders with Checkout X is fast and simple on any device to give your customers on the move a better shopping experience. 56 - **Buy Now links.** Help customers skip the cart and go straight to checkout with the product already there, ready to complete the order faster. 57 - **Abandoned cart emails.** Recover any revenue leaks by sending out personal email notifications that help shoppers pickup where they left from and complete their orders. 58 59 == Boost revenue and AOV with relevant & well-timed upsells == 60 61 Post-purchase upsells can be effective in all E-commerce stores, whatever the industry. 3 out of 4 merchants who set up an upsell manage to get extra sales. 62 63 - **[Post-purchase upsells](https://www.checkout-x.com/post_purchase_upsells).** Trigger special offers for customers after they’ve entered their payment information and confirmed their order so it’s twice as easy to increase AOV without any additional actions. 64 - **A/B testing.** Run tests between multiple triggers and upsell offers to find the highest-converting combinations that provide the most value for customers and the most revenue for your WooCommerce store. 65 66 == Promote trust, confidence, and security to increase sales == 67 68 - **[Impeccable payment security](https://www.checkout-x.com/seamless_payments).** With the tailored payment integrations, Checkout X brings the security of your payment provider and their additional features using their native API. All payment data is collected and processed directly by the payment provider and not stored within Checkout X. 69 - **3D Secure payments.** PSD2 compliant with 3D Secure payment support at no extra cost. To combine ease of use with security, 3D Secure is only invoked when required by the customer’s bank. 70 - **Fraud protection.** With 3D security, you get bank-level protection by eliminating fraud liability while shifting all of it to the customer’s bank, letting you focus on growth, instead of worrying about fraud. 71 72 == Connect and start selling in no time. No technical skills needed. == 73 74 https://www.youtube.com/watch?v=kLMvEYNf3ug 75 76 - **Easy to install & setup.** Checkout X takes less than 30 minutes to install and set up thanks to the extremely intuitive onboarding. The plugin is designed to recognize and sync your store data to get you up and selling faster. 77 - **Plug-and-play.** Checkout X doesn’t need any modifications or additional technical setup. You plug it in and it just starts working in the background without any need for regular maintenance. 78 - **Easy to customize.** The checkout page is easy to edit and customize so you can change the copy on all the fields, add your brand colors & styles, and fine-tune the customer experience with trust badges, additional custom sections, or custom scripts. 79 - **No coding required.** You don’t need any developers or technical skills to setup or work with Checkout X. It’s designed to help merchants start making more sales on auto-pilot. 80 - **Customizable Thank you page.** Enrich the customer experience even more by building a Thank you page that makes shoppers want to come back for more. 81 82 == Checkout X is an all-in-one solution == 83 84 Going with Checkout X means you’re going for a competitive advantage in your niche without the need of multiple plugins to achieve a conversion uplift. The app is designed to solve both low conversion rates and revenue while increasing AOV & LTV. 85 86 All of that happens from a sleek modern dashboard where simplicity comes together with cutting edge tech to give merchants the hassle-free intuitive experience they need to focus more on growth and less on technical struggles. 87 88 1. **Zero maintenance plugin, ready to go out of the box.** Other plugins require you to build the entire experience from scratch, while Checkout X is ready to go right away. 89 2. **Native cart recovery.** You don’t need other plugins to send out abandoned cart emails since Checkout X has a built-in functionality to help you recover lost revenue. You also have integrations for Klaviyo, Mailchimp, and SMSBump if you prefer using them. 90 3. **Post-purchase upsells.** Forget about plugins that only add upsells to your store. Checkout X gives you a simple way to quickly create multiple upsell offers. 91 4. **Integrated payments.** With Checkout X, you don’t need your WooCommerce store to have your payment provider’s plugin installed. You can simply connect to them from your Checkout X dashboard and you’re ready to roll. 92 93 Optimize your WooCommerce performance by unloading all unnecessary plugins and handle every checkout related process from Checkout X. 94 95 == What do you get with Checkout X? == 96 97 - Allow shoppers to complete a purchase within 25 seconds where the industry average is 66 seconds. 98 - Reduce the checkout process to just 12 input fields where the AVG checkout has 17 input fields with our simplified UX process. 99 - Reduce the user interactions to 11, where the AVG checkout has 18 thanks to a combination of IP localization, address auto-fils, and smart pre-selecting. 100 - Deliver stellar results on both desktop and mobile in the increasingly mobile-driven world with our mobile-first design approach. 101 - Bring in a significant revenue boost and increase AOV and LTV with well-timed and relevant post-purchase upsells. 1 in 2 merchants increases their revenue with over €1000. In total, upsells account for 8% of Checkout X’s transaction volume. 102 - Let customers finish the original order first, offer them the upsell right after to ensure they do not drop during the checkout. 103 104 == What can you do with Checkout X? == 32 105 33 106 - Convert more shoppers into customers 34 107 - Increase the AOV with post-purchase upsells 35 - Offer payment methods your customers prefer36 - Speak the language of your customer (translations available !)37 - Recover abandoned shoppingcarts38 - Integrate with tools you already use and work for you108 - Offer the payment methods your customers prefer 109 - Speak the language of your customer (translations available) 110 - Recover lost revenue from abandoned carts 111 - Integrate with your favorite tools & apps 39 112 40 Take advantage of your new Checkout on Steroids and boost your revenue today! 113 Take advantage of your new Checkout on steroids and boost your revenue today! 114 115 == Who are we? == 116 117 Checkout X is on a mission to democratize checkout technology and help SMBs compete with E-Commerce brands and giants. With us, it’s like your online store has a team of conversion pros and developers working around the clock to constantly improve your conversion rates and add new features to your favorite checkout. 118 119 == What’s coming soon? == 120 121 Our worldwide team is pushing the limits of checkout technology. Here’s what we’re currently developing and bringing to WooCommerce: 122 123 - **Apple Pay** 124 - **Google Pay** 125 126 == Screenshots == 127 128 1. One page, mobile-ready checkout 129 2. Post-purchase upsells 130 3. Modern, minimal thank you page 131 4. Manage your checkout with our app 132 5. Manage your post-purchase upsells 133 6. Checkout-X - your checkout on steroids 41 134 42 135 == Installation == … … 50 143 For automatic installation log in to your WordPress dashboard, navigate to the Plugins menu and click Add New. 51 144 52 53 == Screenshots ==54 55 1. One page, mobile-ready checkout56 2. Post-purchase upsells57 3. Modern, minimal thank you page58 4. Manage your checkout with our app59 5. Manage your post-purchase upsells60 6. Checkout-X - your checkout on steroids61 62 63 145 == Changelog == 64 146 147 = 1.1.2 - 2021-02-12 = 148 * Rename the plugin to Checkout X. 149 * Update the URL of Checkout X app. 150 * Extend the response of the plugin's API endpoints. 151 65 152 = 1.1.1 = 66 * send an event to CheckoutX on plugin activation/deactivation/uninstall153 * Send an event to Checkout X on plugin activation/deactivation/uninstall. -
checkoutx/trunk/admin/class-admin.php
r2441493 r2473627 16 16 private $version; 17 17 18 const CHECKOUT_X_ROOT_URL = "https://www.checkout-x.com"; 18 const CHECKOUTX_APP_URL = "https://app.checkout-x.com"; 19 const CHECKOUTX_WEBSITE_URL = "https://www.checkout-x.com"; 19 20 const HELP_CENTER_URL = "https://help.checkout-x.com"; 20 21 const BASE64_APP_ICON = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aWNvbkA8L3RpdGxlPgogICAgPGcgaWQ9Imljb24iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik0yNS42MjUsMjQgQzI2LjAxNzg1NzEsMjQgMjYuMzQ1MjM4MSwyMy44NjY2NjY3IDI2LjYwNzE0MjksMjMuNiBDMjYuODY5MDQ3NiwyMy4zMzMzMzMzIDI3LDIzIDI3LDIyLjYgTDI3LDIyLjYgTDI3LDkuNCBDMjcsOSAyNi44NjkwNDc2LDguNjY2NjY2NjcgMjYuNjA3MTQyOSw4LjQgQzI2LjM0NTIzODEsOC4xMzMzMzMzMyAyNi4wMTc4NTcxLDggMjUuNjI1LDggTDI1LjYyNSw4IEw2LjM3NSw4IEM1Ljk4MjE0Mjg2LDggNS42NTQ3NjE5LDguMTMzMzMzMzMgNS4zOTI4NTcxNCw4LjQgQzUuMTMwOTUyMzgsOC42NjY2NjY2NyA1LDkgNSw5LjQgTDUsOS40IEw1LDIyLjYgQzUsMjMgNS4xMzA5NTIzOCwyMy4zMzMzMzMzIDUuMzkyODU3MTQsMjMuNiBDNS42NTQ3NjE5LDIzLjg2NjY2NjcgNS45ODIxNDI4NiwyNCA2LjM3NSwyNCBMNi4zNzUsMjQgTDI1LjYyNSwyNCBaIE0yNS4zMzQ5MzY1LDEzLjI4NTg5ODQgTDYuMzM0OTM2NDksMTMuMjg1ODk4NCBMNi4zMzQ5MzY0OSwxMC43ODU4OTg0IEM2LjQwMDkwODcxLDkuNzg1ODk4MzggNi42MTUzMTg0Myw5LjI4NTg5ODM4IDYuOTc4MTY1NjYsOS4yODU4OTgzOCBMMjQuOTQzMTc5Nyw5LjI5NDcxNDExIEMyNS4yNzY3NzYxLDkuNDczMTI0MzcgMjUuMjY4OTY0Myw5Ljc4NTg5ODM4IDI1LjMzNDkzNjUsMTAuNzg1ODk4NCBMMjUuMzM0OTM2NSwxMy4yODU4OTg0IFogTTI0LjY1NTgwODksMjIuMzQ4MDc2MiBMNi45NDIyNjcyNywyMi4zNDgwNzYyIEM2LjU3OTQyMDA1LDIyLjM0ODA3NjIgNi4zNjUwMTAzMywyMi4xNjA1NzYyIDYuMjk5MDM4MTEsMjEuNzg1NTc2MiBMNi4yOTkwMzgxMSwyMS43ODU1NzYyIEw2LjI5OTAzODExLDE2LjM0ODA3NjIgTDI1LjI5OTAzODEsMTYuMzQ4MDc2MiBMMjUuMjk5MDM4MSwyMS43ODU1NzYyIEMyNS4yMzMwNjU5LDIyLjE2MDU3NjIgMjUuMDE4NjU2MiwyMi4zNDgwNzYyIDI0LjY1NTgwODksMjIuMzQ4MDc2MiBMMjQuNjU1ODA4OSwyMi4zNDgwNzYyIFogTTE3LjI2Nzk0OTIsMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxNy44NTg2NjA5IEw3LjI2Nzk0OTE5LDE3Ljg1ODY2MDkgTDcuMjY3OTQ5MTksMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxOS4wNjk1NDIzIFogTTI0LjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwxNy44MTY5ODczIEwyMS4yNDUxOTA1LDE3LjgxNjk4NzMgTDIxLjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwyMC44MTY5ODczIFogTTExLjkwMTkyMzgsMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwxOS45NTY3MzcyIEw3LjkwMTkyMzc5LDE5Ljk1NjczNzIgTDcuOTAxOTIzNzksMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwyMS4xNjc2MTg1IFoiIGlkPSLvhJkiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYuMDAwMDAwLCAxNi4wMDAwMDApIHJvdGF0ZSgzMzAuMDAwMDAwKSB0cmFuc2xhdGUoLTE2LjAwMDAwMCwgLTE2LjAwMDAwMCkgIj48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg=="; … … 54 55 add_menu_page( 55 56 'checkout-x', 56 'Checkout X',57 'Checkout X', 57 58 'manage_options', 58 59 'checkout-x-settings', … … 64 65 add_submenu_page( 65 66 'checkout-x-settings', 66 'Checkout X settings',67 'Checkout X settings', 67 68 'General', 68 69 'manage_options', … … 73 74 add_submenu_page( 74 75 'checkout-x-settings', 75 'Checkout X help center',76 'Checkout X help center', 76 77 'Help center', 77 78 'manage_options', … … 108 109 109 110 if (!empty($shop_id)) { 110 return esc_url(self::CHECKOUT _X_ROOT_URL . "/shops/" . $shop_id . "/" . $additional_path);111 return esc_url(self::CHECKOUTX_APP_URL . "/shops/" . $shop_id . "/" . $additional_path); 111 112 } else { 112 return esc_url(self::CHECKOUT _X_ROOT_URL);113 return esc_url(self::CHECKOUTX_WEBSITE_URL); 113 114 } 114 115 } … … 116 117 public function contact_us_checkoutx_url() 117 118 { 118 return esc_url(self::CHECKOUT _X_ROOT_URL . "/contact_us");119 return esc_url(self::CHECKOUTX_WEBSITE_URL . "/contact_us"); 119 120 } 120 121 } -
checkoutx/trunk/assets/js/public.js
r2441493 r2473627 30 30 */ 31 31 32 // exported to window object and called by storefront script 32 33 var checkoutXPlugin = { 34 // calls method on backend to empty cart and when server responds - trigger 35 // wc_fragment_refresh event to update UI 33 36 clearWoocommerceCart :function(){ 34 37 var data = { … … 49 52 }; 50 53 54 // observe changes on #checkout-x-content element. If it gets updated by 55 // wc_ajax refreshed_cart_fragments - sync cart with Checkout X 56 // TODO: move to storefront script itself 51 57 $(function() { 52 58 var observer = new MutationObserver(function() { -
checkoutx/trunk/changelog.txt
r2441493 r2473627 1 = 1.1.2 - 2021-02-12 = 2 * Rename the plugin to Checkout X. 3 * Update the URL of Checkout X app. 4 * Extend the response of the plugin's API endpoints. 5 1 6 = 1.1.1 = 2 * send an event to CheckoutX on plugin activation/deactivation/uninstall7 * Send an event to Checkout X on plugin activation/deactivation/uninstall. 3 8 4 9 = 1.1.0 = 5 * public release6 * adds automatic shop configuration10 * Public release. 11 * Adds automatic shop configuration. 7 12 8 13 = 1.0 = 9 * closed beta launch14 * Closed beta launch. -
checkoutx/trunk/checkout-x.php
r2441493 r2473627 5 5 * 6 6 * This file is read by WordPress to generate the plugin information in the plugin 7 * admin area. This file also includes all of the dependencies used by the plugin, 8 * registers the activation and deactivation functions, and defines a function 9 * that starts the plugin. 7 * admin area. Plugin version ready from here and set as constant. 8 * 9 * This file registers activation/deactivation and uninstall hooks for the 10 * plugin. It also includes all of the dependencies used by the plugin and defines a functionthat starts the plugin. 10 11 * 11 12 * @link https://www.checkout-x.com … … 14 15 * 15 16 * @wordpress-plugin 16 * Plugin Name: Checkout X17 * Plugin Name: Checkout X 17 18 * Plugin URI: https://www.checkout-x.com 18 * Description: C onnect CheckoutX to your shop19 * Version: 1.1. 119 * Description: Checkout X boosts your revenue with a high-converting, frictionless, mobile-first checkout experience for your WooCommerce store. Get less abandoned carts and more sales with a fast checkout that completes itself on any device to give you more conversions and average order value. 20 * Version: 1.1.2 20 21 * Author: Checkout X 21 22 * Author URI: https://www.checkout-x.com/?utm_source=partner&utm_medium=woocommerce-marketplace … … 26 27 */ 27 28 28 // If this file is called directly, abort. 29 /** 30 * If this file is called directly, abort. 31 */ 29 32 if ( ! defined( 'WPINC' ) ) { 30 33 die; 31 34 } 32 35 36 /** 37 * defines constant to be used as a root in building absolute path when other 38 * files need include/reqiure some dependency 39 */ 33 40 if ( ! defined( 'CHKX_PLUGIN_FILE' ) ) { 34 41 define( 'CHKX_PLUGIN_FILE', __FILE__ ); 35 42 } 36 43 37 // fetch plugin version from plugin data and set as constant 44 /** 45 * fetches plugin version from plugin info above and sets it as constant 46 * plugin version is sent on API status request and also used in assets 47 * filenames digest 48 */ 38 49 if ( ! defined( 'WC_CHECKOUT_X_VERSION' ) ) { 39 50 $plugin_data = get_file_data( __FILE__, array( 'Version' => 'Version' ), false ); … … 41 52 } 42 53 54 /** 55 * defines plugin name constant, used when ensuring that auto-update is enabled 56 * for the plugin 57 */ 43 58 if ( ! defined( 'WC_CHECKOUT_X_PLUGIN_NAME' ) ) { 44 59 define( 'WC_CHECKOUT_X_PLUGIN_NAME', 'checkout-x'); … … 63 78 } 64 79 80 /** 81 * The code that runs during plugin uninstall. 82 * This action is documented in includes/class-uninstallation.php 83 */ 65 84 function uninstall_Checkout_X() { 66 85 require_once plugin_dir_path(__FILE__) . 'includes/class-uninstallation.php'; … … 73 92 74 93 /** 75 * The core plugin class that is used to define internationalization,94 * The core plugin class that is used to define main logic, 76 95 * admin-specific hooks, and public-facing site hooks. 77 96 */ -
checkoutx/trunk/includes/class-activator.php
r2441493 r2473627 16 16 { 17 17 /** 18 * Runs on plugin activation. Sends 'activated' event to CheckoutX 18 * Runs on plugin activation. Sends 'activated' event to Checkout X 19 * 20 * Uses StatusNotifier to send http query to Checkout X app 19 21 * 20 22 * @since 1.0.0 -
checkoutx/trunk/includes/class-api-controller.php
r2441493 r2473627 1 1 <?php 2 3 /** 4 * Declares endpoints for plugin REST API extension 5 * 6 * Defines two endpoints in /wc-checkoutx/v1/ namespace: 7 * - GET /status 8 * No authentication required. Checkout X uses this endpoint to ensure that shop 9 * has plugin installed and checkcurrent version of the plugin. 10 * Returns 11 * - 200 with JSON body { "version": "<plugin version>" } 12 * 13 * 14 * - PUT /settings 15 * Requires authentcation. Only accessible by admins. 16 * Has three mandatory query params: 17 * - shop_id - Checkout X shop hashid 18 * - js_script_url - url to load Checkout X storefront script from 19 * - event_secret - secret to generate request signature when sending notifications 20 * to Checkout X ( i.e. on pludin activation / deactivation ) 21 * Updates plugin settings with values passed in request. 22 * Returns: 23 * - 200 with JSON body { "result": "success" } when shop settings 24 * successfully updated to given values or already was valid 25 * - 403 with "result": "error" and current status of each setting when any 26 * of the settings failed update 27 * 28 * All endpoints have custom header added: 29 * - X-CHECKOUT-X-PLUGIN-VERSION - contains current version of plugin 30 * 31 * @link checkout-x.com 32 * @since 1.0.0 33 * @package Checkout_X 34 * @subpackage Checkout_X/includes 35 * @author Checkout X 36 */ 37 2 38 class Checkout_X_API_Controller 3 39 { 40 /** 41 * wc- prefix here is mandatory to indicate WooCommerce that this endpoint is 42 * third-party extension of Woo REST API. All endpoints within this namespace 43 * support standard WooCommerce authentication automatically 44 */ 4 45 protected $namespace = 'wc-checkoutx'; 5 46 6 47 protected $api_version = 'v1'; 7 48 49 /** 50 * Registers endpoints and defines params, callback and permission check 51 * callback for each of them 52 */ 8 53 public function register_routes() 9 54 { … … 40 85 } 41 86 87 /** 88 * GET /status callback 89 */ 42 90 public function get_status() 43 91 { 44 $data = array('version' => WC_CHECKOUT_X_VERSION); 92 $data = array( 93 "version" => WC_CHECKOUT_X_VERSION, 94 "options" => array( 95 "js_script_url" => get_option("checkout_x_storefront_url", null), 96 ), 97 ); 45 98 return $this->wrap_response($data, 200); 46 99 } 47 100 101 /** 102 * PUT /settings callback 103 * 104 * Uses get_option first to fetch current value of the setting. Need it to 105 * respond with success when setting already had proper value. 106 * update_option returns false when called with same value as setting already 107 * has 108 * 109 * 200 when all settings successfully updated or aleady have proper value 110 * 403 when failed to update any of settings 111 */ 48 112 public function update_settings($request) 49 113 { … … 74 138 } 75 139 76 # check that current user has 'Administrator' level access 77 # https://wordpress.org/support/article/roles-and-capabilities/#administrator 140 /** 141 * checks that current user has 'Administrator' level access 142 * https://wordpress.org/support/article/roles-and-capabilities/#administrator 143 */ 78 144 public function check_is_admin() 79 145 { … … 81 147 } 82 148 149 /** 150 * Adds custom data to responses of all endpoints. Currently adds header with 151 * plugin version only. 152 */ 83 153 private function wrap_response($data, $status = HTTP_STATUS_OK, $headers = array()) 84 154 { -
checkoutx/trunk/includes/class-api.php
r2441493 r2473627 1 1 <?php 2 2 3 /** 4 * Declares controllers for all REST API namespaces that plugin extends 5 * 6 * 7 * @link checkout-x.com 8 * @since 1.0.0 9 * @package Checkout_X 10 * @subpackage Checkout_X/includes 11 * @author Checkout X 12 */ 3 13 class Checkout_X_API 4 14 { -
checkoutx/trunk/includes/class-custom-webhooks.php
r2441493 r2473627 1 1 <?php 2 3 2 /** 4 * The file that defines the core plugin class3 * Extends WooCommerce webhooks system with additional topics for Checkout X app 5 4 * 6 * A class definition that includes attributes and functions used across both the 7 * public-facing side of the site and the admin area. 5 * 6 * Defines following additional webhooks: 7 * - product_category.created 8 * - product_category.updated 9 * - product_category.deleted 10 * - shop.updated 8 11 * 9 12 * @link checkout-x.com 10 * @since 1.0.511 *12 * @package Checkout_X13 * @subpackage Checkout_X/includes14 */15 16 /**17 * The core plugin class.18 *19 * This is used to define internationalization, admin-specific hooks, and20 * public-facing site hooks.21 *22 * Also maintains the unique identifier of this plugin as well as the current23 * version of the plugin.24 *25 13 * @since 1.0.5 26 14 * @package Checkout_X … … 48 36 * @access protected 49 37 * @var string $plugin_name The string used to uniquely identify this plugin. 38 * @deprecated Not used in this class anymore 50 39 */ 51 40 protected $plugin_name; … … 61 50 62 51 /** 63 * Define the core functionality of the plugin. 64 * 65 * Set the plugin name and the plugin version that can be used throughout the plugin. 66 * Load the dependencies, define the locale, and set the hooks for the admin area and 67 * the public-facing side of the site. 52 * Adds hook for shop.updated and hooks for product category CRUD events 53 * 54 * Also sets plugin name ( deprecated, could be removed ) and version from 55 * contructor params 68 56 * 69 57 * @since 1.0.5 … … 78 66 } 79 67 68 /** 69 * Generates payload for product category and shop events 70 * 71 * Follow the same logic as default webhook implementationi in WooCommerce: 72 * - get webhook by ID from database 73 * - temporarily set user to owner of webhook 74 * - make a request to WooCommerce REST API, fetch value for payload and update 75 * $payload param of the method 76 * - switch back to original user 77 * 78 * Called by wooocmmerce_webhook_payload filter, it expects this method to 79 * update $payload with proper value 80 */ 80 81 public function add_custom_webhook_payload($payload, $resource, $resource_id, $webhook_id) 81 82 { … … 126 127 } 127 128 129 /** 130 * Maps webhook topic name to action name 131 * 132 * Called by `woocommerce_webhook_topic_hooks`, expected to extend 133 * dictionary of $topic_hooks 134 */ 128 135 public function add_custom_topic_hooks($topic_hooks) 129 136 { … … 145 152 } 146 153 154 /** 155 * Adds our custom events to the list of allowed events 156 * 157 * Called by `woocommerce_valid_webhook_events` filter. Extends 158 * $topic_events array with our events. 159 */ 147 160 public function add_custom_topic_events($topic_events) 148 161 { … … 157 170 } 158 171 172 /** 173 * Maps webhooks topics to webhook displayed name in admin dashboard 174 * 175 * __() method fetches localized version of the string. We don't use i18n 176 * but it's left here for consistency with default WooCommerce 177 * implementation. 178 * Called by `woocommerce_webhook_topics` 179 * 180 */ 159 181 public function add_custom_webhook_topics($topics) 160 182 { 161 // New topic array to add to the list, must match hooks being created.162 183 $new_topics = array( 163 184 'product_category.created' => __( 'Product Category Created', 'woocommerce' ), … … 170 191 } 171 192 193 /** 194 * Adds our resources ( shop & product category ) to the list of valid resources 195 * 196 * Required for WC REST API.. Function that validates webhook topic is here: wordpress/wp-content/plugins/woocommerce/includes/wc-webhook-functions.php#67 197 */ 172 198 public function extend_valid_webhook_resources($resources) 173 199 { … … 179 205 } 180 206 207 /** 208 * Triggers shop.updated webhook on any change to WooCommerce settings 209 */ 181 210 public function send_webhook_on_settings_change($setting_changed) 182 211 { … … 187 216 } 188 217 218 /** 219 * Subscribes to any Wordpress option change 220 */ 189 221 private function add_settings_hook() 190 222 { … … 192 224 } 193 225 226 227 /** 228 * Subscribes to product_cat CRUD events and trggers relevant webhook topic 229 */ 194 230 private function add_product_cat_hooks() 195 231 { -
checkoutx/trunk/includes/class-deactivator.php
r2441493 r2473627 16 16 17 17 /** 18 * Runs on plugin deactivation. Sends 'deactivated' event to Checkout X.18 * Runs on plugin deactivation. Sends 'deactivated' event to Checkout X. 19 19 * 20 * Uses StatusNotifier to send http query to Checkout X app. 20 21 * @since 1.0.0 21 22 */ 23 22 24 public static function deactivate() { 23 25 require_once plugin_dir_path(CHKX_PLUGIN_FILE) . 'includes/class-status-notifier.php'; -
checkoutx/trunk/includes/class-i18n.php
r2441493 r2473627 4 4 * Define the internationalization functionality 5 5 * 6 * Not used at the moment. 6 7 * Loads and defines the internationalization files for this plugin 7 8 * so that it is ready for translation. -
checkoutx/trunk/includes/class-loader.php
r2441493 r2473627 1 1 <?php 2 3 /**4 * Register all actions and filters for the plugin5 *6 * @link checkout-x.com7 * @since 1.0.08 *9 * @package Checkout_X10 * @subpackage Checkout_X/includes11 */12 13 2 /** 14 3 * Register all actions and filters for the plugin. … … 18 7 * run function to execute the list of actions and filters. 19 8 * 9 * @link checkout-x.com 10 * @since 1.0.0 20 11 * @package Checkout_X 21 12 * @subpackage Checkout_X/includes 22 * @author Vlad <just.raeno@icloud.com>13 * @author Checkout X 23 14 */ 24 15 -
checkoutx/trunk/includes/class-main.php
r2441493 r2473627 6 6 * A class definition that includes attributes and functions used across both the 7 7 * public-facing side of the site and the admin area. 8 * It also extends Wordpress REST API to include methods to check plugin status 9 * and update plugin settings and extends WooCommerce webhooks to include additional 10 * webhooks required by Checkout X to work properly. 8 11 * 9 12 * @link checkout-x.com … … 72 75 * - Checkout_X_Admin. Defines all hooks for the admin area. 73 76 * - Checkout_X_Public. Defines all hooks for the public side of the site. 77 * - Checkout_X_API. Registers custom REST API namespace /wc-checkoutx/v1/. 78 * - Checkout_X_API_Controller. Defines logic for REST API plugin endpoints. 79 * - Checkout_X_CustomWebhooks. Extends WooCommerce webhooks with events 80 * Checkout X needs 74 81 * 75 82 * Create an instance of the loader which will be used to register the hooks … … 100 107 101 108 /** 102 * Classes responsible for Checkout X API on top of WooCommerce API109 * Classes responsible for Checkout X API on top of WooCommerce API 103 110 */ 104 111 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-api.php'; … … 123 130 * Uses the Checkout_X_i18n class in order to set the domain and to register the hook 124 131 * with WordPress. 132 * Currently plugin has almost no text and doesn't use i18n. 125 133 * 126 134 * @since 1.0.0 … … 162 170 $plugin_public = new Checkout_X_Public($this->get_plugin_name(), $this->get_version()); 163 171 164 # uncomment this if you want to add some styles from plugin 172 # uncomment this if you want to load some styles from plugin 173 # on shop public pages ( product pages, cart, etc ) 165 174 # $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); 166 175 176 # loads plugin JS file on all shop pages 177 # more info in assets/js/public.js documentation 167 178 $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); 179 180 # adds meta tag with shop ID to <head>. Used by CHKX storefront JS. 168 181 $this->loader->add_action('wp_head', $plugin_public, 'add_resources'); 169 182 … … 179 192 } 180 193 194 /** 195 * Registers hook that extends cart_fragments JSON with DOM element that 196 * includes cart content for Checkout X storefront script 197 */ 181 198 private function define_filters() 182 199 { … … 186 203 } 187 204 205 /** 206 * Registers hook that extend WooCommerce webhooks with custom topics: 207 * - product_category CRUD 208 * - shop.updated 209 */ 188 210 private function define_custom_webhooks() 189 211 { … … 202 224 } 203 225 226 /** 227 * Registers filter that externds REST API namespaces with plugin specific /wc-checkoutx 228 */ 204 229 public function define_api() 205 230 { … … 208 233 } 209 234 235 /** 236 * Registers filter that is triggered when Wordpress check whether auto 237 * update is enabled for plugin or not 238 */ 210 239 public function configure_auto_update() 211 240 { … … 213 242 } 214 243 244 245 /** 246 * Triggered by `auto_update_plguin` filter. Returns true for our plugin to 247 * indicate that plugin should always have auto-update enabled 248 */ 215 249 public function enable_auto_update( $update, $item) 216 250 { -
checkoutx/trunk/includes/class-status-notifier.php
r2441493 r2473627 1 1 <?php 2 2 3 /** 4 * Sends events to Checkout X when plugin state changes 5 * 6 * Currently sends three types of events: 7 * - plugin activated 8 * - plugin deactivated 9 * - plugin uninstalled 10 * 11 * Uses `wp_remote_post` behind the scenes to make POST request to Checkout X 12 * endpoint. Request body is JSON. 13 * 14 * Uses event secret stored inside of`checkout_x_event_secret` settingto generate 15 * signature and sends it as X-WC-CHECCHECKOUTX-PLUGIN-EVENT-SIGNATURE header, 16 * necessary for request authentication on Checkout X 17 * 18 * Base url for all requests id defined in CHECKOUTX_URL environment variable. 19 * If no url present, use the production URL. 20 * 21 * @link checkout-x.com 22 * @since 1.1.0 23 * @package Checkout_X 24 * @subpackage Checkout_X/includes 25 * @author Checkout X 26 */ 3 27 class Checkout_X_Status_Notifier 4 28 { 5 const DEFAULT_CHECKOUT_X_URL = 'https:// www.checkout-x.com';29 const DEFAULT_CHECKOUT_X_URL = 'https://app.checkout-x.com'; 6 30 7 31 public function plugin_activated() … … 42 66 } 43 67 68 /** 69 * Build url to send event to. 70 * 71 * Takes root url from ENV for dev/staging shops, we don't expect this environment variable 72 * to be defined on real shops and we use production URL. 73 * 74 * Also relies on `checkout_x_shop_id` to be present and uses it as part of 75 * event url. 76 * 77 */ 44 78 public function event_delivery_url() 45 79 { 46 80 $shop_id = get_option('checkout_x_shop_id'); 47 81 48 # use url from ENV for dev/staging, use default url on merchant shops49 82 $checkout_x_url = getenv('CHECKOUTX_URL') ?: self::DEFAULT_CHECKOUT_X_URL; 50 83 … … 53 86 54 87 88 /** 89 * Builds signature similar to WooCommerce webhook signature to 90 * authenticate requests from plugin on Checkout X side 91 */ 55 92 public function build_signature($payload) 56 93 { -
checkoutx/trunk/includes/class-uninstallation.php
r2441493 r2473627 16 16 { 17 17 /** 18 * Runs on plugin uninstall. Send 'uninstall' event to CheckoutX.18 * Runs on plugin uninstall. Sends 'uninstall' event to Checkout X. 19 19 * @since 1.1.0 20 20 */ -
checkoutx/trunk/public/class-public.php
r2441493 r2473627 2 2 3 3 /** 4 * The public-facing functionality of the plugin. 4 * Defines all logic related to shop pages and cart handling 5 * 6 * Loads public.js script on every shop page. Adds meta tag with shop hashid on 7 * every store page. 8 * 9 * Main logic of Checkout X is handled here: 10 * - we include JSON encoded cart content on the page inside script 11 * tag. This script tag is inserted every time any shop page is loaded 12 * ( product page, cart page, etc). Also we add key with scrip tag id to 13 * cart_fragments, when cart content is changed via AJAX call => script tag 14 * content is updated via `get_refreshed_fragments` flow. 15 * - JSON encoded cart content is used by Checkout X to sync cart to latest state 16 * 17 * When user goes to checkout page - we redirect him to Checkout X checkout page 18 * if proper cookie is found on the page. 19 * 20 * Also adds logic to clear cart when order on Checkout X side is completed. 5 21 * 6 22 * @link checkout-x.com 7 23 * @since 1.0.0 8 *9 24 * @package Checkout_X 10 25 * @subpackage Checkout_X/public 11 */ 12 13 /** 14 * The public-facing functionality of the plugin. 15 * 16 * Defines the plugin name, version, and two examples hooks for how to 17 * enqueue the public-facing stylesheet and JavaScript. 18 * 19 * @package Checkout_X 20 * @subpackage Checkout_X/public 21 * @author Vlad <just.raeno@icloud.com> 26 * @author Checkout X 22 27 */ 23 28 … … 87 92 } 88 93 94 /** 95 * Adds meta tag with shop ID to be used by Checkout X storefront script 96 */ 89 97 public function add_resources() 90 98 { … … 101 109 } 102 110 111 /** 112 * Fetches shop ID from settings 113 */ 103 114 public function get_shop_id() 104 115 { … … 106 117 } 107 118 119 /** 120 * Fetches Checkout X storefront script url value from settings 121 */ 108 122 public function get_storefront_script_url() 109 123 { … … 111 125 } 112 126 113 // cart content element is placed within "checkout-x-content" div to 114 // reduce amount of nodes to observe on JS side 127 /* 128 * Adds parent tag with cart content inside on the page. 129 * 130 * Cart content element is placed within "#checkout-x-content" div to 131 * reduce JS load when checking updates. We use MutationObserver 132 * and having parent element allows to observe only child elements. 133 */ 115 134 public function add_cart_json() 116 135 { … … 119 138 } 120 139 140 /* 141 * Adds cart content to cart fragments. 142 * 143 * Key here is jQuery selector of element. Value - content of element to 144 * replace found selector with. WooCommerce iterates over each key in 145 * refreshed fragments 146 */ 121 147 public function add_cart_json_fragments($fragments) 122 148 { … … 125 151 } 126 152 153 /** 154 * Loads cart from WC root function or global $woocommerce variable 155 * 156 * TODO: WC function is available from version 2.1 of WooCommerce, most probably 157 * we don't need it since we support WooCommerce version only > 4 158 */ 127 159 public function maybe_load_cart() { 128 160 129 if ( function_exists( 'WC' )) {130 if ( empty( WC()->cart )) {131 WC()->cart = new WC_Cart();132 }133 } else {134 global $woocommerce;135 if ( empty( $woocommerce->cart )) {136 $woocommerce->cart = new WC_Cart();137 } 138 }161 if (function_exists('WC')) { 162 if (empty(WC()->cart)) { 163 WC()->cart = new WC_Cart(); 164 } 165 } else { 166 global $woocommerce; 167 if (empty( $woocommerce->cart)) { 168 $woocommerce->cart = new WC_Cart(); 169 } 170 } 139 171 } 140 172 … … 147 179 } 148 180 181 /** 182 * Generates script tag with cart content encoded as JSON 183 * 184 * 185 * We also add "properties" key to each item with "product_id" entry. It's 186 * necessary for WooCommerce since Checkout X expect every checkout item to 187 * be unique and uses combination of variant_id and properties to validate 188 * uniqueness. For WooCommerce shop variant_id could be same for different 189 * products. 190 */ 149 191 private function cart_content() 150 192 { … … 169 211 } 170 212 213 /** 214 * Redirects to Checkout X checkout page if cart is not empty and user 215 * reaches /checkout page 216 */ 171 217 public function checkout_nav_menu_redirect() 172 218 { … … 182 228 } 183 229 230 /** 231 * Build checkout_url based on cookie set by Checkout X script 232 * 233 * Returns original url if cookie is not set 234 */ 184 235 public function checkoutx_checkout_url($original_url) 185 236 { … … 191 242 } 192 243 244 /** 245 * Empties WooCommerce cart. 246 * 247 * Available for public.js via wp_localize_script. Called when Checkout X API 248 * indicates that checkout is already completed. 249 */ 193 250 public function clear_cart() 194 251 { … … 202 259 echo json_encode(WC()->cart->get_cart_contents()); 203 260 261 # this method is called via AJAX so it's safe to die here 204 262 wp_die(); 205 263 } -
checkoutx/trunk/public/partials/checkout-x-public-display.php
r2416469 r2473627 1 <h2>Checkout X Dev</h2>1 <h2>Checkout X Dev</h2> 2 2 <?php 3 3
Note: See TracChangeset
for help on using the changeset viewer.