Skip to content
bleedingdeaconsPublic

About

Questions for Conference Collation Plugin

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Confur — Conference Question Collation

CI Semgrep Coverage Status PHPStan PHPCS Version PHP Licence

Automated collation of answers to conference questions submitted online by groups. Confur provides one place for groups to lodge their answers and one place for region representatives to read them back, organised and ready to discuss.

What it does

Conference cycles are messy. Confur cleans the mess up by separating three things that used to be tangled together:

  1. Groups submit answers through a public-facing form that creates an Answer custom post.
  2. Region reps review in a centralised admin screen — Status (who's submitted, how complete), Results (the full text, by committee, ready to collate).
  3. AA programme content (Steps, Traditions, Responsibility Pledge) is reusable via shortcodes wherever it's needed.

The question set — committees and how many questions each has — is edited on the Questions admin screen, without code changes. Answers are stored in Advanced Custom Fields on the Answer post.

Requirements

Confur is a MIT-licensed plugin published by The Bleeding Deacons.

Installation

  1. Install and activate 12 Step Meeting List, Unity, TSML for Unity and Advanced Custom Fields.
  2. Upload the confur directory to /wp-content/plugins/.
  3. Activate Confur through the Plugins menu in WordPress.
  4. Import the bundled ACF configuration (setup/confur_v3_0.json) — this registers the Answer custom post type and its field group, and the Allocation field group on TSML groups.
  5. Create a public registration page containing a form (ID registration--q4c) that creates the Answer post and fills its group field — and fellow_group when two groups answer together — with TSML groups, plus email.

Administration

Under the Questions for Conference sidebar menu:

Screen What it shows
Status Submission progress per group/committee — who's filed, who hasn't.
Results The latest answers grouped for collation.
Questions Administrators set the committees, how many questions each has, and optionally which committee number holds the questions every committee answers together ("All Committees"). "Complete" requires an answer to every question here. Answer pages are built from shortcodes and must be edited to match.

Questions for all committees

Some cycles ask questions of every committee together. They are kept under a committee number of their own, 7 in the bundled set, so their answers use that number's fields (c7_a1, …) and answer pages use [answer committee="7" question="1"] as for any other. Everywhere a committee is named (the progress table, the Results page and its copied text, the dashboard and the allocation wording), that number is called All Committees instead, and on the Results page it has a section of its own. A cycle with no such questions chooses No questions for all committees on the Questions screen.

Shortcodes

Answer & question management

[answer committee="1" question="1"]          Generate an answer input field
[question number="1" committee="1"]          Render a question with formatting
[committee number="1" name="Finance"]…[/committee]   Wrap a committee section
[start_committee number="1"] … [end_committee]      Open / close a committee section
[header]                                     "Answers from" the registered group(s)
[allocated_committee]                        The committee this group was allocated
[progress_table]                             Per-committee progress table
[control position="top"]                     Save controls (Draft / Complete)
[status position="top"]                      Unsaved-changes notice

[configure_form] is retired and renders nothing; it is still registered so older answer pages that contain it do not show the raw shortcode.

AA programme content

[step number="1"]                            Display an AA Step + PDF link
[tradition number="1"]                       Display an AA Tradition + PDF link

General utilities

These four are also shipped by the Amber plugin; whichever loads first registers them.

[open_new_link href="url" class="…"]Link[/open_new_link]  Link that opens in a new tab
[open_email address="x@y" subject="…"]Text[/open_email]   Mailto link
[pdf_link url="…" name="file.pdf"]Link[/pdf_link]         Inline PDF download link
[days_remaining end_date="2024-12-31" extend_by="0"]     Countdown to deadline

REST API

The answer page script uses two public endpoints. An answer page's slug has a random prefix and is only sent to the group, so the slug is the credential — there is no nonce, which would expire on cached, logged-out pages.

GET  /wp-json/answer/v1/status/{slug}     State and last save time
POST /wp-json/confur/v1/answers/{slug}    Save: {"state": "Draft"|"Complete", "answers": {"c1_a1": "…"}}

A save returns {"message", "updated", "state"}. "Complete" is only granted when every question has an answer; otherwise the answers are saved as a Draft and message says how many remain. A cancelled registration answers 403, an unknown slug 404.

Logging

Confur logs through Sentinel's shared logger, on one channel, confur, so its lines can be filtered on Sentinel's log screen and Monitor's error alerts can be scoped to it. Failures that need someone to act (an answer that could not be saved, an email that failed to send, the plugin failing to boot) are error or critical, which Monitor alerts on by default. Routine events (a duplicate registration, a blocked address, Complete asked for with questions unanswered) are info or notice.

Without Sentinel the same lines go to the PHP error log, prefixed [confur]. Neither carries members' answers or email addresses: posts are named by ID and settings by key.

Upgrading saved times (one-off)

Before 3.3, an answer's updated and completed times were stored as text such as Monday, 2024-01-01 01:02:03 PM, so sorting by them sorted by weekday name. They are now stored as 2024-01-01 13:02:03, the date-time picker's own format. Both display the same and both are read correctly, so nothing breaks before the old values are converted; only sorting waits on it.

To convert the old values, back up the database, then:

wp confur migrate-dates --dry-run   # list what would change; writes nothing
wp confur migrate-dates             # convert

It is safe to run more than once. Values it cannot read are reported and left as they are.

Building a release

The plugin ships with a cross-platform build.php script that packages a distributable zip:

php build.php                       # Production zip (default)
php build.php build:production      # Production zip
php build.php build:dev             # Dev zip (keeps tests)
php build.php clean                 # Remove the build/ directory
php build.php --version=2.12.0      # Override version on the way out
php build.php --help                # Show all options

Output lands in build/confur-production-<version>.zip (or -dev-). On every build the script reads the version from the Version: header in Confur.php, syncs the **Version:** line in this README and the Stable tag: line in readme.txt, and stamps the build date into readme.txt immediately after the Stable tag: line.

Testing

The suite is written in Pest 5, running on PHPUnit and configured by phpunit.xml and tests/Pest.php. Run it with composer test (or vendor/bin/pest), or:

# Unix-like
./run-tests.sh

# Windows
run-tests.cmd

Coverage reports drop into coverage/. Line coverage is also reported to Coveralls on every CI run.

Licence

MIT (Modified). See LICENSE for the full text.

About

Questions for Conference Collation Plugin

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages