Version Description
- Automatically deactivate plugin when PHP version is not sufficient.
Download this release
Release Info
Developer | webkinder |
Plugin | Google Analytics |
Version | 1.7.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.1 to 1.7.2
- Classes/PluginFactory.php +3 -3
- Config/EnvironmentChecksConfig.php +12 -12
- phpunit.xml.dist-php5.3 +30 -0
- readme.txt +6 -2
- tests-php5.3/bootstrap.php +25 -0
- tests-php5.3/test-factory.php +20 -0
- wk-ga.php +1 -1
Classes/PluginFactory.php
CHANGED
@@ -19,7 +19,7 @@ final class PluginFactory
|
|
19 |
|
20 |
return $plugin;
|
21 |
} else {
|
22 |
-
add_action('admin_notices',
|
23 |
return null;
|
24 |
}
|
25 |
}
|
@@ -33,7 +33,7 @@ final class PluginFactory
|
|
33 |
// Return failed checks
|
34 |
public static function environmentChecks()
|
35 |
{
|
36 |
-
$environment_checks =
|
37 |
foreach (self::getEnvironmentChecks() as $check) {
|
38 |
if ($check['check']) {
|
39 |
array_push($environment_checks, $check);
|
@@ -53,4 +53,4 @@ final class PluginFactory
|
|
53 |
<?php
|
54 |
endforeach;
|
55 |
}
|
56 |
-
}
|
19 |
|
20 |
return $plugin;
|
21 |
} else {
|
22 |
+
add_action('admin_notices', array( __CLASS__, 'DisplayEvironmentErrors' ));
|
23 |
return null;
|
24 |
}
|
25 |
}
|
33 |
// Return failed checks
|
34 |
public static function environmentChecks()
|
35 |
{
|
36 |
+
$environment_checks = array();
|
37 |
foreach (self::getEnvironmentChecks() as $check) {
|
38 |
if ($check['check']) {
|
39 |
array_push($environment_checks, $check);
|
53 |
<?php
|
54 |
endforeach;
|
55 |
}
|
56 |
+
}
|
Config/EnvironmentChecksConfig.php
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
<?php
|
2 |
-
return
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
1 |
<?php
|
2 |
+
return array(
|
3 |
+
array(
|
4 |
+
'id' => 'php',
|
5 |
+
'check' => !version_compare(PHP_VERSION, '5.4', '>='),
|
6 |
+
'error_message' => __('WebKinder Google Analytics needs PHP version 5.4 to run.', 'wk-google-analytics'),
|
7 |
+
),
|
8 |
+
array(
|
9 |
+
'id' => 'wp',
|
10 |
+
'check' => !version_compare(get_bloginfo('version'), '4.8', '>='),
|
11 |
+
'error_message' => __('WebKinder Google Analytics needs WordPress version 4.8 to run.', 'wk-google-analytics'),
|
12 |
+
)
|
13 |
+
);
|
phpunit.xml.dist-php5.3
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<phpunit
|
2 |
+
bootstrap="tests/bootstrap.php"
|
3 |
+
backupGlobals="false"
|
4 |
+
colors="true"
|
5 |
+
convertErrorsToExceptions="true"
|
6 |
+
convertNoticesToExceptions="true"
|
7 |
+
convertWarningsToExceptions="true"
|
8 |
+
>
|
9 |
+
<testsuites>
|
10 |
+
<testsuite>
|
11 |
+
<directory prefix="test-" suffix=".php">./tests-php5.3/</directory>
|
12 |
+
</testsuite>
|
13 |
+
</testsuites>
|
14 |
+
<php>
|
15 |
+
<ini name="display_errors" value="On" />
|
16 |
+
<ini name="display_startup_errors" value="On" />
|
17 |
+
</php>
|
18 |
+
<filter>
|
19 |
+
<whitelist processUncoveredFilesFromWhitelist="true">
|
20 |
+
<directory suffix=".php">./Classes</directory>
|
21 |
+
<exclude>
|
22 |
+
<file>./admin/mailchimp-form.php</file>
|
23 |
+
</exclude>
|
24 |
+
<file>./wk-ga.php</file>
|
25 |
+
</whitelist>
|
26 |
+
</filter>
|
27 |
+
<logging>
|
28 |
+
<log type="coverage-html" target="coverage-report" lowUpperBound="20" highLowerBound="40"/>
|
29 |
+
</logging>
|
30 |
+
</phpunit>
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: webkinder
|
3 |
Tags: google analytics, tracking code, analytics, anonymization, anonymize, anonymizeIp, cookie, Datenschutz, ga, gaoptout, google, googleanalytics, google tag manager, gtm, Datenschutz, datenschutzkonform, script, snippet
|
4 |
Requires at least: 3.0
|
5 |
-
Requires PHP: 5.
|
6 |
Tested up to: 4.9.6
|
7 |
-
Stable tag: 1.7.
|
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.7.1 =
|
37 |
* The "Anonymize IPs" field is now checked by default.
|
38 |
* The Google Analytics tracking opt-out shortcode is automatically integrated on the new WordPress Privacy Policy page along with the Privacy Policy for the use of Google Analytics. This statement is currently available in English and German. You can use this shortcode on any page you wish, so your users can opt-out of Google Analytics tracking.
|
2 |
Contributors: webkinder
|
3 |
Tags: google analytics, tracking code, analytics, anonymization, anonymize, anonymizeIp, cookie, Datenschutz, ga, gaoptout, google, googleanalytics, google tag manager, gtm, Datenschutz, datenschutzkonform, script, snippet
|
4 |
Requires at least: 3.0
|
5 |
+
Requires PHP: 5.4
|
6 |
Tested up to: 4.9.6
|
7 |
+
Stable tag: 1.7.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
33 |
|
34 |
== Changelog ==
|
35 |
|
36 |
+
= 1.7.2 =
|
37 |
+
|
38 |
+
* Automatically deactivate plugin when PHP version is not sufficient.
|
39 |
+
|
40 |
= 1.7.1 =
|
41 |
* The "Anonymize IPs" field is now checked by default.
|
42 |
* The Google Analytics tracking opt-out shortcode is automatically integrated on the new WordPress Privacy Policy page along with the Privacy Policy for the use of Google Analytics. This statement is currently available in English and German. You can use this shortcode on any page you wish, so your users can opt-out of Google Analytics tracking.
|
tests-php5.3/bootstrap.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PHPUnit bootstrap file
|
4 |
+
*
|
5 |
+
* @package Google_Analytics
|
6 |
+
*/
|
7 |
+
|
8 |
+
$_tests_dir = getenv( 'WP_TESTS_DIR' );
|
9 |
+
if ( ! $_tests_dir ) {
|
10 |
+
$_tests_dir = '/tmp/wordpress-tests-lib';
|
11 |
+
}
|
12 |
+
|
13 |
+
// Give access to tests_add_filter() function.
|
14 |
+
require_once $_tests_dir . '/includes/functions.php';
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Manually load the plugin being tested.
|
18 |
+
*/
|
19 |
+
function _manually_load_plugin() {
|
20 |
+
require dirname( dirname( __FILE__ ) ) . '/wk-ga.php';
|
21 |
+
}
|
22 |
+
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
|
23 |
+
|
24 |
+
// Start up the WP testing environment.
|
25 |
+
require $_tests_dir . '/includes/bootstrap.php';
|
tests-php5.3/test-factory.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class SampleTest
|
4 |
+
*
|
5 |
+
* @package Google_Analytics
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Sample test case.
|
10 |
+
*/
|
11 |
+
class FactoryTest extends WP_UnitTestCase {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* A single example test.
|
15 |
+
*/
|
16 |
+
function test_creates_only_one_instance() {
|
17 |
+
$one = WebKinder\GoogleAnalytics\PluginFactory::create();
|
18 |
+
$this->assertNull( $one );
|
19 |
+
}
|
20 |
+
}
|
wk-ga.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Google Analytics by WebKinder
|
4 |
Plugin URI: https://wordpress.org/plugins/wk-google-analytics/
|
5 |
Description: Google Analytics for WordPress without tracking your own visits
|
6 |
-
Version: 1.7.
|
7 |
Author: WebKinder
|
8 |
Author URI: https://www.webkinder.ch
|
9 |
License: GPL2
|
3 |
Plugin Name: Google Analytics by WebKinder
|
4 |
Plugin URI: https://wordpress.org/plugins/wk-google-analytics/
|
5 |
Description: Google Analytics for WordPress without tracking your own visits
|
6 |
+
Version: 1.7.2
|
7 |
Author: WebKinder
|
8 |
Author URI: https://www.webkinder.ch
|
9 |
License: GPL2
|