Skip to content

Conversation

@n7studios
Copy link
Contributor

@n7studios n7studios commented Nov 25, 2024

Summary

WordPress 6.7 displays a PHP notice if a Theme or Plugin calls load_plugin_textdomain too early i.e. before the WordPress init hook and WP_DEBUG is enabled.

This Plugin's tests run with WP_DEBUG enabled, and due to activating third party Plugins to run specific tests against, we get errors:
Screenshot 2024-11-25 at 13 10 30

This PR resolves by suppressing the _load_textdomain_just_in_time PHP notice in our automated testing via use of a Plugin, whilst allowing other notices to still display and be detected.

Also fixes cron tests failing due to a change in the admin UI URL in WP Crontrol 1.17.1, released November 23rd.

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Nov 25, 2024
@n7studios n7studios requested review from a team, corydhmiller and noelherrick and removed request for a team November 25, 2024 12:50
@n7studios n7studios marked this pull request as ready for review November 25, 2024 12:50
… into add-block-visibility-support-non-inline-forms
Copy link
Contributor

@noelherrick noelherrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this still catch errors in the Kit plugin if it made this mistake?

@n7studios
Copy link
Contributor Author

Would this still catch errors in the Kit plugin if it made this mistake?

It only suppresses the _load_textdomain_just_in_time error, caused by third party Plugins calling load_plugin_textdomain too early:
https://stackoverflow.com/questions/79198701/notice-function-load-textdomain-just-in-time-was-called-incorrectly

We load our language files correctly by using the init hook, so the Kit plugin won't be triggering this:
https://github.com/Kit/convertkit-wordpress/blob/main/includes/class-wp-convertkit.php#L51

…ine-forms

Block Visibility: Support non-inline Forms
Fix character encoding when inserting Form after specific HTML element
@n7studios n7studios merged commit 5d38edf into main Nov 27, 2024
@n7studios n7studios deleted the fix-tests-doing-it-wrong-notice branch February 28, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants