-
Notifications
You must be signed in to change notification settings - Fork 81
Welcome Page: Fix missing CSS when used as fallback #1820
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
Conversation
Oh, nice catch! I saw that once in my testing and couldn't figure out what happened. How would you feel about enqueueing it from the template itself, like we do with embeds? Could help avoid a bit of logic |
no real preference, so happy to move it to the template. |
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.
Pull Request Overview
This PR fixes the issue of missing CSS on the Welcome page when it is used as a fallback by changing the CSS enqueue behavior. Key changes include:
- Enqueueing the Welcome page CSS directly in the template.
- Removing the redundant CSS enqueue action in the admin welcome fields.
- Adding tests for polyfill functions and updating the changelog.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/includes/class-test-compat.php | Added tests for new polyfill functions |
templates/welcome.php | Enqueued CSS directly in the template to fix the fallback styling issue |
includes/wp-admin/class-welcome-fields.php | Removed redundant enqueue_styles hook for the Welcome page |
includes/compat.php | Added polyfill for str_ends_with function |
.github/changelog/1820-from-description | Created changelog entry for the bug fix |
@obenland done |
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.
Do you want to keep the str_ends_with()
stuff? It doesn't seem to be needed any longer
I would love to keep it and simplify other parts of the code to use that instead! |
While testing #1802 and #1806 I experienced a bug, where the CSS was not shown for the Welcome page when used as fallback.
When the plugin is configured to use only
Actors
(no blog user), the plugin loads the Welcome page as fallback if you try to load/wp-admin/options-general.php?page=activitypub&tab=blog-profile
(same with other potentially deactivated settings pages). In this case thetab
query param isblog-profile
but it loads the welcome screen and because we have this check in place:if ( 'welcome' === ( isset( $_GET['tab'] ) ? \sanitize_key( $_GET['tab'] ) : 'welcome' ) )
the welcome screen will be loaded without CSS.
Proposed changes:
Other information:
Testing instructions:
/wp-admin/options-general.php?page=activitypub&tab=blog-profile
Changelog entry
Changelog Entry Details
Significance
Type
Message
The Welcome screen now loads with proper styling when shown as a fallback.