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

Fixes #1196 Exclude common external jQuery from defer JS safe mode #1733

Merged
merged 5 commits into from May 28, 2019

Conversation

Projects
None yet
2 participants
@Tabrisrp
Copy link
Contributor

commented May 17, 2019

Exclude jQuery loaded from wp.com CDN and from ajax.googleapis.com

@Tabrisrp Tabrisrp added this to the 3.3.4 milestone May 17, 2019

@Tabrisrp Tabrisrp requested a review from Screenfeed May 17, 2019

@Tabrisrp Tabrisrp self-assigned this May 17, 2019

@@ -468,9 +468,13 @@ function get_rocket_exclude_defer_js() {
];
if ( get_rocket_option( 'defer_all_js', 0 ) && get_rocket_option( 'defer_all_js_safe', 0 ) ) {
$jquery = site_url( $wp_scripts->registered['jquery-core']->src );
$jquery = site_url( $wp_scripts->registered['jquery-core']->src );

This comment has been minimized.

Copy link
@Screenfeed

Screenfeed May 28, 2019

Contributor

I remember some people messing with jquery-core and jquery-migrate, and registering their custom jQuery under jquery. Do you think it's still a thing today?

This comment has been minimized.

Copy link
@Tabrisrp

Tabrisrp May 28, 2019

Author Contributor

not often enough to warrant that I think, and often they replaced with the googleapis one so it should be covered by that

This comment has been minimized.

Copy link
@Screenfeed

Screenfeed May 28, 2019

Contributor

OK. Let's say that the risk of $wp_scripts->registered['jquery-core']->src not being set or being empty can be neglected then.

@Tabrisrp Tabrisrp merged commit bd8aa17 into develop May 28, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@Tabrisrp Tabrisrp deleted the fix/1196-external-jquery branch May 28, 2019

@Tabrisrp Tabrisrp referenced this pull request Jun 4, 2019

Merged

3.3.4 #1754

Tabrisrp added a commit that referenced this pull request Jun 4, 2019

Fixes #1196 Exclude common external jQuery from defer JS safe mode (#…
…1733)

* also exclude jetpack and googleapis jquery

* define ABSPATH

* remove ABSPATH define

* add tests for get_rocket_exclude_defer_js

* add integration tests for get_rocket_exclude_defer_js()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.