Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "WooCommerce Analytics" ready for PHP 8.3 #22838

Open
enual opened this issue Dec 10, 2024 · 0 comments
Open

Make "WooCommerce Analytics" ready for PHP 8.3 #22838

enual opened this issue Dec 10, 2024 · 0 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. triaged

Comments

@enual
Copy link

enual commented Dec 10, 2024

Customer is using "WooCommerce Analytics"-Plugin for their eCommerce systems. They have now upgraded their infrastructure to PHP 8.3. After upgrading the PHP version, they received a couple of "PHP Deprecated: Creation of dynamic property" warnings about uninitiated variables

Most of the "Warnings" are located in the "Tracker.php"-File. Here are two examples..

[03-Dec-2024 13:14:35 UTC] PHP Deprecated: Creation of dynamic property WooPiwik\Tracking\Tracker::$configSessionCookieTimeout is deprecated in /var/www/html/wp-content/plugins/woocommerce-piwik-analytics/libs/piwik-php-tracker/MatomoTracker.php on line 187
[03-Dec-2024 13:14:35 UTC] PHP Deprecated: Creation of dynamic property WooPiwik\Tracking\Tracker::$configReferralCookieTimeout is deprecated in /var/www/html/wp-content/plugins/woocommerce-piwik-analytics/libs/piwik-php-tracker/MatomoTracker.php on line 189

Customer informed us that the solution to remove the warnings is, to add the definition to the top of the class
private null|string $requestMethod = null;
public false|null|array $ecommerceItems;
public false|null|array $attributionInfo;
public false|null|array $eventCustomVar;
public mixed $forcedDatetime;
public null|bool $forcedNewVisit;
public false|int|null $networkTime;
public false|null|int $serverTime;
public false|null|int $transferTime;
public false|null|int $domProcessingTime;
public false|null|int $domCompletionTime;
public false|null|int $onLoadTime;
public false|null|array $pageCustomVar;
public false|null|array $ecommerceView;
public false|null|array $customParameters;
public false|null|array $customDimensions;
public mixed $customData;
public null|bool $hasCookies;
public mixed $token_auth;
public false|null|string $userAgent;
public false|null|string $country;
public false|null|string $region;
public false|null|string $city;
public false|null|float $lat;
public false|null|float $long;
public false|null|int $width;
public false|null|int $height;
public false|null|string $plugins;
public false|null|int $localHour;
public mixed $localMinute;
public mixed $localSecond;
public mixed $idPageview;
public mixed $idSite;
public mixed $urlReferrer;
public mixed $pageCharset;
public mixed $pageUrl;
public mixed $ip;
public false|string $acceptLanguage;
public int $configVisitorCookieTimeout = 0;
public int $configSessionCookieTimeout = 0;
public int $configReferralCookieTimeout = 0;
public false|string|int $userId;
public false|string $forcedVisitorId;
public mixed $cookieVisitorId;
public mixed $randomVisitorId;
public bool $configCookiesDisabled;
public null|string $configCookiePath;
public null|string $configCookieDomain;
public null|int $currentTs;
public mixed $createTs;
public null|int $requestTimeout;
public bool $doBulkRequests;
public false|null|array $storedTrackingActions;
public bool $sendImageResponse;
public false|null|array $visitorCustomVar;
public false|null|array $outgoingTrackerCookies;
public false|null|array $incomingTrackerCookies;

This fixes the "PHP Deprecated: Creation of dynamic property" warning

@enual enual added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. To Triage An issue awaiting triage by a Matomo core team member labels Dec 10, 2024
@randy-innocraft randy-innocraft added triaged and removed To Triage An issue awaiting triage by a Matomo core team member labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. triaged
Projects
None yet
Development

No branches or pull requests

2 participants