Cleanup: remove verified-dead code (ponytail audit) - #7
Merged
Conversation
Proof: `grep -rn "debug_log" --include="*.php"` returns only the definition at public/class-infinite-loader-for-woocommerce-public.php:620 - zero callers. It is a `private` method, so no dynamic/external dispatch is possible; nothing in the class (or repo) invokes it. Removing it changes no behavior. PHP-only cut - no JS/CSS source touched, so the grunt min bundles are unaffected. build-release.sh passes: PHP lint clean, verify-build-freshness OK, zip built. Kept (reported as owner decisions, not cut): - Rate limiter (check_rate_limit/get_client_ip) - guards the live read-GET next-page fetch, which sends infinite_loader_ajax=1 (infinite_loader_products.js:265). DoS/scraping protection on a real endpoint; owner decision. - add_security_headers() - live X-Frame/X-Content-Type/Referrer-Policy headers on frontend WooCommerce pages; owner decision. - Hand-rolled sanitize_hex_color() (public + admin) - many live callers, and the signature differs from core (takes a $default fallback, runs on the frontend where the customizer's sanitize_hex_color() is not guaranteed loaded); NOT an exact core replacement. - sanitize_css_js_option / sanitize_javascript - input sanitization, never removed.
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.
Summary
Removes one proven-dead private method. Correctness over volume - this plugin is already lean; only a single orphaned helper qualified.
Removed
Infinite_Loader_For_Woocommerce_Public::debug_log()(public class, was line 620)grep -rn "debug_log" --include="*.php"returns only the definition - zero callers.privatemethod, so no dynamic/external dispatch is possible. Removing it changes no behavior.Reviewed and KEPT (owner decisions - not cut)
check_rate_limit/get_client_ip): guards the live read-GET next-page fetch, which sendsinfinite_loader_ajax=1(infinite_loader_products.js:265). It protects a real endpoint against DoS/scraping - HIGH RISK to remove, owner decision.add_security_headers(): liveX-Frame-Options/X-Content-Type-Options/Referrer-Policy/X-XSS-Protectionon frontend WooCommerce pages. Owner decision.sanitize_hex_color()(public + admin): many live callers; signature differs from WP core (takes a$defaultfallback, and runs on the frontend where the customizer'ssanitize_hex_color()is not guaranteed loaded). NOT an exact core replacement - kept.sanitize_css_js_option/sanitize_javascript: input sanitization on save - never removed.infinite-loader-for-woocommerce-public.jshover/click handlers, admin icon-picker): thin but genuinely enqueued and executing - not dead.Gate
bash bin/build-release.sh-> PHP lint clean,verify-build-freshness: OK, zip built (86 files). Green.No version bump, no changelog edit, no refactors.
dist/*.zipbuild artifacts intentionally excluded from the commit.