Version Description
- 2021-11-10 =
- Fix - Remove the slow order counting query from admin init.
- Tweak - WC 5.9 compatibility.
Download this release
Release Info
| Developer | automattic |
| Plugin | |
| Version | 1.5.4 |
| Comparing to | |
| See all releases | |
Code changes from version 1.5.3 to 1.5.4
- changelog.txt +4 -0
- languages/woocommerce-google-analytics-integration.pot +0 -272
- readme.txt +5 -1
- woocommerce-google-analytics-integration.php +17 -10
changelog.txt
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
*** Changelog ***
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
= 1.5.3 - 2021-09-15 =
|
| 4 |
* Tweak - Avoid unnecessary completed orders queries.
|
| 5 |
* Tweak - WC 5.7 compatibility.
|
| 1 |
*** Changelog ***
|
| 2 |
|
| 3 |
+
= 1.5.4 - 2021-11-10 =
|
| 4 |
+
* Fix - Remove the slow order counting query from admin init.
|
| 5 |
+
* Tweak - WC 5.9 compatibility.
|
| 6 |
+
|
| 7 |
= 1.5.3 - 2021-09-15 =
|
| 8 |
* Tweak - Avoid unnecessary completed orders queries.
|
| 9 |
* Tweak - WC 5.7 compatibility.
|
languages/woocommerce-google-analytics-integration.pot
DELETED
|
@@ -1,272 +0,0 @@
|
|
| 1 |
-
# Copyright (C) 2021 WooCommerce
|
| 2 |
-
# This file is distributed under the GPLv2 or later.
|
| 3 |
-
msgid ""
|
| 4 |
-
msgstr ""
|
| 5 |
-
"Project-Id-Version: WooCommerce Google Analytics Integration 1.5.3\n"
|
| 6 |
-
"Report-Msgid-Bugs-To: "
|
| 7 |
-
"https://wordpress.org/support/plugin/woocommerce-google-analytics-"
|
| 8 |
-
"integration\n"
|
| 9 |
-
"POT-Creation-Date: 2021-09-15 08:00:44+00:00\n"
|
| 10 |
-
"MIME-Version: 1.0\n"
|
| 11 |
-
"Content-Type: text/plain; charset=utf-8\n"
|
| 12 |
-
"Content-Transfer-Encoding: 8bit\n"
|
| 13 |
-
"PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
|
| 14 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
| 15 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
| 16 |
-
"X-Generator: node-wp-i18n 1.2.3\n"
|
| 17 |
-
|
| 18 |
-
#: includes/class-wc-google-analytics-info-banner.php:64
|
| 19 |
-
msgid "Google Analytics & WooCommerce"
|
| 20 |
-
msgstr ""
|
| 21 |
-
|
| 22 |
-
#: includes/class-wc-google-analytics-info-banner.php:65
|
| 23 |
-
msgid ""
|
| 24 |
-
"<a href=\"%s\">Connect WooCommerce to Google Analytics</a> to finish "
|
| 25 |
-
"setting up this integration."
|
| 26 |
-
msgstr ""
|
| 27 |
-
|
| 28 |
-
#: includes/class-wc-google-analytics-info-banner.php:69
|
| 29 |
-
msgid "Dismiss this notice."
|
| 30 |
-
msgstr ""
|
| 31 |
-
|
| 32 |
-
#: includes/class-wc-google-analytics-info-banner.php:69
|
| 33 |
-
msgid "(Dismiss)"
|
| 34 |
-
msgstr ""
|
| 35 |
-
|
| 36 |
-
#: includes/class-wc-google-analytics.php:54
|
| 37 |
-
msgid "Google Analytics"
|
| 38 |
-
msgstr ""
|
| 39 |
-
|
| 40 |
-
#: includes/class-wc-google-analytics.php:55
|
| 41 |
-
msgid ""
|
| 42 |
-
"Google Analytics is a free service offered by Google that generates "
|
| 43 |
-
"detailed statistics about the visitors to a website."
|
| 44 |
-
msgstr ""
|
| 45 |
-
|
| 46 |
-
#: includes/class-wc-google-analytics.php:148
|
| 47 |
-
msgid "Google Analytics Tracking ID"
|
| 48 |
-
msgstr ""
|
| 49 |
-
|
| 50 |
-
#: includes/class-wc-google-analytics.php:149
|
| 51 |
-
msgid ""
|
| 52 |
-
"Log into your Google Analytics account to find your ID. e.g. "
|
| 53 |
-
"<code>G-XXXXX</code> or <code>UA-XXXXX-X</code>"
|
| 54 |
-
msgstr ""
|
| 55 |
-
|
| 56 |
-
#: includes/class-wc-google-analytics.php:155
|
| 57 |
-
msgid "Set Domain Name"
|
| 58 |
-
msgstr ""
|
| 59 |
-
|
| 60 |
-
#: includes/class-wc-google-analytics.php:156
|
| 61 |
-
msgid ""
|
| 62 |
-
"(Optional) Sets the <code>_setDomainName</code> variable. <a href=\"%s\" "
|
| 63 |
-
"target=\"_blank\">See here for more information</a>."
|
| 64 |
-
msgstr ""
|
| 65 |
-
|
| 66 |
-
#: includes/class-wc-google-analytics.php:163
|
| 67 |
-
msgid "Tracking Options"
|
| 68 |
-
msgstr ""
|
| 69 |
-
|
| 70 |
-
#: includes/class-wc-google-analytics.php:164
|
| 71 |
-
msgid "Use Global Site Tag"
|
| 72 |
-
msgstr ""
|
| 73 |
-
|
| 74 |
-
#: includes/class-wc-google-analytics.php:165
|
| 75 |
-
msgid ""
|
| 76 |
-
"The Global Site Tag provides streamlined tagging across Google’s site "
|
| 77 |
-
"measurement, conversion tracking, and remarketing products. This must be "
|
| 78 |
-
"enabled to use a Google Analytics 4 Measurement ID (e.g., "
|
| 79 |
-
"<code>G-XXXXX</code>). <a href=\"%s\" target=\"_blank\">See here for more "
|
| 80 |
-
"information</a>."
|
| 81 |
-
msgstr ""
|
| 82 |
-
|
| 83 |
-
#: includes/class-wc-google-analytics.php:172
|
| 84 |
-
msgid "Enable Universal Analytics"
|
| 85 |
-
msgstr ""
|
| 86 |
-
|
| 87 |
-
#: includes/class-wc-google-analytics.php:173
|
| 88 |
-
msgid ""
|
| 89 |
-
"Uses Universal Analytics instead of Classic Google Analytics. If you have "
|
| 90 |
-
"<strong>not</strong> previously used Google Analytics on this site, check "
|
| 91 |
-
"this box. Otherwise, %sfollow step 1 of the Universal Analytics upgrade "
|
| 92 |
-
"guide.%s Enabling this setting will take care of step 2. %sRead more about "
|
| 93 |
-
"Universal Analytics%s. Universal Analytics or Global Site Tag must be "
|
| 94 |
-
"enabled to enable enhanced eCommerce."
|
| 95 |
-
msgstr ""
|
| 96 |
-
|
| 97 |
-
#: includes/class-wc-google-analytics.php:180
|
| 98 |
-
msgid "Enable Standard Tracking"
|
| 99 |
-
msgstr ""
|
| 100 |
-
|
| 101 |
-
#: includes/class-wc-google-analytics.php:181
|
| 102 |
-
msgid ""
|
| 103 |
-
"This tracks session data such as demographics, system, etc. You don't need "
|
| 104 |
-
"to enable this if you are using a 3rd party Google analytics plugin."
|
| 105 |
-
msgstr ""
|
| 106 |
-
|
| 107 |
-
#: includes/class-wc-google-analytics.php:187
|
| 108 |
-
msgid "\"Display Advertising\" Support"
|
| 109 |
-
msgstr ""
|
| 110 |
-
|
| 111 |
-
#: includes/class-wc-google-analytics.php:188
|
| 112 |
-
msgid ""
|
| 113 |
-
"Set the Google Analytics code to support Display Advertising. %sRead more "
|
| 114 |
-
"about Display Advertising%s."
|
| 115 |
-
msgstr ""
|
| 116 |
-
|
| 117 |
-
#: includes/class-wc-google-analytics.php:194
|
| 118 |
-
msgid "Use Enhanced Link Attribution"
|
| 119 |
-
msgstr ""
|
| 120 |
-
|
| 121 |
-
#: includes/class-wc-google-analytics.php:195
|
| 122 |
-
msgid ""
|
| 123 |
-
"Set the Google Analytics code to support Enhanced Link Attribution. %sRead "
|
| 124 |
-
"more about Enhanced Link Attribution%s."
|
| 125 |
-
msgstr ""
|
| 126 |
-
|
| 127 |
-
#: includes/class-wc-google-analytics.php:201
|
| 128 |
-
msgid "Anonymize IP addresses"
|
| 129 |
-
msgstr ""
|
| 130 |
-
|
| 131 |
-
#: includes/class-wc-google-analytics.php:202
|
| 132 |
-
msgid ""
|
| 133 |
-
"Enabling this option is mandatory in certain countries due to national "
|
| 134 |
-
"privacy laws. %sRead more about IP Anonymization%s."
|
| 135 |
-
msgstr ""
|
| 136 |
-
|
| 137 |
-
#: includes/class-wc-google-analytics.php:208
|
| 138 |
-
msgid "Track 404 (Not found) Errors"
|
| 139 |
-
msgstr ""
|
| 140 |
-
|
| 141 |
-
#: includes/class-wc-google-analytics.php:209
|
| 142 |
-
msgid ""
|
| 143 |
-
"Enable this to find broken or dead links. An \"Event\" with category "
|
| 144 |
-
"\"Error\" and action \"404 Not Found\" will be created in Google Analytics "
|
| 145 |
-
"for each incoming pageview to a non-existing page. By setting up a \"Custom "
|
| 146 |
-
"Goal\" for these events within Google Analytics you can find out where "
|
| 147 |
-
"broken links originated from (the referrer). %sRead how to set up a goal%s."
|
| 148 |
-
msgstr ""
|
| 149 |
-
|
| 150 |
-
#: includes/class-wc-google-analytics.php:215
|
| 151 |
-
msgid "Purchase Transactions"
|
| 152 |
-
msgstr ""
|
| 153 |
-
|
| 154 |
-
#: includes/class-wc-google-analytics.php:216
|
| 155 |
-
msgid ""
|
| 156 |
-
"This requires a payment gateway that redirects to the thank you/order "
|
| 157 |
-
"received page after payment. Orders paid with gateways which do not do this "
|
| 158 |
-
"will not be tracked."
|
| 159 |
-
msgstr ""
|
| 160 |
-
|
| 161 |
-
#: includes/class-wc-google-analytics.php:222
|
| 162 |
-
msgid "Add to Cart Events"
|
| 163 |
-
msgstr ""
|
| 164 |
-
|
| 165 |
-
#: includes/class-wc-google-analytics.php:229
|
| 166 |
-
msgid "Enhanced eCommerce"
|
| 167 |
-
msgstr ""
|
| 168 |
-
|
| 169 |
-
#: includes/class-wc-google-analytics.php:230
|
| 170 |
-
msgid "Enable Enhanced eCommerce "
|
| 171 |
-
msgstr ""
|
| 172 |
-
|
| 173 |
-
#: includes/class-wc-google-analytics.php:231
|
| 174 |
-
msgid ""
|
| 175 |
-
"Enhanced eCommerce allows you to measure more user interactions with your "
|
| 176 |
-
"store, including: product impressions, product detail views, starting the "
|
| 177 |
-
"checkout process, adding cart items, and removing cart items. Universal "
|
| 178 |
-
"Analytics or Global Site Tag must be enabled for Enhanced eCommerce to "
|
| 179 |
-
"work. If using Universal Analytics, turn on Enhanced eCommerce in your "
|
| 180 |
-
"Google Analytics dashboard before enabling this setting. <a href=\"%s\" "
|
| 181 |
-
"target=\"_blank\">See here for more information</a>."
|
| 182 |
-
msgstr ""
|
| 183 |
-
|
| 184 |
-
#: includes/class-wc-google-analytics.php:241
|
| 185 |
-
msgid "Remove from Cart Events"
|
| 186 |
-
msgstr ""
|
| 187 |
-
|
| 188 |
-
#: includes/class-wc-google-analytics.php:249
|
| 189 |
-
msgid "Product Impressions from Listing Pages"
|
| 190 |
-
msgstr ""
|
| 191 |
-
|
| 192 |
-
#: includes/class-wc-google-analytics.php:257
|
| 193 |
-
msgid "Product Clicks from Listing Pages"
|
| 194 |
-
msgstr ""
|
| 195 |
-
|
| 196 |
-
#: includes/class-wc-google-analytics.php:265
|
| 197 |
-
msgid "Product Detail Views"
|
| 198 |
-
msgstr ""
|
| 199 |
-
|
| 200 |
-
#: includes/class-wc-google-analytics.php:273
|
| 201 |
-
msgid "Checkout Process Initiated"
|
| 202 |
-
msgstr ""
|
| 203 |
-
|
| 204 |
-
#: includes/class-wc-google-analytics.php:286
|
| 205 |
-
msgid "Please allow Google Analytics 24 hours to start displaying results."
|
| 206 |
-
msgstr ""
|
| 207 |
-
|
| 208 |
-
#: includes/class-wc-google-analytics.php:289
|
| 209 |
-
msgid ""
|
| 210 |
-
"Please note, for transaction tracking to work properly, you will need to "
|
| 211 |
-
"use a payment gateway that redirects the customer back to a WooCommerce "
|
| 212 |
-
"order received/thank you page."
|
| 213 |
-
msgstr ""
|
| 214 |
-
|
| 215 |
-
#: includes/class-wc-google-analytics.php:444
|
| 216 |
-
#: includes/class-wc-google-analytics.php:512
|
| 217 |
-
msgid "Products"
|
| 218 |
-
msgstr ""
|
| 219 |
-
|
| 220 |
-
#: includes/class-wc-google-analytics.php:445
|
| 221 |
-
#: includes/class-wc-google-analytics.php:513
|
| 222 |
-
msgid "Add to Cart"
|
| 223 |
-
msgstr ""
|
| 224 |
-
|
| 225 |
-
#: includes/class-wc-google-analytics.php:446
|
| 226 |
-
msgid "ID:"
|
| 227 |
-
msgstr ""
|
| 228 |
-
|
| 229 |
-
#: woocommerce-google-analytics-integration.php:75
|
| 230 |
-
msgid "Settings"
|
| 231 |
-
msgstr ""
|
| 232 |
-
|
| 233 |
-
#: woocommerce-google-analytics-integration.php:76
|
| 234 |
-
msgid "Support"
|
| 235 |
-
msgstr ""
|
| 236 |
-
|
| 237 |
-
#: woocommerce-google-analytics-integration.php:110
|
| 238 |
-
msgid "WooCommerce Google Analytics depends on the last version of %s to work!"
|
| 239 |
-
msgstr ""
|
| 240 |
-
|
| 241 |
-
#. Author of the plugin/theme
|
| 242 |
-
msgid "WooCommerce"
|
| 243 |
-
msgstr ""
|
| 244 |
-
|
| 245 |
-
#: woocommerce-google-analytics-integration.php:146
|
| 246 |
-
msgid "Get detailed insights into your sales with Google Analytics Pro"
|
| 247 |
-
msgstr ""
|
| 248 |
-
|
| 249 |
-
#: woocommerce-google-analytics-integration.php:149
|
| 250 |
-
#. translators: 1: href link to GA pro
|
| 251 |
-
msgid ""
|
| 252 |
-
"Add advanced tracking for your sales funnel, coupons and more. [<a "
|
| 253 |
-
"href=\"%s\" target=\"_blank\">Learn more</a> >]"
|
| 254 |
-
msgstr ""
|
| 255 |
-
|
| 256 |
-
#. Plugin Name of the plugin/theme
|
| 257 |
-
msgid "WooCommerce Google Analytics Integration"
|
| 258 |
-
msgstr ""
|
| 259 |
-
|
| 260 |
-
#. Plugin URI of the plugin/theme
|
| 261 |
-
msgid "https://wordpress.org/plugins/woocommerce-google-analytics-integration/"
|
| 262 |
-
msgstr ""
|
| 263 |
-
|
| 264 |
-
#. Description of the plugin/theme
|
| 265 |
-
msgid ""
|
| 266 |
-
"Allows Google Analytics tracking code to be inserted into WooCommerce store "
|
| 267 |
-
"pages."
|
| 268 |
-
msgstr ""
|
| 269 |
-
|
| 270 |
-
#. Author URI of the plugin/theme
|
| 271 |
-
msgid "https://woocommerce.com"
|
| 272 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: woocommerce, automattic, claudiosanches, bor0, royho, laurendaviss
|
|
| 3 |
Tags: woocommerce, google analytics
|
| 4 |
Requires at least: 3.9
|
| 5 |
Tested up to: 5.8
|
| 6 |
-
Stable tag: 1.5.
|
| 7 |
License: GPLv3
|
| 8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
| 9 |
|
|
@@ -60,6 +60,10 @@ Exact wording depends on the national data privacy laws and should be adjusted.
|
|
| 60 |
|
| 61 |
== Changelog ==
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
= 1.5.3 - 2021-09-15 =
|
| 64 |
* Tweak - Avoid unnecessary completed orders queries.
|
| 65 |
* Tweak - WC 5.7 compatibility.
|
| 3 |
Tags: woocommerce, google analytics
|
| 4 |
Requires at least: 3.9
|
| 5 |
Tested up to: 5.8
|
| 6 |
+
Stable tag: 1.5.4
|
| 7 |
License: GPLv3
|
| 8 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
| 9 |
|
| 60 |
|
| 61 |
== Changelog ==
|
| 62 |
|
| 63 |
+
= 1.5.4 - 2021-11-10 =
|
| 64 |
+
* Fix - Remove the slow order counting query from admin init.
|
| 65 |
+
* Tweak - WC 5.9 compatibility.
|
| 66 |
+
|
| 67 |
= 1.5.3 - 2021-09-15 =
|
| 68 |
* Tweak - Avoid unnecessary completed orders queries.
|
| 69 |
* Tweak - WC 5.7 compatibility.
|
woocommerce-google-analytics-integration.php
CHANGED
|
@@ -5,9 +5,9 @@
|
|
| 5 |
* Description: Allows Google Analytics tracking code to be inserted into WooCommerce store pages.
|
| 6 |
* Author: WooCommerce
|
| 7 |
* Author URI: https://woocommerce.com
|
| 8 |
-
* Version: 1.5.
|
| 9 |
* WC requires at least: 3.2
|
| 10 |
-
* WC tested up to: 5.
|
| 11 |
* Tested up to: 5.8
|
| 12 |
* License: GPLv2 or later
|
| 13 |
* Text Domain: woocommerce-google-analytics-integration
|
|
@@ -20,7 +20,15 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
| 20 |
|
| 21 |
if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
|
| 22 |
|
| 23 |
-
define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '1.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
/**
|
| 26 |
* WooCommerce Google Analytics Integration main class.
|
|
@@ -40,7 +48,9 @@ if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
|
|
| 40 |
|
| 41 |
// Load plugin text domain
|
| 42 |
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
|
| 43 |
-
|
|
|
|
|
|
|
| 44 |
|
| 45 |
// Checks which WooCommerce is installed.
|
| 46 |
if ( class_exists( 'WC_Integration' ) && defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '3.2', '>=' ) ) {
|
|
@@ -125,7 +135,7 @@ if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
|
|
| 125 |
/**
|
| 126 |
* Logic for Google Analytics Pro notices.
|
| 127 |
*/
|
| 128 |
-
public function
|
| 129 |
// Notice was already shown
|
| 130 |
if ( get_option( 'woocommerce_google_analytics_pro_notice_shown', false ) ) {
|
| 131 |
return;
|
|
@@ -134,12 +144,9 @@ if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
|
|
| 134 |
$completed_orders = wc_orders_count( 'completed' );
|
| 135 |
|
| 136 |
// Only show the notice if there are 10 <= completed orders <= 100.
|
| 137 |
-
|
| 138 |
-
$too_many_orders_to_show_the_notice = $completed_orders > 100;
|
| 139 |
-
if ( $too_many_orders_to_show_the_notice ) {
|
| 140 |
update_option( 'woocommerce_google_analytics_pro_notice_shown', true );
|
| 141 |
-
|
| 142 |
-
if ( $too_few_orders_to_show_the_notice || $too_many_orders_to_show_the_notice ) {
|
| 143 |
return;
|
| 144 |
}
|
| 145 |
|
| 5 |
* Description: Allows Google Analytics tracking code to be inserted into WooCommerce store pages.
|
| 6 |
* Author: WooCommerce
|
| 7 |
* Author URI: https://woocommerce.com
|
| 8 |
+
* Version: 1.5.4
|
| 9 |
* WC requires at least: 3.2
|
| 10 |
+
* WC tested up to: 5.9
|
| 11 |
* Tested up to: 5.8
|
| 12 |
* License: GPLv2 or later
|
| 13 |
* Text Domain: woocommerce-google-analytics-integration
|
| 20 |
|
| 21 |
if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
|
| 22 |
|
| 23 |
+
define( 'WC_GOOGLE_ANALYTICS_INTEGRATION_VERSION', '1.5.4' ); // WRCS: DEFINED_VERSION.
|
| 24 |
+
|
| 25 |
+
// Maybe show the GA Pro notice on plugin activation.
|
| 26 |
+
register_activation_hook(
|
| 27 |
+
__FILE__,
|
| 28 |
+
function () {
|
| 29 |
+
WC_Google_Analytics_Integration::get_instance()->maybe_show_ga_pro_notices();
|
| 30 |
+
}
|
| 31 |
+
);
|
| 32 |
|
| 33 |
/**
|
| 34 |
* WooCommerce Google Analytics Integration main class.
|
| 48 |
|
| 49 |
// Load plugin text domain
|
| 50 |
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
|
| 51 |
+
|
| 52 |
+
// Track completed orders and determine whether the GA Pro notice should be displayed.
|
| 53 |
+
add_action( 'woocommerce_order_status_completed', array( $this, 'maybe_show_ga_pro_notices' ) );
|
| 54 |
|
| 55 |
// Checks which WooCommerce is installed.
|
| 56 |
if ( class_exists( 'WC_Integration' ) && defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '3.2', '>=' ) ) {
|
| 135 |
/**
|
| 136 |
* Logic for Google Analytics Pro notices.
|
| 137 |
*/
|
| 138 |
+
public function maybe_show_ga_pro_notices() {
|
| 139 |
// Notice was already shown
|
| 140 |
if ( get_option( 'woocommerce_google_analytics_pro_notice_shown', false ) ) {
|
| 141 |
return;
|
| 144 |
$completed_orders = wc_orders_count( 'completed' );
|
| 145 |
|
| 146 |
// Only show the notice if there are 10 <= completed orders <= 100.
|
| 147 |
+
if ( $completed_orders < 10 || $completed_orders > 100 ) {
|
|
|
|
|
|
|
| 148 |
update_option( 'woocommerce_google_analytics_pro_notice_shown', true );
|
| 149 |
+
|
|
|
|
| 150 |
return;
|
| 151 |
}
|
| 152 |
|
