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

Fix/link prefetch mobile above the fold option #58

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion assets/link-prefetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ document.addEventListener( 'DOMContentLoaded', () => {
entries.forEach( ( entry ) => {
if ( entry.isIntersecting ) {
observer.unobserve( entry.target );
this.prefetchIfEligible( entry.target.href );
this.prefetchIfEligible( entry.target.href ) &&
this.prefetchIt( entry.target.href );
}
} );
} );
Expand Down
2 changes: 1 addition & 1 deletion build/link-prefetch.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/linkPrefetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const LinkPrefetch = ( { methods, constants } ) => {

const handleChangeOptionIgnoreKeywords = ( value ) => {
clearTimeout( ignoreKeywordsTimer );
value = value.substring( 0, 1000 );
setIgnoreKeywords( value );
ignoreKeywordsTimer = setTimeout( function () {
handleChangeOption( 'ignoreKeywords', value );
Expand Down
10 changes: 5 additions & 5 deletions components/performance/defaultText.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ const defaultText = {
),
cacheExclusionSaved: __( 'Cache Exclusion saved', 'wp-module-performance' ),
cacheExclusionSaveButton: __( 'Save', 'wp-module-performance' ),
// Skip 404
// Skip 404
skip404Title: __( 'Skip 404', 'wp-module-performance' ),
skip404Description: __(
'When enabled, static resources like images and fonts will use a default server 404 page and not WordPress 404 pages. Pages and posts will continue using WordPress for 404 pages. This can considerably speed up your website if a static resource like an image or font is missing.',
'wp-module-performance'
),
skip404NoticeTitle: __( 'Skip 404 saved', 'wp-module-performance' ),
skip404Notice: __( 'Skip 404 saved', 'wp-module-performance' ),
skip404Notice: __( 'Skip 404 saved', 'wp-module-performance' ),
// Image Optimization
imageOptimizationSettingsTitle: __(
'Image Optimization',
Expand Down Expand Up @@ -202,7 +202,7 @@ const defaultText = {
),
linkPrefetchBehaviorLabel: __( 'Behavior', 'wp-module-performance' ),
linkPrefetchBehaviorMouseDownLabel: __(
'Prefetch on Mouse down',
'Prefetch on Mouse Down',
'wp-module-performance'
),
linkPrefetchBehaviorMouseDownDescription: __(
Expand All @@ -218,7 +218,7 @@ const defaultText = {
'wp-module-performance'
),
linkPrefetchActivateOnMobileDescription: __(
'Enable link prefetching on Mobile',
'Enable link prefetching on mobile',
'wp-module-performance'
),
linkPrefetchActivateOnMobileLabel: __(
Expand All @@ -230,7 +230,7 @@ const defaultText = {
'wp-module-performance'
),
linkPrefetchBehaviorMobileTouchstartDescription: __(
'Prefetch on Touch Start: Instantly starts loading the page as soon as you tap the screen, ensuring a quicker response when you lift your finger.',
'Prefetch on Touchstart: Instantly starts loading the page as soon as you tap the screen, ensuring a quicker response when you lift your finger.',
'wp-module-performance'
),
linkPrefetchBehaviorMobileViewportLabel: __(
Expand Down
Loading