Plugin Directory

Changeset 1534436


Ignore:
Timestamp:
11/15/2016 04:15:35 PM (9 years ago)
Author:
cueteam
Message:

Tagging version 1.0.7

Location:
cue-connect
Files:
11 edited
2 copied

Legend:

Unmodified
Added
Removed
  • cue-connect/tags/1.0.7/cue-connect.php

    r1488766 r1534436  
    44 * Plugin URI: https://wordpress.org/plugins/cue-connect
    55 * Description: Meet Cue, your customers’ personal shopping assistant that feeds you actionable data.
    6  * Version: 1.0.6
     6 * Version: 1.0.7
    77 * Author: Cue Connect
    88 * Author URI: https://business.cueconnect.com/
     
    2828    define('CUE_PLUGIN_URL', plugin_dir_url(__FILE__));
    2929
    30     register_activation_hook(__FILE__, array('cue', 'plugin_activate'));
    31     register_deactivation_hook(__FILE__, array('cue', 'plugin_deactivate'));
    32     register_uninstall_hook(__FILE__, array('cue', 'plugin_uninstall'));
     30    register_activation_hook(__FILE__, array('Cue', 'pluginActivate'));
     31    register_deactivation_hook(__FILE__, array('Cue', 'pluginDeactivate'));
     32    register_uninstall_hook(__FILE__, array('Cue', 'pluginUninstall'));
    3333
    3434    require_once CUE_PLUGIN_DIR . 'inc/class.cue-env.php';
  • cue-connect/tags/1.0.7/inc/class.cue-api.php

    r1477180 r1534436  
    271271            $queryString  = '?' . http_build_query($params);
    272272            try {
    273                 $response = file_get_contents($url . $queryString);
     273                $response_get = wp_remote_get($url . $queryString);
     274                if (is_array($response_get)) {
     275                    $response = $response_get['body'];
     276                }
    274277            } catch (Exception $e) {
    275278                // TODO: Log errors
     
    279282    }
    280283}
    281 
    282 /*
    283 <url>https://business.cueconnect.com/magento/saveCustomer</url>
    284 <url>https://business.cueconnect.com/magento/saveMark</url>
    285 <url>https://business.cueconnect.com/magento/priceChanged</url>
    286 <url>https://business.cueconnect.com/magento/selectVersion</url>
    287 */
  • cue-connect/tags/1.0.7/inc/class.cue-sync.php

    r1531870 r1534436  
    156156     * @return array products ready to be sent to cue app
    157157     */
    158     private static function prepare_products($ids) {
     158    public static function prepare_products($ids) {
    159159        global $wpdb;
    160160
     
    182182        $updated = array();
    183183        foreach ($products as $product) {
    184        
    185             $p = array();
    186 
    187             if (!$categories = wp_get_post_terms($product['sku'], 'product_cat', array( 'fields' => 'names'))) {
    188                 $categories[0] = '';
    189             }
    190184           
    191185            $product['description'] = self::strip_tags_shortcodes($product['description']);
     
    200194    }
    201195
    202     private static function get_slices_from_array($data, $slice_size)
     196    public static function get_slices_from_array($data, $slice_size)
    203197    {
    204198        $slices = array();
  • cue-connect/tags/1.0.7/inc/class.cue.php

    r1488888 r1534436  
    5656                exit;
    5757            }
    58 
    5958        }
    6059
    6160        if (self::$_options['place_id'] && self::$_options['api_key']) {
    62             // Add Cue product HTML meta tags
    63             add_action('wp_head', array($this, 'cueMeta'));
    6461
    6562            // Add Cue frontend script
     
    7370            );
    7471
     72            add_action(
     73                'woocommerce_proceed_to_checkout',
     74                array($this, 'cartAddOB'),
     75                0
     76            );
     77
    7578            // Add converstion tracking code
    7679            add_action(
     
    9093    }
    9194
    92     public static function plugin_activate()
     95    public static function pluginActivate()
    9396    {
    9497        // Requirements
     
    105108     * Executed when the plugin is deactivated
    106109     */
    107     public static function plugin_deactivate() {
     110    public static function pluginDeactivate()
     111    {
    108112        // Disable products synchronization cron
    109113        wp_clear_scheduled_hook('cue_sync_hook');
     
    120124     * Executed when the plugin is uninstalled
    121125     */
    122     public static function plugin_uninstall() {
     126    public static function pluginUninstall()
     127    {
    123128        // Erase Cue settings
    124129        wp_clear_scheduled_hook('cue_sync_hook');
     
    174179    }
    175180
    176     // private function addSyncCron()
    177     // {
    178     //     wp_clear_scheduled_hook('cue_sync_hook');
    179     //     wp_schedule_event(time(), 'twicedaily', 'cue_sync_hook');
    180     // }
    181 
    182181    public function mylistRewrite()
    183182    {
     
    205204    {
    206205        $reg_firstname = (!empty($_POST['reg_firstname']))?trim($_POST['reg_firstname']):'';
    207         $reg_lastname = (!empty($_POST['reg_lastname'] ))?trim($_POST['reg_lastname']):'';
     206        $reg_lastname = (!empty($_POST['reg_lastname']))?trim($_POST['reg_lastname']):'';
    208207        ?>
    209208
    210 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
    211     <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label>
    212     <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>">
    213 </p>
    214 
    215 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
    216     <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label>
    217     <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>">
    218 </p>
     209        <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
     210            <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label>
     211            <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>">
     212        </p>
     213
     214        <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
     215            <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label>
     216            <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>">
     217        </p>
    219218
    220219        <?php
     
    240239        ?>
    241240
    242 <div class="cue-wrapper" style="margin: 1em 0">
    243 <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
    244 <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
    245 <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
    246 </div>
     241        <div class="cue-wrapper" style="margin: 1em 0">
     242        <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     243        <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     244        <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     245        </div>
    247246
    248247        <?php
    249248    }
    250249
    251     public function cueMeta()
    252     {
    253         global $post;
    254         if (isset($post->post_type) && 'product' == $post->post_type && is_single()) {
    255             $description = CueSync::strip_tags_shortcodes($post->post_content);
    256 ?>
    257 
    258 <!-- CUE META START -->
    259 <meta property="og:url" content="<?php echo get_permalink($post->ID) ?>" />
    260 <meta property="og:title" content="<?php echo $post->post_title ?>" />
    261 <meta property="og:description" content="<?php echo $description ?>" />
    262 <meta property="og:image" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" />
    263 <meta property="og:type" content="website" />
    264 <meta name="cue:name" content="<?php echo $post->post_title ?>" />
    265 <meta name="cue:description" content="<?php echo $description ?>" />
    266 <meta name="cue:image_url" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" />
    267 <meta name="cue:sku" content="<?php echo $post->ID ?>" />
    268 <meta name="cue:url" content="<?php echo get_permalink($post->ID) ?>" />
    269 <meta name="cue:price" content="<?php echo get_post_meta($post->ID, '_price', true); ?>" />
    270 <!-- CUE META END -->
    271 
    272 <?php
    273 
    274         }
     250    public function cartAddOB()
     251    {
     252        $items = array();
     253
     254        global $woocommerce;
     255        $items = $woocommerce->cart->get_cart();
     256
     257        // bail if no items in cart
     258        if (!count($items)) {
     259            return;
     260        }
     261
     262        $item = reset($items);
     263        $imiSku = $item['data']->post->ID;
     264        $cid = is_user_logged_in();
     265
     266        ?>
     267       
     268        <style>.cue-wrapper iframe{margin:0;padding:0;}.cue-wrapper>* {display:inline-block}</style>
     269
     270        <div class="cue-wrapper" style="margin:1em 0; clear:both;">
     271            <div class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     272        </div>
     273
     274        <?php
    275275    }
    276276
     
    296296    /**
    297297     * Renders tracking pixel gif image.
    298      * Url format: 
     298     * Url format:
    299299     * //api.cueconnect.com/imi/cart_track/json?
    300300     *      api_key=XXX
     
    343343        return $url;
    344344    }
    345 
    346345}
  • cue-connect/tags/1.0.7/readme.txt

    r1488760 r1534436  
    66WC requires at least: 1.6
    77WC tested up to: 2.6.4
    8 Stable tag: 1.0.6
     8Stable tag: 1.0.7
    99License: GPLv3 or later License
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9393== Changelog ==
    9494
     95= 1.0.7 =
     96* Removed meta tags used for product syncronizations
     97* Updated css for My List page
     98
    9599= 1.0.6 =
    96100* Updates to products syncronization process
  • cue-connect/tags/1.0.7/templates/mylist.php

    r1488760 r1534436  
    55
    66?>
     7
     8<style>
     9.cue-mylist-wrapper {
     10    max-width: 1000px;
     11    width:100%;
     12    margin: 2em auto;
     13}
     14</style>
    715
    816<div class="cue-mylist-wrapper">
  • cue-connect/trunk/cue-connect.php

    r1488766 r1534436  
    44 * Plugin URI: https://wordpress.org/plugins/cue-connect
    55 * Description: Meet Cue, your customers’ personal shopping assistant that feeds you actionable data.
    6  * Version: 1.0.6
     6 * Version: 1.0.7
    77 * Author: Cue Connect
    88 * Author URI: https://business.cueconnect.com/
     
    2828    define('CUE_PLUGIN_URL', plugin_dir_url(__FILE__));
    2929
    30     register_activation_hook(__FILE__, array('cue', 'plugin_activate'));
    31     register_deactivation_hook(__FILE__, array('cue', 'plugin_deactivate'));
    32     register_uninstall_hook(__FILE__, array('cue', 'plugin_uninstall'));
     30    register_activation_hook(__FILE__, array('Cue', 'pluginActivate'));
     31    register_deactivation_hook(__FILE__, array('Cue', 'pluginDeactivate'));
     32    register_uninstall_hook(__FILE__, array('Cue', 'pluginUninstall'));
    3333
    3434    require_once CUE_PLUGIN_DIR . 'inc/class.cue-env.php';
  • cue-connect/trunk/inc/class.cue-api.php

    r1477180 r1534436  
    271271            $queryString  = '?' . http_build_query($params);
    272272            try {
    273                 $response = file_get_contents($url . $queryString);
     273                $response_get = wp_remote_get($url . $queryString);
     274                if (is_array($response_get)) {
     275                    $response = $response_get['body'];
     276                }
    274277            } catch (Exception $e) {
    275278                // TODO: Log errors
     
    279282    }
    280283}
    281 
    282 /*
    283 <url>https://business.cueconnect.com/magento/saveCustomer</url>
    284 <url>https://business.cueconnect.com/magento/saveMark</url>
    285 <url>https://business.cueconnect.com/magento/priceChanged</url>
    286 <url>https://business.cueconnect.com/magento/selectVersion</url>
    287 */
  • cue-connect/trunk/inc/class.cue-sync.php

    r1531870 r1534436  
    156156     * @return array products ready to be sent to cue app
    157157     */
    158     private static function prepare_products($ids) {
     158    public static function prepare_products($ids) {
    159159        global $wpdb;
    160160
     
    182182        $updated = array();
    183183        foreach ($products as $product) {
    184        
    185             $p = array();
    186 
    187             if (!$categories = wp_get_post_terms($product['sku'], 'product_cat', array( 'fields' => 'names'))) {
    188                 $categories[0] = '';
    189             }
    190184           
    191185            $product['description'] = self::strip_tags_shortcodes($product['description']);
     
    200194    }
    201195
    202     private static function get_slices_from_array($data, $slice_size)
     196    public static function get_slices_from_array($data, $slice_size)
    203197    {
    204198        $slices = array();
  • cue-connect/trunk/inc/class.cue.php

    r1488888 r1534436  
    5656                exit;
    5757            }
    58 
    5958        }
    6059
    6160        if (self::$_options['place_id'] && self::$_options['api_key']) {
    62             // Add Cue product HTML meta tags
    63             add_action('wp_head', array($this, 'cueMeta'));
    6461
    6562            // Add Cue frontend script
     
    7370            );
    7471
     72            add_action(
     73                'woocommerce_proceed_to_checkout',
     74                array($this, 'cartAddOB'),
     75                0
     76            );
     77
    7578            // Add converstion tracking code
    7679            add_action(
     
    9093    }
    9194
    92     public static function plugin_activate()
     95    public static function pluginActivate()
    9396    {
    9497        // Requirements
     
    105108     * Executed when the plugin is deactivated
    106109     */
    107     public static function plugin_deactivate() {
     110    public static function pluginDeactivate()
     111    {
    108112        // Disable products synchronization cron
    109113        wp_clear_scheduled_hook('cue_sync_hook');
     
    120124     * Executed when the plugin is uninstalled
    121125     */
    122     public static function plugin_uninstall() {
     126    public static function pluginUninstall()
     127    {
    123128        // Erase Cue settings
    124129        wp_clear_scheduled_hook('cue_sync_hook');
     
    174179    }
    175180
    176     // private function addSyncCron()
    177     // {
    178     //     wp_clear_scheduled_hook('cue_sync_hook');
    179     //     wp_schedule_event(time(), 'twicedaily', 'cue_sync_hook');
    180     // }
    181 
    182181    public function mylistRewrite()
    183182    {
     
    205204    {
    206205        $reg_firstname = (!empty($_POST['reg_firstname']))?trim($_POST['reg_firstname']):'';
    207         $reg_lastname = (!empty($_POST['reg_lastname'] ))?trim($_POST['reg_lastname']):'';
     206        $reg_lastname = (!empty($_POST['reg_lastname']))?trim($_POST['reg_lastname']):'';
    208207        ?>
    209208
    210 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
    211     <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label>
    212     <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>">
    213 </p>
    214 
    215 <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
    216     <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label>
    217     <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>">
    218 </p>
     209        <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
     210            <label for="reg_firstname">First Name<!--<span class="required">*</span> --></label>
     211            <input type="text" name="reg_firstname" id="reg_firstname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_firstname ?>">
     212        </p>
     213
     214        <p class="woocommerce-FormRow woocommerce-FormRow--wide form-row form-row-wide">
     215            <label for="reg_lastname">Last Name<!-- <span class="required">*</span> --></label>
     216            <input type="text" name="reg_lastname" id="reg_lastname" class="woocommerce-Input woocommerce-Input--text input-text" value="<?php echo $reg_lastname ?>">
     217        </p>
    219218
    220219        <?php
     
    240239        ?>
    241240
    242 <div class="cue-wrapper" style="margin: 1em 0">
    243 <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
    244 <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
    245 <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
    246 </div>
     241        <div class="cue-wrapper" style="margin: 1em 0">
     242        <div style="display: inline-block; margin-right: 1em;" class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     243        <div style="display: inline-block; margin-right: 1em;" class="cue-cueit" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     244        <div style="display: inline-block;" class="cue-learnmore" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     245        </div>
    247246
    248247        <?php
    249248    }
    250249
    251     public function cueMeta()
    252     {
    253         global $post;
    254         if (isset($post->post_type) && 'product' == $post->post_type && is_single()) {
    255             $description = CueSync::strip_tags_shortcodes($post->post_content);
    256 ?>
    257 
    258 <!-- CUE META START -->
    259 <meta property="og:url" content="<?php echo get_permalink($post->ID) ?>" />
    260 <meta property="og:title" content="<?php echo $post->post_title ?>" />
    261 <meta property="og:description" content="<?php echo $description ?>" />
    262 <meta property="og:image" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" />
    263 <meta property="og:type" content="website" />
    264 <meta name="cue:name" content="<?php echo $post->post_title ?>" />
    265 <meta name="cue:description" content="<?php echo $description ?>" />
    266 <meta name="cue:image_url" content="<?php echo get_the_post_thumbnail_url($post->ID, 'post-thumbnail'); ?>" />
    267 <meta name="cue:sku" content="<?php echo $post->ID ?>" />
    268 <meta name="cue:url" content="<?php echo get_permalink($post->ID) ?>" />
    269 <meta name="cue:price" content="<?php echo get_post_meta($post->ID, '_price', true); ?>" />
    270 <!-- CUE META END -->
    271 
    272 <?php
    273 
    274         }
     250    public function cartAddOB()
     251    {
     252        $items = array();
     253
     254        global $woocommerce;
     255        $items = $woocommerce->cart->get_cart();
     256
     257        // bail if no items in cart
     258        if (!count($items)) {
     259            return;
     260        }
     261
     262        $item = reset($items);
     263        $imiSku = $item['data']->post->ID;
     264        $cid = is_user_logged_in();
     265
     266        ?>
     267       
     268        <style>.cue-wrapper iframe{margin:0;padding:0;}.cue-wrapper>* {display:inline-block}</style>
     269
     270        <div class="cue-wrapper" style="margin:1em 0; clear:both;">
     271            <div class="cue-onebutton" data-imisku="<?php echo $imiSku;?>" data-cid="<?php echo $cid; ?>"></div>
     272        </div>
     273
     274        <?php
    275275    }
    276276
     
    296296    /**
    297297     * Renders tracking pixel gif image.
    298      * Url format: 
     298     * Url format:
    299299     * //api.cueconnect.com/imi/cart_track/json?
    300300     *      api_key=XXX
     
    343343        return $url;
    344344    }
    345 
    346345}
  • cue-connect/trunk/readme.txt

    r1488760 r1534436  
    66WC requires at least: 1.6
    77WC tested up to: 2.6.4
    8 Stable tag: 1.0.6
     8Stable tag: 1.0.7
    99License: GPLv3 or later License
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9393== Changelog ==
    9494
     95= 1.0.7 =
     96* Removed meta tags used for product syncronizations
     97* Updated css for My List page
     98
    9599= 1.0.6 =
    96100* Updates to products syncronization process
  • cue-connect/trunk/templates/mylist.php

    r1488760 r1534436  
    55
    66?>
     7
     8<style>
     9.cue-mylist-wrapper {
     10    max-width: 1000px;
     11    width:100%;
     12    margin: 2em auto;
     13}
     14</style>
    715
    816<div class="cue-mylist-wrapper">
Note: See TracChangeset for help on using the changeset viewer.