Plugin Directory

Changeset 3334315


Ignore:
Timestamp:
07/25/2025 07:28:32 PM (8 months ago)
Author:
uncannyowl
Message:

Thrive apprentice backward compatibility with older Automator Pro Versions

Location:
uncanny-automator/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • uncanny-automator/trunk/languages/uncanny-automator.pot

    r3333864 r3334315  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Uncanny Automator 6.7.0\n"
     5"Project-Id-Version: Uncanny Automator 6.7.0.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/uncanny-automator\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-07-24T16:51:15+00:00\n"
     12"POT-Creation-Date: 2025-07-25T18:38:56+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
     
    3129831298#: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:141
    3129931299#: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:144
    31300 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1090
     31300#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1094
    3130131301#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:260
    3130231302#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:263
     
    3134931349#: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:171
    3135031350#: src/integrations/thrive-apprentice/actions/thrive-apprentice-issue-user-certificate.php:174
    31351 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1091
     31351#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1095
    3135231352#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-completes-all-free-lessons-in-premium-course.php:159
    3135331353#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-completes-all-free-lessons-in-premium-course.php:162
     
    3138931389msgstr ""
    3139031390
    31391 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:107
    31392 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:110
     31391#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:111
     31392#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:114
    3139331393msgctxt "Thrive Apprentice"
    3139431394msgid "Any course"
    3139531395msgstr ""
    3139631396
    31397 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:176
     31397#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:180
    3139831398msgctxt "Content type selection"
    3139931399msgid "Any content type"
    3140031400msgstr ""
    3140131401
    31402 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:250
    31403 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:266
     31402#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:254
     31403#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:270
    3140431404msgctxt "Thrive Apprentice"
    3140531405msgid "Any content"
    3140631406msgstr ""
    3140731407
    31408 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:326
    31409 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:382
     31408#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:330
     31409#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:386
    3141031410msgctxt "Thrive Apprentice lesson selection"
    3141131411msgid "Any lesson"
    3141231412msgstr ""
    3141331413
    31414 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:431
    31415 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:516
     31414#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:435
     31415#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:520
    3141631416msgctxt "Module selection"
    3141731417msgid "Any module"
     
    3141931419
    3142031420#. translators: %s is replaced with the error message
    31421 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:473
     31421#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:477
    3142231422#, php-format
    3142331423msgctxt "Error message"
     
    3142531425msgstr ""
    3142631426
    31427 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:611
     31427#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:615
    3142831428msgctxt "Assessment selection"
    3142931429msgid "Any assessment"
    3143031430msgstr ""
    3143131431
    31432 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:785
     31432#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:789
    3143331433msgctxt "Product selection"
    3143431434msgid "Any product"
     
    3143631436
    3143731437#. translators: %s is replaced with the content type name
    31438 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:975
     31438#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:979
    3143931439#, php-format
    3144031440msgctxt "Thrive Apprentice"
     
    3144331443
    3144431444#. translators: %s is replaced with the content type name
    31445 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1023
     31445#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1027
    3144631446#, php-format
    3144731447msgctxt "Content type name"
     
    3145031450
    3145131451#. translators: %s is replaced with the content type name
    31452 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1042
    31453 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1056
     31452#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1046
     31453#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1060
    3145431454#, php-format
    3145531455msgctxt "Error message"
     
    3145831458
    3145931459#. translators: %s is replaced with the content type name
    31460 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1070
     31460#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1074
    3146131461#, php-format
    3146231462msgctxt "Content type name"
     
    3146431464msgstr ""
    3146531465
    31466 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1092
     31466#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1096
    3146731467msgctxt "Thrive Apprentice"
    3146831468msgid "Course author"
    3146931469msgstr ""
    3147031470
    31471 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1093
     31471#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1097
    3147231472msgctxt "Thrive Apprentice"
    3147331473msgid "Course summary"
    3147431474msgstr ""
    3147531475
    31476 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1094
     31476#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1098
    3147731477#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:266
    3147831478#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-content-unlocked.php:269
     
    3149931499msgstr ""
    3150031500
    31501 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1107
     31501#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1111
    3150231502#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:198
    3150331503#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:201
     
    3150831508msgstr ""
    3150931509
    31510 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1108
     31510#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1112
    3151131511#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-module-completed.php:180
    3151231512#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-module-completed.php:183
     
    3151531515msgstr ""
    3151631516
    31517 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1109
     31517#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1113
    3151831518#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:204
    3151931519#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:207
     
    3152431524msgstr ""
    3152531525
    31526 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1122
     31526#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1126
    3152731527#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:174
    3152831528#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:177
     
    3153131531msgstr ""
    3153231532
    31533 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1123
     31533#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1127
    3153431534#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:180
    3153531535#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:183
     
    3153831538msgstr ""
    3153931539
    31540 #: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1124
     31540#: src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php:1128
    3154131541#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:186
    3154231542#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-course-lesson-completed.php:189
     
    3156931569msgstr ""
    3157031570
    31571 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:37
     31571#. translators: %1$s: Product Name
     31572#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:58
    3157231573#, php-format
    3157331574msgctxt "Thrive Apprentice"
     
    3157531576msgstr ""
    3157631577
    31577 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:43
     31578#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:64
    3157831579msgctxt "Thrive Apprentice"
    3157931580msgid "A user receives access to {{a product}}"
    3158031581msgstr ""
    3158131582
    31582 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:56
     31583#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:79
    3158331584msgctxt "Thrive Apprentice"
    3158431585msgid "Product"
    3158531586msgstr ""
    3158631587
    31587 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:121
    31588 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:124
     31588#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:120
     31589#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:123
    3158931590msgctxt "Thrive Apprentice"
    3159031591msgid "Product ID"
    3159131592msgstr ""
    3159231593
    31593 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:127
    31594 #: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:130
     31594#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:126
     31595#: src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php:129
    3159531596msgctxt "Thrive Apprentice"
    31596 msgid "Product title"
     31597msgid "Product name"
    3159731598msgstr ""
    3159831599
  • uncanny-automator/trunk/readme.txt

    r3333891 r3334315  
    55Tested up to: 6.8.2
    66Requires PHP: 7.3
    7 Stable tag: 6.7.0
     7Stable tag: 6.7.0.1
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    394394== Changelog ==
    395395
     396= 6.7.0.1 [2025-07-25] =
     397
     398**Update:**
     399
     400* Thrive Apprentice - `class_alias` added to support older Automator Pro versions
     401
    396402= 6.7.0 [2025-07-24] =
    397403
  • uncanny-automator/trunk/src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php

    r3333864 r3334315  
    11<?php
    22namespace Uncanny_Automator\Integrations\Thrive_Apprentice;
     3
     4
     5// Create class alias for backward compatibility with Pro plugin
     6class_alias( 'Uncanny_Automator\Integrations\Thrive_Apprentice\Thrive_Apprentice_Helpers', 'Uncanny_Automator\Thrive_Apprentice_Helpers' );
    37
    48/**
  • uncanny-automator/trunk/src/integrations/thrive-apprentice/thrive-apprentice-integration.php

    r3333864 r3334315  
    3737        new THRIVE_APPRENTICE_USER_PASS_ASSESSMENT_IN_COURSE($this->helpers);
    3838        new THRIVE_APPRENTICE_USER_SUBMITS_ASSESSMENT_IN_COURSE($this->helpers);
     39        new THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED($this->helpers);
    3940    }
    4041
     
    4849     */
    4950    public function plugin_active() {
    50         return class_exists( '\TVA_Manager' );
     51        return class_exists( '\TVA_Const', false );
    5152    }
    5253}
  • uncanny-automator/trunk/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php

    r3333864 r3334315  
    11<?php
    2 namespace Uncanny_Automator;
     2namespace Uncanny_Automator\Integrations\Thrive_Apprentice;
    33
    44use Uncanny_Automator\Recipe\Trigger;
    55
    66/**
    7  * Class THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED
     7 * Class THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED
    88 *
     9 * @package Uncanny_Automator
    910 */
    10 class THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED extends Trigger {
     11class THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED extends Trigger {
    1112
    12     const TRIGGER_CODE = 'THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED';
    13     const TRIGGER_META = 'THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED_META';
    14 
    15     /**
    16      * @var Thrive_Apprentice_Helpers
    17      */
    1813    protected $helper;
    1914
    2015    /**
    21      * Setup trigger.
     16     * Constant TRIGGER_CODE.
     17     *
     18     * @var string
     19     */
     20    const TRIGGER_CODE = 'THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED';
     21
     22    /**
     23     * Constant TRIGGER_META.
     24     *
     25     * @var string
     26     */
     27    const TRIGGER_META = 'THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED_META';
     28
     29
     30    /**
     31     * Define and register the trigger by pushing it into the Automator object.
     32     *
     33     * @return void.
    2234     */
    2335    protected function setup_trigger() {
    24         $this->helper = new Thrive_Apprentice_Helpers( false );
     36
     37        $this->helper = array_shift( $this->dependencies );
    2538
    2639        $this->set_integration( 'THRIVE_APPRENTICE' );
     40
    2741        $this->set_trigger_code( self::TRIGGER_CODE );
     42
    2843        $this->set_trigger_meta( self::TRIGGER_META );
     44
    2945        $this->set_is_pro( false );
    3046
     47        $this->set_is_login_required( true );
     48
     49        // The action hook to attach this trigger into.
    3150        $this->add_action( 'tva_user_receives_product_access' );
     51
     52        // The number of arguments that the action hook accepts.
    3253        $this->set_action_args_count( 2 );
    3354
    3455        $this->set_sentence(
    35             // translators: %1$s: Product Name
    3656            sprintf(
     57                /* translators: %1$s: Product Name */
    3758                esc_html_x( 'A user receives access to {{a product:%1$s}}', 'Thrive Apprentice', 'uncanny-automator' ),
    3859                $this->get_trigger_meta()
     
    4667
    4768    /**
    48      * Options.
     69     * Loads all options.
    4970     *
    50      * @return mixed
     71     * @return array The list of options.
    5172     */
    5273    public function options() {
     74
    5375        return array(
    5476            array(
    5577                'option_code'     => $this->get_trigger_meta(),
     78                'required'        => true,
    5679                'label'           => esc_html_x( 'Product', 'Thrive Apprentice', 'uncanny-automator' ),
    5780                'input_type'      => 'select',
    58                 'required'        => true,
    59                 'options'         => $this->helper->get_dropdown_options_products( true, true ),
     81                'options'         => $this->get_helper()->get_dropdown_options_products(true, true),
    6082                'relevant_tokens' => array(),
    6183            ),
     
    6486
    6587    /**
    66      * Validate.
     88     * Validate the trigger.
    6789     *
    68      * @param mixed $trigger The trigger.
    69      * @param mixed $hook_args The arguments.
    70      * @return mixed
     90     * @param array $trigger The trigger data.
     91     * @param array $hook_args The hook arguments.
     92     * @return bool True if validation was successful.
    7193     */
    7294    public function validate( $trigger, $hook_args ) {
    73         list( $user, $product ) = $hook_args;
     95        list( $user, $product_id ) = $hook_args;
    7496
    75         if ( empty( $user ) || empty( $product ) ) {
     97        if ( empty( $user ) || empty( $product_id ) ) {
    7698            return false;
    7799        }
    78100
    79         $selected_product_id = intval( $trigger['meta'][ $this->get_trigger_meta() ] );
    80         $user_id             = $user instanceof \WP_User ? $user->ID : intval( $user );
     101        $this->set_user_id( absint( $user->ID ) );
    81102
    82         $this->set_user_id( $user_id );
     103        $product_id          = absint( $product_id );
     104        $selected_product_id = $trigger['meta'][ $this->get_trigger_meta() ];
    83105
    84         if ( -1 === $selected_product_id ) {
    85             return true;
    86         }
     106        // Match if any product is selected (-1) or if specific product matches
     107        return intval( '-1' ) === intval( $selected_product_id ) || (int) $selected_product_id === (int) $product_id;
     108    }
    87109
    88         $product_id = $this->get_product_id( $product );
    89 
    90         return $product_id === $selected_product_id;
     110    /**
     111     * Define tokens.
     112     *
     113     * @param array $trigger The trigger configuration.
     114     * @param array $tokens The existing tokens.
     115     * @return array
     116     */
     117    public function define_tokens( $trigger, $tokens ) {
     118        return array(
     119            'PRODUCT_ID'   => array(
     120                'name'      => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ),
     121                'type'      => 'int',
     122                'tokenId'   => 'PRODUCT_ID',
     123                'tokenName' => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ),
     124            ),
     125            'PRODUCT_NAME' => array(
     126                'name'      => esc_html_x( 'Product name', 'Thrive Apprentice', 'uncanny-automator' ),
     127                'type'      => 'text',
     128                'tokenId'   => 'PRODUCT_NAME',
     129                'tokenName' => esc_html_x( 'Product name', 'Thrive Apprentice', 'uncanny-automator' ),
     130            ),
     131        );
    91132    }
    92133
     
    94135     * Hydrate tokens.
    95136     *
    96      * @param mixed $trigger The trigger.
    97      * @param mixed $hook_args The arguments.
    98      * @return mixed
     137     * @param array $trigger The trigger data.
     138     * @param array $hook_args The hook arguments.
     139     * @return array The token values.
    99140     */
    100141    public function hydrate_tokens( $trigger, $hook_args ) {
    101         list( $user, $product ) = $hook_args;
     142        list( $user, $product_id ) = $hook_args;
    102143
    103         $product_data = $this->get_product_data( $product );
     144        if ( empty( $product_id ) ) {
     145            return array();
     146        }
     147
     148        $product = new \TVA\Product( $product_id );
    104149
    105150        return array(
    106             'PRODUCT_ID'    => $product_data['id'],
    107             'PRODUCT_TITLE' => $product_data['title'],
    108         );
    109     }
    110 
    111     /**
    112      * Define tokens.
    113      *
    114      * @param mixed $trigger The trigger.
    115      * @param mixed $tokens The destination.
    116      * @return mixed
    117      */
    118     public function define_tokens( $trigger, $tokens ) {
    119         return array(
    120             'PRODUCT_ID'    => array(
    121                 'name'      => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ),
    122                 'type'      => 'int',
    123                 'tokenId'   => 'PRODUCT_ID',
    124                 'tokenName' => esc_html_x( 'Product ID', 'Thrive Apprentice', 'uncanny-automator' ),
    125             ),
    126             'PRODUCT_TITLE' => array(
    127                 'name'      => esc_html_x( 'Product title', 'Thrive Apprentice', 'uncanny-automator' ),
    128                 'type'      => 'text',
    129                 'tokenId'   => 'PRODUCT_TITLE',
    130                 'tokenName' => esc_html_x( 'Product title', 'Thrive Apprentice', 'uncanny-automator' ),
    131             ),
    132         );
    133     }
    134 
    135     /**
    136      * Extract product ID from various product object types
    137      *
    138      * @param mixed $product
    139      * @return int|null
    140      */
    141     private function get_product_id( $product ) {
    142         // TVA\Product object
    143         if ( is_object( $product ) && method_exists( $product, 'get_id' ) ) {
    144             return intval( $product->get_id() );
    145         }
    146 
    147         // WP_Term object (product term)
    148         if ( $product instanceof \WP_Term && 'tva_product' === $product->taxonomy ) {
    149             return intval( $product->term_id );
    150         }
    151 
    152         // Numeric value
    153         if ( is_numeric( $product ) ) {
    154             return intval( $product );
    155         }
    156 
    157         // Array with ID
    158         if ( is_array( $product ) && isset( $product['ID'] ) ) {
    159             return intval( $product['ID'] );
    160         }
    161 
    162         // Array with term_id
    163         if ( is_array( $product ) && isset( $product['term_id'] ) ) {
    164             return intval( $product['term_id'] );
    165         }
    166 
    167         // TVA\Product object with get_term_id method
    168         if ( is_object( $product ) && method_exists( $product, 'get_term_id' ) ) {
    169             return intval( $product->get_term_id() );
    170         }
    171 
    172         // Object with term_id property
    173         if ( is_object( $product ) && isset( $product->term_id ) ) {
    174             return intval( $product->term_id );
    175         }
    176 
    177         return null;
    178     }
    179 
    180     /**
    181      * Extract product data (ID and title) from various product object types
    182      *
    183      * @param mixed $product
    184      * @return array
    185      */
    186     private function get_product_data( $product ) {
    187         $product_id    = null;
    188         $product_title = '';
    189 
    190         // TVA\Product object
    191         if ( is_object( $product ) && method_exists( $product, 'get_id' ) ) {
    192             $product_id    = $product->get_id();
    193             $product_title = method_exists( $product, 'get_name' ) ? $product->get_name() : '';
    194         } elseif ( $product instanceof \WP_Term && 'tva_product' === $product->taxonomy ) {
    195             // WP_Term object (product term)
    196             $product_id    = $product->term_id;
    197             $product_title = $product->name;
    198         } elseif ( is_numeric( $product ) ) {
    199             // Numeric value
    200             $product_id    = intval( $product );
    201             $product_term  = get_term( $product_id, 'tva_product' );
    202             $product_title = $product_term instanceof \WP_Term ? $product_term->name : '';
    203         } elseif ( is_array( $product ) && isset( $product['ID'] ) ) {
    204             // Array with ID
    205             $product_id    = intval( $product['ID'] );
    206             $product_title = isset( $product['name'] ) ? $product['name'] : '';
    207         } elseif ( is_array( $product ) && isset( $product['term_id'] ) ) {
    208             // Array with term_id
    209             $product_id    = intval( $product['term_id'] );
    210             $product_title = isset( $product['name'] ) ? $product['name'] : '';
    211         } elseif ( is_object( $product ) && method_exists( $product, 'get_term_id' ) ) {
    212             // TVA\Product object with get_term_id method
    213             $product_id    = $product->get_term_id();
    214             $product_title = method_exists( $product, 'get_name' ) ? $product->get_name() : '';
    215         } elseif ( is_object( $product ) && isset( $product->term_id ) ) {
    216             // Object with term_id property
    217             $product_id    = $product->term_id;
    218             $product_title = isset( $product->name ) ? $product->name : '';
    219         }
    220 
    221         return array(
    222             'id'    => $product_id,
    223             'title' => $product_title,
     151            'PRODUCT_ID'   => $product_id,
     152            'PRODUCT_NAME' => $product->get_name(),
    224153        );
    225154    }
  • uncanny-automator/trunk/src/integrations/thrive-quiz-builder/add-thrive-quiz-builder-integration.php

    r2901959 r3334315  
    3434     */
    3535    public function plugin_active() {
    36         return class_exists( 'Thrive_Quiz_Builder' );
     36        return class_exists( 'Thrive_Quiz_Builder', false );
    3737    }
    3838}
  • uncanny-automator/trunk/src/integrations/thrive-ultimatum/class-thrive-ultimatum-integration.php

    r3265280 r3334315  
    4040     */
    4141    public function plugin_active() {
    42         return class_exists( 'TVE_Ult_Const' );
     42        return class_exists( 'TVE_Ult_Const', false );
    4343    }
    4444}
  • uncanny-automator/trunk/uncanny-automator.php

    r3333864 r3334315  
    1010 * License:             GPLv3
    1111 * License URI:         https://www.gnu.org/licenses/gpl-3.0.html
    12  * Version:             6.7.0
     12 * Version:             6.7.0.1
    1313 * Requires at least:   5.6
    1414 * Requires PHP:        7.3
     
    2323     * Specify Automator version.
    2424     */
    25     define( 'AUTOMATOR_PLUGIN_VERSION', '6.7.0' );
     25    define( 'AUTOMATOR_PLUGIN_VERSION', '6.7.0.1' );
    2626}
    2727
  • uncanny-automator/trunk/vendor/composer/autoload_classmap.php

    r3333864 r3334315  
    840840    'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_FAIL_ASSESSMENT_IN_COURSE' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-fail-assessment-in-course.php',
    841841    'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PASS_ASSESSMENT_IN_COURSE' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-pass-assessment-in-course.php',
     842    'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php',
    842843    'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_SUBMITS_ASSESSMENT_IN_COURSE' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-submits-assessment-in-course.php',
    843844    'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\Thrive_Apprentice_Helpers' => $baseDir . '/src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php',
     
    12171218    'Uncanny_Automator\\TELEGRAM_MESSAGE_RECEIVED' => $baseDir . '/src/integrations/telegram/triggers/telegram-message-received.php',
    12181219    'Uncanny_Automator\\TELEGRAM_SEND_MESSAGE' => $baseDir . '/src/integrations/telegram/actions/telegram-send-message.php',
    1219     'Uncanny_Automator\\THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED' => $baseDir . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php',
    12201220    'Uncanny_Automator\\THRIVE_OVATION_TESTIMONIAL_CREATED' => $baseDir . '/src/integrations/thrive-ovation/triggers/thrive-ovation-testimonial-created.php',
    12211221    'Uncanny_Automator\\TL_FORM_SUBMITTED' => $baseDir . '/src/integrations/thrive-leads/triggers/tl-form-submitted.php',
  • uncanny-automator/trunk/vendor/composer/autoload_static.php

    r3333864 r3334315  
    851851        'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_FAIL_ASSESSMENT_IN_COURSE' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-fail-assessment-in-course.php',
    852852        'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PASS_ASSESSMENT_IN_COURSE' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-pass-assessment-in-course.php',
     853        'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_PRODUCT_ACCESS_RECEIVED' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php',
    853854        'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\THRIVE_APPRENTICE_USER_SUBMITS_ASSESSMENT_IN_COURSE' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-user-submits-assessment-in-course.php',
    854855        'Uncanny_Automator\\Integrations\\Thrive_Apprentice\\Thrive_Apprentice_Helpers' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/helpers/thrive-apprentice-helpers.php',
     
    12281229        'Uncanny_Automator\\TELEGRAM_MESSAGE_RECEIVED' => __DIR__ . '/../..' . '/src/integrations/telegram/triggers/telegram-message-received.php',
    12291230        'Uncanny_Automator\\TELEGRAM_SEND_MESSAGE' => __DIR__ . '/../..' . '/src/integrations/telegram/actions/telegram-send-message.php',
    1230         'Uncanny_Automator\\THRIVE_APPRENTICE_PRODUCT_ACCESS_RECEIVED' => __DIR__ . '/../..' . '/src/integrations/thrive-apprentice/triggers/thrive-apprentice-product-access-received.php',
    12311231        'Uncanny_Automator\\THRIVE_OVATION_TESTIMONIAL_CREATED' => __DIR__ . '/../..' . '/src/integrations/thrive-ovation/triggers/thrive-ovation-testimonial-created.php',
    12321232        'Uncanny_Automator\\TL_FORM_SUBMITTED' => __DIR__ . '/../..' . '/src/integrations/thrive-leads/triggers/tl-form-submitted.php',
Note: See TracChangeset for help on using the changeset viewer.