Changeset 2070392
- Timestamp:
- 04/18/2019 04:54:10 AM (less than one hour ago)
- Location:
- humcommerce
- Files:
-
- 23 added
- 9 edited
-
tags/2.1.3 (added)
-
tags/2.1.3/LICENSE.txt (added)
-
tags/2.1.3/README.txt (added)
-
tags/2.1.3/admin (added)
-
tags/2.1.3/admin/class-humcommerce-admin.php (added)
-
tags/2.1.3/admin/class-humcommerce-settings.php (added)
-
tags/2.1.3/admin/css (added)
-
tags/2.1.3/admin/css/humcommerce-admin.css (added)
-
tags/2.1.3/admin/images (added)
-
tags/2.1.3/admin/images/icon.png (added)
-
tags/2.1.3/admin/images/logo.png (added)
-
tags/2.1.3/humcommerce-functions.php (added)
-
tags/2.1.3/humcommerce-settings.php (added)
-
tags/2.1.3/humcommerce.php (added)
-
tags/2.1.3/images (added)
-
tags/2.1.3/images/icon.png (added)
-
tags/2.1.3/images/logo.png (added)
-
tags/2.1.3/includes (added)
-
tags/2.1.3/includes/class-humcommerce-loader.php (added)
-
tags/2.1.3/includes/class-humcommerce.php (added)
-
tags/2.1.3/public (added)
-
tags/2.1.3/public/class-humcommerce-public.php (added)
-
tags/2.1.3/uninstall.php (added)
-
trunk/README.txt (modified) (1 diff)
-
trunk/admin/class-humcommerce-admin.php (modified) (1 diff)
-
trunk/admin/class-humcommerce-settings.php (modified) (1 diff)
-
trunk/admin/css/humcommerce-admin.css (modified) (3 diffs)
-
trunk/humcommerce.php (modified) (3 diffs)
-
trunk/includes/class-humcommerce-loader.php (modified) (1 diff)
-
trunk/includes/class-humcommerce.php (modified) (1 diff)
-
trunk/public/class-humcommerce-public.php (modified) (2 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
humcommerce/trunk/README.txt
r2068750 r2070392 1 1 === HumCommerce === 2 Contributors: humcommerce3 Tags: humcommerce, analytics, heatmaps, session recordings4 Requires at least: 3.0.15 Tested up to: 5.1.16 Requires PHP: 5.2.47 Stable tag: 2.1.2.1 8 License: GPLv2 or later9 License URI: http://www.gnu.org/licenses/gpl-2.0.html10 11 The ideal plugin for website visitor recordings, heatmaps, form analytics, A/B testing and more.12 13 == Description ==14 15 [HumCommerce](https://www.humcommerce.com) is a conversion rate optimization (CRO) tool. It provides behavioral analytics (visitor session recordings, Heatmaps, etc.) in addition to traditional analytics (traffic data, traffic source, etc.).16 17 This official HumCommerce extension enables seamless integration between your WooCommerce website and HumCommerce tool. Once integrated, HumCommerce tool will start tracking data of your WooCommerce store. Using this extension, you can also track e-commerce data such as revenue, conversion rate, number of sales, individual product performance, etc.18 19 = Key features of HumCommerce: =20 21 - Visitor Session Recordings - Record visitor sessions and observe what visitors are doing on your website. Find pain points on your website optimized for conversion.22 23 - Heatmaps - See how customers interact with your website. Heatmaps show visitor interaction (click, move, scroll data) for different devices.24 25 - Sales Funnels - Find problems in your sales funnels and optimize them for better conversions. Find at which stage do visitors abandon your website. Improve your funnel conversion rate to maximize profit.26 27 - A/B Testing - Set up A/B testing to compare two versions of a landing page. Compare landing pages to find which color schemes, buttons, or website copy works best to increase conversion rate.28 29 - Form Analytics - Form Analytics gives you powerful insights into how your visitors interact with the forms on your website. Boost form completion rate by adding/removing/editing form fields.30 31 = E-commerce insights like: =32 33 - Product performance - Know how your products are performing based on the revenue, product conversion rate, visits, etc. Product performance gives you an idea of which products should you be focussing on to improve sales.34 35 - Abandoned Carts - Get all the abandoned cart data. You can check how much percentage of your visitors end up abandoning the cart and how much revenue has been left in the cart.36 37 - Sales data - Get insights on your buyers. Know the source of every sale that happens on your website. Sales data can be analyzed to maximize conversions.38 39 This plugin provides a simple installation of HumCommerce on your WordPress website, by providing you instant access to all HumCommerce features.40 41 42 == Installation ==43 44 1. Download plugin.45 2. Upload plugin from Admin -> Plugins -> Add New -> Upload Plugin.46 47 = Manual Alternatives =48 1. Extract & upload `humcommerce.zip` to the `/wp-content/plugins/` directory49 2. Activate the plugin through the 'Plugins' menu in WordPress50 51 == Screenshots ==52 53 1. screenshot-1.png54 55 == Frequently Asked Questions ==56 57 = Do I need a HumCommerce account to use this plugin? =58 59 Yes. You can sign up for a [free HumCommerce plan](https://www.humcommerce.com/lifetime-free/) that provides access to all our features including heatmaps, session recordings/replays, and deep e-commerce integration tools and more.60 You can also check out HumComemrce premium plans like Beginner plan, Pro plan and Business plan.61 Confused about which plan to choose? Visit our [plan comparison page](https://www.humcommerce.com/pricing/) to know more.62 63 = Should I purchase a paid plan? =64 65 HumCommerce's paid services include more session recordings, more pageviews, priority support, and more.66 To learn more about the services we provide, visit our [plan comparison page](https://www.humcommerce.com/pricing?from=wporg).67 68 = What are the HumCommerce Terms of Use? =69 70 The full [terms of use are available here](https://www.humcommerce.com/terms-of-use/) along with other legal and privacy documentation. If you have further questions do not hesitate to reach out to our [support]([email protected]).71 72 = What is Site ID? =73 74 Login to your HumCommerce Account. Go to My Account. Click on Launch Dashboard button.75 The site id number is listed under Settings/Website/Manage in your HumDash administration panel.76 77 = How do I view my stats? =78 79 Once you've installed HumCommerce, you can launch our tool from the "Launch Dashboard" button on My Account page.2 2 Contributors: humcommerce 3 3 Tags: humcommerce, analytics, heatmaps, session recordings 4 4 Requires at least: 3.0.1 5 5 Tested up to: 5.1.1 6 6 Requires PHP: 5.2.4 7 7 Stable tag: 2.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 11 The ideal plugin for website visitor recordings, heatmaps, form analytics, A/B testing and more. 12 12 13 13 == Description == 14 14 15 15 [HumCommerce](https://www.humcommerce.com) is a conversion rate optimization (CRO) tool. It provides behavioral analytics (visitor session recordings, Heatmaps, etc.) in addition to traditional analytics (traffic data, traffic source, etc.). 16 16 17 17 This official HumCommerce extension enables seamless integration between your WooCommerce website and HumCommerce tool. Once integrated, HumCommerce tool will start tracking data of your WooCommerce store. Using this extension, you can also track e-commerce data such as revenue, conversion rate, number of sales, individual product performance, etc. 18 18 19 19 = Key features of HumCommerce: = 20 20 21 21 - Visitor Session Recordings - Record visitor sessions and observe what visitors are doing on your website. Find pain points on your website optimized for conversion. 22 22 23 23 - Heatmaps - See how customers interact with your website. Heatmaps show visitor interaction (click, move, scroll data) for different devices. 24 24 25 25 - Sales Funnels - Find problems in your sales funnels and optimize them for better conversions. Find at which stage do visitors abandon your website. Improve your funnel conversion rate to maximize profit. 26 26 27 27 - A/B Testing - Set up A/B testing to compare two versions of a landing page. Compare landing pages to find which color schemes, buttons, or website copy works best to increase conversion rate. 28 28 29 29 - Form Analytics - Form Analytics gives you powerful insights into how your visitors interact with the forms on your website. Boost form completion rate by adding/removing/editing form fields. 30 30 31 31 = E-commerce insights like: = 32 32 33 33 - Product performance - Know how your products are performing based on the revenue, product conversion rate, visits, etc. Product performance gives you an idea of which products should you be focussing on to improve sales. 34 34 35 35 - Abandoned Carts - Get all the abandoned cart data. You can check how much percentage of your visitors end up abandoning the cart and how much revenue has been left in the cart. 36 36 37 37 - Sales data - Get insights on your buyers. Know the source of every sale that happens on your website. Sales data can be analyzed to maximize conversions. 38 38 39 39 This plugin provides a simple installation of HumCommerce on your WordPress website, by providing you instant access to all HumCommerce features. 40 40 41 41 42 42 == Installation == 43 43 44 44 1. Download plugin. 45 45 2. Upload plugin from Admin -> Plugins -> Add New -> Upload Plugin. 46 46 47 47 = Manual Alternatives = 48 48 1. Extract & upload `humcommerce.zip` to the `/wp-content/plugins/` directory 49 49 2. Activate the plugin through the 'Plugins' menu in WordPress 50 50 51 51 == Screenshots == 52 52 53 53 1. screenshot-1.png 54 54 55 55 == Frequently Asked Questions == 56 56 57 57 = Do I need a HumCommerce account to use this plugin? = 58 58 59 59 Yes. You can sign up for a [free HumCommerce plan](https://www.humcommerce.com/lifetime-free/) that provides access to all our features including heatmaps, session recordings/replays, and deep e-commerce integration tools and more. 60 60 You can also check out HumComemrce premium plans like Beginner plan, Pro plan and Business plan. 61 61 Confused about which plan to choose? Visit our [plan comparison page](https://www.humcommerce.com/pricing/) to know more. 62 62 63 63 = Should I purchase a paid plan? = 64 64 65 65 HumCommerce's paid services include more session recordings, more pageviews, priority support, and more. 66 66 To learn more about the services we provide, visit our [plan comparison page](https://www.humcommerce.com/pricing?from=wporg). 67 67 68 68 = What are the HumCommerce Terms of Use? = 69 69 70 70 The full [terms of use are available here](https://www.humcommerce.com/terms-of-use/) along with other legal and privacy documentation. If you have further questions do not hesitate to reach out to our [support]([email protected]). 71 71 72 72 = What is Site ID? = 73 73 74 74 Login to your HumCommerce Account. Go to My Account. Click on Launch Dashboard button. 75 75 The site id number is listed under Settings/Website/Manage in your HumDash administration panel. 76 76 77 77 = How do I view my stats? = 78 78 79 79 Once you've installed HumCommerce, you can launch our tool from the "Launch Dashboard" button on My Account page. -
humcommerce/trunk/admin/class-humcommerce-admin.php
r2036908 r2070392 1 1 <?php 2 if (!defined('ABSPATH')) { 3 exit; // Exit if accessed directly. 2 /** 3 * The admin-specific functionality of the plugin. 4 * 5 * @since 1.0.0 6 * 7 * @package humcommerce 8 * @subpackage humcommerce/admin 9 */ 10 11 if ( ! defined( 'ABSPATH' ) ) { 12 exit; // Exit if accessed directly. 4 13 } 5 14 6 class Class_Humcommerce_Admin 7 { 15 /** 16 * The admin-specific functionality of the plugin. 17 * 18 * Defines the plugin name, version, and two examples hooks for how to 19 * enqueue the admin-specific stylesheet and JavaScript. 20 * 21 * @package humcommerce 22 * @subpackage humcommerce/admin 23 */ 24 class Humcommerce_Admin { 8 25 9 private $humcommerce; 26 /** 27 * The name of this plugin. 28 * 29 * @since 1.0.0 30 * @access private 31 * @var string $humcommerce The name of this plugin. 32 */ 33 private $humcommerce; 10 34 11 private $version; 35 /** 36 * The version of this plugin. 37 * 38 * @since 1.0.0 39 * @access private 40 * @var string $version The current version of this plugin. 41 */ 42 private $version; 12 43 13 public function __construct($humcommerce, $version) 14 { 44 /** 45 * Initialize the class and set its properties. 46 * 47 * @since 1.0.0 48 * @param string $humcommerce The name of this plugin. 49 * @param string $version The version of this plugin. 50 */ 51 public function __construct( $humcommerce, $version ) { 15 52 16 $this->humcommerce = $humcommerce;17 $this->version= $version;53 $this->humcommerce = $humcommerce; 54 $this->version = $version; 18 55 19 }56 } 20 57 21 public function enqueue_styles() 22 { 58 /** 59 * Register the stylesheets for the admin area. 60 * 61 * @since 1.0.0 62 */ 63 public function enqueue_styles() { 23 64 24 wp_enqueue_style($this->humcommerce, plugin_dir_url(__FILE__) . 'css/humcommerce-admin.css', array(), $this->version, 'all');65 wp_enqueue_style( $this->humcommerce, plugin_dir_url( __FILE__ ) . 'css/humcommerce-admin.css', array(), $this->version, 'all' ); 25 66 26 }67 } 27 68 28 public function enqueue_scripts() 29 { 69 /** 70 * Register the JavaScript for the admin area. 71 * 72 * @since 1.0.0 73 */ 74 public function enqueue_scripts() { 30 75 31 wp_enqueue_script($this->humcommerce, plugin_dir_url(__FILE__) . 'js/humcommerce-admin.js', array('jquery'), $this->version, false);76 wp_enqueue_script( $this->humcommerce, plugin_dir_url( __FILE__ ) . 'js/humcommerce-admin.js', array( 'jquery' ), $this->version, false ); 32 77 33 }78 } 34 79 35 80 -
humcommerce/trunk/admin/class-humcommerce-settings.php
r2036919 r2070392 1 1 <?php 2 2 /** 3 * Created by PhpStorm. 4 * User: nalin 5 * Date: 2019-02-20 6 * Time: 11:29 3 * The admin-specific settings of the plugin. 4 * 5 * @since 1.0.0 6 * 7 * @package humcommerce 8 * @subpackage humcommerce/admin 7 9 */ 8 10 9 class Class_Humcommerce_Settings 10 { 11 private $options; 12 13 public function __construct() 14 { 15 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); 16 add_action( 'admin_init', array( $this, 'page_init' ) ); 17 } 18 19 /** 20 * Add options page 21 */ 22 public function add_plugin_page() 23 { 24 add_menu_page( 25 'HumCommerce Settings', 26 'HumCommerce', 27 'administrator', 28 'humcommerce-settings', 29 array($this, 'create_admin_page'), 30 esc_url(plugins_url('images/icon.png', __FILE__)) 31 ); 32 33 } 34 35 /** 36 * Options page callback 37 */ 38 public function create_admin_page() 39 { 40 // Set class property 41 $this->options = get_option( 'humcommerce_options' ); 42 ?> 43 <div id="humcommerce-plugin-container"> 44 <div class="humcommerce-masthead"> 45 <div class="humcommerce-masthead__inside-container"> 46 <div class="humcommerce-masthead__logo-container"> 47 <img class="humcommerce-masthead__logo" 48 src="<?php echo plugins_url('/images/logo.png', __FILE__); ?>" alt="humcommerce"> 49 </div> 50 </div> 51 </div> 52 <div class="humcommerce-lower"> 53 54 <div class="humcommerce-box"> 55 <h2>Record visitors on your site</h2> 56 <p>Select one of the options below to get started.</p> 57 </div> 58 <div class="humcommerce-boxes"> 59 <div class="humcommerce-box"> 60 <h3>Activate HumCommerce</h3> 61 <div class="humcommerce-right"> 62 <form name="humcommerce_activate" action="https://www.humcommerce.com/" method="POST" 63 target="_blank"> 64 <input type="hidden" name="redirect" value="plugin-signup"> 65 <input type="submit" class="humcommerce-button humcommerce-is-primary" 66 value="Get your site ID"> 67 </form> 68 </div> 69 <p>Log in or sign up now.</p> 70 </div> 71 <div class="humcommerce-box"> 72 <div class="icon32" id="icon-options-general"><br></div> 73 <form action="options.php" method="post"> 74 <?php 75 if (function_exists('wp_nonce_field')) 76 wp_nonce_field('humcommerce-action_' . "yep"); 77 ?> 78 <?php settings_fields('humcommerce_options'); ?> 79 <?php do_settings_sections(__FILE__); ?> 80 <p class="submit"> 81 <input name="Submit" type="submit" class="humcommerce-button" 82 value="<?php esc_attr_e('Save Changes'); ?>"/> 83 </p> 84 </form> 85 </div> 86 </div> 87 </div> 88 </div> 89 <?php 90 } 91 92 /** 93 * Register and add settings 94 */ 95 public function page_init() 96 { 97 register_setting( 98 'humcommerce_options', 99 'humcommerce_options', 100 array($this, 'humcommerce_options_validate') 101 ); 102 103 add_settings_section('main_section', 104 '', 105 array($this, 'section_text_fn'), 106 __FILE__ 107 ); 108 109 add_settings_field('si', 110 'Your site ID:', 111 array($this, 'setting_si_fn'), 112 __FILE__, 113 'main_section'); 114 115 add_settings_field( 116 'host', 117 '', 118 array($this, 'setting_host_fn'), 119 __FILE__, 120 'main_section' 121 ); 122 } 123 124 /** 125 * Print the Section text 126 */ 127 function section_text_fn() 128 { 129 echo ' 11 /** 12 * The admin-specific settings of the plugin. 13 * 14 * Defines plugin settings, fetch options saved for the plugin, validate input. 15 * 16 * @since 1.0.0 17 * 18 * @package humcommerce 19 * @subpackage humcommerce/admin 20 */ 21 class Humcommerce_Settings { 22 23 /** 24 * The options for this plugin. 25 * 26 * @since 1.0.0 27 * @access private 28 * @var string $options The current options for this plugin. 29 */ 30 private $options; 31 32 /** 33 * Initialize the class. 34 * 35 * @since 1.0.0 36 */ 37 public function __construct() { 38 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); 39 add_action( 'admin_init', array( $this, 'page_init' ) ); 40 } 41 42 /** 43 * Add options page. 44 * 45 * @since 1.0.0 46 */ 47 public function add_plugin_page() { 48 add_menu_page( 49 'HumCommerce Settings', 50 'HumCommerce', 51 'administrator', 52 'humcommerce-settings', 53 array( $this, 'create_admin_page' ), 54 esc_url( plugins_url( 'images/icon.png', __FILE__ ) ) 55 ); 56 57 } 58 59 /** 60 * Options page callback. 61 * 62 * @since 1.0.0 63 */ 64 public function create_admin_page() { 65 // Set class property. 66 $this->options = get_option( 'humcommerce_options' ); 67 ?> 68 <div id="humcommerce-plugin-container"> 69 <div class="humcommerce-masthead"> 70 <div class="humcommerce-masthead__inside-container"> 71 <div class="humcommerce-masthead__logo-container"> 72 <img class="humcommerce-masthead__logo" src="<?php echo esc_url( plugins_url( '/images/logo.png', __FILE__ ) ); ?>" alt="humcommerce"> 73 </div> 74 </div> 75 </div> 76 <div class="humcommerce-lower"> 77 78 <div class="humcommerce-box"> 79 <h2>Record visitors on your site</h2> 80 <p>Select one of the options below to get started.</p> 81 </div> 82 <div class="humcommerce-boxes"> 83 <div class="humcommerce-box"> 84 <h3>Activate HumCommerce</h3> 85 <div class="humcommerce-right"> 86 <form name="humcommerce_activate" action="https://www.humcommerce.com/" method="POST" target="_blank"> 87 <input type="hidden" name="redirect" value="plugin-signup"> 88 <input type="submit" class="humcommerce-button humcommerce-is-primary" value="Get your site ID"> 89 </form> 90 </div> 91 <p>Log in or sign up now.</p> 92 </div> 93 <div class="humcommerce-box"> 94 <div class="icon32" id="icon-options-general"><br></div> 95 <form action="options.php" method="post"> 96 <?php 97 if ( function_exists( 'wp_nonce_field' ) ) { 98 wp_nonce_field( 'humcommerce-action_yep' ); 99 } 100 ?> 101 <?php settings_fields( 'humcommerce_options' ); ?> 102 <?php do_settings_sections( __FILE__ ); ?> 103 <p class="submit"> 104 <input name="Submit" type="submit" class="humcommerce-button" value="<?php esc_attr_e( 'Save Changes' ); ?>"/> 105 </p> 106 </form> 107 </div> 108 </div> 109 </div> 110 </div> 111 <?php 112 } 113 114 /** 115 * Register and add settings. 116 * 117 * @since 1.0.0 118 */ 119 public function page_init() { 120 register_setting( 121 'humcommerce_options', 122 'humcommerce_options', 123 array( $this, 'humcommerce_options_validate' ) 124 ); 125 126 add_settings_section( 127 'main_section', 128 '', 129 array( $this, 'section_text_fn' ), 130 __FILE__ 131 ); 132 133 add_settings_field( 134 'si', 135 'Your site ID:', 136 array( $this, 'setting_si_fn' ), 137 __FILE__, 138 'main_section' 139 ); 140 141 add_settings_field( 142 'host', 143 '', 144 array( $this, 'setting_host_fn' ), 145 __FILE__, 146 'main_section' 147 ); 148 } 149 150 /** 151 * Print the Section text. 152 * 153 * @since 1.0.0 154 */ 155 public function section_text_fn() { 156 echo ' 130 157 <h3>Or enter your site ID</h3> 131 158 <p>Already have your site ID? Enter it here. <a href="https://www.humcommerce.com/docs/find-site-id-humcommmerce-tool/" target="_blank">(What is site ID?)</a></p> 132 159 '; 133 } 134 135 /* 136 * Get site ID from option array and print its value 137 */ 138 public function setting_si_fn() 139 { 140 echo "<input required id='si' class='regular-text code' style='flex-grow: 1; margin-right: 1rem;' name='humcommerce_options[si]' size='40' type='number' value='{$this->options['si']}' />"; 141 } 142 143 /* 144 * Get HumCommerce Host from options array and prints its value 145 */ 146 function setting_host_fn() 147 { 148 echo "<input hidden id='host' class='regular-text code' style='flex-grow: 1; margin-right: 1rem;' name='humcommerce_options[host]' size='40' value='app.humdash.com' />"; 149 } 150 151 function humcommerce_options_validate($input) 152 { 153 if (empty($input['si'])) { 154 add_settings_error('humcommerce_options', 'error_code', 'Please enter Site ID.'); 155 } else { 156 $input['si'] = wp_filter_nohtml_kses($input['si']); 157 if (!is_numeric($input['si'])) { 158 sanitize_text_field($input['si']); 159 add_settings_error('humcommerce_options', 'error_code', 'Please enter valid Site ID.'); 160 $input['si'] = ''; 161 } 162 } 163 return $input; 164 } 160 } 161 162 /** 163 * Get site ID from option array and print its value. 164 * 165 * @since 1.0.0 166 */ 167 public function setting_si_fn() { 168 echo "<input required id='si' class='regular-text code' style='flex-grow: 1; margin-right: 1rem;' name='humcommerce_options[si]' size='40' type='number' value='" . esc_attr( $this->options['si'] ) . "' />"; 169 } 170 171 /** 172 * Get HumCommerce Host from options array and prints its value. 173 * 174 * @since 1.0.0 175 */ 176 public function setting_host_fn() { 177 echo "<input hidden id='host' class='regular-text code' style='flex-grow: 1; margin-right: 1rem;' name='humcommerce_options[host]' size='40' value='app.humdash.com' />"; 178 } 179 180 /** 181 * Validate input with options. 182 * 183 * @since 1.0.0 184 * 185 * @param string $input Input to validate. 186 * 187 * @return mixed 188 */ 189 public function humcommerce_options_validate( $input ) { 190 if ( empty( $input['si'] ) ) { 191 add_settings_error( 'humcommerce_options', 'error_code', 'Please enter Site ID.' ); 192 } else { 193 $input['si'] = wp_filter_nohtml_kses( $input['si'] ); 194 if ( ! is_numeric( $input['si'] ) ) { 195 sanitize_text_field( $input['si'] ); 196 add_settings_error( 'humcommerce_options', 'error_code', 'Please enter valid Site ID.' ); 197 $input['si'] = ''; 198 } 199 } 200 return $input; 201 } 165 202 } 166 203 167 if( is_admin() ) 168 $my_settings_page = new Class_Humcommerce_Settings(); 204 if ( is_admin() ) { 205 $my_settings_page = new Humcommerce_Settings(); 206 } -
humcommerce/trunk/admin/css/humcommerce-admin.css
r1904986 r2070392 1 1 .wp-admin.jetpack_page_humcommerce-key-config, .wp-admin.settings_page_humcommerce-key-config { 2 background-color: #f3f6f8;2 background-color: #f3f6f8; 3 3 } 4 4 5 5 #submitted-on { 6 position: relative;6 position: relative; 7 7 } 8 8 9 9 #the-comment-list .author .humcommerce-user-comment-count { 10 display: inline;10 display: inline; 11 11 } 12 12 13 13 #the-comment-list .author a span { 14 text-decoration: none;15 color: #999;14 text-decoration: none; 15 color: #999; 16 16 } 17 17 18 18 #the-comment-list .author a span.humcommerce-span-link { 19 text-decoration: inherit;20 color: inherit;19 text-decoration: inherit; 20 color: inherit; 21 21 } 22 22 23 23 #the-comment-list .humcommerce_remove_url { 24 margin-left: 3px;25 color: #999;26 padding: 2px 3px 2px 0;24 margin-left: 3px; 25 color: #999; 26 padding: 2px 3px 2px 0; 27 27 } 28 28 29 29 #the-comment-list .humcommerce_remove_url:hover { 30 color: #A7301F;31 font-weight: bold;32 padding: 2px 2px 2px 0;30 color: #A7301F; 31 font-weight: bold; 32 padding: 2px 2px 2px 0; 33 33 } 34 34 35 35 #dashboard_recent_comments .humcommerce-status { 36 display: none;36 display: none; 37 37 } 38 38 39 39 .humcommerce-status { 40 float: right;40 float: right; 41 41 } 42 42 43 43 .humcommerce-status a { 44 color: #AAA;45 font-style: italic;44 color: #AAA; 45 font-style: italic; 46 46 } 47 47 48 48 table.comments td.comment p a { 49 text-decoration: underline;49 text-decoration: underline; 50 50 } 51 51 52 52 table.comments td.comment p a:after { 53 content: attr(href);54 color: #aaa;55 display: inline-block; /* Show the URL without the link's underline extending under it. */56 padding: 0 1ex; /* Because it's inline block, we can't just use spaces in the content: attribute to separate it from the link text. */53 content: attr(href); 54 color: #aaa; 55 display: inline-block; /* Show the URL without the link's underline extending under it. */ 56 padding: 0 1ex; /* Because it's inline block, we can't just use spaces in the content: attribute to separate it from the link text. */ 57 57 } 58 58 59 59 .mshot-arrow { 60 width: 0;61 height: 0;62 border-top: 10px solid transparent;63 border-bottom: 10px solid transparent;64 border-right: 10px solid #5C5C5C;65 position: absolute;66 left: -6px;67 top: 91px;60 width: 0; 61 height: 0; 62 border-top: 10px solid transparent; 63 border-bottom: 10px solid transparent; 64 border-right: 10px solid #5C5C5C; 65 position: absolute; 66 left: -6px; 67 top: 91px; 68 68 } 69 69 70 70 .mshot-container { 71 background: #5C5C5C;72 position: absolute;73 top: -94px;74 padding: 7px;75 width: 450px;76 height: 338px;77 z-index: 20000;78 -moz-border-radius: 6px;79 border-radius: 6px;80 -webkit-border-radius: 6px;71 background: #5C5C5C; 72 position: absolute; 73 top: -94px; 74 padding: 7px; 75 width: 450px; 76 height: 338px; 77 z-index: 20000; 78 -moz-border-radius: 6px; 79 border-radius: 6px; 80 -webkit-border-radius: 6px; 81 81 } 82 82 83 83 .humcommerce-mshot { 84 position: absolute;85 z-index: 100;84 position: absolute; 85 z-index: 100; 86 86 } 87 87 88 88 .humcommerce-mshot .mshot-image { 89 margin: 0;90 height: 338px;91 width: 450px;89 margin: 0; 90 height: 338px; 91 width: 450px; 92 92 } 93 93 94 94 .checkforspam { 95 display: inline-block !important;95 display: inline-block !important; 96 96 } 97 97 98 98 .checkforspam-progress { 99 padding-left: 1ex;100 display: none;99 padding-left: 1ex; 100 display: none; 101 101 } 102 102 103 103 .checkforspam.button-disabled .checkforspam-progress { 104 display: inline;104 display: inline; 105 105 } 106 106 107 107 .checkforspam-spinner { 108 display: inline-block;109 margin-top: 7px;108 display: inline-block; 109 margin-top: 7px; 110 110 } 111 111 112 112 .humcommerce-right { 113 float: right;113 float: right; 114 114 } 115 115 116 116 .humcommerce-card .humcommerce-right { 117 margin: 1em 0;117 margin: 1em 0; 118 118 } 119 119 120 120 .humcommerce-alert-text { 121 color: #dd3d36;122 font-weight: bold;123 font-size: 120%;124 margin-top: .5rem;121 color: #dd3d36; 122 font-weight: bold; 123 font-size: 120%; 124 margin-top: .5rem; 125 125 } 126 126 127 127 .humcommerce-alert { 128 border: 1px solid #e5e5e5;129 padding: 0.4em 1em 1.4em 1em;130 border-radius: 3px;131 -webkit-border-radius: 3px;132 border-width: 1px;133 border-style: solid;128 border: 1px solid #e5e5e5; 129 padding: 0.4em 1em 1.4em 1em; 130 border-radius: 3px; 131 -webkit-border-radius: 3px; 132 border-width: 1px; 133 border-style: solid; 134 134 } 135 135 136 136 .humcommerce-alert h3.humcommerce-key-status { 137 color: #fff;138 margin: 1em 0 0.5em 0;137 color: #fff; 138 margin: 1em 0 0.5em 0; 139 139 } 140 140 141 141 .humcommerce-alert.humcommerce-critical { 142 background-color: #993300;142 background-color: #993300; 143 143 } 144 144 145 145 .humcommerce-alert.humcommerce-active { 146 background-color: #649316;146 background-color: #649316; 147 147 } 148 148 149 149 .humcommerce-alert p.humcommerce-key-status { 150 font-size: 24px;150 font-size: 24px; 151 151 } 152 152 153 153 .humcommerce-alert p.humcommerce-description { 154 color: #fff;155 font-size: 14px;156 margin: 0 0;157 font-style: normal;154 color: #fff; 155 font-size: 14px; 156 margin: 0 0; 157 font-style: normal; 158 158 } 159 159 … … 162 162 .humcommerce-alert p.humcommerce-description a, 163 163 .humcommerce-alert p.humcommerce-description a { 164 color: #fff;164 color: #fff; 165 165 } 166 166 167 167 .humcommerce-new-snapshot { 168 margin-top: 1em;169 padding: 1em;170 text-align: center;171 background: #fff;168 margin-top: 1em; 169 padding: 1em; 170 text-align: center; 171 background: #fff; 172 172 } 173 173 174 174 .humcommerce-new-snapshot h3 { 175 background: #f5f5f5;176 color: #888;177 font-size: 11px;178 margin: 0;179 padding: 3px;175 background: #f5f5f5; 176 color: #888; 177 font-size: 11px; 178 margin: 0; 179 padding: 3px; 180 180 } 181 181 182 182 .new-snapspot ul { 183 font-size: 12px;184 width: 100%;183 font-size: 12px; 184 width: 100%; 185 185 } 186 186 187 187 .humcommerce-new-snapshot ul li { 188 color: #999;189 float: left;190 font-size: 11px;191 padding: 0 20px;192 text-transform: uppercase;193 width: 33%;194 box-sizing: border-box;195 -moz-box-sizing: border-box;196 -webkit-box-sizing: border-box;197 -ms-box-sizing: border-box;188 color: #999; 189 float: left; 190 font-size: 11px; 191 padding: 0 20px; 192 text-transform: uppercase; 193 width: 33%; 194 box-sizing: border-box; 195 -moz-box-sizing: border-box; 196 -webkit-box-sizing: border-box; 197 -ms-box-sizing: border-box; 198 198 } 199 199 200 200 .humcommerce-new-snapshot ul li:first-child, 201 201 .humcommerce-new-snapshot ul li:nth-child(2) { 202 border-right: 1px dotted #ccc;202 border-right: 1px dotted #ccc; 203 203 } 204 204 205 205 .humcommerce-new-snapshot ul li span { 206 color: #52accc;207 display: block;208 font-size: 32px;209 font-weight: lighter;210 line-height: 1.5em;206 color: #52accc; 207 display: block; 208 font-size: 32px; 209 font-weight: lighter; 210 line-height: 1.5em; 211 211 } 212 212 213 213 .humcommerce-settings th:first-child { 214 vertical-align: top;215 padding-top: 15px;214 vertical-align: top; 215 padding-top: 15px; 216 216 } 217 217 218 218 .humcommerce-settings th.humcommerce-api-key { 219 vertical-align: middle;220 padding-top: 0;219 vertical-align: middle; 220 padding-top: 0; 221 221 } 222 222 223 223 .humcommerce-settings input[type=text] { 224 width: 75%;224 width: 75%; 225 225 } 226 226 227 227 .humcommerce-settings span.humcommerce-note { 228 float: left;229 padding-left: 23px;230 font-size: 75%;231 margin-top: -10px;228 float: left; 229 padding-left: 23px; 230 font-size: 75%; 231 margin-top: -10px; 232 232 } 233 233 … … 236 236 */ 237 237 .humcommerce_activate { 238 min-width: 825px;239 border: 1px solid #4F800D;240 padding: 5px;241 margin: 15px 0;242 background: #83AF24;243 background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D));244 background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24);245 -moz-border-radius: 3px;246 border-radius: 3px;247 -webkit-border-radius: 3px;248 position: relative;249 overflow: hidden;238 min-width: 825px; 239 border: 1px solid #4F800D; 240 padding: 5px; 241 margin: 15px 0; 242 background: #83AF24; 243 background-image: -webkit-gradient(linear, 0% 0, 80% 100%, from(#83AF24), to(#4F800D)); 244 background-image: -moz-linear-gradient(80% 100% 120deg, #4F800D, #83AF24); 245 -moz-border-radius: 3px; 246 border-radius: 3px; 247 -webkit-border-radius: 3px; 248 position: relative; 249 overflow: hidden; 250 250 } 251 251 252 252 .humcommerce_activate .aa_a { 253 position: absolute;254 top: -5px;255 right: 10px;256 font-size: 140px;257 color: #769F33;258 font-family: Georgia, "Times New Roman", Times, serif;259 z-index: 1;253 position: absolute; 254 top: -5px; 255 right: 10px; 256 font-size: 140px; 257 color: #769F33; 258 font-family: Georgia, "Times New Roman", Times, serif; 259 z-index: 1; 260 260 } 261 261 262 262 .humcommerce_activate .aa_button { 263 font-weight: bold;264 border: 1px solid #029DD6;265 border-top: 1px solid #06B9FD;266 font-size: 15px;267 text-align: center;268 padding: 9px 0 8px 0;269 color: #FFF;270 background: #029DD6;271 background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));272 background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);273 -moz-border-radius: 2px;274 border-radius: 2px;275 -webkit-border-radius: 2px;276 width: 100%;277 cursor: pointer;278 margin: 0;263 font-weight: bold; 264 border: 1px solid #029DD6; 265 border-top: 1px solid #06B9FD; 266 font-size: 15px; 267 text-align: center; 268 padding: 9px 0 8px 0; 269 color: #FFF; 270 background: #029DD6; 271 background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1)); 272 background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6); 273 -moz-border-radius: 2px; 274 border-radius: 2px; 275 -webkit-border-radius: 2px; 276 width: 100%; 277 cursor: pointer; 278 margin: 0; 279 279 } 280 280 281 281 .humcommerce_activate .aa_button:hover { 282 text-decoration: none !important;283 border: 1px solid #029DD6;284 border-bottom: 1px solid #00A8EF;285 font-size: 15px;286 text-align: center;287 padding: 9px 0 8px 0;288 color: #F0F8FB;289 background: #0079B1;290 background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF));291 background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1);292 -moz-border-radius: 2px;293 border-radius: 2px;294 -webkit-border-radius: 2px;282 text-decoration: none !important; 283 border: 1px solid #029DD6; 284 border-bottom: 1px solid #00A8EF; 285 font-size: 15px; 286 text-align: center; 287 padding: 9px 0 8px 0; 288 color: #F0F8FB; 289 background: #0079B1; 290 background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#0079B1), to(#0092BF)); 291 background-image: -moz-linear-gradient(0% 100% 90deg, #0092BF, #0079B1); 292 -moz-border-radius: 2px; 293 border-radius: 2px; 294 -webkit-border-radius: 2px; 295 295 } 296 296 297 297 .humcommerce_activate .aa_button_border { 298 border: 1px solid #006699;299 -moz-border-radius: 2px;300 border-radius: 2px;301 -webkit-border-radius: 2px;302 background: #029DD6;303 background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1));304 background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6);298 border: 1px solid #006699; 299 -moz-border-radius: 2px; 300 border-radius: 2px; 301 -webkit-border-radius: 2px; 302 background: #029DD6; 303 background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#029DD6), to(#0079B1)); 304 background-image: -moz-linear-gradient(0% 100% 90deg, #0079B1, #029DD6); 305 305 } 306 306 307 307 .humcommerce_activate .aa_button_container { 308 display: inline-block;309 background: #DEF1B8;310 padding: 5px;311 -moz-border-radius: 2px;312 border-radius: 2px;313 -webkit-border-radius: 2px;314 width: 266px;308 display: inline-block; 309 background: #DEF1B8; 310 padding: 5px; 311 -moz-border-radius: 2px; 312 border-radius: 2px; 313 -webkit-border-radius: 2px; 314 width: 266px; 315 315 } 316 316 317 317 .humcommerce_activate .aa_description { 318 position: absolute;319 top: 22px;320 left: 285px;321 margin-left: 25px;322 color: #E5F2B1;323 font-size: 15px;324 z-index: 1000;318 position: absolute; 319 top: 22px; 320 left: 285px; 321 margin-left: 25px; 322 color: #E5F2B1; 323 font-size: 15px; 324 z-index: 1000; 325 325 } 326 326 327 327 .humcommerce_activate .aa_description strong { 328 color: #FFF;329 font-weight: normal;328 color: #FFF; 329 font-weight: normal; 330 330 } 331 331 332 332 .jetpack_page_humcommerce-key-config #wpcontent, .settings_page_humcommerce-key-config #wpcontent { 333 padding-left: 0;333 padding-left: 0; 334 334 } 335 335 336 336 .humcommerce-masthead { 337 background-color: #fff;338 text-align: center;339 box-shadow: 0 1px 0 rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3337 background-color: #fff; 338 text-align: center; 339 box-shadow: 0 1px 0 rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3 340 340 } 341 341 342 342 @media (max-width: 45rem) { 343 .humcommerce-masthead {344 padding: 0 1.25rem345 }343 .humcommerce-masthead { 344 padding: 0 1.25rem 345 } 346 346 } 347 347 348 348 .humcommerce-masthead__inside-container { 349 padding: .375rem 0;350 margin: 0 auto;351 width: 100%;352 max-width: 45rem;353 text-align: left;349 padding: .375rem 0; 350 margin: 0 auto; 351 width: 100%; 352 max-width: 45rem; 353 text-align: left; 354 354 } 355 355 356 356 .humcommerce-masthead__logo-container { 357 padding: 0.3125rem 0 0;357 padding: 0.3125rem 0 0; 358 358 } 359 359 360 360 .humcommerce-masthead__logo { 361 width: 8.375rem;362 height: 2.8125rem;361 width: 8.375rem; 362 height: 2.8125rem; 363 363 } 364 364 365 365 .humcommerce-masthead__logo-link { 366 display: inline-block;367 outline: none;368 vertical-align: middle366 display: inline-block; 367 outline: none; 368 vertical-align: middle 369 369 } 370 370 371 371 .humcommerce-masthead__logo-link:focus { 372 line-height: 0;373 box-shadow: 0 0 0 2px #78dcfa372 line-height: 0; 373 box-shadow: 0 0 0 2px #78dcfa 374 374 } 375 375 376 376 .humcommerce-masthead__logo-link + code { 377 margin: 0 10px;378 padding: 5px 9px;379 border-radius: 2px;380 background: #e6ecf1;381 color: #647a88377 margin: 0 10px; 378 padding: 5px 9px; 379 border-radius: 2px; 380 background: #e6ecf1; 381 color: #647a88 382 382 } 383 383 384 384 .humcommerce-masthead__links { 385 display: -ms-flexbox;386 display: flex;387 -ms-flex-flow: row wrap;388 flex-flow: row wrap;389 -ms-flex: 2 50%;390 flex: 2 50%;391 -ms-flex-pack: end;392 justify-content: flex-end;393 margin: 0385 display: -ms-flexbox; 386 display: flex; 387 -ms-flex-flow: row wrap; 388 flex-flow: row wrap; 389 -ms-flex: 2 50%; 390 flex: 2 50%; 391 -ms-flex-pack: end; 392 justify-content: flex-end; 393 margin: 0 394 394 } 395 395 396 396 @media (max-width: 480px) { 397 .humcommerce-masthead__links {398 padding-right: .625rem399 }397 .humcommerce-masthead__links { 398 padding-right: .625rem 399 } 400 400 } 401 401 402 402 .humcommerce-masthead__link-li { 403 margin: 0;404 padding: 0403 margin: 0; 404 padding: 0 405 405 } 406 406 407 407 .humcommerce-masthead__link { 408 font-style: normal;409 color: #0087be;410 padding: .625rem;411 display: inline-block408 font-style: normal; 409 color: #0087be; 410 padding: .625rem; 411 display: inline-block 412 412 } 413 413 414 414 .humcommerce-masthead__link:visited { 415 color: #0087be415 color: #0087be 416 416 } 417 417 418 418 .humcommerce-masthead__link:active, .humcommerce-masthead__link:hover { 419 color: #00aadc419 color: #00aadc 420 420 } 421 421 422 422 .humcommerce-masthead__link:hover { 423 text-decoration: underline423 text-decoration: underline 424 424 } 425 425 426 426 .humcommerce-masthead__link .dashicons { 427 display: none427 display: none 428 428 } 429 429 430 430 @media (max-width: 480px) { 431 .humcommerce-masthead__link:hover, .humcommerce-masthead__link:active {432 text-decoration: none433 }434 435 .humcommerce-masthead__link .dashicons {436 display: block;437 font-size: 1.75rem438 }439 440 .humcommerce-masthead__link span + span {441 display: none442 }431 .humcommerce-masthead__link:hover, .humcommerce-masthead__link:active { 432 text-decoration: none 433 } 434 435 .humcommerce-masthead__link .dashicons { 436 display: block; 437 font-size: 1.75rem 438 } 439 440 .humcommerce-masthead__link span + span { 441 display: none 442 } 443 443 } 444 444 445 445 .humcommerce-masthead__link-li:last-of-type .humcommerce-masthead__link { 446 padding-right: 0446 padding-right: 0 447 447 } 448 448 449 449 .humcommerce-lower { 450 margin: 0 auto;451 text-align: left;452 max-width: 45rem;453 padding: 1.5rem;450 margin: 0 auto; 451 text-align: left; 452 max-width: 45rem; 453 padding: 1.5rem; 454 454 } 455 455 456 456 .humcommerce-lower .notice { 457 margin-bottom: 2rem;457 margin-bottom: 2rem; 458 458 } 459 459 460 460 .humcommerce-card { 461 margin-top: 1rem;462 margin-bottom: 0;463 position: relative;464 margin: 0 auto 0.625rem auto;465 box-sizing: border-box;466 background: white;467 box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;461 margin-top: 1rem; 462 margin-bottom: 0; 463 position: relative; 464 margin: 0 auto 0.625rem auto; 465 box-sizing: border-box; 466 background: white; 467 box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; 468 468 } 469 469 470 470 .humcommerce-card:after, .humcommerce-card .inside:after, .humcommerce-masthead__logo-container:after { 471 content: ".";472 display: block;473 height: 0;474 clear: both;475 visibility: hidden;471 content: "."; 472 display: block; 473 height: 0; 474 clear: both; 475 visibility: hidden; 476 476 } 477 477 478 478 .humcommerce-card .inside { 479 padding: 1.5rem;480 padding-top: 1rem;479 padding: 1.5rem; 480 padding-top: 1rem; 481 481 } 482 482 483 483 .humcommerce-card .humcommerce-card-actions { 484 margin-top: 1rem;484 margin-top: 1rem; 485 485 } 486 486 487 487 .jetpack_page_humcommerce-key-config .update-nag, .settings_page_humcommerce-key-config .update-nag { 488 display: none;488 display: none; 489 489 } 490 490 491 491 .humcommerce-masthead .humcommerce-right { 492 line-height: 2.125rem;493 font-size: 0.9rem;492 line-height: 2.125rem; 493 font-size: 0.9rem; 494 494 } 495 495 496 496 .humcommerce-box { 497 box-sizing: border-box;498 background: white;499 border: 1px solid rgba(200, 215, 225, 0.5);497 box-sizing: border-box; 498 background: white; 499 border: 1px solid rgba(200, 215, 225, 0.5); 500 500 } 501 501 502 502 .humcommerce-box h2, .humcommerce-box h3 { 503 padding: 1.5rem 1.5rem .5rem 1.5rem;504 margin: 0;503 padding: 1.5rem 1.5rem .5rem 1.5rem; 504 margin: 0; 505 505 } 506 506 507 507 .humcommerce-box p { 508 padding: 0 1.5rem 1.5rem 1.5rem;509 margin: 0;508 padding: 0 1.5rem 1.5rem 1.5rem; 509 margin: 0; 510 510 } 511 511 512 512 .humcommerce-jetpack-email { 513 font-style: oblique;513 font-style: oblique; 514 514 } 515 515 516 516 .humcommerce-jetpack-gravatar { 517 padding: 0 0 0 1.5rem;518 float: left;519 margin-right: 1rem;520 width: 54px;521 height: 54px;517 padding: 0 0 0 1.5rem; 518 float: left; 519 margin-right: 1rem; 520 width: 54px; 521 height: 54px; 522 522 } 523 523 524 524 .humcommerce-box p:after { 525 content: ".";526 display: block;527 height: 0;528 clear: both;529 visibility: hidden;525 content: "."; 526 display: block; 527 height: 0; 528 clear: both; 529 visibility: hidden; 530 530 } 531 531 532 532 .humcommerce-box .humcommerce-right { 533 padding-right: 1.5rem;533 padding-right: 1.5rem; 534 534 } 535 535 536 536 .humcommerce-boxes .humcommerce-box { 537 margin-bottom: 0;538 padding: 0;539 margin-top: -1px;537 margin-bottom: 0; 538 padding: 0; 539 margin-top: -1px; 540 540 } 541 541 542 542 .humcommerce-boxes .humcommerce-box:last-child { 543 margin-bottom: 1.5rem;543 margin-bottom: 1.5rem; 544 544 } 545 545 546 546 .humcommerce-boxes .humcommerce-box:first-child { 547 margin-top: 1.5rem;547 margin-top: 1.5rem; 548 548 } 549 549 550 550 .humcommerce-button, .humcommerce-button:hover, .humcommerce-button:visited { 551 background: white;552 border-color: #c8d7e1;553 border-style: solid;554 border-width: 1px 1px 2px;555 color: #2e4453;556 cursor: pointer;557 display: inline-block;558 margin: 0;559 outline: 0;560 overflow: hidden;561 font-size: 14px;562 font-weight: 500;563 text-overflow: ellipsis;564 text-decoration: none;565 vertical-align: top;566 box-sizing: border-box;567 font-size: 14px;568 line-height: 21px;569 border-radius: 4px;570 padding: 7px 14px 9px;571 -webkit-appearance: none;572 -moz-appearance: none;573 appearance: none;551 background: white; 552 border-color: #c8d7e1; 553 border-style: solid; 554 border-width: 1px 1px 2px; 555 color: #2e4453; 556 cursor: pointer; 557 display: inline-block; 558 margin: 0; 559 outline: 0; 560 overflow: hidden; 561 font-size: 14px; 562 font-weight: 500; 563 text-overflow: ellipsis; 564 text-decoration: none; 565 vertical-align: top; 566 box-sizing: border-box; 567 font-size: 14px; 568 line-height: 21px; 569 border-radius: 4px; 570 padding: 7px 14px 9px; 571 -webkit-appearance: none; 572 -moz-appearance: none; 573 appearance: none; 574 574 } 575 575 576 576 .humcommerce-button:hover { 577 border-color: #a8bece;577 border-color: #a8bece; 578 578 } 579 579 580 580 .humcommerce-button:active { 581 border-width: 2px 1px 1px;581 border-width: 2px 1px 1px; 582 582 } 583 583 584 584 .humcommerce-is-primary, .humcommerce-is-primary:hover, .humcommerce-is-primary:visited { 585 background: #00aadc;586 border-color: #0087be;587 color: white;585 background: #00aadc; 586 border-color: #0087be; 587 color: white; 588 588 } 589 589 590 590 .humcommerce-is-primary:hover, .humcommerce-is-primary:focus { 591 border-color: #005082;591 border-color: #005082; 592 592 } 593 593 594 594 .humcommerce-is-primary:hover { 595 border-color: #005082;595 border-color: #005082; 596 596 } 597 597 598 598 .humcommerce-section-header { 599 position: relative;600 margin: 0 auto 0.625rem auto;601 padding: 1rem;602 box-sizing: border-box;603 box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3;604 background: #ffffff;605 width: 100%;606 padding-top: 0.6875rem;607 padding-bottom: 0.6875rem;608 display: flex;599 position: relative; 600 margin: 0 auto 0.625rem auto; 601 padding: 1rem; 602 box-sizing: border-box; 603 box-shadow: 0 0 0 1px rgba(200, 215, 225, 0.5), 0 1px 2px #e9eff3; 604 background: #ffffff; 605 width: 100%; 606 padding-top: 0.6875rem; 607 padding-bottom: 0.6875rem; 608 display: flex; 609 609 } 610 610 611 611 .humcommerce-section-header__label { 612 display: -ms-flexbox;613 display: flex;614 -ms-flex-align: center;615 align-items: center;616 -ms-flex-positive: 1;617 flex-grow: 1;618 line-height: 1.75rem;619 position: relative;620 font-size: 0.875rem;621 color: #4f748e;612 display: -ms-flexbox; 613 display: flex; 614 -ms-flex-align: center; 615 align-items: center; 616 -ms-flex-positive: 1; 617 flex-grow: 1; 618 line-height: 1.75rem; 619 position: relative; 620 font-size: 0.875rem; 621 color: #4f748e; 622 622 } 623 623 624 624 .humcommerce-section-header__actions { 625 line-height: 1.75rem;625 line-height: 1.75rem; 626 626 } 627 627 628 628 table.form-table { 629 padding: 0px 0px 0px 0px;630 margin: -18px 0px 0px 26px;629 padding: 0px 0px 0px 0px; 630 margin: -18px 0px 0px 26px; 631 631 } 632 632 633 633 #si { 634 width: 120px;634 width: 120px; 635 635 } 636 636 637 637 #humcommerce-plugin-container { 638 margin: 0 0 0 -20px;639 } 638 margin: 0 0 0 -20px; 639 } -
humcommerce/trunk/humcommerce.php
r2068750 r2070392 1 1 <?php 2 3 2 /** 4 3 * The plugin bootstrap file … … 16 15 * Plugin Name: HumCommerce 17 16 * Plugin URI: https://wordpress.org/plugins/humcommerce/ 18 * Description: HumCommerce Word press plugin to Record, Analyze & Convert your visitors.19 * Version: 2.1. 2.117 * Description: HumCommerce WordPress plugin to Record, Analyze & Convert your visitors. 18 * Version: 2.1.3 20 19 * Author: HumCommerce 21 20 * Author URI: https://www.humcommerce.com … … 25 24 * Domain Path: /languages 26 25 */ 27 if (!defined('ABSPATH')) { 28 exit; // Exit if accessed directly. 26 27 if ( ! defined( 'ABSPATH' ) ) { 28 exit; // Exit if accessed directly. 29 29 } 30 30 31 define( 'HUMCOMMERCE_VERSION', '2.1.2.1');31 define( 'HUMCOMMERCE_VERSION', '2.1.3' ); 32 32 33 33 34 require plugin_dir_path( __FILE__) . 'includes/class-humcommerce.php';34 require plugin_dir_path( __FILE__ ) . 'includes/class-humcommerce.php'; 35 35 36 function run_humcommerce() 37 { 38 39 $plugin = new Humcommerce(); 40 $plugin->run(); 36 /** 37 * Begins execution of the plugin. 38 * 39 * Since everything within the plugin is registered via hooks, 40 * then kicking off the plugin from this point in the file does 41 * not affect the page life cycle. 42 * 43 * @since 1.0.0 44 */ 45 function run_humcommerce() { 46 $plugin = new Humcommerce(); 47 $plugin->run(); 41 48 42 49 } -
humcommerce/trunk/includes/class-humcommerce-loader.php
r2036908 r2070392 1 1 <?php 2 2 /** 3 * Created by PhpStorm. 4 * User: nalin 5 * Date: 2019-02-20 6 * Time: 10:35 3 * Register all actions and filters for the plugin 4 * 5 * @since 1.0.0 6 * 7 * @package humcommerce 8 * @subpackage humcommerce/includes 7 9 */ 8 10 9 class Class_Humcommerce_Loader 10 { 11 protected $actions; 11 /** 12 * Register all actions and filters for the plugin 13 * 14 * @since 1.0.0 15 * 16 * Maintain a list of all hooks that are registered throughout 17 * the plugin, and register them with the WordPress API. Call the 18 * run function to execute the list of actions and filters. 19 * 20 * @package humcommerce 21 * @subpackage humcommerce/includes 22 */ 23 class Humcommerce_Loader { 12 24 13 protected $filters; 25 /** 26 * The array of actions registered with WordPress. 27 * 28 * @since 1.0.0 29 * @access protected 30 * @var array $actions The actions registered with WordPress to fire when the plugin loads. 31 */ 32 protected $actions; 14 33 15 public function __construct() 16 { 34 /** 35 * The array of filters registered with WordPress. 36 * 37 * @since 1.0.0 38 * @access protected 39 * @var array $filters The filters registered with WordPress to fire when the plugin loads. 40 */ 41 protected $filters; 17 42 18 $this->actions = array(); 19 $this->filters = array(); 43 /** 44 * Initialize the collections used to maintain the actions and filters. 45 * 46 * @since 1.0.0 47 */ 48 public function __construct() { 20 49 21 } 50 $this->actions = array(); 51 $this->filters = array(); 22 52 23 public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1) 24 { 25 $this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args); 26 } 53 } 27 54 28 private function add($hooks, $hook, $component, $callback, $priority, $accepted_args) 29 { 55 /** 56 * Add a new action to the collection to be registered with WordPress. 57 * 58 * @since 1.0.0 59 * @param string $hook The name of the WordPress action that is being registered. 60 * @param object $component A reference to the instance of the object on which the action is defined. 61 * @param string $callback The name of the function definition on the $component. 62 * @param int $priority Optional. The priority at which the function should be fired. Default is 10. 63 * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. 64 */ 65 public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { 66 $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args ); 67 } 30 68 31 $hooks[] = array( 32 'hook' => $hook, 33 'component' => $component, 34 'callback' => $callback, 35 'priority' => $priority, 36 'accepted_args' => $accepted_args 37 ); 69 /** 70 * A utility function that is used to register the actions and hooks into a single 71 * collection. 72 * 73 * @since 1.0.0 74 * @access private 75 * @param array $hooks The collection of hooks that is being registered (that is, actions or filters). 76 * @param string $hook The name of the WordPress filter that is being registered. 77 * @param object $component A reference to the instance of the object on which the filter is defined. 78 * @param string $callback The name of the function definition on the $component. 79 * @param int $priority The priority at which the function should be fired. 80 * @param int $accepted_args The number of arguments that should be passed to the $callback. 81 * @return array The collection of actions and filters registered with WordPress. 82 */ 83 private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { 38 84 39 return $hooks; 85 $hooks[] = array( 86 'hook' => $hook, 87 'component' => $component, 88 'callback' => $callback, 89 'priority' => $priority, 90 'accepted_args' => $accepted_args, 91 ); 40 92 41 } 93 return $hooks; 42 94 43 public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1) 44 { 45 $this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args); 46 } 95 } 47 96 48 public function run() 49 { 97 /** 98 * Add a new filter to the collection to be registered with WordPress. 99 * 100 * @since 1.0.0 101 * @param string $hook The name of the WordPress filter that is being registered. 102 * @param object $component A reference to the instance of the object on which the filter is defined. 103 * @param string $callback The name of the function definition on the $component. 104 * @param int $priority Optional. The priority at which the function should be fired. Default is 10. 105 * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1. 106 */ 107 public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) { 108 $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args ); 109 } 50 110 51 foreach ($this->filters as $hook) { 52 add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']); 53 } 111 /** 112 * Register the filters and actions with WordPress. 113 * 114 * @since 1.0.0 115 */ 116 public function run() { 54 117 55 foreach ($this->actions as $hook) {56 add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);57 }118 foreach ( $this->filters as $hook ) { 119 add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); 120 } 58 121 59 } 122 foreach ( $this->actions as $hook ) { 123 add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); 124 } 125 126 } 60 127 } -
humcommerce/trunk/includes/class-humcommerce.php
r2067623 r2070392 1 1 <?php 2 /** 3 * The file that defines the core plugin class. 4 * 5 * A class definition that includes attributes and functions used across both the 6 * public-facing side of the site and the admin area. 7 * 8 * @since 1.0.0 9 * 10 * @package humcommerce 11 * @subpackage humcommerce/includes 12 */ 2 13 3 class Humcommerce 4 { 14 /** 15 * The core plugin class. 16 * 17 * This is used to define internationalization, admin-specific hooks, and 18 * public-facing site hooks. 19 * 20 * Also maintains the unique identifier of this plugin as well as the current 21 * version of the plugin. 22 * 23 * @since 1.0.0 24 * @package humcommerce 25 * @subpackage humcommerce/includes 26 */ 27 class Humcommerce { 5 28 6 protected $loader; 29 /** 30 * The loader that's responsible for maintaining and registering all hooks that power 31 * the plugin. 32 * 33 * @since 1.1 34 * @access protected 35 * @var Humcommerce_Loader $loader Maintains and registers all hooks for the plugin. 36 */ 37 protected $loader; 7 38 8 protected $humcommerce; 39 /** 40 * The unique identifier of this plugin. 41 * 42 * @since 1.1 43 * @access protected 44 * @var string $humcommerce The string used to uniquely identify this plugin. 45 */ 46 protected $humcommerce; 9 47 10 protected $version; 48 /** 49 * The current version of the plugin. 50 * 51 * @since 1.1 52 * @access protected 53 * @var string $version The current version of the plugin. 54 */ 55 protected $version; 11 56 12 public function __construct() 13 { 14 if (defined('HUMCOMMERCE_VERSION')) { 15 $this->version = HUMCOMMERCE_VERSION; 16 } else { 17 $this->version = '1.0.0'; 18 } 19 $this->humcommerce = 'humcommerce'; 57 /** 58 * Define the core functionality of the plugin. 59 * 60 * Set the plugin name and the plugin version that can be used throughout the plugin. 61 * Load the dependencies, define the locale, and set the hooks for the admin area and 62 * the public-facing side of the site. 63 * 64 * @since 1.1 65 */ 66 public function __construct() { 67 if ( defined( 'HUMCOMMERCE_VERSION' ) ) { 68 $this->version = HUMCOMMERCE_VERSION; 69 } else { 70 $this->version = '1.0.0'; 71 } 72 $this->humcommerce = 'humcommerce'; 20 73 21 $this->load_dependencies();22 $this->define_admin_hooks();23 $this->define_public_hooks();24 add_filter( 'plugin_action_links_' .plugin_basename( plugin_dir_path( __DIR__ ) . $this->humcommerce . '.php' ), array($this,'humcommerce_plugin_action_links'),10 );25 }74 $this->load_dependencies(); 75 $this->define_admin_hooks(); 76 $this->define_public_hooks(); 77 add_filter( 'plugin_action_links_' . plugin_basename( plugin_dir_path( __DIR__ ) . $this->humcommerce . '.php' ), array( $this, 'humcommerce_plugin_action_links' ), 10 ); 78 } 26 79 27 private function load_dependencies() 28 { 80 /** 81 * Load the required dependencies for this plugin. 82 * 83 * Include the following files that make up the plugin: 84 * 85 * - Humcommerce_Loader. Orchestrates the hooks of the plugin. 86 * - Humcommerce_Settings. Defines settings. 87 * - Humcommerce_Admin. Defines all hooks for the admin area. 88 * - Humcommerce_Public. Defines all hooks for the public side of the site. 89 * 90 * Create an instance of the loader which will be used to register the hooks 91 * with WordPress. 92 * 93 * @since 1.1 94 * @access private 95 */ 96 private function load_dependencies() { 29 97 30 require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-humcommerce-loader.php';98 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-humcommerce-loader.php'; 31 99 32 require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-humcommerce-admin.php';100 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-humcommerce-admin.php'; 33 101 34 require_once plugin_dir_path(dirname(__FILE__)) . 'public/class-humcommerce-public.php';102 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-humcommerce-public.php'; 35 103 36 require_once plugin_dir_path(dirname(__FILE__)) . 'admin/class-humcommerce-settings.php';104 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-humcommerce-settings.php'; 37 105 38 $this->loader = new Class_Humcommerce_Loader();106 $this->loader = new Humcommerce_Loader(); 39 107 40 }108 } 41 109 110 /** 111 * Register all of the hooks related to the admin area functionality 112 * of the plugin. 113 * 114 * @since 1.1 115 * @access private 116 */ 117 private function define_admin_hooks() { 118 $plugin_admin = new Humcommerce_Admin( $this->get_humcommerce(), $this->get_version() ); 42 119 43 private function define_admin_hooks() 44 { 45 $plugin_admin = new Class_Humcommerce_Admin($this->get_humcommerce(), $this->get_version()); 120 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); 121 } 46 122 47 $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); 48 } 123 /** 124 * Register all of the hooks related to the public-facing functionality 125 * of the plugin. 126 * 127 * @since 1.1 128 * @access private 129 */ 130 private function define_public_hooks() { 131 $plugin_public = new Humcommerce_Public( $this->get_humcommerce(), $this->get_version() ); 49 132 50 private function define_public_hooks() 51 { 52 $plugin_public = new Class_Humcommerce_Public($this->get_humcommerce(), $this->get_version()); 133 $this->loader->add_action( 'wp', $plugin_public, 'init_hum_commerce' ); 134 $this->loader->add_action( 'wp_head', $plugin_public, 'add_humcommerce_script_to_wp_head' ); 135 $this->loader->add_action( 'woocommerce_add_to_cart', $plugin_public, 'track_update_cart', 99999, 0 ); 136 $this->loader->add_action( 'woocommerce_cart_item_removed', $plugin_public, 'track_update_cart', 99999, 0 ); 137 $this->loader->add_action( 'woocommerce_cart_item_restored', $plugin_public, 'track_update_cart', 99999, 0 ); 138 $this->loader->add_filter( 'woocommerce_update_cart_action_cart_updated', $plugin_public, 'track_update_cart_updated', 99999, 1 ); 139 $this->loader->add_action( 'woocommerce_applied_coupon', $plugin_public, 'track_update_cart', 99999, 0 ); 140 $this->loader->add_action( 'woocommerce_removed_coupon', $plugin_public, 'track_update_cart', 99999, 0 ); 141 $this->loader->add_action( 'woocommerce_order_status_completed', $plugin_public, 'track_ecommerce_order' ); 142 } 53 143 54 $this->loader->add_action('wp', $plugin_public, 'initHumCommerce'); 55 $this->loader->add_action('wp_head', $plugin_public, 'add_humcommerce_script_to_wp_head'); 56 $this->loader->add_action('woocommerce_add_to_cart', $plugin_public, 'track_update_cart', 99999, 0); 57 $this->loader->add_action('woocommerce_cart_item_removed', $plugin_public, 'track_update_cart', 99999, 0); 58 $this->loader->add_action('woocommerce_cart_item_restored', $plugin_public, 'track_update_cart', 99999, 0); 59 $this->loader->add_filter('woocommerce_update_cart_action_cart_updated', $plugin_public, 'track_update_cart_updated', 99999, 1); 60 $this->loader->add_action('woocommerce_applied_coupon', $plugin_public, 'track_update_cart', 99999, 0); 61 $this->loader->add_action('woocommerce_removed_coupon', $plugin_public, 'track_update_cart', 99999, 0); 62 $this->loader->add_action('woocommerce_order_status_completed', $plugin_public, 'track_ecommerce_order'); 63 } 144 /** 145 * Returns the plugin name. 146 * 147 * @since 1.0.0 148 * @return string 149 */ 150 public function get_humcommerce() { 151 return $this->humcommerce; 152 } 64 153 65 public function get_humcommerce() 66 { 67 return $this->humcommerce; 68 } 154 /** 155 * Returns the plugin version. 156 * 157 * @since 1.0.0 158 * @return string 159 */ 160 public function get_version() { 161 return $this->version; 162 } 69 163 70 public function get_version() 71 { 72 return $this->version; 73 } 164 /** 165 * Runs the plugin. 166 * 167 * @since 1.0.0 168 */ 169 public function run() { 170 $this->loader->run(); 171 } 74 172 75 public function run() 76 { 77 $this->loader->run(); 78 } 173 /** 174 * Returns the Loader instance. 175 * 176 * $since 1.0.0 177 * 178 * @return Humcommerce_Loader 179 */ 180 public function get_loader() { 181 return $this->loader; 182 } 79 183 80 public function get_loader() 81 { 82 return $this->loader; 83 } 84 85 public function humcommerce_plugin_action_links($links) 86 { 87 $setting_url = 'admin.php?page=humcommerce-settings'; 88 $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>'; 89 return $links; 90 } 184 /** 185 * Returns plugin action links. 186 * 187 * @since 1.0.0 188 * @param string $links Links to be updated. 189 * 190 * @return array 191 */ 192 public function humcommerce_plugin_action_links( $links ) { 193 $setting_url = 'admin.php?page=humcommerce-settings'; 194 $links[] = '<a href="' . get_admin_url( null, $setting_url ) . '">Settings</a>'; 195 return $links; 196 } 91 197 } -
humcommerce/trunk/public/class-humcommerce-public.php
r2068731 r2070392 1 1 <?php 2 2 /** 3 * Created by PhpStorm. 4 * User: nalin 5 * Date: 2019-02-20 6 * Time: 10:12 3 * The public facing functionality of the plugin. 4 * 5 * @since 1.0.0 6 * 7 * @package humcommerce 8 * @subpackage humcommerce/public 7 9 */ 8 10 9 class Class_Humcommerce_Public 10 { 11 /** 12 * The ID of this plugin. 13 * 14 * @since 1.0.0 15 * @access private 16 * @var string $humcommerce_custom The ID of this plugin. 17 */ 18 private $humcommerce; 19 20 /** 21 * The version of this plugin. 22 * 23 * @since 1.0.0 24 * @access private 25 * @var string $version The current version of this plugin. 26 */ 27 private $version; 28 29 /** 30 * Initialize the class and set its properties. 31 * 32 * @since 1.0.0 33 * @param string $humcommerce_custom The name of the plugin. 34 * @param string $version The version of this plugin. 35 */ 36 public function __construct( $humcommerce, $version ) { 37 38 $this->humcommerce_custom = $humcommerce; 39 $this->version = $version; 40 41 } 42 43 /** 44 * Register the stylesheets for the public-facing side of the site. 45 * 46 * @since 1.0.0 47 */ 48 public function enqueue_styles() { 49 50 /** 51 * This function is provided for demonstration purposes only. 52 * 53 * An instance of this class should be passed to the run() function 54 * defined in Humcommerce_Custom_Loader as all of the hooks are defined 55 * in that particular class. 56 * 57 * The Humcommerce_Custom_Loader will then create the relationship 58 * between the defined hooks and the functions defined in this 59 * class. 60 */ 61 62 wp_enqueue_style( $this->humcommerce_custom, plugin_dir_url( __FILE__ ) . 'css/humcommerce-custom-public.css', array(), $this->version, 'all' ); 63 64 } 65 66 /** 67 * Register the JavaScript for the public-facing side of the site. 68 * 69 * @since 1.0.0 70 */ 71 public function enqueue_scripts() { 72 73 /** 74 * This function is provided for demonstration purposes only. 75 * 76 * An instance of this class should be passed to the run() function 77 * defined in Humcommerce_Custom_Loader as all of the hooks are defined 78 * in that particular class. 79 * 80 * The Humcommerce_Custom_Loader will then create the relationship 81 * between the defined hooks and the functions defined in this 82 * class. 83 */ 84 85 wp_enqueue_script( $this->humcommerce_custom, plugin_dir_url( __FILE__ ) . 'js/humcommerce-custom-public.js', array( 'jquery' ), $this->version, false ); 86 87 } 88 89 public function initHumCommerce() 90 { 91 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 92 if ( is_plugin_active('woocommerce/woocommerce.php')) 93 { 94 if (is_product()) { 95 $product = get_page_by_path(get_post()->post_name, OBJECT, 'product'); 96 if (!empty($product)) { 97 $product = wc_get_product($product); 98 $categoryTerms = get_the_terms($product->get_id(), 'product_cat'); 99 $categoryArray = $this->get_categories_array($categoryTerms); 100 } 101 $pCode = ' 11 /** 12 * The public facing functionality of the plugin. 13 * 14 * @since 1.0.0 15 * 16 * @package humcommerce 17 * @subpackage humcommerce/public 18 */ 19 class Humcommerce_Public { 20 21 /** 22 * The ID of this plugin. 23 * 24 * @since 1.0.0 25 * @access private 26 * @var string $humcommerce_custom The ID of this plugin. 27 */ 28 private $humcommerce; 29 30 /** 31 * The version of this plugin. 32 * 33 * @since 1.0.0 34 * @access private 35 * @var string $version The current version of this plugin. 36 */ 37 private $version; 38 39 /** 40 * Initialize the class and set its properties. 41 * 42 * @since 1.0.0 43 * @param string $humcommerce The name of the plugin. 44 * @param string $version The version of this plugin. 45 */ 46 public function __construct( $humcommerce, $version ) { 47 48 $this->humcommerce_custom = $humcommerce; 49 $this->version = $version; 50 51 } 52 53 /** 54 * Register the stylesheets for the public-facing side of the site. 55 * 56 * @since 1.0.0 57 */ 58 public function enqueue_styles() { 59 60 /** 61 * This function is provided for demonstration purposes only. 62 * 63 * An instance of this class should be passed to the run() function 64 * defined in Humcommerce_Custom_Loader as all of the hooks are defined 65 * in that particular class. 66 * 67 * The Humcommerce_Custom_Loader will then create the relationship 68 * between the defined hooks and the functions defined in this 69 * class. 70 */ 71 72 wp_enqueue_style( $this->humcommerce_custom, plugin_dir_url( __FILE__ ) . 'css/humcommerce-custom-public.css', array(), $this->version, 'all' ); 73 74 } 75 76 /** 77 * Register the JavaScript for the public-facing side of the site. 78 * 79 * @since 1.0.0 80 */ 81 public function enqueue_scripts() { 82 83 /** 84 * This function is provided for demonstration purposes only. 85 * 86 * An instance of this class should be passed to the run() function 87 * defined in Humcommerce_Custom_Loader as all of the hooks are defined 88 * in that particular class. 89 * 90 * The Humcommerce_Custom_Loader will then create the relationship 91 * between the defined hooks and the functions defined in this 92 * class. 93 */ 94 95 wp_enqueue_script( $this->humcommerce_custom, plugin_dir_url( __FILE__ ) . 'js/humcommerce-custom-public.js', array( 'jquery' ), $this->version, false ); 96 97 } 98 99 /** 100 * HumCommerce init functionality 101 * 102 * @since 1.0.0 103 */ 104 public function init_hum_commerce() { 105 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 106 if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { 107 if ( is_product() ) { 108 $product = get_page_by_path( get_post()->post_name, OBJECT, 'product' ); 109 if ( ! empty( $product ) ) { 110 $product = wc_get_product( $product ); 111 $category_terms = get_the_terms( $product->get_id(), 'product_cat' ); 112 $category_array = $this->get_categories_array( $category_terms ); 113 } 114 $p_code = ' 102 115 _ha.push(["setEcommerceView", 103 116 "' . $product->get_sku() . '", 104 117 "' . $product->get_title() . '", 105 [' . $category Array . '],106 ' . get_post_meta( $product->get_id(), '_price', true) . '118 [' . $category_array . '], 119 ' . get_post_meta( $product->get_id(), '_price', true ) . ' 107 120 ]);'; 108 update_option('humcommerce_product_view', $pCode);109 }110 111 if (is_product_category()) {112 $cCode = '121 update_option( 'humcommerce_product_view', $p_code ); 122 } 123 124 if ( is_product_category() ) { 125 $c_code = ' 113 126 _ha.push(["setEcommerceView", 114 127 productSku = false, 115 128 productName = false, 116 category = "' . single_cat_title( "", false) . '"129 category = "' . single_cat_title( '', false ) . '" 117 130 ]);'; 118 update_option('humcommerce_category_view', $cCode); 119 } 120 } 121 122 } 123 124 public function add_humcommerce_script_to_wp_head() 125 { 126 $options = get_option('humcommerce_options'); 127 128 if(array_key_exists('host',$options)){ 129 $host_url = $options['host']; 130 } else{ 131 $host_url = 'app.humdash.com'; 132 } 133 134 135 echo " <!-- HumDash --> 136 <script type=\"text/javascript\"> 137 var _ha = _ha || []; " . get_option("humcommerce_add_to_cart") . "" . get_option("humcommerce_track_order") . "" . get_option("humcommerce_product_view") . "" . get_option("humcommerce_category_view") . " 131 update_option( 'humcommerce_category_view', $c_code ); 132 } 133 } 134 135 } 136 137 /** 138 * Add the JavaScript to the head for the public-facing side of the site. 139 * 140 * @since 1.0.0 141 */ 142 public function add_humcommerce_script_to_wp_head() { 143 $options = get_option( 'humcommerce_options' ); 144 145 if ( array_key_exists( 'host', $options ) ) { 146 $host_url = $options['host']; 147 } else { 148 $host_url = 'app.humdash.com'; 149 } 150 151 echo ' <!-- HumDash --> 152 <script type="text/javascript"> 153 var _ha = _ha || []; ' . wp_kses_post( get_option( 'humcommerce_add_to_cart' ) ) . ' 154 ' . wp_kses_post( get_option( 'humcommerce_track_order' ) ) . ' 155 ' . wp_kses_post( get_option( 'humcommerce_product_view' ) ) . ' 156 ' . wp_kses_post( get_option( 'humcommerce_category_view' ) ) . " 138 157 _ha.push(['trackPageView']); 139 158 _ha.push(['enableLinkTracking']); 140 159 (function() { 141 var u=\"//" . $host_url. "/\";160 var u=\"//" . esc_js( $host_url ) . "/\"; 142 161 _ha.push(['setTrackerUrl', u+'humdash.php']); 143 _ha.push(['setSiteId', '" . $options["si"]. "']);162 _ha.push(['setSiteId', '" . esc_js( $options['si'] ) . "']); 144 163 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; 145 164 g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'humdash.js'; s.parentNode.insertBefore(g,s); … … 147 166 </script> 148 167 <!-- End HumDash Code -->"; 149 delete_option('humcommerce_add_to_cart'); 150 delete_option('humcommerce_track_order'); 151 delete_option('humcommerce_product_view'); 152 delete_option('humcommerce_category_view'); 153 } 154 155 public function track_update_cart() 156 { 157 global $woocommerce; 158 $items = $woocommerce->cart->get_cart(); 159 $code = ''; 160 foreach ($items as $item => $values) { 161 $_product = wc_get_product($values['data']->get_id()); 162 $categoryTerms = get_the_terms($values['data']->get_id(), 'product_cat'); 163 $categoryArray = $this->get_categories_array($categoryTerms); 164 $code .= ' 168 delete_option( 'humcommerce_add_to_cart' ); 169 delete_option( 'humcommerce_track_order' ); 170 delete_option( 'humcommerce_product_view' ); 171 delete_option( 'humcommerce_category_view' ); 172 } 173 174 /** 175 * To update tracking code for updated cart. 176 * 177 * @since 1.0.0 178 */ 179 public function track_update_cart() { 180 global $woocommerce; 181 $items = $woocommerce->cart->get_cart(); 182 $code = ''; 183 foreach ( $items as $item => $values ) { 184 $_product = wc_get_product( $values['data']->get_id() ); 185 $category_terms = get_the_terms( $values['data']->get_id(), 'product_cat' ); 186 $category_array = $this->get_categories_array( $category_terms ); 187 $code .= ' 165 188 _ha.push(["addEcommerceItem", 166 189 "' . $_product->get_sku() . '", 167 190 "' . $_product->get_title() . '", 168 [' . $category Array . '],169 ' . get_post_meta( $values['product_id'], '_price', true) . ',191 [' . $category_array . '], 192 ' . get_post_meta( $values['product_id'], '_price', true ) . ', 170 193 ' . $values['quantity'] . ' 171 194 ]);'; 172 update_option('humcommerce_add_to_cart', $code);173 }174 175 $total = 0;176 $cart= $woocommerce->cart;177 if (!empty($cart->total)) {178 $total = $cart->total;179 } elseif (!empty($cart->cart_contents_total)) {180 $total = $cart->cart_contents_total;181 }182 $code .= '195 update_option( 'humcommerce_add_to_cart', $code ); 196 } 197 198 $total = 0; 199 $cart = $woocommerce->cart; 200 if ( ! empty( $cart->total ) ) { 201 $total = $cart->total; 202 } elseif ( ! empty( $cart->cart_contents_total ) ) { 203 $total = $cart->cart_contents_total; 204 } 205 $code .= ' 183 206 _ha.push(["trackEcommerceCartUpdate",' . $total . ']);'; 184 update_option('humcommerce_add_to_cart', $code); 185 } 186 187 public function track_update_cart_updated($cart_updated) 188 { 189 $this->track_update_cart(); 190 return $cart_updated; 191 } 192 193 public function track_ecommerce_order($orderId) 194 { 195 $code = ''; 196 $order = wc_get_order($orderId); 197 $orderNumberToTrack = $orderId; 198 if (method_exists($order, 'get_order_number')) { 199 $orderNumberToTrack = $order->get_order_number(); 200 } 201 202 foreach ($order->get_items() as $item_key => $item_values) { 203 $product = $item_values->get_product(); 204 205 $item_data = $item_values->get_data(); 206 207 $product_name = $item_data['name']; 208 $product_id = $item_data['product_id']; 209 $categoryTerms = get_the_terms($product_id, 'product_cat'); 210 $categoryArray = $this->get_categories_array($categoryTerms); 211 $quantity = $item_data['quantity']; 212 $product_sku = $product->get_sku(); 213 $product_price = $product->get_price(); 214 $code .= '_ha.push(["addEcommerceItem", 207 update_option( 'humcommerce_add_to_cart', $code ); 208 } 209 210 /** 211 * To update tracking code for updated cart. 212 * 213 * @since 1.0.0 214 * @param string $cart_updated Flag for cart updated. 215 */ 216 public function track_update_cart_updated( $cart_updated ) { 217 $this->track_update_cart(); 218 return $cart_updated; 219 } 220 221 /** 222 * To track ecommerce order. 223 * 224 * @since 1.0.0 225 * @param int $order_id Order id. 226 */ 227 public function track_ecommerce_order( $order_id ) { 228 $code = ''; 229 $order = wc_get_order( $order_id ); 230 $order_number_to_track = $order_id; 231 if ( method_exists( $order, 'get_order_number' ) ) { 232 $order_number_to_track = $order->get_order_number(); 233 } 234 235 foreach ( $order->get_items() as $item_key => $item_values ) { 236 $product = $item_values->get_product(); 237 238 $item_data = $item_values->get_data(); 239 240 $product_name = $item_data['name']; 241 $product_id = $item_data['product_id']; 242 $category_terms = get_the_terms( $product_id, 'product_cat' ); 243 $category_array = $this->get_categories_array( $category_terms ); 244 $quantity = $item_data['quantity']; 245 $product_sku = $product->get_sku(); 246 $product_price = $product->get_price(); 247 $code .= '_ha.push(["addEcommerceItem", 215 248 "' . $product_sku . '", 216 249 "' . $product_name . '", 217 [' . $category Array . '],250 [' . $category_array . '], 218 251 ' . $product_price . ', 219 252 ' . $quantity . ' 220 253 ]);'; 221 }222 223 $shippingAmt = $this->woocommerceVersion3() ? $order->get_shipping_total() : $order->get_total_shipping();224 $code.= '_ha.push(["trackEcommerceOrder",225 "' . $order NumberToTrack . '",254 } 255 256 $shipping_amt = $this->woocommerce_version3() ? $order->get_shipping_total() : $order->get_total_shipping(); 257 $code .= '_ha.push(["trackEcommerceOrder", 258 "' . $order_number_to_track . '", 226 259 ' . $order->get_total() . ', 227 260 ' . $order->get_subtotal() . ', 228 261 ' . $order->get_cart_tax() . ', 229 ' . $shipping Amt . ',262 ' . $shipping_amt . ', 230 263 ' . $order->get_total_discount() . ' 231 264 ]);'; 232 update_option('humcommerce_track_order', $code); 233 } 234 235 public function woocommerceVersion3() 236 { 237 global $woocommerce; 238 $result = version_compare($woocommerce->version, '3.0', '>='); 239 return $result; 240 } 241 242 public function get_categories_array($categoryTerms){ 243 $categories = array(); 244 if (is_wp_error($categoryTerms)) { 245 return $categories; 246 } 247 if (!empty($categoryTerms)) { 248 foreach ($categoryTerms as $category) { 249 $categories[] = $category->name; 250 } 251 } 252 $categories = array_unique($categories); 253 $categories = array_slice($categories, 0, 5); 254 $categoryArray = ''; 255 foreach ($categories as $category) { 256 $categoryArray .= '"' . $category . '",'; 257 } 258 return $categoryArray; 259 } 265 update_option( 'humcommerce_track_order', $code ); 266 } 267 268 /** 269 * Compare the currently installed version of WooCommerce. 270 * 271 * @since 1.0.0 272 */ 273 public function woocommerce_version3() { 274 global $woocommerce; 275 $result = version_compare( $woocommerce->version, '3.0', '>=' ); 276 return $result; 277 } 278 279 /** 280 * To get Categories array. 281 * 282 * @since 1.0.0 283 * @param array $category_terms Category Terms. 284 */ 285 public function get_categories_array( $category_terms ) { 286 $categories = array(); 287 if ( is_wp_error( $category_terms ) ) { 288 return $categories; 289 } 290 if ( ! empty( $category_terms ) ) { 291 foreach ( $category_terms as $category ) { 292 $categories[] = $category->name; 293 } 294 } 295 $categories = array_unique( $categories ); 296 $categories = array_slice( $categories, 0, 5 ); 297 $category_array = ''; 298 foreach ( $categories as $category ) { 299 $category_array .= '"' . $category . '",'; 300 } 301 return $category_array; 302 } 260 303 } -
humcommerce/trunk/uninstall.php
r1904986 r2070392 1 1 <?php 2 /** 3 * Uninstall file for the plugin. 4 * 5 * @since 1.0.0 6 * 7 * @package humcommerce 8 */ 2 9 3 if ( !defined('WP_UNINSTALL_PLUGIN')) {4 exit;10 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 11 exit; 5 12 }
Note: See TracChangeset
for help on using the changeset viewer.