Plugin Directory

Changeset 2473627


Ignore:
Timestamp:
02/12/2021 10:05:56 AM (5 years ago)
Author:
checkoutx
Message:

Release version 1.1.2

Location:
checkoutx
Files:
34 edited
1 copied

Legend:

Unmodified
Added
Removed
  • checkoutx/tags/1.1.2/README.txt

    r2441493 r2473627  
    11=== Checkout X for WooCommerce ===
    22Contributors: checkoutx
    3 Tags: Checkout, Checkout X, checkoutx, one-page checkout, one page checkout, upsells, post-purchase upsells. automatic discounts, woocommerce, e-commerce
     3Tags: checkout, one page checkout, upsell, post-purchase upsell, automatic discount, woocommerce, e-commerce, payment, abandoned cart, AOV, conversion, WooCommerce checkout
    44Requires at least: 5.4
    5 Tested up to: 5.5.1
    6 Stable tag: trunk
     5Tested up to: 5.6.1
     6Stable tag: 1.1.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    1313== Description ==
    1414
    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
     19Checkout 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
     21The 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.
    1622
    1723Having processed over $600M in transactions across thousands of stores, we are always working on optimization and adjustments to deliver the best-in-class results.
    1824
    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)
    2026
    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 ==
    3028
    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
     34Want to ask a pre-sale question? [Get in touch](https://www.checkout-x.com/contact_us)!
     35
     36== What do we do best? ==
     37
     38The 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.**
     41Checkout 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.**
     44With 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.**
     47Forget 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
     61Post-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
     74https://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
     84Going 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
     86All 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
     881. **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.
     892. **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.
     903. **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.
     914. **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
     93Optimize 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? ==
    32105
    33106- Convert more shoppers into customers
    34107- Increase the AOV with post-purchase upsells
    35 - Offer payment methods your customers prefer
    36 - Speak the language of your customer (translations available!)
    37 - Recover abandoned shopping carts
    38 - Integrate with tools you already use and work for you
     108- 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
    39112
    40 Take advantage of your new Checkout on Steroids and boost your revenue today!
     113Take advantage of your new Checkout on steroids and boost your revenue today!
     114
     115== Who are we? ==
     116
     117Checkout 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
     121Our 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
     1281. One page, mobile-ready checkout
     1292. Post-purchase upsells
     1303. Modern, minimal thank you page
     1314. Manage your checkout with our app
     1325. Manage your post-purchase upsells
     1336. Checkout-X - your checkout on steroids
    41134
    42135== Installation ==
     
    50143For automatic installation log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
    51144
    52 
    53 == Screenshots ==
    54 
    55 1. One page, mobile-ready checkout
    56 2. Post-purchase upsells
    57 3. Modern, minimal thank you page
    58 4. Manage your checkout with our app
    59 5. Manage your post-purchase upsells
    60 6. Checkout-X - your checkout on steroids
    61 
    62 
    63145== Changelog ==
    64146
     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
    65152= 1.1.1 =
    66 * send an event to CheckoutX on plugin activation/deactivation/uninstall
     153* Send an event to Checkout X on plugin activation/deactivation/uninstall.
  • checkoutx/tags/1.1.2/admin/class-admin.php

    r2441493 r2473627  
    1616    private $version;
    1717
    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";
    1920    const HELP_CENTER_URL = "https://help.checkout-x.com";
    2021    const BASE64_APP_ICON = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aWNvbkA8L3RpdGxlPgogICAgPGcgaWQ9Imljb24iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik0yNS42MjUsMjQgQzI2LjAxNzg1NzEsMjQgMjYuMzQ1MjM4MSwyMy44NjY2NjY3IDI2LjYwNzE0MjksMjMuNiBDMjYuODY5MDQ3NiwyMy4zMzMzMzMzIDI3LDIzIDI3LDIyLjYgTDI3LDIyLjYgTDI3LDkuNCBDMjcsOSAyNi44NjkwNDc2LDguNjY2NjY2NjcgMjYuNjA3MTQyOSw4LjQgQzI2LjM0NTIzODEsOC4xMzMzMzMzMyAyNi4wMTc4NTcxLDggMjUuNjI1LDggTDI1LjYyNSw4IEw2LjM3NSw4IEM1Ljk4MjE0Mjg2LDggNS42NTQ3NjE5LDguMTMzMzMzMzMgNS4zOTI4NTcxNCw4LjQgQzUuMTMwOTUyMzgsOC42NjY2NjY2NyA1LDkgNSw5LjQgTDUsOS40IEw1LDIyLjYgQzUsMjMgNS4xMzA5NTIzOCwyMy4zMzMzMzMzIDUuMzkyODU3MTQsMjMuNiBDNS42NTQ3NjE5LDIzLjg2NjY2NjcgNS45ODIxNDI4NiwyNCA2LjM3NSwyNCBMNi4zNzUsMjQgTDI1LjYyNSwyNCBaIE0yNS4zMzQ5MzY1LDEzLjI4NTg5ODQgTDYuMzM0OTM2NDksMTMuMjg1ODk4NCBMNi4zMzQ5MzY0OSwxMC43ODU4OTg0IEM2LjQwMDkwODcxLDkuNzg1ODk4MzggNi42MTUzMTg0Myw5LjI4NTg5ODM4IDYuOTc4MTY1NjYsOS4yODU4OTgzOCBMMjQuOTQzMTc5Nyw5LjI5NDcxNDExIEMyNS4yNzY3NzYxLDkuNDczMTI0MzcgMjUuMjY4OTY0Myw5Ljc4NTg5ODM4IDI1LjMzNDkzNjUsMTAuNzg1ODk4NCBMMjUuMzM0OTM2NSwxMy4yODU4OTg0IFogTTI0LjY1NTgwODksMjIuMzQ4MDc2MiBMNi45NDIyNjcyNywyMi4zNDgwNzYyIEM2LjU3OTQyMDA1LDIyLjM0ODA3NjIgNi4zNjUwMTAzMywyMi4xNjA1NzYyIDYuMjk5MDM4MTEsMjEuNzg1NTc2MiBMNi4yOTkwMzgxMSwyMS43ODU1NzYyIEw2LjI5OTAzODExLDE2LjM0ODA3NjIgTDI1LjI5OTAzODEsMTYuMzQ4MDc2MiBMMjUuMjk5MDM4MSwyMS43ODU1NzYyIEMyNS4yMzMwNjU5LDIyLjE2MDU3NjIgMjUuMDE4NjU2MiwyMi4zNDgwNzYyIDI0LjY1NTgwODksMjIuMzQ4MDc2MiBMMjQuNjU1ODA4OSwyMi4zNDgwNzYyIFogTTE3LjI2Nzk0OTIsMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxNy44NTg2NjA5IEw3LjI2Nzk0OTE5LDE3Ljg1ODY2MDkgTDcuMjY3OTQ5MTksMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxOS4wNjk1NDIzIFogTTI0LjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwxNy44MTY5ODczIEwyMS4yNDUxOTA1LDE3LjgxNjk4NzMgTDIxLjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwyMC44MTY5ODczIFogTTExLjkwMTkyMzgsMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwxOS45NTY3MzcyIEw3LjkwMTkyMzc5LDE5Ljk1NjczNzIgTDcuOTAxOTIzNzksMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwyMS4xNjc2MTg1IFoiIGlkPSLvhJkiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYuMDAwMDAwLCAxNi4wMDAwMDApIHJvdGF0ZSgzMzAuMDAwMDAwKSB0cmFuc2xhdGUoLTE2LjAwMDAwMCwgLTE2LjAwMDAwMCkgIj48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==";
     
    5455        add_menu_page(
    5556            'checkout-x',
    56             'CheckoutX',
     57            'Checkout X',
    5758            'manage_options',
    5859            'checkout-x-settings',
     
    6465        add_submenu_page(
    6566            'checkout-x-settings',
    66             'CheckoutX settings',
     67            'Checkout X settings',
    6768            'General',
    6869            'manage_options',
     
    7374        add_submenu_page(
    7475            'checkout-x-settings',
    75             'CheckoutX help center',
     76            'Checkout X help center',
    7677            'Help center',
    7778            'manage_options',
     
    108109
    109110        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);
    111112        } else {
    112           return esc_url(self::CHECKOUT_X_ROOT_URL);
     113          return esc_url(self::CHECKOUTX_WEBSITE_URL);
    113114        }
    114115    }
     
    116117    public function contact_us_checkoutx_url()
    117118    {
    118       return esc_url(self::CHECKOUT_X_ROOT_URL . "/contact_us");
     119      return esc_url(self::CHECKOUTX_WEBSITE_URL . "/contact_us");
    119120    }
    120121}
  • checkoutx/tags/1.1.2/assets/js/public.js

    r2441493 r2473627  
    3030     */
    3131
     32  // exported to window object and called by storefront script
    3233    var checkoutXPlugin = {
     34      // calls method on backend to empty cart and when server responds - trigger
     35      // wc_fragment_refresh event to update UI
    3336        clearWoocommerceCart :function(){
    3437            var data = {
     
    4952    };
    5053
     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
    5157    $(function() {
    5258      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
    16= 1.1.1 =
    2 * send an event to CheckoutX on plugin activation/deactivation/uninstall
     7* Send an event to Checkout X on plugin activation/deactivation/uninstall.
    38
    49= 1.1.0 =
    5 * public release
    6 * adds automatic shop configuration
     10* Public release.
     11* Adds automatic shop configuration.
    712
    813= 1.0 =
    9 * closed beta launch
     14* Closed beta launch.
  • checkoutx/tags/1.1.2/checkout-x.php

    r2441493 r2473627  
    55 *
    66 * 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.
    1011 *
    1112 * @link              https://www.checkout-x.com
     
    1415 *
    1516 * @wordpress-plugin
    16  * Plugin Name:       CheckoutX
     17 * Plugin Name:       Checkout X
    1718 * Plugin URI:        https://www.checkout-x.com
    18  * Description:       Connect CheckoutX to your shop
    19  * Version:           1.1.1
     19 * 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
    2021 * Author:            Checkout X
    2122 * Author URI:        https://www.checkout-x.com/?utm_source=partner&utm_medium=woocommerce-marketplace
     
    2627 */
    2728
    28 // If this file is called directly, abort.
     29/**
     30 * If this file is called directly, abort.
     31 */
    2932if ( ! defined( 'WPINC' ) ) {
    3033  die;
    3134}
    3235
     36/**
     37 * defines constant to be used as a root in building absolute path when other
     38 * files need include/reqiure some dependency
     39 */
    3340if ( ! defined( 'CHKX_PLUGIN_FILE' ) ) {
    3441  define( 'CHKX_PLUGIN_FILE', __FILE__ );
    3542}
    3643
    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 */
    3849if ( ! defined( 'WC_CHECKOUT_X_VERSION' ) ) {
    3950  $plugin_data = get_file_data( __FILE__, array( 'Version' => 'Version' ), false );
     
    4152}
    4253
     54/**
     55 * defines plugin name constant, used when ensuring that auto-update is enabled
     56 * for the plugin
     57 */
    4358if ( ! defined( 'WC_CHECKOUT_X_PLUGIN_NAME' ) ) {
    4459  define( 'WC_CHECKOUT_X_PLUGIN_NAME', 'checkout-x');
     
    6378}
    6479
     80/**
     81 * The code that runs during plugin uninstall.
     82 * This action is documented in includes/class-uninstallation.php
     83 */
    6584function uninstall_Checkout_X() {
    6685  require_once plugin_dir_path(__FILE__) . 'includes/class-uninstallation.php';
     
    7392
    7493/**
    75  * The core plugin class that is used to define internationalization,
     94 * The core plugin class that is used to define main logic,
    7695 * admin-specific hooks, and public-facing site hooks.
    7796 */
  • checkoutx/tags/1.1.2/includes/class-activator.php

    r2441493 r2473627  
    1616{
    1717  /**
    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
    1921   *
    2022   * @since    1.0.0
  • checkoutx/tags/1.1.2/includes/class-api-controller.php

    r2441493 r2473627  
    11<?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
    238class Checkout_X_API_Controller
    339{
     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   */
    445  protected $namespace = 'wc-checkoutx';
    546
    647  protected $api_version = 'v1';
    748
     49  /**
     50   * Registers endpoints and defines params, callback and permission check
     51   * callback for each of them
     52   */
    853  public function register_routes()
    954  {
     
    4085  }
    4186
     87  /**
     88   * GET /status callback
     89  */
    4290  public function get_status()
    4391  {
    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    );
    4598    return $this->wrap_response($data, 200);
    4699  }
    47100
     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   */
    48112  public function update_settings($request)
    49113  {
     
    74138  }
    75139
    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   */
    78144  public function check_is_admin()
    79145  {
     
    81147  }
    82148
     149  /**
     150   * Adds custom data to responses of all endpoints. Currently adds header with
     151   * plugin version only.
     152   */
    83153  private function wrap_response($data, $status = HTTP_STATUS_OK, $headers = array())
    84154  {
  • checkoutx/tags/1.1.2/includes/class-api.php

    r2441493 r2473627  
    11<?php
    22
     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 */
    313class Checkout_X_API
    414{
  • checkoutx/tags/1.1.2/includes/class-custom-webhooks.php

    r2441493 r2473627  
    11<?php
    2 
    32/**
    4  * The file that defines the core plugin class
     3 * Extends WooCommerce webhooks system with additional topics for Checkout X app
    54 *
    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
    811 *
    912 * @link       checkout-x.com
    10  * @since      1.0.5
    11  *
    12  * @package    Checkout_X
    13  * @subpackage Checkout_X/includes
    14  */
    15 
    16 /**
    17  * The core plugin class.
    18  *
    19  * This is used to define internationalization, admin-specific hooks, and
    20  * public-facing site hooks.
    21  *
    22  * Also maintains the unique identifier of this plugin as well as the current
    23  * version of the plugin.
    24  *
    2513 * @since      1.0.5
    2614 * @package    Checkout_X
     
    4836     * @access   protected
    4937     * @var      string    $plugin_name    The string used to uniquely identify this plugin.
     38     * @deprecated Not used in this class anymore
    5039     */
    5140    protected $plugin_name;
     
    6150
    6251    /**
    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
    6856     *
    6957     * @since    1.0.5
     
    7866    }
    7967
     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     */
    8081    public function add_custom_webhook_payload($payload, $resource, $resource_id, $webhook_id)
    8182    {
     
    126127    }
    127128
     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     */
    128135    public function add_custom_topic_hooks($topic_hooks)
    129136    {
     
    145152    }
    146153
     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     */
    147160    public function add_custom_topic_events($topic_events)
    148161    {
     
    157170    }
    158171
     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     */
    159181    public function add_custom_webhook_topics($topics)
    160182    {
    161         // New topic array to add to the list, must match hooks being created.
    162183        $new_topics = array(
    163184            'product_category.created' => __( 'Product Category Created', 'woocommerce' ),
     
    170191    }
    171192
     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     */
    172198    public function extend_valid_webhook_resources($resources)
    173199    {
     
    179205    }
    180206
     207    /**
     208     * Triggers shop.updated webhook on any change to WooCommerce settings
     209     */
    181210    public function send_webhook_on_settings_change($setting_changed)
    182211    {
     
    187216    }
    188217
     218    /**
     219     * Subscribes to any Wordpress option change
     220     */
    189221    private function add_settings_hook()
    190222    {
     
    192224    }
    193225
     226
     227    /**
     228     * Subscribes to product_cat CRUD events and trggers relevant webhook topic
     229     */
    194230    private function add_product_cat_hooks()
    195231    {
  • checkoutx/tags/1.1.2/includes/class-deactivator.php

    r2441493 r2473627  
    1616
    1717  /**
    18    * Runs on plugin deactivation. Sends 'deactivated' event to CheckoutX.
     18   * Runs on plugin deactivation. Sends 'deactivated' event to Checkout X.
    1919   *
     20   * Uses StatusNotifier to send http query to Checkout X app.
    2021   * @since    1.0.0
    2122   */
     23
    2224  public static function deactivate() {
    2325    require_once plugin_dir_path(CHKX_PLUGIN_FILE) . 'includes/class-status-notifier.php';
  • checkoutx/tags/1.1.2/includes/class-i18n.php

    r2441493 r2473627  
    44 * Define the internationalization functionality
    55 *
     6 * Not used at the moment.
    67 * Loads and defines the internationalization files for this plugin
    78 * so that it is ready for translation.
  • checkoutx/tags/1.1.2/includes/class-loader.php

    r2441493 r2473627  
    11<?php
    2 
    3 /**
    4  * Register all actions and filters for the plugin
    5  *
    6  * @link       checkout-x.com
    7  * @since      1.0.0
    8  *
    9  * @package    Checkout_X
    10  * @subpackage Checkout_X/includes
    11  */
    12 
    132/**
    143 * Register all actions and filters for the plugin.
     
    187 * run function to execute the list of actions and filters.
    198 *
     9 * @link       checkout-x.com
     10 * @since      1.0.0
    2011 * @package    Checkout_X
    2112 * @subpackage Checkout_X/includes
    22  * @author     Vlad <just.raeno@icloud.com>
     13 * @author     Checkout X
    2314 */
    2415
  • checkoutx/tags/1.1.2/includes/class-main.php

    r2441493 r2473627  
    66 * A class definition that includes attributes and functions used across both the
    77 * 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.
    811 *
    912 * @link       checkout-x.com
     
    7275     * - Checkout_X_Admin. Defines all hooks for the admin area.
    7376     * - 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
    7481     *
    7582     * Create an instance of the loader which will be used to register the hooks
     
    100107
    101108        /**
    102          * Classes responsible for CheckoutX API on top of WooCommerce API
     109         * Classes responsible for Checkout X API on top of WooCommerce API
    103110         */
    104111        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-api.php';
     
    123130     * Uses the Checkout_X_i18n class in order to set the domain and to register the hook
    124131     * with WordPress.
     132     * Currently plugin has almost no text and doesn't use i18n.
    125133     *
    126134     * @since    1.0.0
     
    162170        $plugin_public = new Checkout_X_Public($this->get_plugin_name(), $this->get_version());
    163171
    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 )
    165174        # $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
    166175       
     176        # loads plugin JS file on all shop pages
     177        # more info in assets/js/public.js documentation
    167178        $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.
    168181        $this->loader->add_action('wp_head', $plugin_public, 'add_resources');
    169182
     
    179192    }
    180193
     194    /**
     195     * Registers hook that extends cart_fragments JSON with DOM element that
     196     * includes cart content for Checkout X storefront script
     197     */
    181198    private function define_filters()
    182199    {
     
    186203    }
    187204
     205    /**
     206     * Registers hook that extend WooCommerce webhooks with custom topics:
     207     * - product_category CRUD
     208     * - shop.updated
     209     */
    188210    private function define_custom_webhooks()
    189211    {
     
    202224    }
    203225
     226    /**
     227     * Registers filter that externds REST API namespaces with plugin specific /wc-checkoutx
     228     */
    204229    public function define_api()
    205230    {
     
    208233    }
    209234
     235    /**
     236     * Registers filter that is triggered when Wordpress check whether auto
     237     * update is enabled for plugin or not
     238     */
    210239    public function configure_auto_update()
    211240    {
     
    213242    }
    214243
     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     */
    215249    public function enable_auto_update( $update, $item)
    216250    {
  • checkoutx/tags/1.1.2/includes/class-status-notifier.php

    r2441493 r2473627  
    11<?php
    22
     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 */
    327class Checkout_X_Status_Notifier
    428{
    5   const DEFAULT_CHECKOUT_X_URL = 'https://www.checkout-x.com';
     29  const DEFAULT_CHECKOUT_X_URL = 'https://app.checkout-x.com';
    630
    731  public function plugin_activated()
     
    4266  }
    4367
     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   */
    4478  public function event_delivery_url()
    4579  {
    4680    $shop_id = get_option('checkout_x_shop_id');
    4781
    48     # use url from ENV for dev/staging, use default url on merchant shops
    4982    $checkout_x_url = getenv('CHECKOUTX_URL') ?: self::DEFAULT_CHECKOUT_X_URL;
    5083
     
    5386
    5487
     88  /**
     89   * Builds signature similar to WooCommerce webhook signature to
     90   * authenticate requests from plugin on Checkout X side
     91   */
    5592  public function build_signature($payload)
    5693  {
  • checkoutx/tags/1.1.2/includes/class-uninstallation.php

    r2441493 r2473627  
    1616{
    1717  /**
    18    * Runs on plugin uninstall. Send 'uninstall' event to CheckoutX.
     18   * Runs on plugin uninstall. Sends 'uninstall' event to Checkout X.
    1919   * @since 1.1.0
    2020   */
  • checkoutx/tags/1.1.2/public/class-public.php

    r2441493 r2473627  
    22
    33/**
    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.
    521 *
    622 * @link       checkout-x.com
    723 * @since      1.0.0
    8  *
    924 * @package    Checkout_X
    1025 * @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
    2227 */
    2328
     
    8792    }
    8893
     94    /**
     95     * Adds meta tag with shop ID to be used by Checkout X storefront script
     96     */
    8997    public function add_resources()
    9098    {
     
    101109    }
    102110
     111    /**
     112     * Fetches shop ID from settings
     113     */
    103114    public function get_shop_id()
    104115    {
     
    106117    }
    107118
     119    /**
     120     * Fetches Checkout X storefront script url value from settings
     121     */
    108122    public function get_storefront_script_url()
    109123    {
     
    111125    }
    112126
    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     */
    115134    public function add_cart_json()
    116135    {
     
    119138    }
    120139
     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     */
    121147    public function add_cart_json_fragments($fragments)
    122148    {
     
    125151    }
    126152
     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     */
    127159    public function maybe_load_cart() {
    128160
    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      }
    139171    }
    140172
     
    147179    }
    148180
     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     */
    149191    private function cart_content()
    150192    {
     
    169211    }
    170212
     213    /**
     214     * Redirects to Checkout X checkout page if cart is not empty and user
     215     * reaches /checkout page
     216     */
    171217    public function checkout_nav_menu_redirect()
    172218    {
     
    182228    }
    183229
     230    /**
     231     * Build checkout_url based on cookie set by Checkout X script
     232     *
     233     * Returns original url if cookie is not set
     234     */
    184235    public function checkoutx_checkout_url($original_url)
    185236    {
     
    191242    }
    192243
     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     */
    193250    public function clear_cart()
    194251    {
     
    202259        echo json_encode(WC()->cart->get_cart_contents());
    203260
     261        # this method is called via AJAX so it's safe to die here
    204262        wp_die();
    205263    }
  • checkoutx/tags/1.1.2/public/partials/checkout-x-public-display.php

    r2416469 r2473627  
    1 <h2>CheckoutX Dev</h2>
     1<h2>Checkout X Dev</h2>
    22<?php
    33
  • checkoutx/trunk/README.txt

    r2441493 r2473627  
    11=== Checkout X for WooCommerce ===
    22Contributors: checkoutx
    3 Tags: Checkout, Checkout X, checkoutx, one-page checkout, one page checkout, upsells, post-purchase upsells. automatic discounts, woocommerce, e-commerce
     3Tags: checkout, one page checkout, upsell, post-purchase upsell, automatic discount, woocommerce, e-commerce, payment, abandoned cart, AOV, conversion, WooCommerce checkout
    44Requires at least: 5.4
    5 Tested up to: 5.5.1
    6 Stable tag: trunk
     5Tested up to: 5.6.1
     6Stable tag: 1.1.2
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    1313== Description ==
    1414
    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
     19Checkout 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
     21The 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.
    1622
    1723Having processed over $600M in transactions across thousands of stores, we are always working on optimization and adjustments to deliver the best-in-class results.
    1824
    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)
    2026
    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 ==
    3028
    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
     34Want to ask a pre-sale question? [Get in touch](https://www.checkout-x.com/contact_us)!
     35
     36== What do we do best? ==
     37
     38The 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.**
     41Checkout 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.**
     44With 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.**
     47Forget 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
     61Post-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
     74https://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
     84Going 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
     86All 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
     881. **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.
     892. **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.
     903. **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.
     914. **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
     93Optimize 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? ==
    32105
    33106- Convert more shoppers into customers
    34107- Increase the AOV with post-purchase upsells
    35 - Offer payment methods your customers prefer
    36 - Speak the language of your customer (translations available!)
    37 - Recover abandoned shopping carts
    38 - Integrate with tools you already use and work for you
     108- 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
    39112
    40 Take advantage of your new Checkout on Steroids and boost your revenue today!
     113Take advantage of your new Checkout on steroids and boost your revenue today!
     114
     115== Who are we? ==
     116
     117Checkout 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
     121Our 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
     1281. One page, mobile-ready checkout
     1292. Post-purchase upsells
     1303. Modern, minimal thank you page
     1314. Manage your checkout with our app
     1325. Manage your post-purchase upsells
     1336. Checkout-X - your checkout on steroids
    41134
    42135== Installation ==
     
    50143For automatic installation log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.
    51144
    52 
    53 == Screenshots ==
    54 
    55 1. One page, mobile-ready checkout
    56 2. Post-purchase upsells
    57 3. Modern, minimal thank you page
    58 4. Manage your checkout with our app
    59 5. Manage your post-purchase upsells
    60 6. Checkout-X - your checkout on steroids
    61 
    62 
    63145== Changelog ==
    64146
     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
    65152= 1.1.1 =
    66 * send an event to CheckoutX on plugin activation/deactivation/uninstall
     153* Send an event to Checkout X on plugin activation/deactivation/uninstall.
  • checkoutx/trunk/admin/class-admin.php

    r2441493 r2473627  
    1616    private $version;
    1717
    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";
    1920    const HELP_CENTER_URL = "https://help.checkout-x.com";
    2021    const BASE64_APP_ICON = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMzJweCIgaGVpZ2h0PSIzMnB4IiB2aWV3Qm94PSIwIDAgMzIgMzIiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8dGl0bGU+aWNvbkA8L3RpdGxlPgogICAgPGcgaWQ9Imljb24iIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIGQ9Ik0yNS42MjUsMjQgQzI2LjAxNzg1NzEsMjQgMjYuMzQ1MjM4MSwyMy44NjY2NjY3IDI2LjYwNzE0MjksMjMuNiBDMjYuODY5MDQ3NiwyMy4zMzMzMzMzIDI3LDIzIDI3LDIyLjYgTDI3LDIyLjYgTDI3LDkuNCBDMjcsOSAyNi44NjkwNDc2LDguNjY2NjY2NjcgMjYuNjA3MTQyOSw4LjQgQzI2LjM0NTIzODEsOC4xMzMzMzMzMyAyNi4wMTc4NTcxLDggMjUuNjI1LDggTDI1LjYyNSw4IEw2LjM3NSw4IEM1Ljk4MjE0Mjg2LDggNS42NTQ3NjE5LDguMTMzMzMzMzMgNS4zOTI4NTcxNCw4LjQgQzUuMTMwOTUyMzgsOC42NjY2NjY2NyA1LDkgNSw5LjQgTDUsOS40IEw1LDIyLjYgQzUsMjMgNS4xMzA5NTIzOCwyMy4zMzMzMzMzIDUuMzkyODU3MTQsMjMuNiBDNS42NTQ3NjE5LDIzLjg2NjY2NjcgNS45ODIxNDI4NiwyNCA2LjM3NSwyNCBMNi4zNzUsMjQgTDI1LjYyNSwyNCBaIE0yNS4zMzQ5MzY1LDEzLjI4NTg5ODQgTDYuMzM0OTM2NDksMTMuMjg1ODk4NCBMNi4zMzQ5MzY0OSwxMC43ODU4OTg0IEM2LjQwMDkwODcxLDkuNzg1ODk4MzggNi42MTUzMTg0Myw5LjI4NTg5ODM4IDYuOTc4MTY1NjYsOS4yODU4OTgzOCBMMjQuOTQzMTc5Nyw5LjI5NDcxNDExIEMyNS4yNzY3NzYxLDkuNDczMTI0MzcgMjUuMjY4OTY0Myw5Ljc4NTg5ODM4IDI1LjMzNDkzNjUsMTAuNzg1ODk4NCBMMjUuMzM0OTM2NSwxMy4yODU4OTg0IFogTTI0LjY1NTgwODksMjIuMzQ4MDc2MiBMNi45NDIyNjcyNywyMi4zNDgwNzYyIEM2LjU3OTQyMDA1LDIyLjM0ODA3NjIgNi4zNjUwMTAzMywyMi4xNjA1NzYyIDYuMjk5MDM4MTEsMjEuNzg1NTc2MiBMNi4yOTkwMzgxMSwyMS43ODU1NzYyIEw2LjI5OTAzODExLDE2LjM0ODA3NjIgTDI1LjI5OTAzODEsMTYuMzQ4MDc2MiBMMjUuMjk5MDM4MSwyMS43ODU1NzYyIEMyNS4yMzMwNjU5LDIyLjE2MDU3NjIgMjUuMDE4NjU2MiwyMi4zNDgwNzYyIDI0LjY1NTgwODksMjIuMzQ4MDc2MiBMMjQuNjU1ODA4OSwyMi4zNDgwNzYyIFogTTE3LjI2Nzk0OTIsMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxNy44NTg2NjA5IEw3LjI2Nzk0OTE5LDE3Ljg1ODY2MDkgTDcuMjY3OTQ5MTksMTkuMDY5NTQyMyBMMTcuMjY3OTQ5MiwxOS4wNjk1NDIzIFogTTI0LjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwxNy44MTY5ODczIEwyMS4yNDUxOTA1LDE3LjgxNjk4NzMgTDIxLjI0NTE5MDUsMjAuODE2OTg3MyBMMjQuMjQ1MTkwNSwyMC44MTY5ODczIFogTTExLjkwMTkyMzgsMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwxOS45NTY3MzcyIEw3LjkwMTkyMzc5LDE5Ljk1NjczNzIgTDcuOTAxOTIzNzksMjEuMTY3NjE4NSBMMTEuOTAxOTIzOCwyMS4xNjc2MTg1IFoiIGlkPSLvhJkiIGZpbGw9IiNGRkZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTYuMDAwMDAwLCAxNi4wMDAwMDApIHJvdGF0ZSgzMzAuMDAwMDAwKSB0cmFuc2xhdGUoLTE2LjAwMDAwMCwgLTE2LjAwMDAwMCkgIj48L3BhdGg+CiAgICA8L2c+Cjwvc3ZnPg==";
     
    5455        add_menu_page(
    5556            'checkout-x',
    56             'CheckoutX',
     57            'Checkout X',
    5758            'manage_options',
    5859            'checkout-x-settings',
     
    6465        add_submenu_page(
    6566            'checkout-x-settings',
    66             'CheckoutX settings',
     67            'Checkout X settings',
    6768            'General',
    6869            'manage_options',
     
    7374        add_submenu_page(
    7475            'checkout-x-settings',
    75             'CheckoutX help center',
     76            'Checkout X help center',
    7677            'Help center',
    7778            'manage_options',
     
    108109
    109110        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);
    111112        } else {
    112           return esc_url(self::CHECKOUT_X_ROOT_URL);
     113          return esc_url(self::CHECKOUTX_WEBSITE_URL);
    113114        }
    114115    }
     
    116117    public function contact_us_checkoutx_url()
    117118    {
    118       return esc_url(self::CHECKOUT_X_ROOT_URL . "/contact_us");
     119      return esc_url(self::CHECKOUTX_WEBSITE_URL . "/contact_us");
    119120    }
    120121}
  • checkoutx/trunk/assets/js/public.js

    r2441493 r2473627  
    3030     */
    3131
     32  // exported to window object and called by storefront script
    3233    var checkoutXPlugin = {
     34      // calls method on backend to empty cart and when server responds - trigger
     35      // wc_fragment_refresh event to update UI
    3336        clearWoocommerceCart :function(){
    3437            var data = {
     
    4952    };
    5053
     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
    5157    $(function() {
    5258      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
    16= 1.1.1 =
    2 * send an event to CheckoutX on plugin activation/deactivation/uninstall
     7* Send an event to Checkout X on plugin activation/deactivation/uninstall.
    38
    49= 1.1.0 =
    5 * public release
    6 * adds automatic shop configuration
     10* Public release.
     11* Adds automatic shop configuration.
    712
    813= 1.0 =
    9 * closed beta launch
     14* Closed beta launch.
  • checkoutx/trunk/checkout-x.php

    r2441493 r2473627  
    55 *
    66 * 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.
    1011 *
    1112 * @link              https://www.checkout-x.com
     
    1415 *
    1516 * @wordpress-plugin
    16  * Plugin Name:       CheckoutX
     17 * Plugin Name:       Checkout X
    1718 * Plugin URI:        https://www.checkout-x.com
    18  * Description:       Connect CheckoutX to your shop
    19  * Version:           1.1.1
     19 * 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
    2021 * Author:            Checkout X
    2122 * Author URI:        https://www.checkout-x.com/?utm_source=partner&utm_medium=woocommerce-marketplace
     
    2627 */
    2728
    28 // If this file is called directly, abort.
     29/**
     30 * If this file is called directly, abort.
     31 */
    2932if ( ! defined( 'WPINC' ) ) {
    3033  die;
    3134}
    3235
     36/**
     37 * defines constant to be used as a root in building absolute path when other
     38 * files need include/reqiure some dependency
     39 */
    3340if ( ! defined( 'CHKX_PLUGIN_FILE' ) ) {
    3441  define( 'CHKX_PLUGIN_FILE', __FILE__ );
    3542}
    3643
    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 */
    3849if ( ! defined( 'WC_CHECKOUT_X_VERSION' ) ) {
    3950  $plugin_data = get_file_data( __FILE__, array( 'Version' => 'Version' ), false );
     
    4152}
    4253
     54/**
     55 * defines plugin name constant, used when ensuring that auto-update is enabled
     56 * for the plugin
     57 */
    4358if ( ! defined( 'WC_CHECKOUT_X_PLUGIN_NAME' ) ) {
    4459  define( 'WC_CHECKOUT_X_PLUGIN_NAME', 'checkout-x');
     
    6378}
    6479
     80/**
     81 * The code that runs during plugin uninstall.
     82 * This action is documented in includes/class-uninstallation.php
     83 */
    6584function uninstall_Checkout_X() {
    6685  require_once plugin_dir_path(__FILE__) . 'includes/class-uninstallation.php';
     
    7392
    7493/**
    75  * The core plugin class that is used to define internationalization,
     94 * The core plugin class that is used to define main logic,
    7695 * admin-specific hooks, and public-facing site hooks.
    7796 */
  • checkoutx/trunk/includes/class-activator.php

    r2441493 r2473627  
    1616{
    1717  /**
    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
    1921   *
    2022   * @since    1.0.0
  • checkoutx/trunk/includes/class-api-controller.php

    r2441493 r2473627  
    11<?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
    238class Checkout_X_API_Controller
    339{
     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   */
    445  protected $namespace = 'wc-checkoutx';
    546
    647  protected $api_version = 'v1';
    748
     49  /**
     50   * Registers endpoints and defines params, callback and permission check
     51   * callback for each of them
     52   */
    853  public function register_routes()
    954  {
     
    4085  }
    4186
     87  /**
     88   * GET /status callback
     89  */
    4290  public function get_status()
    4391  {
    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    );
    4598    return $this->wrap_response($data, 200);
    4699  }
    47100
     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   */
    48112  public function update_settings($request)
    49113  {
     
    74138  }
    75139
    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   */
    78144  public function check_is_admin()
    79145  {
     
    81147  }
    82148
     149  /**
     150   * Adds custom data to responses of all endpoints. Currently adds header with
     151   * plugin version only.
     152   */
    83153  private function wrap_response($data, $status = HTTP_STATUS_OK, $headers = array())
    84154  {
  • checkoutx/trunk/includes/class-api.php

    r2441493 r2473627  
    11<?php
    22
     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 */
    313class Checkout_X_API
    414{
  • checkoutx/trunk/includes/class-custom-webhooks.php

    r2441493 r2473627  
    11<?php
    2 
    32/**
    4  * The file that defines the core plugin class
     3 * Extends WooCommerce webhooks system with additional topics for Checkout X app
    54 *
    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
    811 *
    912 * @link       checkout-x.com
    10  * @since      1.0.5
    11  *
    12  * @package    Checkout_X
    13  * @subpackage Checkout_X/includes
    14  */
    15 
    16 /**
    17  * The core plugin class.
    18  *
    19  * This is used to define internationalization, admin-specific hooks, and
    20  * public-facing site hooks.
    21  *
    22  * Also maintains the unique identifier of this plugin as well as the current
    23  * version of the plugin.
    24  *
    2513 * @since      1.0.5
    2614 * @package    Checkout_X
     
    4836     * @access   protected
    4937     * @var      string    $plugin_name    The string used to uniquely identify this plugin.
     38     * @deprecated Not used in this class anymore
    5039     */
    5140    protected $plugin_name;
     
    6150
    6251    /**
    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
    6856     *
    6957     * @since    1.0.5
     
    7866    }
    7967
     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     */
    8081    public function add_custom_webhook_payload($payload, $resource, $resource_id, $webhook_id)
    8182    {
     
    126127    }
    127128
     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     */
    128135    public function add_custom_topic_hooks($topic_hooks)
    129136    {
     
    145152    }
    146153
     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     */
    147160    public function add_custom_topic_events($topic_events)
    148161    {
     
    157170    }
    158171
     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     */
    159181    public function add_custom_webhook_topics($topics)
    160182    {
    161         // New topic array to add to the list, must match hooks being created.
    162183        $new_topics = array(
    163184            'product_category.created' => __( 'Product Category Created', 'woocommerce' ),
     
    170191    }
    171192
     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     */
    172198    public function extend_valid_webhook_resources($resources)
    173199    {
     
    179205    }
    180206
     207    /**
     208     * Triggers shop.updated webhook on any change to WooCommerce settings
     209     */
    181210    public function send_webhook_on_settings_change($setting_changed)
    182211    {
     
    187216    }
    188217
     218    /**
     219     * Subscribes to any Wordpress option change
     220     */
    189221    private function add_settings_hook()
    190222    {
     
    192224    }
    193225
     226
     227    /**
     228     * Subscribes to product_cat CRUD events and trggers relevant webhook topic
     229     */
    194230    private function add_product_cat_hooks()
    195231    {
  • checkoutx/trunk/includes/class-deactivator.php

    r2441493 r2473627  
    1616
    1717  /**
    18    * Runs on plugin deactivation. Sends 'deactivated' event to CheckoutX.
     18   * Runs on plugin deactivation. Sends 'deactivated' event to Checkout X.
    1919   *
     20   * Uses StatusNotifier to send http query to Checkout X app.
    2021   * @since    1.0.0
    2122   */
     23
    2224  public static function deactivate() {
    2325    require_once plugin_dir_path(CHKX_PLUGIN_FILE) . 'includes/class-status-notifier.php';
  • checkoutx/trunk/includes/class-i18n.php

    r2441493 r2473627  
    44 * Define the internationalization functionality
    55 *
     6 * Not used at the moment.
    67 * Loads and defines the internationalization files for this plugin
    78 * so that it is ready for translation.
  • checkoutx/trunk/includes/class-loader.php

    r2441493 r2473627  
    11<?php
    2 
    3 /**
    4  * Register all actions and filters for the plugin
    5  *
    6  * @link       checkout-x.com
    7  * @since      1.0.0
    8  *
    9  * @package    Checkout_X
    10  * @subpackage Checkout_X/includes
    11  */
    12 
    132/**
    143 * Register all actions and filters for the plugin.
     
    187 * run function to execute the list of actions and filters.
    198 *
     9 * @link       checkout-x.com
     10 * @since      1.0.0
    2011 * @package    Checkout_X
    2112 * @subpackage Checkout_X/includes
    22  * @author     Vlad <just.raeno@icloud.com>
     13 * @author     Checkout X
    2314 */
    2415
  • checkoutx/trunk/includes/class-main.php

    r2441493 r2473627  
    66 * A class definition that includes attributes and functions used across both the
    77 * 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.
    811 *
    912 * @link       checkout-x.com
     
    7275     * - Checkout_X_Admin. Defines all hooks for the admin area.
    7376     * - 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
    7481     *
    7582     * Create an instance of the loader which will be used to register the hooks
     
    100107
    101108        /**
    102          * Classes responsible for CheckoutX API on top of WooCommerce API
     109         * Classes responsible for Checkout X API on top of WooCommerce API
    103110         */
    104111        require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-api.php';
     
    123130     * Uses the Checkout_X_i18n class in order to set the domain and to register the hook
    124131     * with WordPress.
     132     * Currently plugin has almost no text and doesn't use i18n.
    125133     *
    126134     * @since    1.0.0
     
    162170        $plugin_public = new Checkout_X_Public($this->get_plugin_name(), $this->get_version());
    163171
    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 )
    165174        # $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
    166175       
     176        # loads plugin JS file on all shop pages
     177        # more info in assets/js/public.js documentation
    167178        $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.
    168181        $this->loader->add_action('wp_head', $plugin_public, 'add_resources');
    169182
     
    179192    }
    180193
     194    /**
     195     * Registers hook that extends cart_fragments JSON with DOM element that
     196     * includes cart content for Checkout X storefront script
     197     */
    181198    private function define_filters()
    182199    {
     
    186203    }
    187204
     205    /**
     206     * Registers hook that extend WooCommerce webhooks with custom topics:
     207     * - product_category CRUD
     208     * - shop.updated
     209     */
    188210    private function define_custom_webhooks()
    189211    {
     
    202224    }
    203225
     226    /**
     227     * Registers filter that externds REST API namespaces with plugin specific /wc-checkoutx
     228     */
    204229    public function define_api()
    205230    {
     
    208233    }
    209234
     235    /**
     236     * Registers filter that is triggered when Wordpress check whether auto
     237     * update is enabled for plugin or not
     238     */
    210239    public function configure_auto_update()
    211240    {
     
    213242    }
    214243
     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     */
    215249    public function enable_auto_update( $update, $item)
    216250    {
  • checkoutx/trunk/includes/class-status-notifier.php

    r2441493 r2473627  
    11<?php
    22
     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 */
    327class Checkout_X_Status_Notifier
    428{
    5   const DEFAULT_CHECKOUT_X_URL = 'https://www.checkout-x.com';
     29  const DEFAULT_CHECKOUT_X_URL = 'https://app.checkout-x.com';
    630
    731  public function plugin_activated()
     
    4266  }
    4367
     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   */
    4478  public function event_delivery_url()
    4579  {
    4680    $shop_id = get_option('checkout_x_shop_id');
    4781
    48     # use url from ENV for dev/staging, use default url on merchant shops
    4982    $checkout_x_url = getenv('CHECKOUTX_URL') ?: self::DEFAULT_CHECKOUT_X_URL;
    5083
     
    5386
    5487
     88  /**
     89   * Builds signature similar to WooCommerce webhook signature to
     90   * authenticate requests from plugin on Checkout X side
     91   */
    5592  public function build_signature($payload)
    5693  {
  • checkoutx/trunk/includes/class-uninstallation.php

    r2441493 r2473627  
    1616{
    1717  /**
    18    * Runs on plugin uninstall. Send 'uninstall' event to CheckoutX.
     18   * Runs on plugin uninstall. Sends 'uninstall' event to Checkout X.
    1919   * @since 1.1.0
    2020   */
  • checkoutx/trunk/public/class-public.php

    r2441493 r2473627  
    22
    33/**
    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.
    521 *
    622 * @link       checkout-x.com
    723 * @since      1.0.0
    8  *
    924 * @package    Checkout_X
    1025 * @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
    2227 */
    2328
     
    8792    }
    8893
     94    /**
     95     * Adds meta tag with shop ID to be used by Checkout X storefront script
     96     */
    8997    public function add_resources()
    9098    {
     
    101109    }
    102110
     111    /**
     112     * Fetches shop ID from settings
     113     */
    103114    public function get_shop_id()
    104115    {
     
    106117    }
    107118
     119    /**
     120     * Fetches Checkout X storefront script url value from settings
     121     */
    108122    public function get_storefront_script_url()
    109123    {
     
    111125    }
    112126
    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     */
    115134    public function add_cart_json()
    116135    {
     
    119138    }
    120139
     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     */
    121147    public function add_cart_json_fragments($fragments)
    122148    {
     
    125151    }
    126152
     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     */
    127159    public function maybe_load_cart() {
    128160
    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      }
    139171    }
    140172
     
    147179    }
    148180
     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     */
    149191    private function cart_content()
    150192    {
     
    169211    }
    170212
     213    /**
     214     * Redirects to Checkout X checkout page if cart is not empty and user
     215     * reaches /checkout page
     216     */
    171217    public function checkout_nav_menu_redirect()
    172218    {
     
    182228    }
    183229
     230    /**
     231     * Build checkout_url based on cookie set by Checkout X script
     232     *
     233     * Returns original url if cookie is not set
     234     */
    184235    public function checkoutx_checkout_url($original_url)
    185236    {
     
    191242    }
    192243
     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     */
    193250    public function clear_cart()
    194251    {
     
    202259        echo json_encode(WC()->cart->get_cart_contents());
    203260
     261        # this method is called via AJAX so it's safe to die here
    204262        wp_die();
    205263    }
  • checkoutx/trunk/public/partials/checkout-x-public-display.php

    r2416469 r2473627  
    1 <h2>CheckoutX Dev</h2>
     1<h2>Checkout X Dev</h2>
    22<?php
    33
Note: See TracChangeset for help on using the changeset viewer.