Skip to content

Fix - Slider assets load unconditionally on the blog index due to an operator-precedence bug - #145

Open
deepench wants to merge 1 commit into
developfrom
fix/slider-scripts-operator-precedence
Open

deepench wants to merge 1 commit into
developfrom
fix/slider-scripts-operator-precedence

Conversation

@deepench

Copy link
Copy Markdown
Contributor

Changes proposed in this Pull Request:

Fixes #145. On the homepage/blog index, two slider-related script files were loading every time, even when the "Activate Slider" setting in the Customizer was turned off. This did not cause the slider itself to show up when it should not (that part was already working correctly), it just meant a small amount of unused JavaScript was being downloaded on every visit to the homepage under the default "Your latest posts" setting. This fix makes those scripts load only when the slider setting is actually turned on, matching how Spacious Pro already does it.

How to test the changes in this Pull Request:

  1. On a fresh site with default Reading settings ("Your latest posts" as homepage) and the Customizer "Activate Slider" setting left off, load the homepage.
  2. Check the browser's Network tab (or View Source) for jquery.cycle2.min.js and jquery.cycle2.swipe.min.js - neither should load.
  3. Turn "Activate Slider" on in the Customizer and reload the homepage - both scripts should now load and the slider should display as before.

Types of changes:

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (modification of the currently available functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Other information:

  • Have you added an explanation of what your changes do and why you would like us to include them?
  • Have you successfully ran tests with your changes locally?
  • Have you updated the documentation accordingly?

Changelog entry

Fix - Slider scripts loaded on the homepage even when the slider setting was off.

@tg-autopilot
tg-autopilot requested a lite review from Copilot September 25, 2026 06:53
@github-actions

Copy link
Copy Markdown

QA suite — refused, no regression spec

This PR changes product source but adds no spec, so the suite was
refused before booting WordPress — running it just to report the same
thing at the end costs runner minutes for nothing. Run
/claudegrill:verify-fix locally and let write-spec add the guard
to this branch, then push again.

Source files changed with no matching spec
inc/enqueue-scripts.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The conditional fix addresses the reported issue without changing enabled-slider behavior.

Review effort: Lite
Findings: None

What changed in this PR

Fixes slider scripts loading when the slider is disabled on the blog index.

Changes:

  • Corrects operator precedence in the enqueue condition.
  • Preserves loading when the slider is enabled.
File Description
inc/​enqueue-scripts.php Corrects slider script enqueue gating.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@deepench
deepench requested a review from subin-shk September 25, 2026 07:02
@deepench deepench self-assigned this Sep 25, 2026
@deepench deepench added the bug label Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants