Parsely/wp-parsely

PHP fatal error occurs when AMP is enabled

Closed this issue · 4 comments

Describe the bug

We've got a couple of reports of a PHP fatal error occurring when AMP is enabled. Here are the reported error messages:

PHP message: PHP Fatal error: Uncaught TypeError: Parsely\Scripts::script_loader_tag(): Argument #1 ($tag) must be of type string, null given, called in wp-includes/class-wp-hook.php on line 307 and defined in wp-parsely-3.5/src/class-scripts.php:138
PHP message: PHP Fatal error: Uncaught TypeError: Parsely\Scripts::script_loader_tag(): Argument #1 ($tag) must be of type string, null given, called in wp-includes/class-wp-hook.php on line 307 and defined in wp-parsely-3.8/src/class-scripts.php:145

The first error refers to an old wp-parsely version, and is probably the same as the second error.

To Reproduce

We'll try to reproduce this when we work on fixing it. Apparently, installing the AMP plugin should result in the error.

Expected behavior

We should not have a fatal error.

In my tests, just installing and activating the AMP plugin doesn't surface a fatal error for me.

Information from @thompsonjoshua that may come in handy:

Most recently, a customer said that the error went away when they disabled javascript tracking in wp-parsely.

Just to get back to this, I recently worked with the AMP plugin and noticed no issues. @thompsonjoshua, do you remember having any newer reports regarding this?

I'm thinking of closing this issue because it resembles to be more of a temporary hiccup? Also, plugin versions are old (3.5 and 3.8).

No, I haven't received any reports on this lately. I'm okay with closing this out.