• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bleedingdeacons / confur / 43098764163
96%

Build:
DEFAULT BRANCH: main
Ran 11 Nov 2026 09:00PM UTC
Jobs 1
Files 32
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Nov 2026 08:54PM UTC coverage: 96.404% (+0.3%) from 96.056%
43098764163

push

github

web-flow
feat: save answers through a REST endpoint (#87)

* feat: save answers through a REST endpoint

POST confur/v1/answers/{slug} takes {"state", "answers"} as JSON, finds
the answer post by its slug and saves through SaveAnswers. It replaces
admin-post.php, which worked out the post from the Referer header.

- The slug is the credential, as it already is for viewing the page;
  there is no nonce, which would expire on cached, logged-out pages.
- A save returns {message, updated, state}; a cancelled registration is
  403, an unknown slug 404, a malformed body 400, anything else a
  generic 500.
- AssetService passes the page slug and both endpoint URLs to the page
  script with wp_localize_script on its own handle. The URLs come from
  rest_url(), so subdirectory installs and plain permalinks work; the
  old config was attached to 'jquery' and the script hard-coded
  /wp-json/ and /wp-admin/ paths.
- The page script sends only the answer fields and shows the server's
  reason when a save is refused.
- The admin-post route stays for one release and logs each use.
- README documents both endpoints.

* fix: only treat a readable JSON reply as a successful save

Addresses review on #87: a 200 that is not JSON (a proxy or login page)
was read as {} and treated as success, which cleared the group's local
copy of answers the server never received. A success must now parse and
carry the saved state.

* refactor: remove the admin-post submission fallback

Answers save only through POST confur/v1/answers/{slug} now.

- AnswerHandler keeps only the registration hook; handleSubmission and
  its two admin_post_* hooks are gone, along with the Referer lookup.
- [configure_form] renders nothing. It only added the hidden "action"
  field admin-post needed, but existing answer pages contain it, so it
  stays registered rather than showing as raw text.
- Constants::ACTION and Constants::TOKEN are removed (unused).
- The submission tests that covered behaviour not already t... (continued)

84 of 86 new or added lines in 5 files covered. (97.67%)

2413 of 2503 relevant lines covered (96.4%)

4.47 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
95.77
19.18% src/API/AnswerAPI.php
Jobs
ID Job ID Ran Files Coverage
1 43098764163.1 11 Nov 2026 09:00PM UTC 32
96.4
GitHub Action Run
Source Files on build 43098764163
  • Tree
  • List 32
  • Changed 6
  • Source Changed 5
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #43098764163
  • 27b30faf on github
  • Prev Build on main (#43076900378)
  • Next Build on main (#43099944863)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc