Skip to content

Fix custom badge editor control width and docs#2920

Open
RabbiIslamRony wants to merge 11 commits into
sovware:developmentfrom
RabbiIslamRony:codex/fix-badge-input-width-docs
Open

Fix custom badge editor control width and docs#2920
RabbiIslamRony wants to merge 11 commits into
sovware:developmentfrom
RabbiIslamRony:codex/fix-badge-input-width-docs

Conversation

@RabbiIslamRony

@RabbiIslamRony RabbiIslamRony commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

This PR updates the Directorist Appearance > Badges work so badge rules are safer and more complete across settings, builder metadata, and frontend matching.

  • Adds/updates the custom badge manager behavior for core and custom badges.
  • Keeps New, Popular, and Featured backward-compatible while allowing custom badge rules in directorist_badge_rules.
  • Supports General, Field, and Pricing plan badge conditions without changing the save payload or option storage.
  • Keeps custom badges additive: archive widgets must be placed manually, and single listing custom badges stay disabled until enabled in the grouped Badges widget.
  • Preserves builder chip UI while frontend/admin preview badge output uses saved badge labels, icons, colors, borders, and tooltip values.

Latest Updates

  • Field condition metadata now reads raw directory builder fields, so Pricing Plans add-listing gating does not hide Badge condition choices in Settings.
  • Runtime condition matching now decodes encoded operators like <=, >=, and ≠ before frontend matching.
  • Pricing plan metadata includes published v4 directorist_plans rows in addition to legacy/Woo sources.
  • Pricing runtime checks support legacy _fm_plans, v4 _plan_id, and active v4 package assignment.
  • Reset defaults now opens a confirmation popup before changing badge data.
  • Popular reset now restores two General rows using Any (OR): View count >= 5 and Average rating >= 4.
  • The reset popup is moved to document.body while open so the settings header/subnav/footer cannot appear above the overlay.
  • Badge QA docs were updated with the reset-defaults, modal, condition-source, and operator-normalization guardrails.

QA Results

  • php -l includes/class-helper.php passed in the previous badge-condition commit.
  • php -l includes/classes/class-settings-panel.php passed.
  • Scoped git diff --check passed for the touched source/PHP/docs/SCSS files.
  • Runtime condition matrix passed 48/48 cases:
    • General: age, views, rating, review count, featured status, listing status.
    • Field: text-like, number, select, radio, checkbox, switch, date, time, color, taxonomy, image, video, file, button, map, privacy.
    • Pricing: _fm_plans, _plan_id, and active package assignment.
    • AND/OR, conditionless custom, invalid custom fail-closed, encoded and double-encoded operators.
  • Reset-defaults runtime check passed 3/3 cases:
    • Views >= 5 and rating < 4 shows Popular.
    • Views < 5 and rating >= 4 shows Popular.
    • Views < 5 and rating < 4 does not show Popular.
  • Admin payload QA passed:
    • 6 General options.
    • 90 Field options on the current local site.
    • 3 Pricing plan options: Codex Badge Free Starter, Codex Badge Pro Monthly, Codex Badge Priority PPL.
    • Fresh Badges page Save button disabled.
    • No console/page errors.
  • Reset popup browser QA passed in Agent Browser:
    • Popup opens with the warning copy.
    • Overlay is attached to document.body.
    • Overlay z-index is above settings header/subnav/footer.
    • Cancel removes the modal and clears the modal-open body class.
  • Temporary metadata matrix passed 29/29 supported field types and confirmed Pricing, Social Info, and Business Hours do not leak into the Field source.

Notes

  • No migration, new option key, AJAX action, nonce/capability change, builder maxWidget change, or frontend wrapper rewrite is introduced.
  • No build command was run for the latest reset/modal patch.

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