Matomo Analytics for wordpress - Email reports not functioning well

Hej,

thanks for a great product. Just installed version Version 1.3.2 of
https://matomo.org/blog/2019/10/matomo-analytics-for-wordpress/ to my Wordpress (version 5.3.6) and am trying to learn how it works.

I created a report to be sent via email weekly. Tried to adjust it by choosing more fields but the changes are not saved. I do even notice that some of the options with pull-down menu are not available. Once in a while, i do notice that it states “loading data” once I tried to save the changes.

Anyone experiencing similar problems and how can i resolve it ?

Hi,

It is working fine for me. Do you by chance use some adblocker that is maybe blocking resources needed? Or a server module like mod_security that blocks requests based on some rules?

Can you open your browsers developer tools (F12) and check for errors in the console?

Hi Lukas,
Thanks for the quick reply!

No, I have removed the adblocker plugin in chrome. Not too sure about mod_security though.
See screen dump,

when i press Save after editing on an existing email report , F12 says:

Uncaught TypeError: Cannot read property ‘classList’ of null
at Object.init (dec73.default.include.e52d06.js:19)
at dec73.default.include.e52d06.js:19
asset_manager_core_js.js?v=3.14.0?cb=8675acaa52c59fd34e02c9b0d0b4b445:230 TypeError: jQuery.easing[jQuery.easing.def] is not a function
at Object.swing (asset_manager_core_js.js?v=3.14.0?cb=8675acaa52c59fd34e02c9b0d0b4b445:29)
at init.run (jquery.js:4)
at i (jquery.js:4)
at Function.n.fx.timer (jquery.js:4)
at pb (jquery.js:4)
at HTMLHtmlElement.g (jquery.js:4)
at Function.dequeue (jquery.js:3)
at HTMLHtmlElement. (jquery.js:3)
at Function.each (jquery.js:2)
at n.fn.init.each (jquery.js:2)
(anonymous) @ asset_manager_core_js.js?v=3.14.0?cb=8675acaa52c59fd34e02c9b0d0b4b445:230
asset_manager_core_js.js?v=3.14.0?cb=8675acaa52c59fd34e02c9b0d0b4b445:230 TypeError: jQuery.easing[jQuery.easing.def] is not a function
at Object.swing (asset_manager_core_js.js?v=3.14.0?cb=8675acaa52c59fd34e02c9b0d0b4b445:29)
at init.run (jquery.js:4)
at i (jquery.js:4)
at Function.n.fx.timer (jquery.js:4)
at pb (jquery.js:4)
at HTMLDivElement.g (jquery.![matomo|623x499]js:4)
at Function.dequeue (jquery.js:3)
at HTMLDivElement. (jquery.js:3)
at Function.each (jquery.js:2)
at n.fn.init.each (jquery.js:2)

Hi @Angela

Any chance you are familiar with editing files in your WordPress? If so, could you edit wp-content/plugins/matomo/plugins/WordPress/WpAssetManager.php and apply the patch as shown in https://github.com/matomo-org/wp-matomo/pull/386/files ?

Be great if you could check if this fixes the issue maybe.

Otherwise could you send us your system report maybe (see https://matomo.org/faq/wordpress/how-do-i-find-and-copy-the-system-report-in-matomo-for-wordpress/) ? Either as a comment (it should be anonymised) or by email to wordpress at matomo.org

Do I apply all 93 rows in the beginning or end of the wpassetmanagee.php file suggested ?

Hi @Angela,

You only need to apply this change to the file:

diff --git a/plugins/WordPress/WpAssetManager.php b/plugins/WordPress/WpAssetManager.php
index 94b32093..c4d20e4f 100644
--- a/plugins/WordPress/WpAssetManager.php
+++ b/plugins/WordPress/WpAssetManager.php
@@ -42,10 +42,10 @@ public function getJsInclusionDirective()
 		$jsFiles[] = "jquery/jquery.js";
 		$jsFiles[] = "node_modules/materialize-css/dist/js/materialize.min.js";
 		$jsFiles[] = 'jquery/ui/widget.min.js';
-		$jsFiles[] = 'jquery/ui/selectable.min.js';
-		$jsFiles[] = 'jquery/ui/autocomplete.min.js';
 		$jsFiles[] = 'jquery/ui/core.min.js';
 		$jsFiles[] = 'jquery/ui/mouse.min.js';
+		$jsFiles[] = 'jquery/ui/selectable.min.js';
+		$jsFiles[] = 'jquery/ui/autocomplete.min.js';
 		$jsFiles[] = 'jquery/ui/position.min.js';
 		$jsFiles[] = 'jquery/ui/resizable.min.js';
 		$jsFiles[] = 'jquery/ui/datepicker.min.js';

So you take the two lines and move them down after mouse.min.js

Sure, shall i paste all the 93 rows included ?

/angela

Den ons 2 dec. 2020 20:10thomas_matomo via Matomo forums <forum@matomo.org> skrev:

That be great @Angela thank you

Hi, when I inspected WpAssetManager.php, the lines are already in place, see here:

public function getJsInclusionDirective()
	{
		$result = "<script type=\"text/javascript\">\n" . Translate::getJavascriptTranslations() . "\n</script>";

		$jsFiles = array();
		$jsFiles[] = "jquery/jquery.js";
		$jsFiles[] = 'jquery/ui/widget.min.js';
		$jsFiles[] = 'jquery/ui/mouse.min.js';
		$jsFiles[] = 'jquery/ui/selectable.min.js';
		$jsFiles[] = 'jquery/ui/autocomplete.min.js';
		$jsFiles[] = 'jquery/ui/core.min.js';
		$jsFiles[] = 'jquery/ui/position.min.js';
		$jsFiles[] = 'jquery/ui/resizable.min.js';
		$jsFiles[] = 'jquery/ui/datepicker.min.js';
		$jsFiles[] = 'jquery/ui/dialog.min.js';
		$jsFiles[] = 'jquery/ui/menu.min.js';
		$jsFiles[] = 'jquery/ui/draggable.min.js';
		$jsFiles[] = 'jquery/ui/droppable.min.js';
		$jsFiles[] = 'jquery/ui/tooltip.min.js';
		$jsFiles[] = 'jquery/ui/sortable.min.js';
		$jsFiles[] = 'jquery/ui/spinner.min.js';
		$jsFiles[] = 'jquery/ui/tabs.min.js';
		$jsFiles[] = 'jquery/ui/button.min.js';
		$jsFiles[] = 'jquery/ui/effect.min.js';

Hi again, issue resolved when i deactivate WP Total cache.