Skip to content

Add admin settings update and license APIs - #5

Open
syedgalib wants to merge 1 commit into
sovware:developmentfrom
syedgalib:feat/admin-settings-license-api
Open

Add admin settings update and license APIs#5
syedgalib wants to merge 1 commit into
sovware:developmentfrom
syedgalib:feat/admin-settings-license-api

Conversation

@syedgalib

@syedgalib syedgalib commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

Why is this PR needed?

The App Toolkit admin settings endpoint is read-only, does not expose an All Listings layout, and cannot report whether the site has a current Directorist license entitlement. Administrators need to update app configuration through the API, while clients need a boolean entitlement state.

What is done in this PR?

  • Adds authenticated partial POST, PUT, and PATCH updates to /directorist-app-toolkit/v1/admin-settings.
  • Adds the app_layout_all_listings JSON setting.
  • Activates the first valid Directorist EDD entitlement after successful Themes & Extensions authentication and stores a normalized site-wide state without persisting the raw license key.
  • Adds the boolean has_active_license field to admin settings responses.
  • Validates settings before saving and rejects unknown, read-only, or invalid JSON values.

How to test the PR

  1. Log in as an administrator and send a partial PATCH request to /wp-json/directorist-app-toolkit/v1/admin-settings; confirm only submitted values change and the full settings object is returned.
  2. Update app_layout_all_listings with a JSON object and confirm GET returns the decoded object; confirm invalid JSON, unknown fields, and has_active_license updates return 400.
  3. Repeat the update unauthenticated and confirm it is rejected.
  4. Log in to Directorist through Themes & Extensions with an account containing valid licenses, then confirm the first valid license is activated and GET returns has_active_license: true.
  5. Confirm an expired or unavailable entitlement returns has_active_license: false.

Task Links

@syedgalib
syedgalib requested a review from MahfuzulAlam August 22, 2026 18:40
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