Skip to content

Fix: Prevent missing dependency error when WP Consent API is not inst…#172

Merged
ParhamTehrani merged 1 commit intodevelopmentfrom
bugfix/multiple-fixes
Mar 11, 2026
Merged

Fix: Prevent missing dependency error when WP Consent API is not inst…#172
ParhamTehrani merged 1 commit intodevelopmentfrom
bugfix/multiple-fixes

Conversation

@ParhamTehrani
Copy link
Copy Markdown
Contributor

@ParhamTehrani ParhamTehrani commented Mar 11, 2026

…alled

Check if wp-consent-api script is registered before adding it as a dependency. This fixes the issue where settings page would not load when consent_integration was set to wp_consent_api but the plugin was not installed.

Describe your changes

...

Submission Review Guidelines:

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • Will this be part of a product update? If yes, please write one phrase about this update.
  • I have reviewed my code for security best practices.
  • Following the above guidelines will result in quick merges and clear and detailed feedback when appropriate.
  • My code follows the style guidelines of this project
  • I have updated the change-log in CHANGELOG.md.

Type of change

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Summary by CodeRabbit

Bug Fixes

  • Improved consent API integration loading behavior to occur only when necessary, enhancing script performance and dependency management.

…alled

Check if wp-consent-api script is registered before adding it as a dependency.
This fixes the issue where settings page would not load when consent_integration
was set to wp_consent_api but the plugin was not installed.
@ParhamTehrani ParhamTehrani merged commit 7b87ab0 into development Mar 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2a03dd77-3857-4f50-acc0-eb8c6fb45929

📥 Commits

Reviewing files that changed from the base of the PR and between b9629bb and 2648cb0.

📒 Files selected for processing (1)
  • wp-slimstat.php

📝 Walkthrough

Walkthrough

The enqueue_tracker function in wp-slimstat.php has been modified to conditionally add the 'wp-consent-api' script dependency only when the script is registered or enqueued, rather than unconditionally appending it during consent integration setup.

Changes

Cohort / File(s) Summary
Conditional Dependency Management
wp-slimstat.php
Modified enqueue_tracker function to add 'wp-consent-api' dependency only when the script is actually registered or enqueued, improving conditional logic for consent API integration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through code so clean,
Where dependencies flow—not just a dream!
Now only when needed, the consent API calls,
No wasted whiskers in these logic halls! ✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/multiple-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

parhumm added a commit that referenced this pull request Mar 14, 2026
…218 fix

- Added PR #218: Fix 500 errors on REST/admin-ajax tracking endpoints
- Added PR links for consent fixes (#172, #178), CSS (#175), email layout (#177),
  GeoIP timestamp (#185), admin performance (#189), visitor counting (#178)
@parhumm parhumm mentioned this pull request Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant