Just another IT site ※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。At Your Own Risk!! TURN BACK WHILE YOU CAN
PR

PHP Fatal error: Uncaught Error: Call to undefined function WpMatomo\Ecommerce\WC()

※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。スクリプトはAI生成のものも多いのでコピー&ペーストの際は文字コードに注意ください!

突然、サイトに「重大なエラーが発生」と出て、レイアウトも崩れてしまっていた。
ログを確認

cat /var/log/php-fpm/www-error.log|grep Fatal

[27-Aug-2025 00:15:41 UTC] PHP Fatal error: Uncaught Error: Call to undefined function WpMatomo\Ecommerce\WC() in /xxxxxx/wp-content/plugins/matomo/classes/WpMatomo/Ecommerce/Woocommerce.php:520

Conflict latest update with my WordPress website – Support & Bugs – Matomo forums

 suddenly the content was displaying in a narrow column, even on desktop devices.

Matomo causing massive number of http 500 errors – Support & Bugs – Matomo forums

It occurs if you use WP matomo without woocommerce

For now, till they release a patch, add a return; just after

public function maybe_do_delayed_tracking_early() {

in wp-content/plugins/matomo/classes/WpMatomo/Ecommerce/Base.php

so

public function maybe_do_delayed_tracking_early() {

  return;
Or uncheck this if you have access to backend

5.3.2の更新がらみか。

matomo-for-wordpress/CHANGELOG.md at develop · matomo-org/matomo-for-wordpress · GitHub

== Changelog ===

= 5.3.2 =

  • Fix ecommerce tracking issues that occur when WordPress plugins that initiate WooCommerce events from JavaScript hosted on another server, like the Klarna plugin.
  • Fix issue site switching error that occurs during scheduled task execution when resetting the Matomo environment.
  • Fix issue preventing users with Matomo roles only to view the WordPress admin dashboard.
  • Fix image display issue with SearchEngineKeywordsPerformance plugin.

 

プラグイン自体を無効化したら、有効化できなくなった。。。

取り合えず、更新を待つが、ダメそうならどうしても必要なわけでもないので、プラグインを削除するか。このプラグインに限らず、WordPressのプラグイン更新後の不具合はやっかいですよね・・・

 

5.3.3がリリースされたが有効化できず。

== Changelog ===

= 5.3.3 =

  • Fix regression causing fatal errors when ecommerce tracking is used but WooCommerce is not installed.
  • Workaround infinite recursion problem in Matomo core that occurs when an AJAX method is not authorized to function.

OS再起動したら勝手に有効化されていた。Webサーバーの再起動でもよかったかも。

タイトルとURLをコピーしました