Plugin Directory

Changeset 3442178


Ignore:
Timestamp:
01/19/2026 03:03:41 AM (7 weeks ago)
Author:
convertkit
Message:

Update to version 2.0.5 from GitHub

Location:
convertkit-for-woocommerce
Files:
4 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • convertkit-for-woocommerce/tags/2.0.5/includes/class-ckwc-integration.php

    r3411835 r3442178  
    521521
    522522                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    523                 'class'       => 'enabled subscribe',
     523                'class'       => 'enabled',
    524524            ),
    525525            'subscription'                  => array(
    526                 'title'       => __( 'Subscription', 'woocommerce-convertkit' ),
    527                 'type'        => 'subscription',
    528                 'default'     => '',
    529                 'description' => __( 'The Kit form, tag or sequence to subscribe customers to.', 'woocommerce-convertkit' ),
    530 
    531                 // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    532                 'class'       => 'enabled subscribe',
     526                'title'             => __( 'Subscription', 'woocommerce-convertkit' ),
     527                'type'              => 'subscription',
     528                'default'           => '',
     529                'description'       => __( 'The Kit form, tag or sequence to subscribe customers to.', 'woocommerce-convertkit' ),
     530                'include_forms'     => true,
     531                'include_tags'      => true,
     532                'include_sequences' => true,
     533
     534                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     535                'class'             => 'enabled',
    533536            ),
    534537            'name_format'                   => array(
     
    545548
    546549                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    547                 'class'       => 'enabled subscribe',
     550                'class'       => 'enabled',
    548551            ),
    549552
     
    556559
    557560                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    558                 'class'       => 'enabled subscribe',
     561                'class'       => 'enabled',
    559562            ),
    560563            'custom_field_phone'            => array(
     
    565568
    566569                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    567                 'class'       => 'enabled subscribe',
     570                'class'       => 'enabled',
    568571            ),
    569572            'custom_field_billing_address'  => array(
     
    574577
    575578                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    576                 'class'       => 'enabled subscribe',
     579                'class'       => 'enabled',
    577580            ),
    578581            'custom_field_shipping_address' => array(
     
    583586
    584587                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    585                 'class'       => 'enabled subscribe',
     588                'class'       => 'enabled',
    586589            ),
    587590            'custom_field_address_format'   => array(
     
    620623
    621624                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    622                 'class'       => 'enabled subscribe',
     625                'class'       => 'enabled',
    623626            ),
    624627            'custom_field_customer_note'    => array(
     
    629632
    630633                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    631                 'class'       => 'enabled subscribe',
     634                'class'       => 'enabled',
    632635            ),
    633636
     
    646649
    647650                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    648                 'class'       => 'enabled subscribe',
     651                'class'       => 'enabled',
    649652            ),
    650653            'opt_in_label'                  => array(
     
    656659
    657660                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    658                 'class'       => 'enabled subscribe display_opt_in',
     661                'class'       => 'enabled display_opt_in',
    659662            ),
    660663            'opt_in_status'                 => array(
     
    670673
    671674                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    672                 'class'       => 'enabled subscribe display_opt_in',
     675                'class'       => 'enabled display_opt_in',
    673676            ),
    674677            'opt_in_location'               => array(
     
    684687
    685688                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    686                 'class'       => 'enabled subscribe display_opt_in',
     689                'class'       => 'enabled display_opt_in',
    687690            ),
    688691
     
    701704
    702705                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    703                 'class'       => 'enabled subscribe',
     706                'class'       => 'enabled',
    704707            ),
    705708            'send_purchases_event'          => array(
     
    732735
    733736                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    734                 'class'       => 'enabled subscribe send_purchases',
     737                'class'       => 'enabled send_purchases',
    735738            ),
    736739            'sync_past_orders'              => array(
     
    747750
    748751                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    749                 'class'    => 'enabled subscribe',
     752                'class'    => 'enabled send_purchases',
     753            ),
     754
     755            // Abandoned Cart.
     756            'abandoned_cart'                => array(
     757                'title'       => __( 'Abandoned Cart', 'woocommerce-convertkit' ),
     758                'label'       => __( 'Send abandoned cart data to Kit.', 'woocommerce-convertkit' ),
     759                'type'        => 'checkbox',
     760                'default'     => 'no',
     761                'description' => __(
     762                    'If enabled, the visitor will be subscribed to a tag in Kit, if they leave items in their cart without completing the checkout process after the below number of minutes. The tag is removed when they complete checkout.',
     763                    'woocommerce-convertkit'
     764                ),
     765                'desc_tip'    => false,
     766
     767                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     768                'class'       => 'enabled',
     769            ),
     770            'abandoned_cart_threshold'      => array(
     771                'title'             => __( 'Abandoned Cart: Threshold', 'woocommerce-convertkit' ),
     772                'type'              => 'number',
     773                'default'           => 15,
     774                'description'       => __( 'The number of minutes to wait before considering a cart abandoned.', 'woocommerce-convertkit' ),
     775                'desc_tip'          => false,
     776
     777                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     778                'class'             => 'enabled abandoned_cart',
     779
     780                // Custom attributes for the number input.
     781                'custom_attributes' => array(
     782                    'min'  => 1,
     783                    'max'  => 99999,
     784                    'step' => 1,
     785                ),
     786            ),
     787            'abandoned_cart_subscription'   => array(
     788                'title'             => __( 'Abandoned Cart: Tag', 'woocommerce-convertkit' ),
     789                'type'              => 'subscription',
     790                'default'           => '',
     791                'description'       => __( 'The Kit tag to subscribe visitors to when they abandon their cart. This can be used in a Sequence or Automation to send abandoned cart emails to the subscriber. This tag is removed when the customer completes the checkout process.', 'woocommerce-convertkit' ),
     792                'include_forms'     => false,
     793                'include_tags'      => true,
     794                'include_sequences' => false,
     795
     796                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     797                'class'             => 'enabled abandoned_cart',
    750798            ),
    751799
     
    892940            'custom_attributes' => array(),
    893941            'options'           => array(),
     942            'include_forms'     => false,
     943            'include_tags'      => false,
     944            'include_sequences' => false,
    894945        );
    895946
     
    913964        // Get current subscription setting and other settings to render the subscription dropdown field.
    914965        $subscription = array(
    915             'id'        => 'woocommerce_ckwc_subscription',
    916             'class'     => 'select ckwc-select2 ' . $data['class'],
    917             'name'      => $field,
    918             'value'     => $this->get_option( $key ),
    919             'forms'     => $this->forms,
    920             'tags'      => $this->tags,
    921             'sequences' => $this->sequences,
     966            'id'    => $field,
     967            'class' => 'select ckwc-select2 ' . $data['class'],
     968            'name'  => $field,
     969            'value' => $this->get_option( $key ),
    922970        );
     971
     972        // Include Forms, Tags and Sequences in the subscription dropdown field.
     973        if ( $data['include_forms'] ) {
     974            $subscription['forms'] = $this->forms;
     975        }
     976        if ( $data['include_tags'] ) {
     977            $subscription['tags'] = $this->tags;
     978        }
     979        if ( $data['include_sequences'] ) {
     980            $subscription['sequences'] = $this->sequences;
     981        }
    923982
    924983        ob_start();
  • convertkit-for-woocommerce/tags/2.0.5/includes/class-ckwc-setup.php

    r3273267 r3442178  
    2828        if ( $current_version === CKWC_PLUGIN_VERSION ) {
    2929            return;
     30        }
     31
     32        /**
     33         * 2.0.5: Register Action Scheduler actions.
     34         */
     35        if ( ! $current_version || version_compare( $current_version, '2.0.5', '<' ) ) {
     36            add_action( 'shutdown', 'ckwc_schedule_actions' );
    3037        }
    3138
  • convertkit-for-woocommerce/tags/2.0.5/includes/class-wp-ckwc.php

    r3408882 r3442178  
    249249    private function initialize_global() {
    250250
     251        $this->classes['abandoned_cart']   = new CKWC_Abandoned_Cart();
    251252        $this->classes['admin_notices']    = new CKWC_Admin_Notices();
    252253        $this->classes['checkout']         = new CKWC_Checkout();
  • convertkit-for-woocommerce/tags/2.0.5/includes/cron-functions.php

    r3322555 r3442178  
    66 * @author ConvertKit
    77 */
     8
     9/**
     10 * Subscribe abandoned cart emails to the abandoned cart tag
     11 * by checking the WooCommerce sessions table.
     12 *
     13 * @since   2.0.5
     14 */
     15function ckwc_abandoned_cart() {
     16
     17    // Bail if the integration is unavailable.
     18    if ( ! function_exists( 'WP_CKWC_Integration' ) ) {
     19        return;
     20    }
     21
     22    // Bail if the integration is not enabled.
     23    if ( ! WP_CKWC_Integration()->is_enabled() ) {
     24        return;
     25    }
     26
     27    // Bail if Abandoned Cart is not enabled.
     28    if ( ! WP_CKWC_Integration()->get_option_bool( 'abandoned_cart' ) ) {
     29        return;
     30    }
     31
     32    // Bail if no tag is configured.
     33    $subscription = WP_CKWC_Integration()->get_option( 'abandoned_cart_subscription' );
     34    if ( empty( $subscription ) ) {
     35        return;
     36    }
     37
     38    // Get the tag ID.
     39    list( $resource_type, $tag_id ) = explode( ':', $subscription );
     40
     41    // Calculate the threshold.
     42    $threshold = time() - ( absint( WP_CKWC_Integration()->get_option( 'abandoned_cart_threshold' ) ) * MINUTE_IN_SECONDS );
     43
     44    // Setup the API.
     45    $api = new CKWC_API(
     46        CKWC_OAUTH_CLIENT_ID,
     47        CKWC_OAUTH_CLIENT_REDIRECT_URI,
     48        WP_CKWC_Integration()->get_option( 'access_token' ),
     49        WP_CKWC_Integration()->get_option( 'refresh_token' ),
     50        WP_CKWC_Integration()->get_option_bool( 'debug' )
     51    );
     52
     53    // Get WooCommerce sessions.
     54    // WooCommerce does not provide a public native function to fetch all sessions.
     55    // We must continue to use a direct query to the woocommerce_sessions table.
     56    global $wpdb;
     57    $results = $wpdb->get_results( "SELECT session_key, session_value FROM {$wpdb->prefix}woocommerce_sessions" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     58
     59    foreach ( $results as $row ) {
     60        // Get the session data.
     61        $session_data = maybe_unserialize( $row->session_value );
     62
     63        // If no email or timestamp is set, continue.
     64        if ( empty( $session_data['ckwc_abandoned_cart_email'] ) || empty( $session_data['ckwc_abandoned_cart_timestamp'] ) ) {
     65            continue;
     66        }
     67
     68        $email     = $session_data['ckwc_abandoned_cart_email'];
     69        $timestamp = intval( $session_data['ckwc_abandoned_cart_timestamp'] );
     70
     71        // Check if cart looks abandoned.
     72        if ( $timestamp < $threshold ) {
     73            // Create subscriber and tag.
     74            $api->create_subscriber( $email );
     75            $api->tag_subscriber_by_email( absint( $tag_id ), $email );
     76
     77            // Remove session data so we don't trigger this email again.
     78            unset( $session_data['ckwc_abandoned_cart_email'] );
     79            unset( $session_data['ckwc_abandoned_cart_timestamp'] );
     80            $wpdb->update( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     81                $wpdb->prefix . 'woocommerce_sessions',
     82                array( 'session_value' => maybe_serialize( $session_data ) ),
     83                array( 'session_key' => $row->session_key ),
     84                array( '%s' ),
     85                array( '%s' )
     86            );
     87        }
     88    }
     89
     90}
     91add_action( 'ckwc_abandoned_cart', 'ckwc_abandoned_cart' );
    892
    993/**
  • convertkit-for-woocommerce/tags/2.0.5/includes/functions.php

    r3411835 r3442178  
    66 * @author ConvertKit
    77 */
     8
     9/**
     10 * Runs the activation and update routines when the plugin is activated.
     11 *
     12 * @since   2.0.5
     13 *
     14 * @param   bool $network_wide   Is network wide activation.
     15 */
     16function ckwc_plugin_activate( $network_wide ) {
     17
     18    // Check if we are on a multisite install, activating network wide, or a single install.
     19    if ( ! is_multisite() || ! $network_wide ) {
     20        // Single Site activation.
     21        add_action( 'shutdown', 'ckwc_schedule_actions' );
     22    } else {
     23        // Multisite network wide activation.
     24        $sites = get_sites(
     25            array(
     26                'number' => 0,
     27            )
     28        );
     29        foreach ( $sites as $site ) {
     30            switch_to_blog( (int) $site->blog_id );
     31            add_action( 'shutdown', 'ckwc_schedule_actions' );
     32            restore_current_blog();
     33        }
     34    }
     35
     36}
     37
     38/**
     39 * Runs the activation and update routines when the plugin is activated
     40 * on a WordPress multisite setup.
     41 *
     42 * @since   2.0.5
     43 *
     44 * @param   WP_Site|int $site_or_blog_id    WP_Site or Blog ID.
     45 */
     46function ckwc_plugin_activate_new_site( $site_or_blog_id ) {
     47
     48    // Check if $site_or_blog_id is a WP_Site or a blog ID.
     49    if ( is_a( $site_or_blog_id, 'WP_Site' ) ) {
     50        $site_or_blog_id = $site_or_blog_id->blog_id;
     51    }
     52
     53    // Run installation routine.
     54    switch_to_blog( $site_or_blog_id );
     55    add_action( 'shutdown', 'ckwc_schedule_actions' );
     56    restore_current_blog();
     57
     58}
     59
     60/**
     61 * Runs the deactivation routine when the plugin is deactivated.
     62 *
     63 * @since   2.0.5
     64 *
     65 * @param   bool $network_wide   Is network wide deactivation.
     66 */
     67function ckwc_plugin_deactivate( $network_wide ) {
     68
     69    // Check if we are on a multisite install, activating network wide, or a single install.
     70    if ( ! is_multisite() || ! $network_wide ) {
     71        // Single Site activation.
     72        ckwc_unschedule_actions();
     73    } else {
     74        // Multisite network wide activation.
     75        $sites = get_sites(
     76            array(
     77                'number' => 0,
     78            )
     79        );
     80        foreach ( $sites as $site ) {
     81            switch_to_blog( (int) $site->blog_id );
     82            ckwc_unschedule_actions();
     83            restore_current_blog();
     84        }
     85    }
     86
     87}
     88
     89/**
     90 * Schedules the WordPress Cron events.
     91 *
     92 * @since   2.0.5
     93 */
     94function ckwc_schedule_actions() {
     95
     96    // Bail if the action scheduler is unavailable.
     97    if ( ! function_exists( 'as_schedule_recurring_action' ) ) {
     98        return;
     99    }
     100
     101    // Bail if the scheduled action already exists.
     102    if ( as_next_scheduled_action( 'ckwc_abandoned_cart' ) ) {
     103        return;
     104    }
     105
     106    // Schedule action.
     107    as_schedule_recurring_action(
     108        time(),
     109        15 * MINUTE_IN_SECONDS,
     110        'ckwc_abandoned_cart',
     111        array(),
     112        'ckwc'
     113    );
     114
     115}
     116
     117/**
     118 * Unschedules the WordPress Cron events.
     119 *
     120 * @since   2.0.5
     121 */
     122function ckwc_unschedule_actions() {
     123
     124    // Bail if the action scheduler is unavailable.
     125    if ( ! function_exists( 'as_unschedule_all_actions' ) ) {
     126        return;
     127    }
     128
     129    // Unschedule action.
     130    as_unschedule_all_actions( 'ckwc_abandoned_cart' );
     131
     132}
    8133
    9134/**
  • convertkit-for-woocommerce/tags/2.0.5/languages/woocommerce-convertkit.pot

    r3422972 r3442178  
    1 # Copyright (C) 2025 Kit
     1# Copyright (C) 2026 Kit
    22# This file is distributed under the GPLv3 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Kit (formerly ConvertKit) for WooCommerce 2.0.4\n"
     5"Project-Id-Version: Kit (formerly ConvertKit) for WooCommerce 2.0.5\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-12-18T10:49:33+00:00\n"
     12"POT-Creation-Date: 2026-01-16T03:18:38+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    7474msgstr ""
    7575
     76#: includes/class-ckwc-abandoned-cart.php:105
     77msgid "Email is required."
     78msgstr ""
     79
     80#: includes/class-ckwc-abandoned-cart.php:112
     81msgid "Invalid email."
     82msgstr ""
     83
    7684#: includes/class-ckwc-admin-notices.php:64
    7785msgid "Kit for WooCommerce: Authorization failed. Please"
     
    279287
    280288#: includes/class-ckwc-integration.php:504
    281 #: includes/class-ckwc-integration.php:716
     289#: includes/class-ckwc-integration.php:719
    282290msgid "Processing:"
    283291msgstr ""
    284292
    285293#: includes/class-ckwc-integration.php:505
    286 #: includes/class-ckwc-integration.php:717
     294#: includes/class-ckwc-integration.php:720
    287295msgid "WooCommerce order created, payment received, order awaiting fulfilment."
    288296msgstr ""
    289297
    290298#: includes/class-ckwc-integration.php:510
    291 #: includes/class-ckwc-integration.php:722
     299#: includes/class-ckwc-integration.php:725
    292300msgid "Completed:"
    293301msgstr ""
    294302
    295303#: includes/class-ckwc-integration.php:511
    296 #: includes/class-ckwc-integration.php:723
     304#: includes/class-ckwc-integration.php:726
    297305msgid "WooCommerce order created, payment received, order fulfiled."
    298306msgstr ""
     
    303311
    304312#: includes/class-ckwc-integration.php:518
    305 #: includes/class-ckwc-integration.php:729
     313#: includes/class-ckwc-integration.php:732
    306314msgid "Order Processing"
    307315msgstr ""
    308316
    309317#: includes/class-ckwc-integration.php:519
    310 #: includes/class-ckwc-integration.php:730
     318#: includes/class-ckwc-integration.php:733
    311319msgid "Order Completed"
    312320msgstr ""
     
    320328msgstr ""
    321329
    322 #: includes/class-ckwc-integration.php:535
     330#: includes/class-ckwc-integration.php:538
    323331msgid "Name Format"
    324332msgstr ""
    325333
    326 #: includes/class-ckwc-integration.php:538
     334#: includes/class-ckwc-integration.php:541
    327335msgid "How should the customer name be sent to Kit?"
    328336msgstr ""
    329337
    330 #: includes/class-ckwc-integration.php:541
     338#: includes/class-ckwc-integration.php:544
    331339msgid "Billing First Name"
    332340msgstr ""
    333341
    334 #: includes/class-ckwc-integration.php:542
     342#: includes/class-ckwc-integration.php:545
    335343msgid "Billing Last Name"
    336344msgstr ""
    337345
    338 #: includes/class-ckwc-integration.php:543
     346#: includes/class-ckwc-integration.php:546
    339347msgid "Billing First Name + Billing Last Name"
    340348msgstr ""
    341349
    342 #: includes/class-ckwc-integration.php:552
     350#: includes/class-ckwc-integration.php:555
    343351msgid "Send Last Name"
    344352msgstr ""
    345353
    346 #: includes/class-ckwc-integration.php:555
     354#: includes/class-ckwc-integration.php:558
    347355msgid "The Kit custom field to store the order's last name."
    348356msgstr ""
    349357
    350 #: includes/class-ckwc-integration.php:561
     358#: includes/class-ckwc-integration.php:564
    351359msgid "Send Phone Number"
    352360msgstr ""
    353361
    354 #: includes/class-ckwc-integration.php:564
     362#: includes/class-ckwc-integration.php:567
    355363msgid "The Kit custom field to store the order's phone number."
    356364msgstr ""
    357365
    358 #: includes/class-ckwc-integration.php:570
     366#: includes/class-ckwc-integration.php:573
    359367msgid "Send Billing Address"
    360368msgstr ""
    361369
    362 #: includes/class-ckwc-integration.php:573
     370#: includes/class-ckwc-integration.php:576
    363371msgid "The Kit custom field to store the order's billing address."
    364372msgstr ""
    365373
    366 #: includes/class-ckwc-integration.php:579
     374#: includes/class-ckwc-integration.php:582
    367375msgid "Send Shipping Address"
    368376msgstr ""
    369377
    370 #: includes/class-ckwc-integration.php:582
     378#: includes/class-ckwc-integration.php:585
    371379msgid "The Kit custom field to store the order's shipping address."
    372380msgstr ""
    373381
    374 #: includes/class-ckwc-integration.php:588
     382#: includes/class-ckwc-integration.php:591
    375383msgid "Address Format"
    376384msgstr ""
    377385
    378 #: includes/class-ckwc-integration.php:599
     386#: includes/class-ckwc-integration.php:602
    379387msgid "The format of the billing and shipping addresses to store in Kit."
    380388msgstr ""
    381389
    382 #: includes/class-ckwc-integration.php:602
     390#: includes/class-ckwc-integration.php:605
    383391msgid "Name"
    384392msgstr ""
    385393
    386 #: includes/class-ckwc-integration.php:603
     394#: includes/class-ckwc-integration.php:606
    387395msgid "Company Name"
    388396msgstr ""
    389397
    390 #: includes/class-ckwc-integration.php:604
     398#: includes/class-ckwc-integration.php:607
    391399msgid "Address 1"
    392400msgstr ""
    393401
    394 #: includes/class-ckwc-integration.php:605
     402#: includes/class-ckwc-integration.php:608
    395403msgid "Address 2"
    396404msgstr ""
    397405
    398 #: includes/class-ckwc-integration.php:606
     406#: includes/class-ckwc-integration.php:609
    399407msgid "City"
    400408msgstr ""
    401409
    402 #: includes/class-ckwc-integration.php:607
     410#: includes/class-ckwc-integration.php:610
    403411msgid "State"
    404412msgstr ""
    405413
    406 #: includes/class-ckwc-integration.php:608
     414#: includes/class-ckwc-integration.php:611
    407415msgid "Postcode"
    408416msgstr ""
    409417
    410 #: includes/class-ckwc-integration.php:609
     418#: includes/class-ckwc-integration.php:612
    411419msgid "Country"
    412420msgstr ""
    413421
    414 #: includes/class-ckwc-integration.php:616
     422#: includes/class-ckwc-integration.php:619
    415423msgid "Send Payment Method"
    416424msgstr ""
    417425
    418 #: includes/class-ckwc-integration.php:619
     426#: includes/class-ckwc-integration.php:622
    419427msgid "The Kit custom field to store the order's payment method."
    420428msgstr ""
    421429
    422 #: includes/class-ckwc-integration.php:625
     430#: includes/class-ckwc-integration.php:628
    423431msgid "Send Customer Note"
    424432msgstr ""
    425433
    426 #: includes/class-ckwc-integration.php:628
     434#: includes/class-ckwc-integration.php:631
    427435msgid "The Kit custom field to store the order's customer note."
    428436msgstr ""
    429437
    430 #: includes/class-ckwc-integration.php:636
     438#: includes/class-ckwc-integration.php:639
    431439msgid "Opt-In Checkbox"
    432440msgstr ""
    433441
    434 #: includes/class-ckwc-integration.php:637
     442#: includes/class-ckwc-integration.php:640
    435443msgid "Display an opt-in checkbox on checkout"
    436444msgstr ""
    437445
    438 #: includes/class-ckwc-integration.php:640
     446#: includes/class-ckwc-integration.php:643
    439447msgid ""
    440448"If enabled, customers will <strong>only</strong> be subscribed to the chosen forms, tags and sequences if they check the opt-in checkbox at checkout.<br />\n"
     
    442450msgstr ""
    443451
    444 #: includes/class-ckwc-integration.php:651
     452#: includes/class-ckwc-integration.php:654
    445453msgid "Opt-In Checkbox: Label"
    446454msgstr ""
    447455
    448 #: includes/class-ckwc-integration.php:653
     456#: includes/class-ckwc-integration.php:656
    449457msgid "I want to subscribe to the newsletter"
    450458msgstr ""
    451459
    452 #: includes/class-ckwc-integration.php:654
     460#: includes/class-ckwc-integration.php:657
    453461msgid "Customize the label next to the opt-in checkbox."
    454462msgstr ""
    455463
    456 #: includes/class-ckwc-integration.php:661
     464#: includes/class-ckwc-integration.php:664
    457465msgid "Opt-In Checkbox: Default Status"
    458466msgstr ""
    459467
    460 #: includes/class-ckwc-integration.php:664
     468#: includes/class-ckwc-integration.php:667
    461469msgid "The default state of the opt-in checkbox."
    462470msgstr ""
    463471
    464 #: includes/class-ckwc-integration.php:667
     472#: includes/class-ckwc-integration.php:670
    465473msgid "Checked"
    466474msgstr ""
    467475
    468 #: includes/class-ckwc-integration.php:668
     476#: includes/class-ckwc-integration.php:671
    469477msgid "Unchecked"
    470478msgstr ""
    471479
    472 #: includes/class-ckwc-integration.php:675
     480#: includes/class-ckwc-integration.php:678
    473481msgid "Opt-In Checkbox: Display Location"
    474482msgstr ""
    475483
    476 #: includes/class-ckwc-integration.php:678
     484#: includes/class-ckwc-integration.php:681
    477485msgid "Where to display the opt-in checkbox on the checkout page (under \"Billing details\" or \"Additional information\")."
    478486msgstr ""
    479487
    480 #: includes/class-ckwc-integration.php:681
     488#: includes/class-ckwc-integration.php:684
    481489msgid "Billing"
    482490msgstr ""
    483491
    484 #: includes/class-ckwc-integration.php:682
     492#: includes/class-ckwc-integration.php:685
    485493msgid "Order"
    486494msgstr ""
    487495
    488 #: includes/class-ckwc-integration.php:691
     496#: includes/class-ckwc-integration.php:694
    489497msgid "Purchase Data"
    490498msgstr ""
    491499
    492 #: includes/class-ckwc-integration.php:692
     500#: includes/class-ckwc-integration.php:695
    493501msgid "Send purchase data to Kit."
    494502msgstr ""
    495503
    496 #: includes/class-ckwc-integration.php:695
     504#: includes/class-ckwc-integration.php:698
    497505msgid ""
    498506"If enabled, the customer's order data will be sent to Kit. Their email address will always be subscribed to Kit, <strong>regardless of the Customer's opt in status.</strong><br />\n"
     
    500508msgstr ""
    501509
    502 #: includes/class-ckwc-integration.php:706
     510#: includes/class-ckwc-integration.php:709
    503511msgid "Purchase Data Event"
    504512msgstr ""
    505513
    506 #: includes/class-ckwc-integration.php:712
     514#: includes/class-ckwc-integration.php:715
    507515msgid "When should purchase data be sent?"
    508516msgstr ""
    509517
    510 #: includes/class-ckwc-integration.php:737
     518#: includes/class-ckwc-integration.php:740
    511519msgid "Sync Past Orders"
    512520msgstr ""
    513521
    514 #: includes/class-ckwc-integration.php:738
     522#: includes/class-ckwc-integration.php:741
    515523msgid "Send old purchase data to Kit i.e. Orders that were created in WooCommerce prior to this Plugin being installed."
    516524msgstr ""
    517525
    518 #: includes/class-ckwc-integration.php:754
     526#: includes/class-ckwc-integration.php:757
     527msgid "Abandoned Cart"
     528msgstr ""
     529
     530#: includes/class-ckwc-integration.php:758
     531msgid "Send abandoned cart data to Kit."
     532msgstr ""
     533
     534#: includes/class-ckwc-integration.php:761
     535msgid "If enabled, the visitor will be subscribed to a tag in Kit, if they leave items in their cart without completing the checkout process after the below number of minutes. The tag is removed when they complete checkout."
     536msgstr ""
     537
     538#: includes/class-ckwc-integration.php:771
     539msgid "Abandoned Cart: Threshold"
     540msgstr ""
     541
     542#: includes/class-ckwc-integration.php:774
     543msgid "The number of minutes to wait before considering a cart abandoned."
     544msgstr ""
     545
     546#: includes/class-ckwc-integration.php:788
     547msgid "Abandoned Cart: Tag"
     548msgstr ""
     549
     550#: includes/class-ckwc-integration.php:791
     551msgid "The Kit tag to subscribe visitors to when they abandon their cart. This can be used in a Sequence or Automation to send abandoned cart emails to the subscriber. This tag is removed when the customer completes the checkout process."
     552msgstr ""
     553
     554#: includes/class-ckwc-integration.php:802
    519555msgid "Debug"
    520556msgstr ""
    521557
    522 #: includes/class-ckwc-integration.php:756
     558#: includes/class-ckwc-integration.php:804
    523559msgid "Write data to a log file"
    524560msgstr ""
    525561
    526 #: includes/class-ckwc-integration.php:761
     562#: includes/class-ckwc-integration.php:809
    527563msgid "View log file"
    528564msgstr ""
    529565
    530 #: includes/class-ckwc-integration.php:831
     566#: includes/class-ckwc-integration.php:879
    531567msgid "Do you want to send past WooCommerce Orders to Kit?"
    532568msgstr ""
    533569
    534570#. translators: Number of WooCommerce Orders
    535 #: includes/class-ckwc-integration.php:1011
     571#: includes/class-ckwc-integration.php:1070
    536572#, php-format
    537573msgid "%s not been sent to Kit based on the Purchase Data Event setting above. This is either because sending purchase data is/was disabled, and/or orders were created prior to installing this integration.<br />Use the sync button to send data for these orders to Kit."
     
    539575
    540576#. translators: number of Orders not sent to ConvertKit
    541 #: includes/class-ckwc-integration.php:1014
     577#: includes/class-ckwc-integration.php:1073
    542578#, php-format
    543579msgid "%s WooCommerce order has"
     
    633669
    634670#. translators: %1$s: PHP class name
    635 #: includes/class-wp-ckwc.php:298
     671#: includes/class-wp-ckwc.php:299
    636672#, php-format
    637673msgid "Kit for WooCommerce Error: Could not load Plugin class <strong>%1$s</strong>"
    638674msgstr ""
    639675
    640 #: includes/class-wp-ckwc.php:308
     676#: includes/class-wp-ckwc.php:309
    641677msgid "Kit for WooCommerce Error"
    642678msgstr ""
     
    742778msgstr ""
    743779
    744 #: views/backend/subscription-dropdown-field.php:24
     780#: views/backend/subscription-dropdown-field.php:27
    745781msgid "Sequences"
    746782msgstr ""
    747783
    748 #: views/backend/subscription-dropdown-field.php:37
     784#: views/backend/subscription-dropdown-field.php:44
    749785msgid "Forms"
    750786msgstr ""
    751787
    752 #: views/backend/subscription-dropdown-field.php:49
     788#: views/backend/subscription-dropdown-field.php:60
    753789msgid "Tags"
    754790msgstr ""
  • convertkit-for-woocommerce/tags/2.0.5/readme.txt

    r3422972 r3442178  
    66Tested up to: 6.9
    77Requires PHP: 7.1
    8 Stable tag: 2.0.4
     8Stable tag: 2.0.5
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4646
    4747== Changelog ==
     48
     49### 2.0.5 2026-01-19
     50* Added: Abandoned Cart Functionality
    4851
    4952### 2.0.4 2025-12-18
  • convertkit-for-woocommerce/tags/2.0.5/resources/backend/js/integration.js

    r3369639 r3442178  
    1111    display_opt_in: false,
    1212    send_purchases: false,
     13    abandoned_cart: false,
    1314};
    1415
     
    3334        ),
    3435        send_purchases: $('input[name="woocommerce_ckwc_send_purchases"]').prop(
     36            'checked'
     37        ),
     38        abandoned_cart: $('input[name="woocommerce_ckwc_abandoned_cart"]').prop(
    3539            'checked'
    3640        ),
     
    9599                    }
    96100                });
    97 
    98                 // Don't do anything else.
    99                 break;
    100101            }
    101102        }
  • convertkit-for-woocommerce/tags/2.0.5/views/backend/subscription-dropdown-field.php

    r2766502 r3442178  
    2222    </option>
    2323
    24     <optgroup label="<?php esc_attr_e( 'Sequences', 'woocommerce-convertkit' ); ?>" id="ckwc-sequences" data-option-value-prefix="course:">
     24    <?php
     25    if ( isset( $subscription['sequences'] ) ) {
     26        ?>
     27        <optgroup label="<?php esc_attr_e( 'Sequences', 'woocommerce-convertkit' ); ?>" id="ckwc-sequences" data-option-value-prefix="course:">
     28            <?php
     29            if ( $subscription['sequences']->exist() ) {
     30                foreach ( $subscription['sequences']->get() as $sequence ) {
     31                    // 'course:' is deliberate for backward compat. functionality when Sequences used to be called Courses.
     32                    ?>
     33                    <option value="course:<?php echo esc_attr( $sequence['id'] ); ?>"<?php selected( 'course:' . esc_attr( $sequence['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $sequence['name'] ); ?></option>
     34                    <?php
     35                }
     36            }
     37            ?>
     38        </optgroup>
    2539        <?php
    26         if ( $subscription['sequences']->exist() ) {
    27             foreach ( $subscription['sequences']->get() as $sequence ) {
    28                 // 'course:' is deliberate for backward compat. functionality when Sequences used to be called Courses.
    29                 ?>
    30                 <option value="course:<?php echo esc_attr( $sequence['id'] ); ?>"<?php selected( 'course:' . esc_attr( $sequence['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $sequence['name'] ); ?></option>
    31                 <?php
     40    }
     41
     42    if ( isset( $subscription['forms'] ) ) {
     43        ?>
     44        <optgroup label="<?php esc_attr_e( 'Forms', 'woocommerce-convertkit' ); ?>" id="ckwc-forms" data-option-value-prefix="form:">
     45            <?php
     46            if ( $subscription['forms']->exist() ) {
     47                foreach ( $subscription['forms']->get() as $form ) {
     48                    ?>
     49                    <option value="form:<?php echo esc_attr( $form['id'] ); ?>"<?php selected( 'form:' . esc_attr( $form['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $form['name'] ); ?></option>
     50                    <?php
     51                }
    3252            }
    33         }
     53            ?>
     54        </optgroup>
     55        <?php
     56    }
     57
     58    if ( isset( $subscription['tags'] ) ) {
    3459        ?>
    35     </optgroup>
    36 
    37     <optgroup label="<?php esc_attr_e( 'Forms', 'woocommerce-convertkit' ); ?>" id="ckwc-forms" data-option-value-prefix="form:">
     60        <optgroup label="<?php esc_attr_e( 'Tags', 'woocommerce-convertkit' ); ?>" id="ckwc-tags" data-option-value-prefix="tag:">
     61            <?php
     62            if ( $subscription['tags']->exist() ) {
     63                foreach ( $subscription['tags']->get() as $convertkit_tag ) {
     64                    ?>
     65                    <option value="tag:<?php echo esc_attr( $convertkit_tag['id'] ); ?>"<?php selected( 'tag:' . esc_attr( $convertkit_tag['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $convertkit_tag['name'] ); ?></option>
     66                    <?php
     67                }
     68            }
     69            ?>
     70        </optgroup>
    3871        <?php
    39         if ( $subscription['forms']->exist() ) {
    40             foreach ( $subscription['forms']->get() as $form ) {
    41                 ?>
    42                 <option value="form:<?php echo esc_attr( $form['id'] ); ?>"<?php selected( 'form:' . esc_attr( $form['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $form['name'] ); ?></option>
    43                 <?php
    44             }
    45         }
    46         ?>
    47     </optgroup>
    48 
    49     <optgroup label="<?php esc_attr_e( 'Tags', 'woocommerce-convertkit' ); ?>" id="ckwc-tags" data-option-value-prefix="tag:">
    50         <?php
    51         if ( $subscription['tags']->exist() ) {
    52             foreach ( $subscription['tags']->get() as $convertkit_tag ) {
    53                 ?>
    54                 <option value="tag:<?php echo esc_attr( $convertkit_tag['id'] ); ?>"<?php selected( 'tag:' . esc_attr( $convertkit_tag['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $convertkit_tag['name'] ); ?></option>
    55                 <?php
    56             }
    57         }
    58         ?>
    59     </optgroup>
     72    }
     73    ?>
    6074</select>
  • convertkit-for-woocommerce/tags/2.0.5/woocommerce-convertkit.php

    r3422972 r3442178  
    1010 * Plugin URI:  https://www.kit.com
    1111 * Description: Integrates WooCommerce with Kit, allowing customers to be automatically sent to your Kit account.
    12  * Version:     2.0.4
     12 * Version:     2.0.5
    1313 * Author:      Kit
    1414 * Author URI:  https://www.kit.com
     
    3131define( 'CKWC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    3232define( 'CKWC_PLUGIN_PATH', __DIR__ );
    33 define( 'CKWC_PLUGIN_VERSION', '2.0.4' );
     33define( 'CKWC_PLUGIN_VERSION', '2.0.5' );
    3434define( 'CKWC_OAUTH_CLIENT_ID', 'L0kyADsB3WP5zO5MvUpXQU64gIntQg9BBAIme17r_7A' );
    3535define( 'CKWC_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' );
     
    5353require_once CKWC_PLUGIN_PATH . '/includes/functions.php';
    5454require_once CKWC_PLUGIN_PATH . '/includes/class-wp-ckwc.php';
     55require_once CKWC_PLUGIN_PATH . '/includes/class-ckwc-abandoned-cart.php';
    5556require_once CKWC_PLUGIN_PATH . '/includes/class-ckwc-admin-notices.php';
    5657require_once CKWC_PLUGIN_PATH . '/includes/class-ckwc-api.php';
     
    7576require_once CKWC_PLUGIN_PATH . '/admin/class-ckwc-admin-quick-edit.php';
    7677require_once CKWC_PLUGIN_PATH . '/admin/class-ckwc-admin-refresh-resources.php';
     78
     79// Register Plugin activation and deactivation functions.
     80register_activation_hook( __FILE__, 'ckwc_plugin_activate' );
     81add_action( 'wp_insert_site', 'ckwc_plugin_activate_new_site' );
     82add_action( 'activate_blog', 'ckwc_plugin_activate_new_site' );
     83register_deactivation_hook( __FILE__, 'ckwc_plugin_deactivate' );
    7784
    7885/**
  • convertkit-for-woocommerce/trunk/includes/class-ckwc-integration.php

    r3411835 r3442178  
    521521
    522522                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    523                 'class'       => 'enabled subscribe',
     523                'class'       => 'enabled',
    524524            ),
    525525            'subscription'                  => array(
    526                 'title'       => __( 'Subscription', 'woocommerce-convertkit' ),
    527                 'type'        => 'subscription',
    528                 'default'     => '',
    529                 'description' => __( 'The Kit form, tag or sequence to subscribe customers to.', 'woocommerce-convertkit' ),
    530 
    531                 // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    532                 'class'       => 'enabled subscribe',
     526                'title'             => __( 'Subscription', 'woocommerce-convertkit' ),
     527                'type'              => 'subscription',
     528                'default'           => '',
     529                'description'       => __( 'The Kit form, tag or sequence to subscribe customers to.', 'woocommerce-convertkit' ),
     530                'include_forms'     => true,
     531                'include_tags'      => true,
     532                'include_sequences' => true,
     533
     534                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     535                'class'             => 'enabled',
    533536            ),
    534537            'name_format'                   => array(
     
    545548
    546549                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    547                 'class'       => 'enabled subscribe',
     550                'class'       => 'enabled',
    548551            ),
    549552
     
    556559
    557560                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    558                 'class'       => 'enabled subscribe',
     561                'class'       => 'enabled',
    559562            ),
    560563            'custom_field_phone'            => array(
     
    565568
    566569                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    567                 'class'       => 'enabled subscribe',
     570                'class'       => 'enabled',
    568571            ),
    569572            'custom_field_billing_address'  => array(
     
    574577
    575578                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    576                 'class'       => 'enabled subscribe',
     579                'class'       => 'enabled',
    577580            ),
    578581            'custom_field_shipping_address' => array(
     
    583586
    584587                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    585                 'class'       => 'enabled subscribe',
     588                'class'       => 'enabled',
    586589            ),
    587590            'custom_field_address_format'   => array(
     
    620623
    621624                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    622                 'class'       => 'enabled subscribe',
     625                'class'       => 'enabled',
    623626            ),
    624627            'custom_field_customer_note'    => array(
     
    629632
    630633                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    631                 'class'       => 'enabled subscribe',
     634                'class'       => 'enabled',
    632635            ),
    633636
     
    646649
    647650                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    648                 'class'       => 'enabled subscribe',
     651                'class'       => 'enabled',
    649652            ),
    650653            'opt_in_label'                  => array(
     
    656659
    657660                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    658                 'class'       => 'enabled subscribe display_opt_in',
     661                'class'       => 'enabled display_opt_in',
    659662            ),
    660663            'opt_in_status'                 => array(
     
    670673
    671674                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    672                 'class'       => 'enabled subscribe display_opt_in',
     675                'class'       => 'enabled display_opt_in',
    673676            ),
    674677            'opt_in_location'               => array(
     
    684687
    685688                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    686                 'class'       => 'enabled subscribe display_opt_in',
     689                'class'       => 'enabled display_opt_in',
    687690            ),
    688691
     
    701704
    702705                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    703                 'class'       => 'enabled subscribe',
     706                'class'       => 'enabled',
    704707            ),
    705708            'send_purchases_event'          => array(
     
    732735
    733736                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    734                 'class'       => 'enabled subscribe send_purchases',
     737                'class'       => 'enabled send_purchases',
    735738            ),
    736739            'sync_past_orders'              => array(
     
    747750
    748751                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
    749                 'class'    => 'enabled subscribe',
     752                'class'    => 'enabled send_purchases',
     753            ),
     754
     755            // Abandoned Cart.
     756            'abandoned_cart'                => array(
     757                'title'       => __( 'Abandoned Cart', 'woocommerce-convertkit' ),
     758                'label'       => __( 'Send abandoned cart data to Kit.', 'woocommerce-convertkit' ),
     759                'type'        => 'checkbox',
     760                'default'     => 'no',
     761                'description' => __(
     762                    'If enabled, the visitor will be subscribed to a tag in Kit, if they leave items in their cart without completing the checkout process after the below number of minutes. The tag is removed when they complete checkout.',
     763                    'woocommerce-convertkit'
     764                ),
     765                'desc_tip'    => false,
     766
     767                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     768                'class'       => 'enabled',
     769            ),
     770            'abandoned_cart_threshold'      => array(
     771                'title'             => __( 'Abandoned Cart: Threshold', 'woocommerce-convertkit' ),
     772                'type'              => 'number',
     773                'default'           => 15,
     774                'description'       => __( 'The number of minutes to wait before considering a cart abandoned.', 'woocommerce-convertkit' ),
     775                'desc_tip'          => false,
     776
     777                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     778                'class'             => 'enabled abandoned_cart',
     779
     780                // Custom attributes for the number input.
     781                'custom_attributes' => array(
     782                    'min'  => 1,
     783                    'max'  => 99999,
     784                    'step' => 1,
     785                ),
     786            ),
     787            'abandoned_cart_subscription'   => array(
     788                'title'             => __( 'Abandoned Cart: Tag', 'woocommerce-convertkit' ),
     789                'type'              => 'subscription',
     790                'default'           => '',
     791                'description'       => __( 'The Kit tag to subscribe visitors to when they abandon their cart. This can be used in a Sequence or Automation to send abandoned cart emails to the subscriber. This tag is removed when the customer completes the checkout process.', 'woocommerce-convertkit' ),
     792                'include_forms'     => false,
     793                'include_tags'      => true,
     794                'include_sequences' => false,
     795
     796                // The setting name that needs to be checked/enabled for this setting to display. Used by JS to toggle visibility.
     797                'class'             => 'enabled abandoned_cart',
    750798            ),
    751799
     
    892940            'custom_attributes' => array(),
    893941            'options'           => array(),
     942            'include_forms'     => false,
     943            'include_tags'      => false,
     944            'include_sequences' => false,
    894945        );
    895946
     
    913964        // Get current subscription setting and other settings to render the subscription dropdown field.
    914965        $subscription = array(
    915             'id'        => 'woocommerce_ckwc_subscription',
    916             'class'     => 'select ckwc-select2 ' . $data['class'],
    917             'name'      => $field,
    918             'value'     => $this->get_option( $key ),
    919             'forms'     => $this->forms,
    920             'tags'      => $this->tags,
    921             'sequences' => $this->sequences,
     966            'id'    => $field,
     967            'class' => 'select ckwc-select2 ' . $data['class'],
     968            'name'  => $field,
     969            'value' => $this->get_option( $key ),
    922970        );
     971
     972        // Include Forms, Tags and Sequences in the subscription dropdown field.
     973        if ( $data['include_forms'] ) {
     974            $subscription['forms'] = $this->forms;
     975        }
     976        if ( $data['include_tags'] ) {
     977            $subscription['tags'] = $this->tags;
     978        }
     979        if ( $data['include_sequences'] ) {
     980            $subscription['sequences'] = $this->sequences;
     981        }
    923982
    924983        ob_start();
  • convertkit-for-woocommerce/trunk/includes/class-ckwc-setup.php

    r3273267 r3442178  
    2828        if ( $current_version === CKWC_PLUGIN_VERSION ) {
    2929            return;
     30        }
     31
     32        /**
     33         * 2.0.5: Register Action Scheduler actions.
     34         */
     35        if ( ! $current_version || version_compare( $current_version, '2.0.5', '<' ) ) {
     36            add_action( 'shutdown', 'ckwc_schedule_actions' );
    3037        }
    3138
  • convertkit-for-woocommerce/trunk/includes/class-wp-ckwc.php

    r3408882 r3442178  
    249249    private function initialize_global() {
    250250
     251        $this->classes['abandoned_cart']   = new CKWC_Abandoned_Cart();
    251252        $this->classes['admin_notices']    = new CKWC_Admin_Notices();
    252253        $this->classes['checkout']         = new CKWC_Checkout();
  • convertkit-for-woocommerce/trunk/includes/cron-functions.php

    r3322555 r3442178  
    66 * @author ConvertKit
    77 */
     8
     9/**
     10 * Subscribe abandoned cart emails to the abandoned cart tag
     11 * by checking the WooCommerce sessions table.
     12 *
     13 * @since   2.0.5
     14 */
     15function ckwc_abandoned_cart() {
     16
     17    // Bail if the integration is unavailable.
     18    if ( ! function_exists( 'WP_CKWC_Integration' ) ) {
     19        return;
     20    }
     21
     22    // Bail if the integration is not enabled.
     23    if ( ! WP_CKWC_Integration()->is_enabled() ) {
     24        return;
     25    }
     26
     27    // Bail if Abandoned Cart is not enabled.
     28    if ( ! WP_CKWC_Integration()->get_option_bool( 'abandoned_cart' ) ) {
     29        return;
     30    }
     31
     32    // Bail if no tag is configured.
     33    $subscription = WP_CKWC_Integration()->get_option( 'abandoned_cart_subscription' );
     34    if ( empty( $subscription ) ) {
     35        return;
     36    }
     37
     38    // Get the tag ID.
     39    list( $resource_type, $tag_id ) = explode( ':', $subscription );
     40
     41    // Calculate the threshold.
     42    $threshold = time() - ( absint( WP_CKWC_Integration()->get_option( 'abandoned_cart_threshold' ) ) * MINUTE_IN_SECONDS );
     43
     44    // Setup the API.
     45    $api = new CKWC_API(
     46        CKWC_OAUTH_CLIENT_ID,
     47        CKWC_OAUTH_CLIENT_REDIRECT_URI,
     48        WP_CKWC_Integration()->get_option( 'access_token' ),
     49        WP_CKWC_Integration()->get_option( 'refresh_token' ),
     50        WP_CKWC_Integration()->get_option_bool( 'debug' )
     51    );
     52
     53    // Get WooCommerce sessions.
     54    // WooCommerce does not provide a public native function to fetch all sessions.
     55    // We must continue to use a direct query to the woocommerce_sessions table.
     56    global $wpdb;
     57    $results = $wpdb->get_results( "SELECT session_key, session_value FROM {$wpdb->prefix}woocommerce_sessions" ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     58
     59    foreach ( $results as $row ) {
     60        // Get the session data.
     61        $session_data = maybe_unserialize( $row->session_value );
     62
     63        // If no email or timestamp is set, continue.
     64        if ( empty( $session_data['ckwc_abandoned_cart_email'] ) || empty( $session_data['ckwc_abandoned_cart_timestamp'] ) ) {
     65            continue;
     66        }
     67
     68        $email     = $session_data['ckwc_abandoned_cart_email'];
     69        $timestamp = intval( $session_data['ckwc_abandoned_cart_timestamp'] );
     70
     71        // Check if cart looks abandoned.
     72        if ( $timestamp < $threshold ) {
     73            // Create subscriber and tag.
     74            $api->create_subscriber( $email );
     75            $api->tag_subscriber_by_email( absint( $tag_id ), $email );
     76
     77            // Remove session data so we don't trigger this email again.
     78            unset( $session_data['ckwc_abandoned_cart_email'] );
     79            unset( $session_data['ckwc_abandoned_cart_timestamp'] );
     80            $wpdb->update( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
     81                $wpdb->prefix . 'woocommerce_sessions',
     82                array( 'session_value' => maybe_serialize( $session_data ) ),
     83                array( 'session_key' => $row->session_key ),
     84                array( '%s' ),
     85                array( '%s' )
     86            );
     87        }
     88    }
     89
     90}
     91add_action( 'ckwc_abandoned_cart', 'ckwc_abandoned_cart' );
    892
    993/**
  • convertkit-for-woocommerce/trunk/includes/functions.php

    r3411835 r3442178  
    66 * @author ConvertKit
    77 */
     8
     9/**
     10 * Runs the activation and update routines when the plugin is activated.
     11 *
     12 * @since   2.0.5
     13 *
     14 * @param   bool $network_wide   Is network wide activation.
     15 */
     16function ckwc_plugin_activate( $network_wide ) {
     17
     18    // Check if we are on a multisite install, activating network wide, or a single install.
     19    if ( ! is_multisite() || ! $network_wide ) {
     20        // Single Site activation.
     21        add_action( 'shutdown', 'ckwc_schedule_actions' );
     22    } else {
     23        // Multisite network wide activation.
     24        $sites = get_sites(
     25            array(
     26                'number' => 0,
     27            )
     28        );
     29        foreach ( $sites as $site ) {
     30            switch_to_blog( (int) $site->blog_id );
     31            add_action( 'shutdown', 'ckwc_schedule_actions' );
     32            restore_current_blog();
     33        }
     34    }
     35
     36}
     37
     38/**
     39 * Runs the activation and update routines when the plugin is activated
     40 * on a WordPress multisite setup.
     41 *
     42 * @since   2.0.5
     43 *
     44 * @param   WP_Site|int $site_or_blog_id    WP_Site or Blog ID.
     45 */
     46function ckwc_plugin_activate_new_site( $site_or_blog_id ) {
     47
     48    // Check if $site_or_blog_id is a WP_Site or a blog ID.
     49    if ( is_a( $site_or_blog_id, 'WP_Site' ) ) {
     50        $site_or_blog_id = $site_or_blog_id->blog_id;
     51    }
     52
     53    // Run installation routine.
     54    switch_to_blog( $site_or_blog_id );
     55    add_action( 'shutdown', 'ckwc_schedule_actions' );
     56    restore_current_blog();
     57
     58}
     59
     60/**
     61 * Runs the deactivation routine when the plugin is deactivated.
     62 *
     63 * @since   2.0.5
     64 *
     65 * @param   bool $network_wide   Is network wide deactivation.
     66 */
     67function ckwc_plugin_deactivate( $network_wide ) {
     68
     69    // Check if we are on a multisite install, activating network wide, or a single install.
     70    if ( ! is_multisite() || ! $network_wide ) {
     71        // Single Site activation.
     72        ckwc_unschedule_actions();
     73    } else {
     74        // Multisite network wide activation.
     75        $sites = get_sites(
     76            array(
     77                'number' => 0,
     78            )
     79        );
     80        foreach ( $sites as $site ) {
     81            switch_to_blog( (int) $site->blog_id );
     82            ckwc_unschedule_actions();
     83            restore_current_blog();
     84        }
     85    }
     86
     87}
     88
     89/**
     90 * Schedules the WordPress Cron events.
     91 *
     92 * @since   2.0.5
     93 */
     94function ckwc_schedule_actions() {
     95
     96    // Bail if the action scheduler is unavailable.
     97    if ( ! function_exists( 'as_schedule_recurring_action' ) ) {
     98        return;
     99    }
     100
     101    // Bail if the scheduled action already exists.
     102    if ( as_next_scheduled_action( 'ckwc_abandoned_cart' ) ) {
     103        return;
     104    }
     105
     106    // Schedule action.
     107    as_schedule_recurring_action(
     108        time(),
     109        15 * MINUTE_IN_SECONDS,
     110        'ckwc_abandoned_cart',
     111        array(),
     112        'ckwc'
     113    );
     114
     115}
     116
     117/**
     118 * Unschedules the WordPress Cron events.
     119 *
     120 * @since   2.0.5
     121 */
     122function ckwc_unschedule_actions() {
     123
     124    // Bail if the action scheduler is unavailable.
     125    if ( ! function_exists( 'as_unschedule_all_actions' ) ) {
     126        return;
     127    }
     128
     129    // Unschedule action.
     130    as_unschedule_all_actions( 'ckwc_abandoned_cart' );
     131
     132}
    8133
    9134/**
  • convertkit-for-woocommerce/trunk/languages/woocommerce-convertkit.pot

    r3422972 r3442178  
    1 # Copyright (C) 2025 Kit
     1# Copyright (C) 2026 Kit
    22# This file is distributed under the GPLv3 or later.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Kit (formerly ConvertKit) for WooCommerce 2.0.4\n"
     5"Project-Id-Version: Kit (formerly ConvertKit) for WooCommerce 2.0.5\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/convertkit-woocommerce\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-12-18T10:49:33+00:00\n"
     12"POT-Creation-Date: 2026-01-16T03:18:38+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    7474msgstr ""
    7575
     76#: includes/class-ckwc-abandoned-cart.php:105
     77msgid "Email is required."
     78msgstr ""
     79
     80#: includes/class-ckwc-abandoned-cart.php:112
     81msgid "Invalid email."
     82msgstr ""
     83
    7684#: includes/class-ckwc-admin-notices.php:64
    7785msgid "Kit for WooCommerce: Authorization failed. Please"
     
    279287
    280288#: includes/class-ckwc-integration.php:504
    281 #: includes/class-ckwc-integration.php:716
     289#: includes/class-ckwc-integration.php:719
    282290msgid "Processing:"
    283291msgstr ""
    284292
    285293#: includes/class-ckwc-integration.php:505
    286 #: includes/class-ckwc-integration.php:717
     294#: includes/class-ckwc-integration.php:720
    287295msgid "WooCommerce order created, payment received, order awaiting fulfilment."
    288296msgstr ""
    289297
    290298#: includes/class-ckwc-integration.php:510
    291 #: includes/class-ckwc-integration.php:722
     299#: includes/class-ckwc-integration.php:725
    292300msgid "Completed:"
    293301msgstr ""
    294302
    295303#: includes/class-ckwc-integration.php:511
    296 #: includes/class-ckwc-integration.php:723
     304#: includes/class-ckwc-integration.php:726
    297305msgid "WooCommerce order created, payment received, order fulfiled."
    298306msgstr ""
     
    303311
    304312#: includes/class-ckwc-integration.php:518
    305 #: includes/class-ckwc-integration.php:729
     313#: includes/class-ckwc-integration.php:732
    306314msgid "Order Processing"
    307315msgstr ""
    308316
    309317#: includes/class-ckwc-integration.php:519
    310 #: includes/class-ckwc-integration.php:730
     318#: includes/class-ckwc-integration.php:733
    311319msgid "Order Completed"
    312320msgstr ""
     
    320328msgstr ""
    321329
    322 #: includes/class-ckwc-integration.php:535
     330#: includes/class-ckwc-integration.php:538
    323331msgid "Name Format"
    324332msgstr ""
    325333
    326 #: includes/class-ckwc-integration.php:538
     334#: includes/class-ckwc-integration.php:541
    327335msgid "How should the customer name be sent to Kit?"
    328336msgstr ""
    329337
    330 #: includes/class-ckwc-integration.php:541
     338#: includes/class-ckwc-integration.php:544
    331339msgid "Billing First Name"
    332340msgstr ""
    333341
    334 #: includes/class-ckwc-integration.php:542
     342#: includes/class-ckwc-integration.php:545
    335343msgid "Billing Last Name"
    336344msgstr ""
    337345
    338 #: includes/class-ckwc-integration.php:543
     346#: includes/class-ckwc-integration.php:546
    339347msgid "Billing First Name + Billing Last Name"
    340348msgstr ""
    341349
    342 #: includes/class-ckwc-integration.php:552
     350#: includes/class-ckwc-integration.php:555
    343351msgid "Send Last Name"
    344352msgstr ""
    345353
    346 #: includes/class-ckwc-integration.php:555
     354#: includes/class-ckwc-integration.php:558
    347355msgid "The Kit custom field to store the order's last name."
    348356msgstr ""
    349357
    350 #: includes/class-ckwc-integration.php:561
     358#: includes/class-ckwc-integration.php:564
    351359msgid "Send Phone Number"
    352360msgstr ""
    353361
    354 #: includes/class-ckwc-integration.php:564
     362#: includes/class-ckwc-integration.php:567
    355363msgid "The Kit custom field to store the order's phone number."
    356364msgstr ""
    357365
    358 #: includes/class-ckwc-integration.php:570
     366#: includes/class-ckwc-integration.php:573
    359367msgid "Send Billing Address"
    360368msgstr ""
    361369
    362 #: includes/class-ckwc-integration.php:573
     370#: includes/class-ckwc-integration.php:576
    363371msgid "The Kit custom field to store the order's billing address."
    364372msgstr ""
    365373
    366 #: includes/class-ckwc-integration.php:579
     374#: includes/class-ckwc-integration.php:582
    367375msgid "Send Shipping Address"
    368376msgstr ""
    369377
    370 #: includes/class-ckwc-integration.php:582
     378#: includes/class-ckwc-integration.php:585
    371379msgid "The Kit custom field to store the order's shipping address."
    372380msgstr ""
    373381
    374 #: includes/class-ckwc-integration.php:588
     382#: includes/class-ckwc-integration.php:591
    375383msgid "Address Format"
    376384msgstr ""
    377385
    378 #: includes/class-ckwc-integration.php:599
     386#: includes/class-ckwc-integration.php:602
    379387msgid "The format of the billing and shipping addresses to store in Kit."
    380388msgstr ""
    381389
    382 #: includes/class-ckwc-integration.php:602
     390#: includes/class-ckwc-integration.php:605
    383391msgid "Name"
    384392msgstr ""
    385393
    386 #: includes/class-ckwc-integration.php:603
     394#: includes/class-ckwc-integration.php:606
    387395msgid "Company Name"
    388396msgstr ""
    389397
    390 #: includes/class-ckwc-integration.php:604
     398#: includes/class-ckwc-integration.php:607
    391399msgid "Address 1"
    392400msgstr ""
    393401
    394 #: includes/class-ckwc-integration.php:605
     402#: includes/class-ckwc-integration.php:608
    395403msgid "Address 2"
    396404msgstr ""
    397405
    398 #: includes/class-ckwc-integration.php:606
     406#: includes/class-ckwc-integration.php:609
    399407msgid "City"
    400408msgstr ""
    401409
    402 #: includes/class-ckwc-integration.php:607
     410#: includes/class-ckwc-integration.php:610
    403411msgid "State"
    404412msgstr ""
    405413
    406 #: includes/class-ckwc-integration.php:608
     414#: includes/class-ckwc-integration.php:611
    407415msgid "Postcode"
    408416msgstr ""
    409417
    410 #: includes/class-ckwc-integration.php:609
     418#: includes/class-ckwc-integration.php:612
    411419msgid "Country"
    412420msgstr ""
    413421
    414 #: includes/class-ckwc-integration.php:616
     422#: includes/class-ckwc-integration.php:619
    415423msgid "Send Payment Method"
    416424msgstr ""
    417425
    418 #: includes/class-ckwc-integration.php:619
     426#: includes/class-ckwc-integration.php:622
    419427msgid "The Kit custom field to store the order's payment method."
    420428msgstr ""
    421429
    422 #: includes/class-ckwc-integration.php:625
     430#: includes/class-ckwc-integration.php:628
    423431msgid "Send Customer Note"
    424432msgstr ""
    425433
    426 #: includes/class-ckwc-integration.php:628
     434#: includes/class-ckwc-integration.php:631
    427435msgid "The Kit custom field to store the order's customer note."
    428436msgstr ""
    429437
    430 #: includes/class-ckwc-integration.php:636
     438#: includes/class-ckwc-integration.php:639
    431439msgid "Opt-In Checkbox"
    432440msgstr ""
    433441
    434 #: includes/class-ckwc-integration.php:637
     442#: includes/class-ckwc-integration.php:640
    435443msgid "Display an opt-in checkbox on checkout"
    436444msgstr ""
    437445
    438 #: includes/class-ckwc-integration.php:640
     446#: includes/class-ckwc-integration.php:643
    439447msgid ""
    440448"If enabled, customers will <strong>only</strong> be subscribed to the chosen forms, tags and sequences if they check the opt-in checkbox at checkout.<br />\n"
     
    442450msgstr ""
    443451
    444 #: includes/class-ckwc-integration.php:651
     452#: includes/class-ckwc-integration.php:654
    445453msgid "Opt-In Checkbox: Label"
    446454msgstr ""
    447455
    448 #: includes/class-ckwc-integration.php:653
     456#: includes/class-ckwc-integration.php:656
    449457msgid "I want to subscribe to the newsletter"
    450458msgstr ""
    451459
    452 #: includes/class-ckwc-integration.php:654
     460#: includes/class-ckwc-integration.php:657
    453461msgid "Customize the label next to the opt-in checkbox."
    454462msgstr ""
    455463
    456 #: includes/class-ckwc-integration.php:661
     464#: includes/class-ckwc-integration.php:664
    457465msgid "Opt-In Checkbox: Default Status"
    458466msgstr ""
    459467
    460 #: includes/class-ckwc-integration.php:664
     468#: includes/class-ckwc-integration.php:667
    461469msgid "The default state of the opt-in checkbox."
    462470msgstr ""
    463471
    464 #: includes/class-ckwc-integration.php:667
     472#: includes/class-ckwc-integration.php:670
    465473msgid "Checked"
    466474msgstr ""
    467475
    468 #: includes/class-ckwc-integration.php:668
     476#: includes/class-ckwc-integration.php:671
    469477msgid "Unchecked"
    470478msgstr ""
    471479
    472 #: includes/class-ckwc-integration.php:675
     480#: includes/class-ckwc-integration.php:678
    473481msgid "Opt-In Checkbox: Display Location"
    474482msgstr ""
    475483
    476 #: includes/class-ckwc-integration.php:678
     484#: includes/class-ckwc-integration.php:681
    477485msgid "Where to display the opt-in checkbox on the checkout page (under \"Billing details\" or \"Additional information\")."
    478486msgstr ""
    479487
    480 #: includes/class-ckwc-integration.php:681
     488#: includes/class-ckwc-integration.php:684
    481489msgid "Billing"
    482490msgstr ""
    483491
    484 #: includes/class-ckwc-integration.php:682
     492#: includes/class-ckwc-integration.php:685
    485493msgid "Order"
    486494msgstr ""
    487495
    488 #: includes/class-ckwc-integration.php:691
     496#: includes/class-ckwc-integration.php:694
    489497msgid "Purchase Data"
    490498msgstr ""
    491499
    492 #: includes/class-ckwc-integration.php:692
     500#: includes/class-ckwc-integration.php:695
    493501msgid "Send purchase data to Kit."
    494502msgstr ""
    495503
    496 #: includes/class-ckwc-integration.php:695
     504#: includes/class-ckwc-integration.php:698
    497505msgid ""
    498506"If enabled, the customer's order data will be sent to Kit. Their email address will always be subscribed to Kit, <strong>regardless of the Customer's opt in status.</strong><br />\n"
     
    500508msgstr ""
    501509
    502 #: includes/class-ckwc-integration.php:706
     510#: includes/class-ckwc-integration.php:709
    503511msgid "Purchase Data Event"
    504512msgstr ""
    505513
    506 #: includes/class-ckwc-integration.php:712
     514#: includes/class-ckwc-integration.php:715
    507515msgid "When should purchase data be sent?"
    508516msgstr ""
    509517
    510 #: includes/class-ckwc-integration.php:737
     518#: includes/class-ckwc-integration.php:740
    511519msgid "Sync Past Orders"
    512520msgstr ""
    513521
    514 #: includes/class-ckwc-integration.php:738
     522#: includes/class-ckwc-integration.php:741
    515523msgid "Send old purchase data to Kit i.e. Orders that were created in WooCommerce prior to this Plugin being installed."
    516524msgstr ""
    517525
    518 #: includes/class-ckwc-integration.php:754
     526#: includes/class-ckwc-integration.php:757
     527msgid "Abandoned Cart"
     528msgstr ""
     529
     530#: includes/class-ckwc-integration.php:758
     531msgid "Send abandoned cart data to Kit."
     532msgstr ""
     533
     534#: includes/class-ckwc-integration.php:761
     535msgid "If enabled, the visitor will be subscribed to a tag in Kit, if they leave items in their cart without completing the checkout process after the below number of minutes. The tag is removed when they complete checkout."
     536msgstr ""
     537
     538#: includes/class-ckwc-integration.php:771
     539msgid "Abandoned Cart: Threshold"
     540msgstr ""
     541
     542#: includes/class-ckwc-integration.php:774
     543msgid "The number of minutes to wait before considering a cart abandoned."
     544msgstr ""
     545
     546#: includes/class-ckwc-integration.php:788
     547msgid "Abandoned Cart: Tag"
     548msgstr ""
     549
     550#: includes/class-ckwc-integration.php:791
     551msgid "The Kit tag to subscribe visitors to when they abandon their cart. This can be used in a Sequence or Automation to send abandoned cart emails to the subscriber. This tag is removed when the customer completes the checkout process."
     552msgstr ""
     553
     554#: includes/class-ckwc-integration.php:802
    519555msgid "Debug"
    520556msgstr ""
    521557
    522 #: includes/class-ckwc-integration.php:756
     558#: includes/class-ckwc-integration.php:804
    523559msgid "Write data to a log file"
    524560msgstr ""
    525561
    526 #: includes/class-ckwc-integration.php:761
     562#: includes/class-ckwc-integration.php:809
    527563msgid "View log file"
    528564msgstr ""
    529565
    530 #: includes/class-ckwc-integration.php:831
     566#: includes/class-ckwc-integration.php:879
    531567msgid "Do you want to send past WooCommerce Orders to Kit?"
    532568msgstr ""
    533569
    534570#. translators: Number of WooCommerce Orders
    535 #: includes/class-ckwc-integration.php:1011
     571#: includes/class-ckwc-integration.php:1070
    536572#, php-format
    537573msgid "%s not been sent to Kit based on the Purchase Data Event setting above. This is either because sending purchase data is/was disabled, and/or orders were created prior to installing this integration.<br />Use the sync button to send data for these orders to Kit."
     
    539575
    540576#. translators: number of Orders not sent to ConvertKit
    541 #: includes/class-ckwc-integration.php:1014
     577#: includes/class-ckwc-integration.php:1073
    542578#, php-format
    543579msgid "%s WooCommerce order has"
     
    633669
    634670#. translators: %1$s: PHP class name
    635 #: includes/class-wp-ckwc.php:298
     671#: includes/class-wp-ckwc.php:299
    636672#, php-format
    637673msgid "Kit for WooCommerce Error: Could not load Plugin class <strong>%1$s</strong>"
    638674msgstr ""
    639675
    640 #: includes/class-wp-ckwc.php:308
     676#: includes/class-wp-ckwc.php:309
    641677msgid "Kit for WooCommerce Error"
    642678msgstr ""
     
    742778msgstr ""
    743779
    744 #: views/backend/subscription-dropdown-field.php:24
     780#: views/backend/subscription-dropdown-field.php:27
    745781msgid "Sequences"
    746782msgstr ""
    747783
    748 #: views/backend/subscription-dropdown-field.php:37
     784#: views/backend/subscription-dropdown-field.php:44
    749785msgid "Forms"
    750786msgstr ""
    751787
    752 #: views/backend/subscription-dropdown-field.php:49
     788#: views/backend/subscription-dropdown-field.php:60
    753789msgid "Tags"
    754790msgstr ""
  • convertkit-for-woocommerce/trunk/readme.txt

    r3422972 r3442178  
    66Tested up to: 6.9
    77Requires PHP: 7.1
    8 Stable tag: 2.0.4
     8Stable tag: 2.0.5
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4646
    4747== Changelog ==
     48
     49### 2.0.5 2026-01-19
     50* Added: Abandoned Cart Functionality
    4851
    4952### 2.0.4 2025-12-18
  • convertkit-for-woocommerce/trunk/resources/backend/js/integration.js

    r3369639 r3442178  
    1111    display_opt_in: false,
    1212    send_purchases: false,
     13    abandoned_cart: false,
    1314};
    1415
     
    3334        ),
    3435        send_purchases: $('input[name="woocommerce_ckwc_send_purchases"]').prop(
     36            'checked'
     37        ),
     38        abandoned_cart: $('input[name="woocommerce_ckwc_abandoned_cart"]').prop(
    3539            'checked'
    3640        ),
     
    9599                    }
    96100                });
    97 
    98                 // Don't do anything else.
    99                 break;
    100101            }
    101102        }
  • convertkit-for-woocommerce/trunk/views/backend/subscription-dropdown-field.php

    r2766502 r3442178  
    2222    </option>
    2323
    24     <optgroup label="<?php esc_attr_e( 'Sequences', 'woocommerce-convertkit' ); ?>" id="ckwc-sequences" data-option-value-prefix="course:">
     24    <?php
     25    if ( isset( $subscription['sequences'] ) ) {
     26        ?>
     27        <optgroup label="<?php esc_attr_e( 'Sequences', 'woocommerce-convertkit' ); ?>" id="ckwc-sequences" data-option-value-prefix="course:">
     28            <?php
     29            if ( $subscription['sequences']->exist() ) {
     30                foreach ( $subscription['sequences']->get() as $sequence ) {
     31                    // 'course:' is deliberate for backward compat. functionality when Sequences used to be called Courses.
     32                    ?>
     33                    <option value="course:<?php echo esc_attr( $sequence['id'] ); ?>"<?php selected( 'course:' . esc_attr( $sequence['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $sequence['name'] ); ?></option>
     34                    <?php
     35                }
     36            }
     37            ?>
     38        </optgroup>
    2539        <?php
    26         if ( $subscription['sequences']->exist() ) {
    27             foreach ( $subscription['sequences']->get() as $sequence ) {
    28                 // 'course:' is deliberate for backward compat. functionality when Sequences used to be called Courses.
    29                 ?>
    30                 <option value="course:<?php echo esc_attr( $sequence['id'] ); ?>"<?php selected( 'course:' . esc_attr( $sequence['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $sequence['name'] ); ?></option>
    31                 <?php
     40    }
     41
     42    if ( isset( $subscription['forms'] ) ) {
     43        ?>
     44        <optgroup label="<?php esc_attr_e( 'Forms', 'woocommerce-convertkit' ); ?>" id="ckwc-forms" data-option-value-prefix="form:">
     45            <?php
     46            if ( $subscription['forms']->exist() ) {
     47                foreach ( $subscription['forms']->get() as $form ) {
     48                    ?>
     49                    <option value="form:<?php echo esc_attr( $form['id'] ); ?>"<?php selected( 'form:' . esc_attr( $form['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $form['name'] ); ?></option>
     50                    <?php
     51                }
    3252            }
    33         }
     53            ?>
     54        </optgroup>
     55        <?php
     56    }
     57
     58    if ( isset( $subscription['tags'] ) ) {
    3459        ?>
    35     </optgroup>
    36 
    37     <optgroup label="<?php esc_attr_e( 'Forms', 'woocommerce-convertkit' ); ?>" id="ckwc-forms" data-option-value-prefix="form:">
     60        <optgroup label="<?php esc_attr_e( 'Tags', 'woocommerce-convertkit' ); ?>" id="ckwc-tags" data-option-value-prefix="tag:">
     61            <?php
     62            if ( $subscription['tags']->exist() ) {
     63                foreach ( $subscription['tags']->get() as $convertkit_tag ) {
     64                    ?>
     65                    <option value="tag:<?php echo esc_attr( $convertkit_tag['id'] ); ?>"<?php selected( 'tag:' . esc_attr( $convertkit_tag['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $convertkit_tag['name'] ); ?></option>
     66                    <?php
     67                }
     68            }
     69            ?>
     70        </optgroup>
    3871        <?php
    39         if ( $subscription['forms']->exist() ) {
    40             foreach ( $subscription['forms']->get() as $form ) {
    41                 ?>
    42                 <option value="form:<?php echo esc_attr( $form['id'] ); ?>"<?php selected( 'form:' . esc_attr( $form['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $form['name'] ); ?></option>
    43                 <?php
    44             }
    45         }
    46         ?>
    47     </optgroup>
    48 
    49     <optgroup label="<?php esc_attr_e( 'Tags', 'woocommerce-convertkit' ); ?>" id="ckwc-tags" data-option-value-prefix="tag:">
    50         <?php
    51         if ( $subscription['tags']->exist() ) {
    52             foreach ( $subscription['tags']->get() as $convertkit_tag ) {
    53                 ?>
    54                 <option value="tag:<?php echo esc_attr( $convertkit_tag['id'] ); ?>"<?php selected( 'tag:' . esc_attr( $convertkit_tag['id'] ), $subscription['value'] ); ?>><?php echo esc_html( $convertkit_tag['name'] ); ?></option>
    55                 <?php
    56             }
    57         }
    58         ?>
    59     </optgroup>
     72    }
     73    ?>
    6074</select>
  • convertkit-for-woocommerce/trunk/woocommerce-convertkit.php

    r3422972 r3442178  
    1010 * Plugin URI:  https://www.kit.com
    1111 * Description: Integrates WooCommerce with Kit, allowing customers to be automatically sent to your Kit account.
    12  * Version:     2.0.4
     12 * Version:     2.0.5
    1313 * Author:      Kit
    1414 * Author URI:  https://www.kit.com
     
    3131define( 'CKWC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    3232define( 'CKWC_PLUGIN_PATH', __DIR__ );
    33 define( 'CKWC_PLUGIN_VERSION', '2.0.4' );
     33define( 'CKWC_PLUGIN_VERSION', '2.0.5' );
    3434define( 'CKWC_OAUTH_CLIENT_ID', 'L0kyADsB3WP5zO5MvUpXQU64gIntQg9BBAIme17r_7A' );
    3535define( 'CKWC_OAUTH_CLIENT_REDIRECT_URI', 'https://app.kit.com/wordpress/redirect' );
     
    5353require_once CKWC_PLUGIN_PATH . '/includes/functions.php';
    5454require_once CKWC_PLUGIN_PATH . '/includes/class-wp-ckwc.php';
     55require_once CKWC_PLUGIN_PATH . '/includes/class-ckwc-abandoned-cart.php';
    5556require_once CKWC_PLUGIN_PATH . '/includes/class-ckwc-admin-notices.php';
    5657require_once CKWC_PLUGIN_PATH . '/includes/class-ckwc-api.php';
     
    7576require_once CKWC_PLUGIN_PATH . '/admin/class-ckwc-admin-quick-edit.php';
    7677require_once CKWC_PLUGIN_PATH . '/admin/class-ckwc-admin-refresh-resources.php';
     78
     79// Register Plugin activation and deactivation functions.
     80register_activation_hook( __FILE__, 'ckwc_plugin_activate' );
     81add_action( 'wp_insert_site', 'ckwc_plugin_activate_new_site' );
     82add_action( 'activate_blog', 'ckwc_plugin_activate_new_site' );
     83register_deactivation_hook( __FILE__, 'ckwc_plugin_deactivate' );
    7784
    7885/**
Note: See TracChangeset for help on using the changeset viewer.