Changeset 2161136
- Timestamp:
- 09/23/2019 03:56:19 AM (7 years ago)
- Location:
- subscribility
- Files:
-
- 2 added
- 6 edited
- 36 copied
-
tags/2.9.10 (copied) (copied from subscribility/trunk)
-
tags/2.9.10/composer.json (copied) (copied from subscribility/trunk/composer.json)
-
tags/2.9.10/composer.lock (copied) (copied from subscribility/trunk/composer.lock)
-
tags/2.9.10/includes/admin/assets/js/wp99234-intercom.js (added)
-
tags/2.9.10/includes/admin/controllers/class-wp99234-admin-settings-data-collection.php (copied) (copied from subscribility/trunk/includes/admin/controllers/class-wp99234-admin-settings-data-collection.php)
-
tags/2.9.10/includes/admin/controllers/class-wp99234-admin.php (copied) (copied from subscribility/trunk/includes/admin/controllers/class-wp99234-admin.php)
-
tags/2.9.10/includes/admin/views/html-admin-operations-activity.php (copied) (copied from subscribility/trunk/includes/admin/views/html-admin-operations-activity.php)
-
tags/2.9.10/includes/frontend/assets/css/wp99234_frontend.css (copied) (copied from subscribility/trunk/includes/frontend/assets/css/wp99234_frontend.css)
-
tags/2.9.10/includes/frontend/assets/js/jquery.ba-throttle-debounce.js (copied) (copied from subscribility/trunk/includes/frontend/assets/js/jquery.ba-throttle-debounce.js)
-
tags/2.9.10/includes/frontend/assets/js/wp99234_checkout.js (copied) (copied from subscribility/trunk/includes/frontend/assets/js/wp99234_checkout.js)
-
tags/2.9.10/includes/frontend/assets/js/wp99234_frontend.js (copied) (copied from subscribility/trunk/includes/frontend/assets/js/wp99234_frontend.js)
-
tags/2.9.10/includes/frontend/assets/websocket_script.php (copied) (copied from subscribility/trunk/includes/frontend/assets/websocket_script.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-clubs.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-clubs.php) (4 diffs)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-forms.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-forms.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-orders.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-orders.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-products.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-products.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-registration-forms.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-registration-forms.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-template.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-template.php) (1 diff)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-users.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-users.php) (1 diff)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-wc-filter.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-filter.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-wc-payment-gateway.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-payment-gateway.php)
-
tags/2.9.10/includes/frontend/controllers/class-wp99234-wc-shipping-method.php (copied) (copied from subscribility/trunk/includes/frontend/controllers/class-wp99234-wc-shipping-method.php)
-
tags/2.9.10/includes/frontend/views/newsletter_form.php (copied) (copied from subscribility/trunk/includes/frontend/views/newsletter_form.php)
-
tags/2.9.10/includes/frontend/views/rating.php (copied) (copied from subscribility/trunk/includes/frontend/views/rating.php)
-
tags/2.9.10/includes/frontend/views/registration_form.php (copied) (copied from subscribility/trunk/includes/frontend/views/registration_form.php) (2 diffs)
-
tags/2.9.10/readme.txt (copied) (copied from subscribility/trunk/readme.txt) (2 diffs)
-
tags/2.9.10/uninstall.php (copied) (copied from subscribility/trunk/uninstall.php)
-
tags/2.9.10/vendor/autoload.php (copied) (copied from subscribility/trunk/vendor/autoload.php)
-
tags/2.9.10/vendor/composer/ClassLoader.php (copied) (copied from subscribility/trunk/vendor/composer/ClassLoader.php)
-
tags/2.9.10/vendor/composer/LICENSE (copied) (copied from subscribility/trunk/vendor/composer/LICENSE)
-
tags/2.9.10/vendor/composer/autoload_files.php (copied) (copied from subscribility/trunk/vendor/composer/autoload_files.php)
-
tags/2.9.10/vendor/composer/autoload_psr4.php (copied) (copied from subscribility/trunk/vendor/composer/autoload_psr4.php)
-
tags/2.9.10/vendor/composer/autoload_real.php (copied) (copied from subscribility/trunk/vendor/composer/autoload_real.php)
-
tags/2.9.10/vendor/composer/autoload_static.php (copied) (copied from subscribility/trunk/vendor/composer/autoload_static.php)
-
tags/2.9.10/vendor/composer/installed.json (copied) (copied from subscribility/trunk/vendor/composer/installed.json)
-
tags/2.9.10/vendor/inacho (copied) (copied from subscribility/trunk/vendor/inacho)
-
tags/2.9.10/wp99234.php (copied) (copied from subscribility/trunk/wp99234.php) (4 diffs)
-
trunk/includes/admin/assets/js/wp99234-intercom.js (added)
-
trunk/includes/frontend/controllers/class-wp99234-clubs.php (modified) (4 diffs)
-
trunk/includes/frontend/controllers/class-wp99234-template.php (modified) (1 diff)
-
trunk/includes/frontend/controllers/class-wp99234-users.php (modified) (1 diff)
-
trunk/includes/frontend/views/registration_form.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp99234.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
subscribility/tags/2.9.10/includes/frontend/controllers/class-wp99234-clubs.php
r2150532 r2161136 64 64 $types = array(); 65 65 66 $total = count($results);66 $total = (integer)$results->count; 67 67 $progress = 0; 68 68 … … 78 78 79 79 update_option('wp99234_company_membership_types', $types); 80 81 // Update customer tags 82 self::setup_customer_tags(true); 80 83 81 84 if ($is_sse) { … … 121 124 /** 122 125 * Pull and save Customer tags 126 * @param bool $refresh 127 * @return bool 123 128 */ 124 public static function setup_customer_tags( )129 public static function setup_customer_tags($refresh = false) 125 130 { 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(); 128 134 $company_id = null; 129 135 $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; 130 139 131 140 foreach ($company_membership_types as $row) { … … 154 163 } 155 164 } 165 166 // Ready for DB upgrade 167 return true; 156 168 } 157 169 -
subscribility/tags/2.9.10/includes/frontend/controllers/class-wp99234-template.php
r2152205 r2161136 166 166 $featured_image = $product->tasting_item->url; 167 167 168 // Replace cloudinary image height to 600168 // Replace cloudinary image height to 300 169 169 $featured_image = preg_replace("/h_\d*/", 'h_300', $featured_image); 170 170 171 // Replace cloudinary image width to 600171 // Replace cloudinary image width to 300 172 172 $featured_image = preg_replace("/w_\d*/", 'w_300', $featured_image); 173 173 -
subscribility/tags/2.9.10/includes/frontend/controllers/class-wp99234-users.php
r2150532 r2161136 204 204 // Add the subs_id to the user meta 205 205 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 } 206 211 207 212 // 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 78 78 position: relative; 79 79 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; 93 92 } 94 93 … … 291 290 <div class="wp99234-section chosen-preferences"> 292 291 <h4>Add your preferences</h4> 293 <p>Tell us what you like</p>292 <p>Tell us about you</p> 294 293 295 294 <ul class="tags"> 296 295 <?php foreach($customer_tags as $tag): ?> 297 296 <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> 299 298 </li> 300 299 <?php endforeach; ?> -
subscribility/tags/2.9.10/readme.txt
r2152205 r2161136 3 3 Tags: troly,woocommerce,wine,wine clubs,craft beers 4 4 Requires at least: 4.9.0 5 Tested up to: 5.2. 26 Stable Tag: 2.9. 95 Tested up to: 5.2.3 6 Stable Tag: 2.9.10 7 7 PHP version: 7.0 and above 8 8 License: GPLv2 or later … … 70 70 71 71 ## 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 72 77 ###Version 2.9.9 73 78 - Fixed featured image not showing in Product page -
subscribility/tags/2.9.10/wp99234.php
r2152205 r2161136 4 4 * Plugin URI: https://wordpress.org/plugins/subscribility/ 5 5 * 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. 96 * Version: 2.9.10 7 7 * Author: Troly 8 8 * Author URI: https://troly.io … … 491 491 wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true ); 492 492 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 493 508 wp_enqueue_script( 'wp99234_admin' ); 494 509 } … … 522 537 523 538 foreach ($versions as $version) { 539 $to_upgrade = false; 524 540 switch ($version) { 525 541 case '1.1': … … 533 549 add_option('wp99234_newsletter_collect_mobile', 'no'); 534 550 add_option('wp99234_newsletter_collect_postcode', 'no'); 551 $to_upgrade = true; // set to upgrade DB immediately 535 552 case '1.2': 536 553 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 ); 538 560 } 539 561 } 540 update_option( 'wp99234_db_version', $current_version );541 562 } 542 563 -
subscribility/trunk/includes/frontend/controllers/class-wp99234-clubs.php
r2150532 r2161136 64 64 $types = array(); 65 65 66 $total = count($results);66 $total = (integer)$results->count; 67 67 $progress = 0; 68 68 … … 78 78 79 79 update_option('wp99234_company_membership_types', $types); 80 81 // Update customer tags 82 self::setup_customer_tags(true); 80 83 81 84 if ($is_sse) { … … 121 124 /** 122 125 * Pull and save Customer tags 126 * @param bool $refresh 127 * @return bool 123 128 */ 124 public static function setup_customer_tags( )129 public static function setup_customer_tags($refresh = false) 125 130 { 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(); 128 134 $company_id = null; 129 135 $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; 130 139 131 140 foreach ($company_membership_types as $row) { … … 154 163 } 155 164 } 165 166 // Ready for DB upgrade 167 return true; 156 168 } 157 169 -
subscribility/trunk/includes/frontend/controllers/class-wp99234-template.php
r2152205 r2161136 166 166 $featured_image = $product->tasting_item->url; 167 167 168 // Replace cloudinary image height to 600168 // Replace cloudinary image height to 300 169 169 $featured_image = preg_replace("/h_\d*/", 'h_300', $featured_image); 170 170 171 // Replace cloudinary image width to 600171 // Replace cloudinary image width to 300 172 172 $featured_image = preg_replace("/w_\d*/", 'w_300', $featured_image); 173 173 -
subscribility/trunk/includes/frontend/controllers/class-wp99234-users.php
r2150532 r2161136 204 204 // Add the subs_id to the user meta 205 205 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 } 206 211 207 212 // Add the last time this user was updated by subs to user meta -
subscribility/trunk/includes/frontend/views/registration_form.php
r2150532 r2161136 78 78 position: relative; 79 79 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; 93 92 } 94 93 … … 291 290 <div class="wp99234-section chosen-preferences"> 292 291 <h4>Add your preferences</h4> 293 <p>Tell us what you like</p>292 <p>Tell us about you</p> 294 293 295 294 <ul class="tags"> 296 295 <?php foreach($customer_tags as $tag): ?> 297 296 <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> 299 298 </li> 300 299 <?php endforeach; ?> -
subscribility/trunk/readme.txt
r2152205 r2161136 3 3 Tags: troly,woocommerce,wine,wine clubs,craft beers 4 4 Requires at least: 4.9.0 5 Tested up to: 5.2. 26 Stable Tag: 2.9. 95 Tested up to: 5.2.3 6 Stable Tag: 2.9.10 7 7 PHP version: 7.0 and above 8 8 License: GPLv2 or later … … 70 70 71 71 ## 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 72 77 ###Version 2.9.9 73 78 - Fixed featured image not showing in Product page -
subscribility/trunk/wp99234.php
r2152205 r2161136 4 4 * Plugin URI: https://wordpress.org/plugins/subscribility/ 5 5 * 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. 96 * Version: 2.9.10 7 7 * Author: Troly 8 8 * Author URI: https://troly.io … … 491 491 wp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC_VERSION, true ); 492 492 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 493 508 wp_enqueue_script( 'wp99234_admin' ); 494 509 } … … 522 537 523 538 foreach ($versions as $version) { 539 $to_upgrade = false; 524 540 switch ($version) { 525 541 case '1.1': … … 533 549 add_option('wp99234_newsletter_collect_mobile', 'no'); 534 550 add_option('wp99234_newsletter_collect_postcode', 'no'); 551 $to_upgrade = true; // set to upgrade DB immediately 535 552 case '1.2': 536 553 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 ); 538 560 } 539 561 } 540 update_option( 'wp99234_db_version', $current_version );541 562 } 542 563
Note: See TracChangeset
for help on using the changeset viewer.