Plugin Directory

Changeset 2161136


Ignore:
Timestamp:
09/23/2019 03:56:19 AM (7 years ago)
Author:
subscribility
Message:

Release 2.9.10

Location:
subscribility
Files:
2 added
6 edited
36 copied

Legend:

Unmodified
Added
Removed
  • subscribility/tags/2.9.10/includes/frontend/controllers/class-wp99234-clubs.php

    r2150532 r2161136  
    6464            $types = array();
    6565
    66             $total = count($results);
     66            $total = (integer)$results->count;
    6767            $progress = 0;
    6868
     
    7878
    7979            update_option('wp99234_company_membership_types', $types);
     80
     81            // Update customer tags
     82            self::setup_customer_tags(true);
    8083
    8184            if ($is_sse) {
     
    121124    /**
    122125     * Pull and save Customer tags
     126     * @param bool $refresh
     127     * @return bool
    123128     */
    124     public static function setup_customer_tags()
     129    public static function setup_customer_tags($refresh = false)
    125130    {
    126         $customer_tags = get_option('troly_customer_tags');
    127         if (empty($customer_tags)) {
     131        $customer_tags = get_option('troly_customer_tags', array());
     132        if ($refresh || empty($customer_tags)) {
     133            $customer_tags = array();
    128134            $company_id = null;
    129135            $company_membership_types = get_option('wp99234_company_membership_types');
     136
     137            // Only valid membership type and set to fail DB upgrade
     138            if ( !is_array($company_membership_types) ) return false;
    130139
    131140            foreach ($company_membership_types as $row) {
     
    154163            }
    155164        }
     165
     166        // Ready for DB upgrade
     167        return true;
    156168    }
    157169
  • subscribility/tags/2.9.10/includes/frontend/controllers/class-wp99234-template.php

    r2152205 r2161136  
    166166            $featured_image = $product->tasting_item->url;
    167167
    168             // Replace cloudinary image height to 600
     168            // Replace cloudinary image height to 300
    169169            $featured_image = preg_replace("/h_\d*/", 'h_300', $featured_image);
    170170
    171             // Replace cloudinary image width to 600
     171            // Replace cloudinary image width to 300
    172172            $featured_image = preg_replace("/w_\d*/", 'w_300', $featured_image);
    173173
  • subscribility/tags/2.9.10/includes/frontend/controllers/class-wp99234-users.php

    r2150532 r2161136  
    204204        // Add the subs_id to the user meta
    205205        update_user_meta( $user_id, 'subs_id', $user_data->id );
     206
     207        // Set intercom
     208        if (isset($user_data->intercom_hmac)) {
     209            update_user_meta( $user_id, 'wp99234_intercom_hmac', $user_data->intercom_hmac );
     210        }
    206211
    207212        // Add the last time this user was updated by subs to user meta
  • subscribility/tags/2.9.10/includes/frontend/views/registration_form.php

    r2150532 r2161136  
    7878        position: relative;
    7979        display: inline-block;
    80         height: 37px;
    81         line-height: 37px;
    82         margin: 0 0.5rem 1rem 0;
    83         padding: 0 15px;
    84         border: 1px solid #000;
    85         border-radius: 5px;
    86         font-size: 13px;
    87         background-color: transparent;
    88         cursor: pointer;
    89     }
    90 
    91     .wp99234-section.chosen-preferences .tag-selected {
    92         box-shadow: inset 0 0 5px #888888;
     80    }
     81
     82    .wp99234-section.chosen-preferences .tag button, .wp99234-section.chosen-preferences .tag-editable button {
     83        line-height: 1.618;
     84        padding: 10px;
     85        font-size: 16px;
     86        font-weight: 500;
     87    }
     88
     89    .wp99234-section.chosen-preferences .tag-selected button:before {
     90        content:'\2713\00a0\00a0'; /* Add check icon to selected tag */
     91        white-space: pre;
    9392    }
    9493
     
    291290        <div class="wp99234-section chosen-preferences">
    292291            <h4>Add your preferences</h4>
    293             <p>Tell us what you like</p>
     292            <p>Tell us about you</p>
    294293
    295294            <ul class="tags">
    296295                <?php foreach($customer_tags as $tag): ?>
    297296                <li class="tag <?= in_array($tag->id, $tag_ids) ? 'tag-selected' : ''; ?>" customer-tag="<?= $tag->id; ?>">
    298                     <?= $tag->name; ?>
     297                    <button class="button"><?= $tag->name; ?></button>
    299298                </li>
    300299                <?php endforeach; ?>
  • subscribility/tags/2.9.10/readme.txt

    r2152205 r2161136  
    33Tags: troly,woocommerce,wine,wine clubs,craft beers
    44Requires at least: 4.9.0
    5 Tested up to: 5.2.2
    6 Stable Tag: 2.9.9
     5Tested up to: 5.2.3
     6Stable Tag: 2.9.10
    77PHP version: 7.0 and above
    88License: GPLv2 or later
     
    7070
    7171## Changelog
     72###Version 2.9.10
     73- Fixed DB upgrade
     74- Make user preference options adaptive to current theme in Club registration
     75- Added Intercom integration for admin users
     76
    7277###Version 2.9.9
    7378- Fixed featured image not showing in Product page
  • subscribility/tags/2.9.10/wp99234.php

    r2152205 r2161136  
    44 * Plugin URI: https://wordpress.org/plugins/subscribility/
    55 * Description: Manage and fulfil your sales of wine, beers and other crafted beverages, through clubs and other direct-to-consumer sales channels.
    6  * Version: 2.9.9
     6 * Version: 2.9.10
    77 * Author: Troly
    88 * Author URI: https://troly.io
     
    491491                wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true );
    492492
     493                $current_user = wp_get_current_user();
     494                $user_hmac    = get_user_meta($current_user->ID, 'wp99234_intercom_hmac', true);
     495                if ($user_hmac) {
     496                    $userhash     = hash_hmac('sha256', $current_user->user_email, $user_hmac);
     497                    $website      = get_site_url();
     498                    $hosted       = in_array($_SERVER['SERVER_ADDR'], array('103.18.108.127'), true) ? "true" : "false";
     499                    $company      = explode("-", get_option('wp99234_resource_key'));
     500                    $company      = sizeof($company) == 2 ? $company[1] : '""';
     501
     502                    echo "<script>window.intercomSettings = {app_id: \"hx4g0o0n\", name: \"$current_user->user_firstname $current_user->user_lastname\", email: \"$current_user->user_email\", user_hash: \"$userhash\", company: { id: $company, website: \"$website\", is_website_hosted: $hosted } };</script>";
     503
     504                    wp_enqueue_script( 'wp99234_intercom', WP99234()->plugin_url() . '/includes/admin/assets/js/wp99234-intercom.js' );
     505                    wp_enqueue_script( 'wp99234_intercom' );
     506                }
     507
    493508                wp_enqueue_script( 'wp99234_admin' );
    494509        }
     
    522537
    523538            foreach ($versions as $version) {
     539                $to_upgrade = false;
    524540                switch ($version) {
    525541                    case '1.1':
     
    533549                        add_option('wp99234_newsletter_collect_mobile', 'no');
    534550                        add_option('wp99234_newsletter_collect_postcode', 'no');
     551                        $to_upgrade = true; // set to upgrade DB immediately
    535552                    case '1.2':
    536553                        wp99234_add_troly_streams_table();
    537                         WP99234_Clubs::setup_customer_tags();
     554
     555                        // Make this optional to upgrade in 1st run/install
     556                        $to_upgrade = WP99234_Clubs::setup_customer_tags();
     557                }
     558                if ($to_upgrade) {
     559                    update_option( 'wp99234_db_version', $version );
    538560                }
    539561            }
    540             update_option( 'wp99234_db_version', $current_version );
    541562        }
    542563
  • subscribility/trunk/includes/frontend/controllers/class-wp99234-clubs.php

    r2150532 r2161136  
    6464            $types = array();
    6565
    66             $total = count($results);
     66            $total = (integer)$results->count;
    6767            $progress = 0;
    6868
     
    7878
    7979            update_option('wp99234_company_membership_types', $types);
     80
     81            // Update customer tags
     82            self::setup_customer_tags(true);
    8083
    8184            if ($is_sse) {
     
    121124    /**
    122125     * Pull and save Customer tags
     126     * @param bool $refresh
     127     * @return bool
    123128     */
    124     public static function setup_customer_tags()
     129    public static function setup_customer_tags($refresh = false)
    125130    {
    126         $customer_tags = get_option('troly_customer_tags');
    127         if (empty($customer_tags)) {
     131        $customer_tags = get_option('troly_customer_tags', array());
     132        if ($refresh || empty($customer_tags)) {
     133            $customer_tags = array();
    128134            $company_id = null;
    129135            $company_membership_types = get_option('wp99234_company_membership_types');
     136
     137            // Only valid membership type and set to fail DB upgrade
     138            if ( !is_array($company_membership_types) ) return false;
    130139
    131140            foreach ($company_membership_types as $row) {
     
    154163            }
    155164        }
     165
     166        // Ready for DB upgrade
     167        return true;
    156168    }
    157169
  • subscribility/trunk/includes/frontend/controllers/class-wp99234-template.php

    r2152205 r2161136  
    166166            $featured_image = $product->tasting_item->url;
    167167
    168             // Replace cloudinary image height to 600
     168            // Replace cloudinary image height to 300
    169169            $featured_image = preg_replace("/h_\d*/", 'h_300', $featured_image);
    170170
    171             // Replace cloudinary image width to 600
     171            // Replace cloudinary image width to 300
    172172            $featured_image = preg_replace("/w_\d*/", 'w_300', $featured_image);
    173173
  • subscribility/trunk/includes/frontend/controllers/class-wp99234-users.php

    r2150532 r2161136  
    204204        // Add the subs_id to the user meta
    205205        update_user_meta( $user_id, 'subs_id', $user_data->id );
     206
     207        // Set intercom
     208        if (isset($user_data->intercom_hmac)) {
     209            update_user_meta( $user_id, 'wp99234_intercom_hmac', $user_data->intercom_hmac );
     210        }
    206211
    207212        // Add the last time this user was updated by subs to user meta
  • subscribility/trunk/includes/frontend/views/registration_form.php

    r2150532 r2161136  
    7878        position: relative;
    7979        display: inline-block;
    80         height: 37px;
    81         line-height: 37px;
    82         margin: 0 0.5rem 1rem 0;
    83         padding: 0 15px;
    84         border: 1px solid #000;
    85         border-radius: 5px;
    86         font-size: 13px;
    87         background-color: transparent;
    88         cursor: pointer;
    89     }
    90 
    91     .wp99234-section.chosen-preferences .tag-selected {
    92         box-shadow: inset 0 0 5px #888888;
     80    }
     81
     82    .wp99234-section.chosen-preferences .tag button, .wp99234-section.chosen-preferences .tag-editable button {
     83        line-height: 1.618;
     84        padding: 10px;
     85        font-size: 16px;
     86        font-weight: 500;
     87    }
     88
     89    .wp99234-section.chosen-preferences .tag-selected button:before {
     90        content:'\2713\00a0\00a0'; /* Add check icon to selected tag */
     91        white-space: pre;
    9392    }
    9493
     
    291290        <div class="wp99234-section chosen-preferences">
    292291            <h4>Add your preferences</h4>
    293             <p>Tell us what you like</p>
     292            <p>Tell us about you</p>
    294293
    295294            <ul class="tags">
    296295                <?php foreach($customer_tags as $tag): ?>
    297296                <li class="tag <?= in_array($tag->id, $tag_ids) ? 'tag-selected' : ''; ?>" customer-tag="<?= $tag->id; ?>">
    298                     <?= $tag->name; ?>
     297                    <button class="button"><?= $tag->name; ?></button>
    299298                </li>
    300299                <?php endforeach; ?>
  • subscribility/trunk/readme.txt

    r2152205 r2161136  
    33Tags: troly,woocommerce,wine,wine clubs,craft beers
    44Requires at least: 4.9.0
    5 Tested up to: 5.2.2
    6 Stable Tag: 2.9.9
     5Tested up to: 5.2.3
     6Stable Tag: 2.9.10
    77PHP version: 7.0 and above
    88License: GPLv2 or later
     
    7070
    7171## Changelog
     72###Version 2.9.10
     73- Fixed DB upgrade
     74- Make user preference options adaptive to current theme in Club registration
     75- Added Intercom integration for admin users
     76
    7277###Version 2.9.9
    7378- Fixed featured image not showing in Product page
  • subscribility/trunk/wp99234.php

    r2152205 r2161136  
    44 * Plugin URI: https://wordpress.org/plugins/subscribility/
    55 * Description: Manage and fulfil your sales of wine, beers and other crafted beverages, through clubs and other direct-to-consumer sales channels.
    6  * Version: 2.9.9
     6 * Version: 2.9.10
    77 * Author: Troly
    88 * Author URI: https://troly.io
     
    491491                wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true );
    492492
     493                $current_user = wp_get_current_user();
     494                $user_hmac    = get_user_meta($current_user->ID, 'wp99234_intercom_hmac', true);
     495                if ($user_hmac) {
     496                    $userhash     = hash_hmac('sha256', $current_user->user_email, $user_hmac);
     497                    $website      = get_site_url();
     498                    $hosted       = in_array($_SERVER['SERVER_ADDR'], array('103.18.108.127'), true) ? "true" : "false";
     499                    $company      = explode("-", get_option('wp99234_resource_key'));
     500                    $company      = sizeof($company) == 2 ? $company[1] : '""';
     501
     502                    echo "<script>window.intercomSettings = {app_id: \"hx4g0o0n\", name: \"$current_user->user_firstname $current_user->user_lastname\", email: \"$current_user->user_email\", user_hash: \"$userhash\", company: { id: $company, website: \"$website\", is_website_hosted: $hosted } };</script>";
     503
     504                    wp_enqueue_script( 'wp99234_intercom', WP99234()->plugin_url() . '/includes/admin/assets/js/wp99234-intercom.js' );
     505                    wp_enqueue_script( 'wp99234_intercom' );
     506                }
     507
    493508                wp_enqueue_script( 'wp99234_admin' );
    494509        }
     
    522537
    523538            foreach ($versions as $version) {
     539                $to_upgrade = false;
    524540                switch ($version) {
    525541                    case '1.1':
     
    533549                        add_option('wp99234_newsletter_collect_mobile', 'no');
    534550                        add_option('wp99234_newsletter_collect_postcode', 'no');
     551                        $to_upgrade = true; // set to upgrade DB immediately
    535552                    case '1.2':
    536553                        wp99234_add_troly_streams_table();
    537                         WP99234_Clubs::setup_customer_tags();
     554
     555                        // Make this optional to upgrade in 1st run/install
     556                        $to_upgrade = WP99234_Clubs::setup_customer_tags();
     557                }
     558                if ($to_upgrade) {
     559                    update_option( 'wp99234_db_version', $version );
    538560                }
    539561            }
    540             update_option( 'wp99234_db_version', $current_version );
    541562        }
    542563
Note: See TracChangeset for help on using the changeset viewer.