Version Description
- Fallback for wp_add_inline_script() without registered script used for Google Tag Manager in WordPress with versions below 5.1
Download this release
Release Info
Developer | webkinder |
Plugin | Google Analytics |
Version | 1.9.3 |
Comparing to | |
See all releases |
Code changes from version 1.9.2 to 1.9.3
- lib/Loader.php +11 -3
- readme.txt +5 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +4 -4
- wk-ga.php +1 -1
lib/Loader.php
CHANGED
@@ -125,9 +125,17 @@ gtag('config', '<?php echo $GA_TRACKING_CODE; ?>');
|
|
125 |
{
|
126 |
// Google Tag Manager script in <head>
|
127 |
if (get_option('ga_use_tag_manager')) {
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
|
133 |
// Google Analytics script in <head>
|
125 |
{
|
126 |
// Google Tag Manager script in <head>
|
127 |
if (get_option('ga_use_tag_manager')) {
|
128 |
+
global $wp_version;
|
129 |
+
if (version_compare($wp_version, '5.1', '>=')) {
|
130 |
+
// WordPress version is greater than and equal 5.1 supports inline script without registered dependencies
|
131 |
+
wp_register_script('wk-tag-manager-script', '');
|
132 |
+
wp_enqueue_script('wk-tag-manager-script');
|
133 |
+
wp_add_inline_script('wk-tag-manager-script', $this->google_tag_manager_script());
|
134 |
+
} else {
|
135 |
+
add_action('wp_head', function () {
|
136 |
+
echo '<script type="text/javascript">' . $this->google_tag_manager_script() . '</script>';
|
137 |
+
});
|
138 |
+
}
|
139 |
}
|
140 |
|
141 |
// Google Analytics script in <head>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: google analytics, tracking code, analytics, anonymization, anonymize, anon
|
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 5.5.3
|
6 |
Requires PHP: 7.1
|
7 |
-
Stable tag: 1.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -33,6 +33,10 @@ If you have any questions or feature requests, feel free to contact us via suppo
|
|
33 |
|
34 |
== Changelog ==
|
35 |
|
|
|
|
|
|
|
|
|
36 |
= 1.9.2 =
|
37 |
|
38 |
* Updated wording
|
4 |
Requires at least: 4.8
|
5 |
Tested up to: 5.5.3
|
6 |
Requires PHP: 7.1
|
7 |
+
Stable tag: 1.9.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
33 |
|
34 |
== Changelog ==
|
35 |
|
36 |
+
= 1.9.3 =
|
37 |
+
|
38 |
+
* Fallback for wp_add_inline_script() without registered script used for Google Tag Manager in WordPress with versions below 5.1
|
39 |
+
|
40 |
= 1.9.2 =
|
41 |
|
42 |
* Updated wording
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit16d829d8f7177474c583de4b61926aea::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit586d9140429be238606f0ab34c460ebb
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit16d829d8f7177474c583de4b61926aea
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit16d829d8f7177474c583de4b61926aea', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit16d829d8f7177474c583de4b61926aea', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit16d829d8f7177474c583de4b61926aea::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'W' =>
|
@@ -110,9 +110,9 @@ class ComposerStaticInit586d9140429be238606f0ab34c460ebb
|
|
110 |
public static function getInitializer(ClassLoader $loader)
|
111 |
{
|
112 |
return \Closure::bind(function () use ($loader) {
|
113 |
-
$loader->prefixLengthsPsr4 =
|
114 |
-
$loader->prefixDirsPsr4 =
|
115 |
-
$loader->classMap =
|
116 |
|
117 |
}, null, ClassLoader::class);
|
118 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit16d829d8f7177474c583de4b61926aea
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'W' =>
|
110 |
public static function getInitializer(ClassLoader $loader)
|
111 |
{
|
112 |
return \Closure::bind(function () use ($loader) {
|
113 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit16d829d8f7177474c583de4b61926aea::$prefixLengthsPsr4;
|
114 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit16d829d8f7177474c583de4b61926aea::$prefixDirsPsr4;
|
115 |
+
$loader->classMap = ComposerStaticInit16d829d8f7177474c583de4b61926aea::$classMap;
|
116 |
|
117 |
}, null, ClassLoader::class);
|
118 |
}
|
wk-ga.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: Google Analytics and Google Tag Manager by WebKinder
|
5 |
* Plugin URI: https://wordpress.org/plugins/wk-google-analytics/
|
6 |
* Description: Deploy Google Analytics on your website without having to edit code and without tracking your own visits. You can exclude any logged in user from this and enable tracking solely for them.
|
7 |
-
* Version: 1.9.
|
8 |
* Author: WebKinder
|
9 |
* Author URI: https://www.webkinder.ch
|
10 |
* License: GPL2
|
4 |
* Plugin Name: Google Analytics and Google Tag Manager by WebKinder
|
5 |
* Plugin URI: https://wordpress.org/plugins/wk-google-analytics/
|
6 |
* Description: Deploy Google Analytics on your website without having to edit code and without tracking your own visits. You can exclude any logged in user from this and enable tracking solely for them.
|
7 |
+
* Version: 1.9.3
|
8 |
* Author: WebKinder
|
9 |
* Author URI: https://www.webkinder.ch
|
10 |
* License: GPL2
|