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

Merge Branch 3.15 into develop #6127

Merged
merged 137 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
499e311
Closes #5909 Remove combine CSS option (#5911)
CrochetFeve0251 Jun 20, 2023
e2f04df
Added skeleton
CrochetFeve0251 Jun 21, 2023
b867ee5
Fixed code standards
CrochetFeve0251 Jun 22, 2023
cbb0247
Added Filesystem cache
CrochetFeve0251 Jun 22, 2023
fc8a9bc
Added generate_url method
CrochetFeve0251 Jun 22, 2023
e9181c2
Added code and tests for `delete` and `deleteMultiple`
CrochetFeve0251 Jun 22, 2023
c68468a
Added remaining methods and tests
CrochetFeve0251 Jun 23, 2023
c5d8296
Added simple cache library
CrochetFeve0251 Jun 23, 2023
c543804
Notice and tests
CrochetFeve0251 Jun 26, 2023
59024c3
Fixed code standards
CrochetFeve0251 Jun 26, 2023
3c0fc1e
Fixed code standards
CrochetFeve0251 Jun 26, 2023
fe64484
Added page class
CrochetFeve0251 Jun 26, 2023
c1eb256
Added Services providers
CrochetFeve0251 Jun 26, 2023
d26e19f
Added extract css common operation
CrochetFeve0251 Jun 27, 2023
0b34c7b
Added HTML
CrochetFeve0251 Jun 27, 2023
f7ff15e
Added business logic
CrochetFeve0251 Jul 4, 2023
3f95fa6
Added missing tests resources
CrochetFeve0251 Jul 4, 2023
53df7bf
Merge branch 'feature/5998-filesystem-cache' into feature/5997-create…
CrochetFeve0251 Jul 4, 2023
201736f
Fixed issues with the business logic
CrochetFeve0251 Jul 5, 2023
5b52205
Fixed issues with the business logic
CrochetFeve0251 Jul 5, 2023
b2b3249
Fixed tests
CrochetFeve0251 Jul 5, 2023
f60a0e9
Fixed code standards
CrochetFeve0251 Jul 5, 2023
e45ce7c
Fixed unit tests
CrochetFeve0251 Jul 5, 2023
1985dce
Added new unit tests
CrochetFeve0251 Jul 5, 2023
7e770ee
Fixed conflicts
CrochetFeve0251 Jul 6, 2023
dfafda2
Fixed subscriber class
CrochetFeve0251 Jul 6, 2023
9dcd4d0
Added logger
CrochetFeve0251 Jul 7, 2023
46dea31
Fixed issues with the lazyload
CrochetFeve0251 Jul 7, 2023
b0b65cf
Fixed tests and make code able to respect parameters
CrochetFeve0251 Jul 10, 2023
7e6dc29
Fixed integration tests
CrochetFeve0251 Jul 10, 2023
a1b8f18
Added the context
CrochetFeve0251 Jul 11, 2023
b113aa9
Added filter in `meta-boxes.php`
CrochetFeve0251 Jul 11, 2023
d239d9b
Added new filters
CrochetFeve0251 Jul 11, 2023
342b38d
Merge branch 'develop' into feature/5987-lazyload-css
CrochetFeve0251 Jul 11, 2023
efbe181
Added service provider
CrochetFeve0251 Jul 12, 2023
244ffc1
Fixed integration tests
CrochetFeve0251 Jul 12, 2023
1112b30
Fixed integration tests
CrochetFeve0251 Jul 12, 2023
28ef501
Pushed fixes
CrochetFeve0251 Jul 12, 2023
680a0f8
Fixed test
CrochetFeve0251 Jul 12, 2023
6dddca0
Fixed test CleanPartialCache
CrochetFeve0251 Jul 12, 2023
6adb374
Fixed admin tests
CrochetFeve0251 Jul 12, 2023
dbdb9e6
Fixed tests CleanKinstaPostCache
CrochetFeve0251 Jul 12, 2023
5bc9939
LazyLoad CSS Background Images: Create skeleton #6000 (#6004)
CrochetFeve0251 Jul 13, 2023
244bf11
Closes #5998 Lazyload CSS background images: filesystem cache (#6006)
CrochetFeve0251 Jul 13, 2023
66556f6
Merge branch 'develop' into branch-3.15
remyperona Jul 14, 2023
68f736b
Fixes #5366 protect monolog (#6046)
remyperona Jul 14, 2023
0b0b039
Fixed QA feedback
CrochetFeve0251 Jul 17, 2023
2cb6bac
Fixed feedback from QA on lazyload script loading when the option is …
CrochetFeve0251 Jul 17, 2023
2a72ad2
Fixed replacement to prevent a bug with twice same url
CrochetFeve0251 Jul 18, 2023
d34fa66
Fixed code standards
CrochetFeve0251 Jul 18, 2023
570b729
Added exclusion for content
CrochetFeve0251 Jul 18, 2023
0ea1be5
Added docblock `rocket_lazyload_css_cache_root`
CrochetFeve0251 Jul 18, 2023
184f733
Merge branch 'develop' into feature/5987-lazyload-css
CrochetFeve0251 Jul 18, 2023
9430ba4
Fixed issue with meta box
CrochetFeve0251 Jul 18, 2023
6ea0745
Fixed issue with undefined
CrochetFeve0251 Jul 18, 2023
fafb7b0
Fixed issue with multi background images
CrochetFeve0251 Jul 18, 2023
68b6a95
Prevent crash on invalid dom
CrochetFeve0251 Jul 18, 2023
563c8b1
Fix no slash issue and code standards
CrochetFeve0251 Jul 18, 2023
b7c00c5
Added JS exclusions
CrochetFeve0251 Jul 18, 2023
98ffbbb
Added lazyload minification
CrochetFeve0251 Jul 18, 2023
9d0428e
Refactored addLazyloadScriptRocketDelayJsExclusions.php unit tests
CrochetFeve0251 Jul 19, 2023
251ba8b
Added new activated tests for exclusions
CrochetFeve0251 Jul 19, 2023
26e004e
Fixed path for background-sss
CrochetFeve0251 Jul 19, 2023
7d72f1d
Isolated filter add_lazyload_script_exclude_js
CrochetFeve0251 Jul 19, 2023
c2915ea
Isolated filter add_lazyload_script_exclude_js
CrochetFeve0251 Jul 19, 2023
08685e3
Added fix for admin tests
CrochetFeve0251 Jul 19, 2023
ff802a9
Added fix for admin tests
CrochetFeve0251 Jul 19, 2023
5f411b4
Fixed admin test
CrochetFeve0251 Jul 19, 2023
6bb95d0
Added new build for the script lazyload-css.js
CrochetFeve0251 Jul 19, 2023
77eb85c
Added new build for the script lazyload-css.js
CrochetFeve0251 Jul 19, 2023
92efcf0
Merge remote-tracking branch 'origin/feature/5987-lazyload-css' into …
CrochetFeve0251 Jul 19, 2023
2b31b97
Added new lazyload not crashing
CrochetFeve0251 Jul 19, 2023
4055ded
Added safemode option
CrochetFeve0251 Jul 20, 2023
6a26e5a
Merge remote-tracking branch 'origin/feature/5987-lazyload-css' into …
CrochetFeve0251 Jul 20, 2023
9e21dc4
Fixed standards
CrochetFeve0251 Jul 20, 2023
a4e5970
Fixed an issue with placeholders due to duplication
CrochetFeve0251 Jul 20, 2023
b0c4fb2
Fixed issue with double slash
CrochetFeve0251 Jul 20, 2023
4eaa4a6
Fixed issue with lazyload script loading on search
CrochetFeve0251 Jul 21, 2023
6ca9476
Added a way
CrochetFeve0251 Jul 21, 2023
3f98a56
Added external files handling
CrochetFeve0251 Jul 24, 2023
5423935
Fixed code standards
CrochetFeve0251 Jul 24, 2023
a5e8e77
Excluded comments from replacement
CrochetFeve0251 Jul 24, 2023
e39b4d3
Added excluded test
CrochetFeve0251 Jul 24, 2023
a2e6cbb
Fixed issue with avada
CrochetFeve0251 Jul 24, 2023
cd72454
Fixed code standards
CrochetFeve0251 Jul 24, 2023
7e30c0f
Added fix for tests
CrochetFeve0251 Jul 24, 2023
324dd70
Added a fix for \r line return
CrochetFeve0251 Jul 25, 2023
d377c9d
Added a fix for html comments
CrochetFeve0251 Jul 25, 2023
761c9f1
Allow the case where both background and background-image are present
CrochetFeve0251 Jul 26, 2023
90cf6db
Added timestamp on urls to prevent browser cache issue
CrochetFeve0251 Jul 26, 2023
65c317a
Added domain on relative urls
CrochetFeve0251 Jul 26, 2023
cc9cf6f
Added moving logic for css content
CrochetFeve0251 Jul 27, 2023
180e23a
Added a fix for files without background
CrochetFeve0251 Jul 27, 2023
c110d44
Fixed unit tests from `create_lazy_css_files`
CrochetFeve0251 Jul 27, 2023
ae5d116
Fixed full urs for relative urls exclusions
CrochetFeve0251 Jul 27, 2023
766bcfb
Added exclusion tag
CrochetFeve0251 Jul 28, 2023
4a8eac0
Added AMP compatibility
CrochetFeve0251 Jul 28, 2023
9caf2c9
Refactored the code to make it easier to read
CrochetFeve0251 Aug 3, 2023
994c9cb
Added data structures to prevent checking types all the time
CrochetFeve0251 Aug 3, 2023
e6a567d
Merge branch 'develop' into branch-3.15
remyperona Aug 7, 2023
02abe91
Merge branch 'branch-3.15' into feature/lazyload-bg-images
remyperona Aug 7, 2023
49f3d76
Merge branch 'feature/lazyload-bg-images' into feature/5987-lazyload-css
remyperona Aug 7, 2023
5fca415
remove extra require
remyperona Aug 7, 2023
d4f1562
fix test
remyperona Aug 7, 2023
0b3040d
Merge branch 'branch-3.15' into feature/lazyload-bg-images
remyperona Aug 7, 2023
a4b9537
Merge branch 'feature/lazyload-bg-images' into feature/5987-lazyload-css
remyperona Aug 7, 2023
9ca3806
Fixed CR
CrochetFeve0251 Aug 10, 2023
bff6dc4
Fixed unit tests
CrochetFeve0251 Aug 14, 2023
d7e5426
Fixed conflicts
CrochetFeve0251 Aug 14, 2023
7b118c6
Fixed conflicts
CrochetFeve0251 Aug 14, 2023
430a639
Added cleaning from post meta option
CrochetFeve0251 Aug 16, 2023
1521e11
Fixed an issue with the post meta
CrochetFeve0251 Aug 16, 2023
46bc4ab
Moved content inside local files too.
CrochetFeve0251 Aug 16, 2023
895d495
Merged develop
CrochetFeve0251 Aug 16, 2023
327775e
Merge branch 'develop' into feature/5987-lazyload-css
CrochetFeve0251 Aug 17, 2023
2c2caed
Fixed conflicts
CrochetFeve0251 Aug 17, 2023
e84638c
Fixes #5366 protect monolog (#6046)
remyperona Jul 14, 2023
55020ae
fix test
remyperona Aug 7, 2023
65560bd
Merge remote-tracking branch 'origin/branch-3.15' into branch-3.15
CrochetFeve0251 Aug 17, 2023
a8810ff
Fixed conflicts
CrochetFeve0251 Aug 17, 2023
99d9e49
Reverted changes on dependencies
CrochetFeve0251 Aug 18, 2023
e6ad9ea
Added a fix for rules without ;
CrochetFeve0251 Aug 18, 2023
71fee9b
Translate languages/rocket.pot in pt_BR
transifex-integration[bot] Aug 23, 2023
b408803
Added fix for cdn and CR
CrochetFeve0251 Aug 24, 2023
f01c134
Added fix for cdn and CR
CrochetFeve0251 Aug 24, 2023
30ae7d4
Merge branch 'develop' into branch-3.15
engahmeds3ed Aug 24, 2023
890f529
Merge branch 'branch-3.15' into feature/5987-lazyload-css
engahmeds3ed Aug 24, 2023
9003bc0
update version to 3.15-alpha1
engahmeds3ed Aug 24, 2023
0e9ff8b
Removed delete on trash or delete added new possible cases on regex f…
CrochetFeve0251 Aug 25, 2023
38c9927
Merge branch 'feature/5987-lazyload-css' into transifex
engahmeds3ed Aug 28, 2023
57c186b
update pot file from lazyload branch
engahmeds3ed Aug 28, 2023
baff8fe
Translate languages/rocket.pot in fr_FR
transifex-integration[bot] Aug 28, 2023
803aa28
Feature/5987: Lazyload bg css (PR #6039)
CrochetFeve0251 Aug 29, 2023
56c29fb
generate mo files
engahmeds3ed Aug 29, 2023
5721bfb
update version to alpha2
engahmeds3ed Aug 29, 2023
02c326c
Merge branch 'branch-3.15' into transifex
engahmeds3ed Aug 29, 2023
cae9ba1
lazyload css Changes (PR #6125)
engahmeds3ed Aug 30, 2023
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
77 changes: 77 additions & 0 deletions assets/js/lazyload-css.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
function rocket_css_lazyload_launch() {

const pairs = rocket_pairs || [];

const styleElement = document.querySelector('#wpr-lazyload-bg');

const threshold = rocket_lazyload_css_data.threshold || 300;

const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const pairs = rocket_pairs.filter(s => entry.target.matches(s.selector));
pairs.map(pair => {
if (pair) {
styleElement.innerHTML += pair.style;
pair.elements.forEach(el => {
el.setAttribute('data-rocket-lazy-bg', 'loaded');
// Stop observing the target element
observer.unobserve(el);
});
}
})
}
});
}, {
rootMargin: threshold + 'px'
});

function lazyload() {


pairs.forEach(pair => {
try {
const elements = document.querySelectorAll(pair.selector);
elements.forEach(el => {
observer.observe(el);
// Save el in the pair object (create a new empty array if it doesn't exist)
(pair.elements ||= []).push(el);
});
} catch (error) {
console.error(error);
}
});
}

lazyload();

const observe_DOM = (function(){
const MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

return function( obj, callback ){
if( !obj || obj.nodeType !== 1 ) return;

if( MutationObserver ){
// define a new observer
const mutationObserver = new MutationObserver(callback);

// have the observer observe for changes in children
mutationObserver.observe( obj, { attributes: true, childList:true, subtree:true })
return mutationObserver
}

// browser support fallback
else if( window.addEventListener ){
obj.addEventListener('DOMNodeInserted', callback, false)
obj.addEventListener('DOMNodeRemoved', callback, false)
obj.addEventListener('DOMSubtreeModified', callback, false)
}
}
})()

const body = document.querySelector('body');

observe_DOM(body, lazyload)
}

rocket_css_lazyload_launch();
1 change: 1 addition & 0 deletions assets/js/lazyload-css.js.min.map

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

1 change: 1 addition & 0 deletions assets/js/lazyload-css.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 assets/js/lazyload-css.min.js.map

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

Loading