Lighthouse Extension Audit Returns a 403 on Child Site

I have an issue with the Lighthouse extension running an audit on just 1 child site. This child site is on the same server as the other sites that are audited without issue.

I can run a test just fine using Google’s PageSpeed Insights.

When I run the audit in MainWP I get a message that the audit completed successfully. However, when I check the Event Monitor I receive the following errors:

2024-10-28 05:11:05 CRON :: Lighthouse:: CRON :: CONTINUE total urls to check :: 0

2024-10-28 05:11:12 Lighthouse:: total urls to check ::1

2024-10-28 05:11:12 Lighthouse:: WORKER :: start check urls :: Array ( [urls] => Array ( [0] => Array ( [url] => https://kennethsim.me/ [site_id] => 28 ) ) [total_url_count] => 1 )

2024-10-28 05:11:12 Lighthouse:: running check :: desktop :: https://kennethsim.me/

2024-10-28 05:11:12 Lighthouse:: run lighthouse :: retry :: desktop :: https://kennethsim.me/

2024-10-28 05:11:12 Lighthouse:: check url :: failed :: desktop :: https://kennethsim.me/

2024-10-28 05:11:12 Lighthouse:: error :: non_fatal :: responseCode :: 403

2024-10-28 05:11:12 Lighthouse:: result :: Array ( [responseCode] => 403 [data] => stdClass Object ( [error] => stdClass Object ( [code] => 403 [message] => Requests to this API pagespeedonline method google.chrome.pagespeedonline.v5.PagespeedonlinePagespeedapi.RunPagespeed are blocked. [errors] => Array ( [0] => stdClass Object ( [message] => Requests to this API pagespeedonline method google.chrome.pagespeedonline.v5.PagespeedonlinePagespeedapi.RunPagespeed are blocked. [domain] => global [reason] => forbidden ) ) [status] => PERMISSION_DENIED [details] => Array ( [0] => stdClass Object ( [@type] => type.googleapis.com/google.rpc.ErrorInfo [reason] => API_KEY_SERVICE_BLOCKED [domain] => googleapis.com [metadata] => stdClass Object ( [consumer] => projects/1016859282302 [service] => pagespeedonline.googleapis.com ) ) ) ) ) )

2024-10-28 05:11:12 Lighthouse:: running check :: mobile :: https://kennethsim.me/

2024-10-28 05:11:12 Lighthouse:: run lighthouse :: retry :: mobile :: https://kennethsim.me/

2024-10-28 05:11:12 Lighthouse:: check url :: failed :: mobile :: https://kennethsim.me/

2024-10-28 05:11:12 Lighthouse:: error :: non_fatal :: responseCode :: 403

2024-10-28 05:11:12 Lighthouse:: result :: Array ( [responseCode] => 403 [data] => stdClass Object ( [error] => stdClass Object ( [code] => 403 [message] => Requests to this API pagespeedonline method google.chrome.pagespeedonline.v5.PagespeedonlinePagespeedapi.RunPagespeed are blocked. [errors] => Array ( [0] => stdClass Object ( [message] => Requests to this API pagespeedonline method google.chrome.pagespeedonline.v5.PagespeedonlinePagespeedapi.RunPagespeed are blocked. [domain] => global [reason] => forbidden ) ) [status] => PERMISSION_DENIED [details] => Array ( [0] => stdClass Object ( [@type] => type.googleapis.com/google.rpc.ErrorInfo [reason] => API_KEY_SERVICE_BLOCKED [domain] => googleapis.com [metadata] => stdClass Object ( [service] => pagespeedonline.googleapis.com [consumer] => projects/1016859282302 ) ) ) ) ) )

Hey @kwsim

It seems likely that this 403 error is due to a restriction applied to your specific API key for some reason.

Since the audit works on PageSpeed Insights without issues, this suggests that the block only affects requests made through your API key, not the general Pagespeed tool.

Please try generating a new, unrestricted API key in Google Cloud Console and test it in MainWP to see if the restriction lifts.

The new API key worked. It’s so strange though, that this worked for other child sites except for this one.

Thanks for your help

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.