Remove verified dead code from frontend loader - #21
Merged
Merged
Conversation
Cleanup only, no behavior change. All cuts gated on config keys that are never localized via wp_localize_script (verified with grep): - Drop the dead lazyLoadXT lazy-load subsystem in infinite_loader_products.js: should_lazy_load(), prepare_lazy_load_content(), infinite_loader_update_lazyload(), both lazyLoadXT blocks, and the var-decl entry. Gated on lazy_load, lazy_load_m, mobile_width, LLanimation - none ever localized. - Collapse current_style() mobile branch (use_mobile/mobile_type never localized) to the single set_style(type) line. - Unwrap the is_AAPF guard on the pagination click handler (key never localized, so the guard was always true). - Drop the is_mobile localize key - never read in JS. - Collapse the two byte-identical hover-CSS methods into one private output_hover_css() helper called by both wp_head callbacks. - Inline the one-caller is_woocommerce_blocks_active() class_exists wrapper. Rebuilt public/js/min/infinite_loader_products.min.js to match source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cleanup only, no behavior change. Every cut is gated on a config key that is never localized via
wp_localize_script(verified by grep before deleting), so the affected branches could never execute.JS - public/js/infinite_loader_products.js
should_lazy_load(),prepare_lazy_load_content(),infinite_loader_update_lazyload(), both lazyLoadXT blocks, and theinfinite_loader_update_lazyloadvar-decl entry. Gated onlazy_load/lazy_load_m/mobile_width/LLanimation- none are ever localized.current_style()mobile branch (use_mobile/mobile_typenever localized -> always fell through) to the singleset_style(type)line.is_AAPFguard on the pagination click handler (is_AAPFnever localized, so the guard was always true).trigger_lazy_load()intact - it is a separate generic function, not part of the dead subsystem and not gated on dead keys.PHP - public/class-infinite-loader-for-woocommerce-public.php
is_mobile => wp_is_mobile()localize key - never read in JS.output_hover_css($opt, $sel, $filter, $id)helper; bothwp_headcallbacks remain and delegate to it (hook wiring unchanged).is_woocommerce_blocks_active()class_existswrapper at its single call site.Not touched (per scope)
mobile_typePHP option schema + the second "previous button" partial (a real independently-styled-second-button feature).load_plugin_textdomain, the icon-list data array,edd-license/.dist/zips.Verification
php -lclean on both changed PHP files.public/js/min/infinite_loader_products.min.jsviagrunt uglify:public(36.5 kB -> 16.6 kB); rebuilt min confirmed free of all removed symbols.bash bin/build-release.shexits 0: version agrees, PHP lint clean, contract audit clean, verify-build-freshness OK.