google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.22k stars 278 forks source link

PHP Deprecated Errors and unable to complete plugin setup with PHP 8.2/8.3 & WordPress 6.4.2 #8331

Open adamdunnage opened 6 months ago

adamdunnage commented 6 months ago

Bug Description

Site Kit setup is interrupted and not completed when attempting using a site with PHP 8.2/8.3 & WordPress 6.4.2. After going through OAuth and the setup steps for the plugin, after you click on the Go to my Dashboard button you hit a page full of PHP Deprecated errors as seen in this recording.

After refreshing the page you will be taken to the Dashboard with Unknown Error (code: invalid parameter: 'code') displayed. If you try the Redo the plugin setup button you are taken through OAuth once more and on completion are presented with the page of PHP Deprecated errors once more.

You may also see that Site Kit has now disconnected at this stage and you see the following error: Error connecting Site Kit Unable to receive access token because of an invalid authorization code or refresh token.

Further testing shows that this only happens on PHP 8.2/8.3 with WordPress 6.4.2. I have tested on Site Kit 1.121.0 and 1.120.0 with the same outcome on both. This is preventing users on this particular setup from being able to use Site Kit.

Steps to reproduce

  1. Create a fresh new site with PHP 8.2/8.3 and WordPress 6.4.2.
  2. Start Site Kit setup and go through OAuth and the setup steps.
  3. Once you reach the PHP deprecated errors page, refresh the page.
  4. Attempted the redo setup.
  5. Refresh the PHP deprecated errors page once more.

Screenshots

image

Additional Context


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

archon810 commented 5 months ago

Same issue here, just updated to PHP 8.2 and now there are tons of deprecated notices. The biggest culprits are:

[23-Mar-2024 07:48:43 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\Row::$dimensionValues is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/Row.php on line 32
[23-Mar-2024 07:48:43 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\Row::$metricValues is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/Row.php on line 46

Some others:

[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$dimensionHeaders is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient/src/Model.php on line 104
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$metricHeaders is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient/src/Model.php on line 104
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$totals is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient/src/Model.php on line 104
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$maximums is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient/src/Model.php on line 104
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$minimums is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient/src/Model.php on line 104
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$metadata is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient/src/Model.php on line 115
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\RunReportResponse::$rows is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/RunReportResponse.php on line 164

[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\Filter::$inListFilter is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/Filter.php on line 67
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\FilterExpression::$filter is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/FilterExpression.php on line 49
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\FilterExpressionList::$expressions is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/FilterExpressionList.php on line 30
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData\FilterExpression::$andGroup is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData/FilterExpression.php on line 35

[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\GoogleAnalyticsAdmin::$serviceName is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin.php on line 64
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit_Dependencies\Google\Service\AnalyticsData::$serviceName is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/AnalyticsData.php on line 55
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit\Modules\Analytics_4\GoogleAnalyticsAdmin\AccountProvisioningService::$serviceName is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin.php on line 64
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit\Modules\Analytics_4\GoogleAnalyticsAdmin\PropertiesEnhancedMeasurementService::$serviceName is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin.php on line 64
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit\Modules\Analytics_4\GoogleAnalyticsAdmin\PropertiesAudiencesService::$serviceName is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin.php on line 64
[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  Creation of dynamic property Google\Site_Kit\Modules\Analytics_4\GoogleAnalyticsAdmin\PropertiesAdSenseLinksService::$serviceName is deprecated in public/wp-content/plugins/google-site-kit/third-party/google/apiclient-services/src/GoogleAnalyticsAdmin.php on line 64

[23-Mar-2024 07:48:42 UTC] PHP Deprecated:  strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated in public/wp-content/plugins/google-site-kit/includes/Modules/Analytics_4/Report.php on line 112

There are probably more. Really loads of them.

mxbclang commented 5 months ago

@archon810 I see your comments on several issues and PRs about this. :) We're aware of the notices that occur with PHP 8.2. These don’t impact any Site Kit functionality and are related to some of the dependency libraries used by Site Kit and can be disregarded.

We're working to update these libraries, but it will take some time as it will require updating PHP compatibility for Site Kit, which requires giving our users on older versions ample time to upgrade so that they don't lose functionality.

We anticipate updating Site Kit's PHP minimum required version in the next month or so and then updating the libraries from there, so hopefully this should be resolved soon. In the meantime, while I know it's frustrating to have this many errors in your error log, you can continue to ignore those messages. Thanks!

archon810 commented 5 months ago

Thank you for the update. The thing about the logs is there are so many notices, they would quickly overwhelm Sentry and would push us over our quota, let alone introduce a delay to each request because of Sentry pings. Log storage requirements would increase dramatically too.

archon810 commented 4 days ago

Checking in here. Any chance PHP 8.2/8.3 will be officially supported anytime soon?