-
Notifications
You must be signed in to change notification settings - Fork 894
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
Call _load_textdomain_just_in_time correctly #21742
Merged
vraja-pro
merged 24 commits into
trunk
from
1871-wp-67-function-load_plugin_textdomain-was-called-incorrectly-alternative
Nov 4, 2024
Merged
Call _load_textdomain_just_in_time correctly #21742
vraja-pro
merged 24 commits into
trunk
from
1871-wp-67-function-load_plugin_textdomain-was-called-incorrectly-alternative
Nov 4, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
leonidasmi
force-pushed
the
1871-wp-67-function-load_plugin_textdomain-was-called-incorrectly-alternative
branch
from
October 24, 2024 10:02
10e675b
to
9b570e3
Compare
Pull Request Test Coverage Report for Build 704a401668a6b5dbc72d3ea7e6f22c1de0a99e16Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
17 tasks
leonidasmi
changed the title
1871 wp 67 function load plugin textdomain was called incorrectly alternative
Call _load_textdomain_just_in_time correctly
Oct 25, 2024
* override the WP button style "white-space: nowrap" with "white-space: normal" * rest is apply difference to align the comment and an auto-format
See: https://github.com/tailwindlabs/tailwindcss-container-queries BREAKING CHANGE: added peer dependency
* needed to work with the updated tailwindcss-preset * https://github.com/tailwindlabs/tailwindcss-container-queries
Looks better, approved by Kai
And while Kai was looking: spacing should be 24px instead of 32px
… option that was requested
…_post_types' hook
…n instead of before registering the hooks
…possible and do that for setting the version options
leonidasmi
force-pushed
the
1871-wp-67-function-load_plugin_textdomain-was-called-incorrectly-alternative
branch
from
October 25, 2024 10:02
314d249
to
b28111a
Compare
…was-called-incorrectly-alternative
leonidasmi
added
the
changelog: other
Needs to be included in the 'Other' category in the changelog
label
Oct 25, 2024
pls78
approved these changes
Oct 31, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: ✅
ACC and impact checks ✅ |
vraja-pro
deleted the
1871-wp-67-function-load_plugin_textdomain-was-called-incorrectly-alternative
branch
November 4, 2024 11:25
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Summary
This PR can be summarized in the following changelog entry:
_load_textdomain_just_in_time
loading incorrectly, on WP 6.7.Relevant technical choices:
_load_textdomain_just_in_time
is triggered by calling translating functions (like__()
on hooks earlier thaninit
. When weget()
orset()
Yoast options, we ultimately callWPSEO_Option::get_defaults()
which in turn callsWPSEO_Option::translate_defaults()
andWPSEO_Option::enrich_defaults()
which contain such translating functions. Unfortunately, we have a couple of instances where weget()
orset()
Yoast options before theinit
hook, thus outputting those new noticesget()
ing orset()
ing to ask only for the options that are relevant and not all the Yoast optionsget()
s andset()
s that are called beforeinit
where about settings in thewpseo
andwpseo_social
options, which don't have thoseWPSEO_Option::translate_defaults()
andWPSEO_Option::enrich_defaults()
functions implemented. So, with the new enhancement of the Option framework, we are now able to ask for the defaults of only thewpseo
andwpseo_social
options beforeinit
wpseo_titles
option were required and considering thatwpseo_titles
does have thoseWPSEO_Option::translate_defaults()
andWPSEO_Option::enrich_defaults()
functions implemented, we had to move those away from the pre-init
hook, but we were able to do so seamlessly.Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
(Note, all these steps and the impact check requires
define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false );
in your config file)Function load_plugin_textdomain was called incorrectly
orFunction _load_textdomain_just_in_time was called incorrectly
Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
General smoke test of the additions in our Options framework:
Users->Profile
, change the user's language to not English, eg. greekwpseo
values in both sites.version
option, but that's also expected and should indicate the version of the plugin you have installedwpseo_titles
,wpseo_social
,wpseo_taxonomy_meta
,wpseo_premium
,wpseo_video
,wpseo_local
andwpseo_news
values in both sitesindex_now_key
inwpseo
, you will get a different value in each site, but make sure that it's populated with a string in both cases.wpseo_premium
option. Confirm that the option still is the same in both sites.Yoast SEO->Settings->Genres
, confirm that the values are the same between sitesMultisites:
Users->Profile
, change the user's language to not English, eg. greekwpseo_ms
values in both sites (in thewp_sitemeta
table).SEO analysis
wpseo_ms
option and again confirm it's the same in both sites.Custom rewrite rules for categories:
wp-include/rewrite.php
file, add aerror_log( 'flush_rewrite_rules' );
line in the start of theflush_rewrite_rules()
functionPost->Categories
, find a category and confirm that the URL contains the/category
prefix (aka,http://example/category/cat3/
cat3-new
, again visit that page and confirm you get to the expected page. Also confirm that your debug.log doesn't contain theflush_rewrite_rules
logYoast SEO->Settings->Categories
and uncheck theShow the categories prefix in the slug
optionPost->Categories
page and confirm that now the URL doesn't contain the/category
prefix (aka,http://example/cat3-new/
cat3-new-new
, again visit that page and confirm you get to the expected page. Also confirm that your debug.log contains theflush_rewrite_rules
log.Settings->Permalink
page and add something to theCategory base
setting, eg.cat
. Then, clean your debug.log, again setShow the categories prefix in the slug
to true and repeat all the above steps. (you now expect to seecat
instead ofcategory
in the URLs of the categories, but only whenShow the categories prefix in the slug
is active.Custom rewrite rules for categories (part 2):
Show the categories prefix in the slug
settingGet accessible post types:
src\helpers\post-type-helper.php
adderror_log( print_r( $post_types, true ) );
under$post_types = \apply_filters( 'wpseo_accessible_post_types', $post_types );
attachment
Yoast SEO->Settings->Media page
and enable theEnable media pages
settingattachment
as well in the logged output.Social settings metadata:
Social
tab in Yoast metabox.Update sitemap cache when post is published:
Advanced settings in post metabox:
Schema
tab in the Yoast metaboxRestrict advanced settings for authors
setting (Site basics->Site preferences->Restrict advanced settings for authors setting)Schema
tab in the Yoast metabox.XML sitemap redirect:
wpseo_sitemap_entries_per_page
filter (basically it should be more than your number of posts, so as to have multiple post sitemaps:http://example.com/sitemap_index.xml
).http://example.com/sitemap_index.xml
and confirm you get a 404Upgrade routine:
inc\class-upgrade.php
file, add the'23.8-RC0' => 'upgrade_238',
line, after the'22.6-RC0' => 'upgrade_226',
line and also thefunction after the
upgrade_226()
functionupgrade_238
log. Refresh the admin a couple of times and confirm that you don't get anotherupgrade_238
log.wpseo
option and confirm that theversion
andprevious_version
settings have an appropriate value.Cornerstone filter:
yoastFilterExplanation
in the console, you get the translated version of theMark the most important post as 'cornerstone content' to improve your site structure. Learn more about cornerstone content
stringVideo content width:
Content width
setting and after a refresh confirm that the value is stored.Youtube embeds:
YouTube embeds: make pages load faster by only loading the YouTube player when the user clicks play
settingvideoSEOGenerateYouTubeThumbnail
and confirm you find it in a script in the<head>
of the pageUI changes
Other environments
[shopify-seo]
, added test instructions for Shopify and attached theShopify
label to this PR.Documentation
Quality assurance
Innovation
innovation
label.Fixes https://github.com/Yoast/plugins-automated-testing/issues/1871