Skip to content
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

Improve Performance screen when external requests to WordPress.org fail #1474

Merged
merged 8 commits into from
Aug 16, 2024

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Aug 15, 2024

Fixes #1473.

With the following plugin code active:

add_filter( 
	'pre_http_request',
	static function ( $pre, $args, $url ) {
		if ( strpos( $url, 'wordpress.org' ) ) {
			return true;
		} else {
			return $pre;
		}
	}, 
	10,
	3 
);

Before:

image

After:

image

@westonruter westonruter added [Type] Bug An existing feature is broken [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only labels Aug 15, 2024
@westonruter westonruter added this to the performance-lab 3.4.0 milestone Aug 15, 2024
Copy link

github-actions bot commented Aug 15, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @chimok.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: chimok.

Co-authored-by: westonruter <westonruter@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@westonruter +1 to this nice little UX improvement for when things are broken :)

This reminds me that it would be great to avoid all these individual requests. The more plugins we add, the more of a bottleneck / failure risk they'll become.

I don't think wordpress.org has an API endpoint to get the same data for multiple plugins in bulk, but exploring Requests::request_multiple() might be a good idea. On the other hand, this would require some hacks because the way WordPress core wraps the regular Request::request() method makes for different behavior. I wish WordPress core just had wp_request_multiple()... 😮‍💨

@mukeshpanchal27
Copy link
Member

@westonruter The wp_admin_notice return empty <p></p> tag as the default is true forparagraph_wrap parameter. In 96ab82b i have set false for that parameter and add <p> tag in last message.

Co-authored-by: Weston Ruter <westonruter@google.com>
@mukeshpanchal27 mukeshpanchal27 merged commit ab56ad0 into trunk Aug 16, 2024
14 checks passed
@mukeshpanchal27 mukeshpanchal27 deleted the fix/features-screen-when-requests-fail branch August 16, 2024 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option Page now completely broke without remote access
3 participants