From e7ec4a01cc576363dc14b3dfd084768ad0aadad8 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 2 Sep 2020 11:37:24 +1200 Subject: [PATCH 01/24] adjust tracking settings to make it more clear they are optional and move less important ones to the bottom --- .../WpMatomo/Admin/TrackingSettings/Forms.php | 13 +++- classes/WpMatomo/Admin/views/tracking.php | 61 ++++++++++--------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/classes/WpMatomo/Admin/TrackingSettings/Forms.php b/classes/WpMatomo/Admin/TrackingSettings/Forms.php index 124e0e847..739acd624 100644 --- a/classes/WpMatomo/Admin/TrackingSettings/Forms.php +++ b/classes/WpMatomo/Admin/TrackingSettings/Forms.php @@ -90,8 +90,17 @@ public function show_textarea( $id, $name, $rows, $description, $is_hidden, $gro * * @param string $text Text to show */ - public function show_text( $text ) { - printf( '

%s

', esc_html( $text ) ); + public function show_text( $text , $group_name = '' ) { + printf( '

%s

', $group_name, esc_html( $text ) ); + } + + /** + * Show a simple text + * + * @param string $text Text to show + */ + public function show_headline( $text , $group_name = '') { + printf( '

%s

', $group_name, esc_html( $text ) ); } /** diff --git a/classes/WpMatomo/Admin/views/tracking.php b/classes/WpMatomo/Admin/views/tracking.php index fa382d481..3f7ae2c29 100644 --- a/classes/WpMatomo/Admin/views/tracking.php +++ b/classes/WpMatomo/Admin/views/tracking.php @@ -82,38 +82,10 @@ 'matomo-track-option matomo-track-option-default matomo-track-option-tagmanager matomo-track-option-manually' ); - $matomo_form->show_textarea( 'noscript_code', esc_html__( 'Noscript code', 'matomo' ), 2, 'This is a preview of your <noscript> code which is part of your tracking code.', $matomo_is_not_tracking, 'matomo-track-option matomo-track-option-default matomo-track-option-manually', true, '', ( $settings->get_global_option( 'track_mode' ) !== 'manually' ), false ); - - $matomo_form->show_checkbox( 'track_noscript', __( 'Add <noscript>', 'matomo' ), __( 'Adds the <noscript> code to your footer.', 'matomo' ), $matomo_is_not_tracking, 'matomo-track-option matomo-track-option-default matomo-track-option-manually' ); - - $matomo_form->show_select( - 'track_api_endpoint', - __( 'Endpoint for HTTP Tracking API', 'matomo' ), - array( - 'default' => esc_html__( 'Default', 'matomo' ), - 'restapi' => esc_html__( 'Through WordPress Rest API', 'matomo' ), - ), - __( 'By default the HTTP Tracking API points to your Matomo plugin directory "' . esc_html( $matomo_paths->get_tracker_api_url_in_matomo_dir() ) . '". You can choose to use the WP Rest API (' . esc_html( $matomo_paths->get_tracker_api_rest_api_endpoint() ) . ') instead for example to hide matomo.php or if the other URL doesn\'t work for you. Note: If the tracking mode "Tag Manager" is selected, then this URL currently only applies to the feed tracking.', 'matomo' ), - '', - $matomo_is_not_tracking, - $matomo_full_generated_tracking_group . ' matomo-track-option-manually matomo-track-option-tagmanager' - ); - - $matomo_form->show_select( - 'track_js_endpoint', - __( 'Endpoint for JavaScript tracker', 'matomo' ), - array( - 'default' => esc_html__( 'Default', 'matomo' ), - 'restapi' => esc_html__( 'Through WordPress Rest API (slower)', 'matomo' ), - ), - __( 'By default the JS tracking code will be loaded from "' . esc_html( $matomo_paths->get_js_tracker_url_in_matomo_dir() ) . '". You can choose to serve the JS file through the WP Rest API (' . esc_html( $matomo_paths->get_js_tracker_rest_api_endpoint() ) . ') for example to hide matomo.js. Please note that this means every request to the JavaScript file will launch WordPress PHP and therefore will be slower compared to your webserver serving the JS file directly.', 'matomo' ), - '', - $matomo_is_not_tracking, - $matomo_full_generated_tracking_group - ); - $matomo_form->show_select( \WpMatomo\Settings::SITE_CURRENCY, esc_html__( 'Currency', 'matomo' ), $matomo_currencies, esc_html__('Choose the currency which will be used in reports.', 'matomo'), '' ); + $matomo_form->show_headline(esc_html__('Customise tracking (optional)', 'matomo'), 'matomo-track-option matomo-track-option-default matomo-track-option-manually matomo-track-option-tagmanager'); + $matomo_form->show_checkbox( 'disable_cookies', esc_html__( 'Disable cookies', 'matomo' ), esc_html__( 'Disable all tracking cookies for a visitor.', 'matomo' ), $matomo_is_not_generated_tracking, $matomo_full_generated_tracking_group ); $matomo_form->show_checkbox( 'track_ecommerce', esc_html__( 'Enable ecommerce', 'matomo' ), esc_html__( 'Matom can track Ecommerce orders, abandoned carts and product views for WooCommerce, Easy Digital Analytics, MemberPress, and more. Disabling this feature will also remove Ecommerce reports from the Matomo UI.', 'matomo' ), $matomo_is_not_tracking, $matomo_full_generated_tracking_group . ' matomo-track-option-manually matomo-track-option-tagmanager' ); @@ -198,6 +170,10 @@ $matomo_form->show_input( 'set_link_classes', esc_html__( 'Set classes to be treated as outlinks', 'matomo' ), esc_html__( 'Set classes to be treated as outlinks (in addition to piwik_link), divided by a vertical bar (|). Leave blank to keep Matomo\'s default settings.', 'matomo' ) . ' ' . sprintf( esc_html__( 'See %1$sMatomo JavaScript Tracking Client reference%2$s.', 'matomo' ), '', '' ), $matomo_is_not_tracking, $matomo_full_generated_tracking_group ); + $matomo_form->show_textarea( 'noscript_code', esc_html__( 'Noscript code', 'matomo' ), 2, 'This is a preview of your <noscript> code which is part of your tracking code. Will only show if the noscript feature is enabled.', $matomo_is_not_tracking, 'matomo-track-option matomo-track-option-default matomo-track-option-manually', true, '', ( $settings->get_global_option( 'track_mode' ) !== 'manually' ), false ); + + $matomo_form->show_checkbox( 'track_noscript', __( 'Add <noscript>', 'matomo' ), __( 'Adds the <noscript> code to your footer.', 'matomo' ) . ' This can be useful if you have a lot of visitors that have JavaScript disabled.', $matomo_is_not_tracking, 'matomo-track-option matomo-track-option-default matomo-track-option-manually' ); + $matomo_form->show_select( 'force_protocol', __( 'Force Matomo to use a specific protocol', 'matomo' ), @@ -210,6 +186,31 @@ $matomo_is_not_tracking, $matomo_full_generated_tracking_group . ' matomo-track-option-tagmanager' ); + $matomo_form->show_select( + 'track_api_endpoint', + __( 'Endpoint for HTTP Tracking API', 'matomo' ), + array( + 'default' => esc_html__( 'Default', 'matomo' ), + 'restapi' => esc_html__( 'Through WordPress Rest API', 'matomo' ), + ), + __( 'By default the HTTP Tracking API points to your Matomo plugin directory "' . esc_html( $matomo_paths->get_tracker_api_url_in_matomo_dir() ) . '". You can choose to use the WP Rest API (' . esc_html( $matomo_paths->get_tracker_api_rest_api_endpoint() ) . ') instead for example to hide matomo.php or if the other URL doesn\'t work for you. Note: If the tracking mode "Tag Manager" is selected, then this URL currently only applies to the feed tracking.', 'matomo' ), + '', + $matomo_is_not_tracking, + $matomo_full_generated_tracking_group . ' matomo-track-option-manually matomo-track-option-tagmanager' + ); + + $matomo_form->show_select( + 'track_js_endpoint', + __( 'Endpoint for JavaScript tracker', 'matomo' ), + array( + 'default' => esc_html__( 'Default', 'matomo' ), + 'restapi' => esc_html__( 'Through WordPress Rest API (slower)', 'matomo' ), + ), + __( 'By default the JS tracking code will be loaded from "' . esc_html( $matomo_paths->get_js_tracker_url_in_matomo_dir() ) . '". You can choose to serve the JS file through the WP Rest API (' . esc_html( $matomo_paths->get_js_tracker_rest_api_endpoint() ) . ') for example to hide matomo.js. Please note that this means every request to the JavaScript file will launch WordPress PHP and therefore will be slower compared to your webserver serving the JS file directly.', 'matomo' ), + '', + $matomo_is_not_tracking, + $matomo_full_generated_tracking_group + ); echo $matomo_submit_button; ?> From 0c88efee33f4573bab2b146ce0f341c885b0d75e Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 2 Sep 2020 17:54:58 +1200 Subject: [PATCH 02/24] improve performance of query --- classes/WpMatomo/Admin/SystemReport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/WpMatomo/Admin/SystemReport.php b/classes/WpMatomo/Admin/SystemReport.php index b2718cd0d..0a629ca6d 100644 --- a/classes/WpMatomo/Admin/SystemReport.php +++ b/classes/WpMatomo/Admin/SystemReport.php @@ -630,7 +630,7 @@ private function had_visits_in_last_days($numDays) try { $time = gmdate( 'Y-m-d H:i:s', time() - $days_in_seconds ); - $sql = $wpdb->prepare('SELECT count(idsite) from ' . $prefix_table . ' where visit_last_action_time > %s LIMIT 1', $time ); + $sql = $wpdb->prepare('SELECT idsite from ' . $prefix_table . ' where visit_last_action_time > %s LIMIT 1', $time ); $row = $wpdb->get_var( $sql ); } catch ( \Exception $e ) { $row = null; From 4e0187e5a24d6a7b9e4c327b7b1f4605e48d7120 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Mon, 7 Sep 2020 14:00:12 +1200 Subject: [PATCH 03/24] fix #342 overwrite Matomo Opt Out screen --- assets/js/asset_manager_core_js.js | 2 +- assets/js/opt-out-configurator.directive.html | 9 ++++ assets/js/opt-out-configurator.directive.js | 43 +++++++++++++++++++ plugins/WordPress/WpAssetManager.php | 1 + scripts/update-core.sh | 2 + 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 assets/js/opt-out-configurator.directive.html create mode 100644 assets/js/opt-out-configurator.directive.js diff --git a/assets/js/asset_manager_core_js.js b/assets/js/asset_manager_core_js.js index 1be49051d..21ed4df5e 100644 --- a/assets/js/asset_manager_core_js.js +++ b/assets/js/asset_manager_core_js.js @@ -3787,7 +3787,7 @@ vm.onUpdate();$scope.$watch('piwikurl',function(val,oldVal){vm.onUpdate();});}}) * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -(function(){angular.module('piwikApp').directive('piwikOptOutCustomizer',piwikOptOutCustomizer);piwikOptOutCustomizer.$inject=['piwik'];function piwikOptOutCustomizer(piwik){var defaults={};return{restrict:'A',scope:{language:'@',piwikurl:'@'},templateUrl:'plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html?cb='+piwik.cacheBuster,controller:'OptOutCustomizerController',controllerAs:'optOutCustomizer',compile:function(element,attrs){for(var index in defaults){if(defaults.hasOwnProperty(index)&&attrs[index]===undefined){attrs[index]=defaults[index];}} +(function(){angular.module('piwikApp').directive('piwikOptOutCustmizer',piwikOptOutCustomizer);piwikOptOutCustomizer.$inject=['piwik'];function piwikOptOutCustomizer(piwik){var defaults={};return{restrict:'A',scope:{language:'@',piwikurl:'@'},templateUrl:'plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html?cb='+piwik.cacheBuster,controller:'OptOutCustomizerController',controllerAs:'optOutCustomizer',compile:function(element,attrs){for(var index in defaults){if(defaults.hasOwnProperty(index)&&attrs[index]===undefined){attrs[index]=defaults[index];}} return function(scope,element,attrs){};}};}})(); /*! * Piwik - free/libre analytics platform diff --git a/assets/js/opt-out-configurator.directive.html b/assets/js/opt-out-configurator.directive.html new file mode 100644 index 000000000..a1d639ac4 --- /dev/null +++ b/assets/js/opt-out-configurator.directive.html @@ -0,0 +1,9 @@ +
+

+ Use the short code [matomo_opt_out] to embed the opt out into your website.
+ You can use these short code options:

+
    +
  • language - eg de or en. By default the language is detected automatically based on the user's browser
  • +
+

Example: [matomo_opt_out language=de]

+
diff --git a/assets/js/opt-out-configurator.directive.js b/assets/js/opt-out-configurator.directive.js new file mode 100644 index 000000000..88c20ff22 --- /dev/null +++ b/assets/js/opt-out-configurator.directive.js @@ -0,0 +1,43 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +/** + * Usage: + *
+ */ +(function () { + angular.module('piwikApp').directive('piwikOptOutCustomizer', piwikOptOutCustomizer); + + piwikOptOutCustomizer.$inject = ['piwik']; + + function piwikOptOutCustomizer(piwik){ + var defaults = { + // showAllSitesItem: 'true' + }; + + return { + restrict: 'A', + scope: { + language: '@', + piwikurl: '@' + }, + templateUrl: '../assets/js/opt-out-configurator.directive.html?cb=' + piwik.cacheBuster, + compile: function (element, attrs) { + + for (var index in defaults) { + if (defaults.hasOwnProperty(index) && attrs[index] === undefined) { + attrs[index] = defaults[index]; + } + } + + return function (scope, element, attrs) { + + }; + } + }; + } +})(); \ No newline at end of file diff --git a/plugins/WordPress/WpAssetManager.php b/plugins/WordPress/WpAssetManager.php index f44313778..1e8c2bd1e 100644 --- a/plugins/WordPress/WpAssetManager.php +++ b/plugins/WordPress/WpAssetManager.php @@ -63,6 +63,7 @@ public function getJsInclusionDirective() $result .= ""; $result .= sprintf(self::JS_IMPORT_DIRECTIVE, '../assets/js/asset_manager_core_js.js?v=' . Version::VERSION); + $result .= sprintf(self::JS_IMPORT_DIRECTIVE, '../assets/js/opt-out-configurator.directive.js?v=' . Version::VERSION); // may need to change or allow to this... but how to make the wp-includes relative? // $result .= sprintf(self::JS_IMPORT_DIRECTIVE, plugins_url( 'assets/js/asset_manager_core_js.js', MATOMO_ANALYTICS_FILE ) . '?v=' . Version::VERSION); diff --git a/scripts/update-core.sh b/scripts/update-core.sh index 7d6b54fdc..c1b5aeb0d 100755 --- a/scripts/update-core.sh +++ b/scripts/update-core.sh @@ -48,6 +48,8 @@ find $MATOMO_ROOT/core/Updates -name '*.php' ! -name '3.12.0-b1.php' ! -name '3. rm -rf $MATOMO_ROOT/vendor/piwik/decompress/libs/PclZip mv bootstrap.php $MATOMO_ROOT/bootstrap.php mv .htaccess $MATOMO_ROOT/.htaccess +# we overwrite the opt out customer so don't include it +echo "" > $MATOMO_ROOT/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.js sed -i -e 's/libs\/bower_components\/jquery\/dist\/jquery.min.js/..\/..\/..\/..\/..\/..\/..\/wp-includes\/js\/jquery\/jquery.js/' $MATOMO_ROOT/plugins/Overlay/client/client.js From 7baaa9ec3cdf40b3d2c3f7fdd5be92da06a13141 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 8 Sep 2020 10:50:40 +1200 Subject: [PATCH 04/24] Trim header to prevent newline in email header --- classes/WpMatomo/Email.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/WpMatomo/Email.php b/classes/WpMatomo/Email.php index 2481562bd..325f09262 100644 --- a/classes/WpMatomo/Email.php +++ b/classes/WpMatomo/Email.php @@ -115,6 +115,7 @@ private function sendMailThroughWordPress($recipients, $subject, $content, $head $this->rememberMailSent(); + $header = trim($header); $success = wp_mail( $recipients, $subject, $content, $header ); remove_action( 'wp_mail_failed', array($this, 'onError') ); From fe0ce1bb4b601f4d677b482a3fcc0328967a2af2 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 8 Sep 2020 15:01:24 +1200 Subject: [PATCH 05/24] update donations widget --- app/plugins/CoreHome/templates/_donate.twig | 71 ++++++--------------- classes/WpMatomo/Admin/views/info.php | 5 +- matomo.php | 2 + 3 files changed, 26 insertions(+), 52 deletions(-) diff --git a/app/plugins/CoreHome/templates/_donate.twig b/app/plugins/CoreHome/templates/_donate.twig index 99e713ec8..379cca8bf 100644 --- a/app/plugins/CoreHome/templates/_donate.twig +++ b/app/plugins/CoreHome/templates/_donate.twig @@ -1,58 +1,27 @@ -
+
- {% if msg is defined %} - {{ msg }} - {% else %} -

{{ 'CoreHome_DonateCall1'|translate }}

-

{{ 'CoreHome_DonateCall2'|translate }}

-

{{ 'CoreHome_DonateCall3'|translate('','', '', '')|raw }}

- {% endif %} +

Matomo will always cost you nothing to use, but that doesn't mean it costs us nothing to make.

+

Matomo needs your continued support to grow and thrive.

+

If you feel that Matomo has added significant value to your business or endeavour, please consider donating or purchasing a premium feature. Every penny will help.

- {{ 'CoreHome_HowMuchIsPiwikWorth'|translate }} + Find us on - + -
-
-
-
-
-
-
$30/{{ 'Intl_Year_Short'|translate }}
+

+ Your donation will directly help fund new features and improvements for this open-source analytics platform. This means the community will always benefit from a tool that protects privacy and lets you stay in control of your data. +

+ Thank you from all of us at Matomo! +

- -
+
- -
- - - - - - - - - - - {% if footerMessage is defined %} -
- {{ footerMessage }} -
- {% endif %} -
- +
+
\ No newline at end of file diff --git a/classes/WpMatomo/Admin/views/info.php b/classes/WpMatomo/Admin/views/info.php index a7d628b90..b9a6f5f97 100644 --- a/classes/WpMatomo/Admin/views/info.php +++ b/classes/WpMatomo/Admin/views/info.php @@ -40,7 +40,9 @@ ); ?>

- ' ); ?> + Every penny will help.

diff --git a/matomo.php b/matomo.php index d7162679d..ab8cf8280 100644 --- a/matomo.php +++ b/matomo.php @@ -126,7 +126,9 @@ function matomo_anonymize_value( $value ) { $values_to_anonymize = array( ABSPATH => '$ABSPATH/', str_replace( '/', '\/', ABSPATH ) => '$ABSPATH\/', + str_replace( '/', '\\', ABSPATH ) => '$ABSPATH\/', WP_CONTENT_DIR => '$WP_CONTENT_DIR/', + str_replace( '/', '\\', WP_CONTENT_DIR ) => '$WP_CONTENT_DIR\\', home_url() => '$home_url', site_url() => '$site_url', DB_PASSWORD => '$DB_PASSWORD', From 4547e2b1dd7c484986c2204113abefdbbf25e0f4 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 8 Sep 2020 15:01:59 +1200 Subject: [PATCH 06/24] Create FUNDING.yml --- .github/FUNDING.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..1b87d8c0c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,7 @@ +# These are supported funding model platforms + +patreon: matomo +open_collective: matomo-analytics +ko_fi: matomo +liberapay: Matomo +custom: ['https://www.paypal.com/donate/?hosted_button_id=RPL23NJURMTFA'] From 52129cc1d3cf5edae65d65e4288964ce5be3860c Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 8 Sep 2020 18:27:49 +1200 Subject: [PATCH 07/24] Better language detection --- classes/WpMatomo/User/Sync.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/WpMatomo/User/Sync.php b/classes/WpMatomo/User/Sync.php index c0b4e9d89..6732a0e75 100644 --- a/classes/WpMatomo/User/Sync.php +++ b/classes/WpMatomo/User/Sync.php @@ -169,7 +169,12 @@ protected function sync_users( $users, $idsite ) { if ( $matomo_login ) { $locale = get_user_locale( $user->ID ); - $parts = explode( '_', $locale ); + $locale_dash = str_replace('_', '-', $locale); + if ($locale && in_array($locale_dash, ['zh-cn', 'zh-tw', 'pt-br', 'es-ar'], true)) { + $parts = [$locale_dash]; + } else { + $parts = explode( '_', $locale ); + } if ( ! empty( $parts[0] ) ) { $lang = $parts[0]; From b5572d8a51ae56c8811b0df316a0f330fd3fbf5b Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 8 Sep 2020 19:43:17 +1200 Subject: [PATCH 08/24] Better language detection --- classes/WpMatomo/User/Sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/WpMatomo/User/Sync.php b/classes/WpMatomo/User/Sync.php index 6732a0e75..a7a1ae069 100644 --- a/classes/WpMatomo/User/Sync.php +++ b/classes/WpMatomo/User/Sync.php @@ -169,7 +169,7 @@ protected function sync_users( $users, $idsite ) { if ( $matomo_login ) { $locale = get_user_locale( $user->ID ); - $locale_dash = str_replace('_', '-', $locale); + $locale_dash = Common::mb_strtolower(str_replace('_', '-', $locale)); if ($locale && in_array($locale_dash, ['zh-cn', 'zh-tw', 'pt-br', 'es-ar'], true)) { $parts = [$locale_dash]; } else { From 7d48edebd1f63fba6e7f38267c40e27d18b311a8 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 9 Sep 2020 12:40:34 +1200 Subject: [PATCH 09/24] Add some debugging to ajax tracker --- classes/WpMatomo/AjaxTracker.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/classes/WpMatomo/AjaxTracker.php b/classes/WpMatomo/AjaxTracker.php index 9c41a55dc..8d0db4d4c 100644 --- a/classes/WpMatomo/AjaxTracker.php +++ b/classes/WpMatomo/AjaxTracker.php @@ -9,6 +9,8 @@ namespace WpMatomo; +use WpMatomo\Logger; + if ( ! defined( 'ABSPATH' ) ) { exit; // if accessed directly } @@ -19,8 +21,11 @@ class AjaxTracker extends \PiwikTracker { private $has_cookie = false; + private $logger; public function __construct( Settings $settings ) { + $this->logger = new Logger(); + $site = new Site(); $idsite = $site->get_current_matomo_site_id(); @@ -65,6 +70,7 @@ protected function setCookie( $cookieName, $cookieValue, $cookieTTL ) { protected function sendRequest( $url, $method = 'GET', $data = null, $force = false ) { if ( ! $this->idSite ) { + $this->logger->log('ecommerce tracking could not find idSite, cannot send request'); return; // not installed or synced yet } $args = array( @@ -79,7 +85,13 @@ protected function sendRequest( $url, $method = 'GET', $data = null, $force = fa // 1) Not send any response no matter what happens // 2) Never exit at any point - return wp_remote_request( $url, $args ); + $response = wp_remote_request( $url, $args ); + + if (is_wp_error($response)) { + $this->logger->log_exception('ajax_tracker', new \Exception($response->get_error_message())); + } + + return $response; } } From 5d1dbc70415e72729f2fca743d78fcfb4e4dcd60 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 9 Sep 2020 13:00:21 +1200 Subject: [PATCH 10/24] show tracking failures in system report --- classes/WpMatomo/Admin/SystemReport.php | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/classes/WpMatomo/Admin/SystemReport.php b/classes/WpMatomo/Admin/SystemReport.php index 0a629ca6d..e308b43ac 100644 --- a/classes/WpMatomo/Admin/SystemReport.php +++ b/classes/WpMatomo/Admin/SystemReport.php @@ -20,6 +20,7 @@ use Piwik\Plugins\Diagnostics\Diagnostic\DiagnosticResult; use Piwik\Plugins\Diagnostics\DiagnosticService; use Piwik\Plugins\UserCountry\LocationProvider; +use Piwik\Tracker\Failures; use WpMatomo\Bootstrap; use WpMatomo\Capabilities; use WpMatomo\Installer; @@ -610,6 +611,32 @@ private function get_matomo_info() { ); } + + if ( ! \WpMatomo::is_safe_mode() ) { + Bootstrap::do_bootstrap(); + + $tracking_failures = new Failures(); + $tracking_failures = $tracking_failures->getAllFailures(); + if (!empty($tracking_failures)) { + $rows[] = array( + 'section' => 'Tracking failures', + ); + foreach ($tracking_failures as $failure) { + $comment = sprintf('Solution: %s
More info: %s
Date: %s
Request URL: %s', + $failure['solution'], $failure['solution_url'], + $failure['pretty_date_first_occurred'], $failure['request_url']); + $rows[] = array( + 'name' => $failure['problem'], + 'is_warning' => true, + 'value' => '', + 'comment' => $comment, + ); + } + + } + } + + return $rows; } From f8c10ed1b809034f1c4f4aa36ba45837f586db79 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 17 Sep 2020 14:28:00 +1200 Subject: [PATCH 11/24] update woocommerce tested with version --- matomo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matomo.php b/matomo.php index ab8cf8280..f107f9995 100644 --- a/matomo.php +++ b/matomo.php @@ -7,7 +7,7 @@ * Version: 1.3.0 * Domain Path: /languages * WC requires at least: 2.4.0 - * WC tested up to: 4.0.0 + * WC tested up to: 4.5.0 * * Matomo - free/libre analytics platform * From 5ac495996c64637502acfe6c4fa4a9f24e1c7a88 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Mon, 21 Sep 2020 13:46:01 +1200 Subject: [PATCH 12/24] highlight IP in proxy setting --- classes/WpMatomo/Admin/views/advanced_settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/WpMatomo/Admin/views/advanced_settings.php b/classes/WpMatomo/Admin/views/advanced_settings.php index e37025e59..5cf3b5f99 100644 --- a/classes/WpMatomo/Admin/views/advanced_settings.php +++ b/classes/WpMatomo/Admin/views/advanced_settings.php @@ -39,7 +39,7 @@ REMOTE_ADDR ' . ( ! empty( $_SERVER[ 'REMOTE_ADDR' ] ) ? esc_html( $_SERVER[ 'REMOTE_ADDR' ] ) : esc_html__( 'No value found', 'matomo' ) ) . ' (' . esc_html__( 'Default', 'matomo' ) .')'; foreach ( AdvancedSettings::$valid_host_headers as $host_header ) { - echo ' ' . $host_header . ' ' . ( ! empty( $_SERVER[ $host_header ] ) ? esc_html( $_SERVER[ $host_header ] ) : esc_html__( 'No value found', 'matomo' ) ) . '   '; + echo ' ' . $host_header . ' ' . ( ! empty( $_SERVER[ $host_header ] ) ? (''. esc_html( $_SERVER[ $host_header ] ) . '') : esc_html__( 'No value found', 'matomo' ) ) . '   '; } ?> From 2e57cbb8ec756237f7b34cb24539173e4bc7e8e3 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Mon, 21 Sep 2020 16:06:39 +1200 Subject: [PATCH 13/24] add link to FAQ describing what to do when proxy header is set --- classes/WpMatomo/Admin/SystemReport.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/WpMatomo/Admin/SystemReport.php b/classes/WpMatomo/Admin/SystemReport.php index e308b43ac..9a9fd10fd 100644 --- a/classes/WpMatomo/Admin/SystemReport.php +++ b/classes/WpMatomo/Admin/SystemReport.php @@ -494,6 +494,7 @@ private function get_matomo_info() { if ( ! \WpMatomo::is_safe_mode() ) { Bootstrap::do_bootstrap(); $general = Config::getInstance()->General; + if (empty($general['proxy_client_headers'])) { foreach (AdvancedSettings::$valid_host_headers as $header) { if (!empty($_SERVER[$header])) { @@ -501,7 +502,7 @@ private function get_matomo_info() { 'name' => 'Proxy header', 'value' => $header, 'is_warning' => true, - 'comment' => 'A proxy header is set which means you maybe need to configure a proxy header in the Advanced settings to make location reporting work. If the location in your reports is detected correctly, you can ignore this warning.', + 'comment' => 'A proxy header is set which means you maybe need to configure a proxy header in the Advanced settings to make location reporting work. If the location in your reports is detected correctly, you can ignore this warning. Learn more: https://matomo.org/faq/wordpress/how-do-i-fix-the-proxy-header-warning-in-the-matomo-for-wordpress-system-report/', ); } } From 8aa28bd2ec317af0d6d07568c7a727d497a2e3d9 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 24 Sep 2020 11:55:19 +1200 Subject: [PATCH 14/24] fix #343 Ecommerce tracking with tag manager --- app/plugins/TagManager/Template/Tag/MatomoTag.web.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/plugins/TagManager/Template/Tag/MatomoTag.web.js b/app/plugins/TagManager/Template/Tag/MatomoTag.web.js index 86e343968..ffa0ea02e 100644 --- a/app/plugins/TagManager/Template/Tag/MatomoTag.web.js +++ b/app/plugins/TagManager/Template/Tag/MatomoTag.web.js @@ -111,9 +111,9 @@ lastMatomoUrl = getMatomoUrlFromConfig(matomoConfig); var trackerUrl = lastMatomoUrl + matomoConfig.trackingEndpoint; if (matomoConfig.registerAsDefaultTracker) { - tracker = Piwik.addTracker(trackerUrl); + tracker = Piwik.addTracker(trackerUrl, matomoConfig.idSite); } else { - tracker = Piwik.getTracker(trackerUrl); + tracker = Piwik.getTracker(trackerUrl, matomoConfig.idSite); } configuredTrackers[variableName] = tracker; @@ -155,8 +155,6 @@ tracker.setDomains(domains); } - tracker.setSiteId(matomoConfig.idSite); - if (matomoConfig.alwaysUseSendBeacon) { tracker.alwaysUseSendBeacon(); } From f704239737c2e99c72ae611179210bcbc3fe70e2 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 1 Oct 2020 13:40:48 +1300 Subject: [PATCH 15/24] Add possibility to configure log level --- CHANGELOG.md | 4 ++++ classes/WpMatomo/Logger.php | 23 ++++++++++++++++++- classes/WpMatomo/TrackingCode.php | 10 ++++---- .../TrackingCode/TrackingCodeGenerator.php | 8 ++++--- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a564b3b49..7c8ba94de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ == Changelog == += 1.3.1 = +* Log less messages by default +* Add possibility to disable logging and enable logging of all messages through wp-config.php + = 1.3.0 = * Changed opt out shortcode to no longer use an iframe and instead print the content directly * Automatically use a primary key for log tmp table when required diff --git a/classes/WpMatomo/Logger.php b/classes/WpMatomo/Logger.php index 0cda9e2fe..c86f4e716 100644 --- a/classes/WpMatomo/Logger.php +++ b/classes/WpMatomo/Logger.php @@ -16,8 +16,29 @@ } class Logger { + const LEVEL_NONE = 99; + const LEVEL_DEBUG = 1; + const LEVEL_INFO = 3; + + private function get_log_level() + { + if ( defined('MATOMO_DEBUG')) { + if (MATOMO_DEBUG) { + return self::LEVEL_DEBUG; + } + return self::LEVEL_NONE; + } + + return self::LEVEL_INFO; + } + + public function log( $message , $mode = 3) { + $log_level = $this->get_log_level(); + + if ($log_level > $mode) { + return; + } - public function log( $message ) { if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) { if ( is_array( $message ) || is_object( $message ) ) { error_log( 'Matomo: ' . print_r( $message, true ) ); diff --git a/classes/WpMatomo/TrackingCode.php b/classes/WpMatomo/TrackingCode.php index 4b400665d..ac8b78ac7 100644 --- a/classes/WpMatomo/TrackingCode.php +++ b/classes/WpMatomo/TrackingCode.php @@ -90,14 +90,14 @@ public function is_hidden_user() { */ public function add_javascript_code() { if ( $this->is_hidden_user() ) { - $this->logger->log( 'Do not add tracking code to site (user should not be tracked) Blog ID: ' . get_current_blog_id() ); + $this->logger->log( 'Do not add tracking code to site (user should not be tracked) Blog ID: ' . get_current_blog_id(), Logger::LEVEL_DEBUG ); return; } $tracking_code = $this->generator->get_tracking_code(); - $this->logger->log( 'Add tracking code. Blog ID: ' . get_current_blog_id() ); + $this->logger->log( 'Add tracking code. Blog ID: ' . get_current_blog_id(), Logger::LEVEL_DEBUG ); if ( $this->settings->is_network_enabled() && 'manually' === $this->settings->get_global_option( 'track_mode' ) ) { @@ -120,7 +120,7 @@ public function add_javascript_code() { */ public function add_noscript_code() { if ( $this->is_hidden_user() ) { - $this->logger->log( 'Do not add noscript code to site (user should not be tracked) Blog ID: ' . get_current_blog_id() ); + $this->logger->log( 'Do not add noscript code to site (user should not be tracked) Blog ID: ' . get_current_blog_id(), Logger::LEVEL_DEBUG ); return; } @@ -128,10 +128,10 @@ public function add_noscript_code() { $code = $this->generator->get_noscript_code(); if ( ! empty( $code ) ) { - $this->logger->log( 'Add noscript code. Blog ID: ' . get_current_blog_id() ); + $this->logger->log( 'Add noscript code. Blog ID: ' . get_current_blog_id(), Logger::LEVEL_DEBUG ); echo $code . "\n"; } else { - $this->logger->log( 'No noscript code present. Blog ID: ' . get_current_blog_id() ); + $this->logger->log( 'No noscript code present. Blog ID: ' . get_current_blog_id(), Logger::LEVEL_DEBUG ); } } diff --git a/classes/WpMatomo/TrackingCode/TrackingCodeGenerator.php b/classes/WpMatomo/TrackingCode/TrackingCodeGenerator.php index d23d606a1..1ba5c2982 100644 --- a/classes/WpMatomo/TrackingCode/TrackingCodeGenerator.php +++ b/classes/WpMatomo/TrackingCode/TrackingCodeGenerator.php @@ -211,7 +211,9 @@ public function get_js_endpoint() { * @return array */ public function prepare_tracking_code( $idsite ) { - $this->logger->log( 'Apply tracking code changes:' ); + $logLevel = is_admin() ? Logger::LEVEL_DEBUG : Logger::LEVEL_INFO; + + $this->logger->log( 'Apply tracking code changes:', $logLevel ); $tracker_endpoint = $this->get_tracker_endpoint(); $js_endpoint = $this->get_js_endpoint(); @@ -298,8 +300,8 @@ function ( $host ) { $script = apply_filters( 'matomo_tracking_code_script', $script, $idsite ); $script = apply_filters( 'matomo_tracking_code_noscript', $script, $idsite ); - $this->logger->log( 'Finished tracking code: ' . $script ); - $this->logger->log( 'Finished noscript code: ' . $no_script ); + $this->logger->log( 'Finished tracking code: ' . $script, $logLevel ); + $this->logger->log( 'Finished noscript code: ' . $no_script, $logLevel); return array( 'script' => $script, From c0ffbe2eaad3a71fa02a39e9a7e3db4874f9dda3 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 1 Oct 2020 13:50:59 +1300 Subject: [PATCH 16/24] try fix test --- tests/phpunit/wpmatomo/admin/test-systemreport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/wpmatomo/admin/test-systemreport.php b/tests/phpunit/wpmatomo/admin/test-systemreport.php index 70e039635..4aad7cf12 100644 --- a/tests/phpunit/wpmatomo/admin/test-systemreport.php +++ b/tests/phpunit/wpmatomo/admin/test-systemreport.php @@ -7,7 +7,7 @@ use WpMatomo\Roles; use WpMatomo\Settings; -class AdminSystemReportTest extends MatomoUnit_TestCase { +class AdminSystemReportTest extends MatomoAnalytics_TestCase { /** * @var SystemReport From f3731fa7862de3912184d56046ec3984297048ea Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 1 Oct 2020 13:59:41 +1300 Subject: [PATCH 17/24] fix test --- classes/WpMatomo/Admin/SystemReport.php | 7 ++++++- tests/phpunit/wpmatomo/admin/test-systemreport.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/WpMatomo/Admin/SystemReport.php b/classes/WpMatomo/Admin/SystemReport.php index 9a9fd10fd..cf5e84468 100644 --- a/classes/WpMatomo/Admin/SystemReport.php +++ b/classes/WpMatomo/Admin/SystemReport.php @@ -617,7 +617,12 @@ private function get_matomo_info() { Bootstrap::do_bootstrap(); $tracking_failures = new Failures(); - $tracking_failures = $tracking_failures->getAllFailures(); + + try { + $tracking_failures = $tracking_failures->getAllFailures(); + } catch (\Exception $e) { + $tracking_failures = []; + } if (!empty($tracking_failures)) { $rows[] = array( 'section' => 'Tracking failures', diff --git a/tests/phpunit/wpmatomo/admin/test-systemreport.php b/tests/phpunit/wpmatomo/admin/test-systemreport.php index 4aad7cf12..70e039635 100644 --- a/tests/phpunit/wpmatomo/admin/test-systemreport.php +++ b/tests/phpunit/wpmatomo/admin/test-systemreport.php @@ -7,7 +7,7 @@ use WpMatomo\Roles; use WpMatomo\Settings; -class AdminSystemReportTest extends MatomoAnalytics_TestCase { +class AdminSystemReportTest extends MatomoUnit_TestCase { /** * @var SystemReport From dcf09170f2ac69dfc89afba347f310e558d91598 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 1 Oct 2020 14:00:51 +1300 Subject: [PATCH 18/24] further tweaks --- classes/WpMatomo/Admin/SystemReport.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/classes/WpMatomo/Admin/SystemReport.php b/classes/WpMatomo/Admin/SystemReport.php index cf5e84468..32d82f8c9 100644 --- a/classes/WpMatomo/Admin/SystemReport.php +++ b/classes/WpMatomo/Admin/SystemReport.php @@ -615,19 +615,18 @@ private function get_matomo_info() { if ( ! \WpMatomo::is_safe_mode() ) { Bootstrap::do_bootstrap(); - - $tracking_failures = new Failures(); - + $trackfailures = []; try { - $tracking_failures = $tracking_failures->getAllFailures(); + $tracking_failures = new Failures(); + $trackfailures = $tracking_failures->getAllFailures(); } catch (\Exception $e) { - $tracking_failures = []; + // ignored in case not set up yet etc. } - if (!empty($tracking_failures)) { + if (!empty($trackfailures)) { $rows[] = array( 'section' => 'Tracking failures', ); - foreach ($tracking_failures as $failure) { + foreach ($trackfailures as $failure) { $comment = sprintf('Solution: %s
More info: %s
Date: %s
Request URL: %s', $failure['solution'], $failure['solution_url'], $failure['pretty_date_first_occurred'], $failure['request_url']); From d3597586aec17c5391b9374bf6650dac75332301 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 13 Oct 2020 08:01:31 +1300 Subject: [PATCH 19/24] Use correct protocol for jQuery WP assets refs https://github.com/matomo-org/wp-matomo/issues/358 Seems WordPress is falsely returning an http URL. If HTTPS is used, we can force HTTPS over HTTP. Otherwise use same protocol as requested in case it is behind proxy or similar. --- plugins/WordPress/WpAssetManager.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/WordPress/WpAssetManager.php b/plugins/WordPress/WpAssetManager.php index 1e8c2bd1e..9a5800ac7 100644 --- a/plugins/WordPress/WpAssetManager.php +++ b/plugins/WordPress/WpAssetManager.php @@ -11,6 +11,7 @@ use Piwik\AssetManager; use Piwik\Plugins\WordPress\AssetManager\NeverDeleteOnDiskUiAsset; +use Piwik\ProxyHttp; use Piwik\Translate; use Piwik\Version; @@ -58,6 +59,11 @@ public function getJsInclusionDirective() foreach ($jsFiles as $jsFile) { $jQueryPath = includes_url('js/' . $jsFile); + if (ProxyHttp::isHttps()) { + $jQueryPath = str_replace('http://', 'https://', $jQueryPath); + } else { + $jQueryPath = str_replace('http://', '//', $jQueryPath); + } $result .= sprintf(self::JS_IMPORT_DIRECTIVE, $jQueryPath); } From 1fd12bf162caa5369267e4e2b641a66a24dbe7d7 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 13 Oct 2020 10:46:42 +1300 Subject: [PATCH 20/24] show a warning in system report when MS edge is being used --- classes/WpMatomo/Admin/SystemReport.php | 28 ++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/classes/WpMatomo/Admin/SystemReport.php b/classes/WpMatomo/Admin/SystemReport.php index 32d82f8c9..189641593 100644 --- a/classes/WpMatomo/Admin/SystemReport.php +++ b/classes/WpMatomo/Admin/SystemReport.php @@ -9,11 +9,13 @@ namespace WpMatomo\Admin; +use DeviceDetector\DeviceDetector; use Piwik\CliMulti; use Piwik\Common; use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\Date; +use Piwik\DeviceDetector\DeviceDetectorFactory; use Piwik\Filesystem; use Piwik\MetricsFormatter; use Piwik\Plugins\CoreAdminHome\API; @@ -200,7 +202,7 @@ public function show() { array( 'title' => 'Browser', 'rows' => $this->get_browser_info(), - 'has_comments' => false, + 'has_comments' => true, ), ); } @@ -976,14 +978,34 @@ private function get_browser_info() { if (!empty($_SERVER['HTTP_USER_AGENT'])) { $rows[] = array( 'name' => 'Browser', - 'value' => $_SERVER['HTTP_USER_AGENT'], + 'value' => '', + 'comment' => $_SERVER['HTTP_USER_AGENT'] ); } if (!\WpMatomo::is_safe_mode()) { Bootstrap::do_bootstrap(); + try { + if (!empty($_SERVER['HTTP_USER_AGENT'])) { + $detector = StaticContainer::get(DeviceDetectorFactory::class)->makeInstance($_SERVER['HTTP_USER_AGENT']); + $client = $detector->getClient(); + if (!empty($client['name']) && $client['name'] === 'Microsoft Edge' && (int) $client['version'] >= 85) { + $rows[] = array( + 'name' => 'Browser Compatibility', + 'is_warning' => true, + 'value' => 'Yes', + 'comment' => 'Because you are using MS Edge browser, you may see a warning like "This site has been reported as unsafe" from "Microsoft Defender SmartScreen" when you view the Matomo Reporting, Admin or Tag Manager page. This is a false alert and you can safely ignore this warning by clicking on the icon next to the URL (in the address bar) and choosing either "Report as safe" (preferred) or "Show unsafe content". We are hoping to get this false warning removed in the future.' + ); + } + } + + } catch (\Exception $e) { + + } + $rows[] = array( 'name' => 'Language', - 'value' => Common::getBrowserLanguage() + 'value' => Common::getBrowserLanguage(), + 'comment' => '' ); } From 858df272a2923677a4c0caf6130f16cbd334063c Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 15 Oct 2020 15:42:52 +1300 Subject: [PATCH 21/24] fix some tests that fail in WP trunk --- tests/phpunit/wpmatomo/test-api.php | 5 ++++- tests/phpunit/wpmatomo/test-trackingcode.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/wpmatomo/test-api.php b/tests/phpunit/wpmatomo/test-api.php index 57f0b07c2..b5c44ff17 100644 --- a/tests/phpunit/wpmatomo/test-api.php +++ b/tests/phpunit/wpmatomo/test-api.php @@ -61,13 +61,16 @@ public function test_dispatch_matomo_api_must_use_correct_method() { $request = new WP_REST_Request( 'POST', '/' . API::VERSION . '/api/matomo_version' ); $response = rest_get_server()->dispatch( $request ); + $data = $response->get_data(); + // some newer wp versions have a dot at the end + $data['message'] = trim($data['message'], '.'); $this->assertEquals( array( 'code' => 'rest_no_route', 'message' => 'No route was found matching the URL and request method', 'data' => array( 'status' => 404 ), ), - $response->get_data() + $data ); } diff --git a/tests/phpunit/wpmatomo/test-trackingcode.php b/tests/phpunit/wpmatomo/test-trackingcode.php index b4cc217a5..39b3e2558 100644 --- a/tests/phpunit/wpmatomo/test-trackingcode.php +++ b/tests/phpunit/wpmatomo/test-trackingcode.php @@ -158,7 +158,8 @@ public function test_add_feed_tracking() { $this->set_is_feed(); $url = apply_filters( 'the_excerpt_rss', '

foobarbaz

' ); - $this->assertStringStartsWith( '

foobarbaz

assertStringEndsWith( '" style="border:0;width:0;height:0" width="0" height="0" alt="" />', $url ); } From 413efd7a68d49296eb7de22ab9eb6b221e88a2a8 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 15 Oct 2020 15:46:31 +1300 Subject: [PATCH 22/24] bump version to 1.3.1 and update changelog --- CHANGELOG.md | 3 +++ matomo.php | 4 ++-- readme.txt | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c8ba94de..7d8349ec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ = 1.3.1 = * Log less messages by default * Add possibility to disable logging and enable logging of all messages through wp-config.php +* Make sure jQuery URLs use correct protocol +* Show a warning in system report if MS Edge 85+ is used +* Other minor fixes = 1.3.0 = * Changed opt out shortcode to no longer use an iframe and instead print the content directly diff --git a/matomo.php b/matomo.php index f107f9995..b651c50f8 100644 --- a/matomo.php +++ b/matomo.php @@ -4,10 +4,10 @@ * Description: The #1 Google Analytics alternative that gives you full control over your data and protects the privacy for your users. Free, secure and open. * Author: Matomo * Author URI: https://matomo.org - * Version: 1.3.0 + * Version: 1.3.1 * Domain Path: /languages * WC requires at least: 2.4.0 - * WC tested up to: 4.5.0 + * WC tested up to: 4.6.0 * * Matomo - free/libre analytics platform * diff --git a/readme.txt b/readme.txt index b51288265..57ddf51d4 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: matomo,piwik,analytics,statistics,stats,tracking,ecommerce Requires at least: 4.8 Tested up to: 5.5 -Stable tag: 1.3.0 +Stable tag: 1.3.1 Requires PHP: 7.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html From b1041da6b96bcd0bc592e04f4364d654603c6364 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 15 Oct 2020 15:50:51 +1300 Subject: [PATCH 23/24] exclude .github directory from release --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index e5e4e0bef..8750392d1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,7 @@ /README.md export-ignore /.wordpress-org export-ignore /.github export-ignore +.github export-ignore .gitignore export-ignore .gitattributes export-ignore .travis.yml export-ignore From 9b8225665f8471794e0c591b3c9ef0f9479fe58e Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Thu, 15 Oct 2020 15:53:32 +1300 Subject: [PATCH 24/24] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d8349ec0..15e3c39bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,9 @@ * Log less messages by default * Add possibility to disable logging and enable logging of all messages through wp-config.php * Make sure jQuery URLs use correct protocol +* Optimise order of tracking settings * Show a warning in system report if MS Edge 85+ is used +* Add more information to system report * Other minor fixes = 1.3.0 =