Skip to content

Jetonomy 2.1.0 - #87

Merged
vapvarun merged 219 commits into
mainfrom
2.1.0
Nov 24, 2026
Merged

vapvarun merged 219 commits into
mainfrom
2.1.0

Conversation

@vapvarun

Copy link
Copy Markdown
Owner

Jetonomy 2.1.0 (Free). Release branch into main, lockstep with Jetonomy Pro 2.1.0. QA zip passes J61 and J62 are clear; Docker six checks, upgrade from 2.0.7, full PHPUnit run and security gate recorded in audit/security/2.1.0.md.

Imported topics and replies skip the create actions on purpose (they would notify, queue webhooks and award points for old content). A batch now fires jetonomy_import_batch_imported with only the ids it created, so integrations catch up quietly: the external search index is fed from it, and Import_Manager::is_running() is true (request-local, cleared on exceptions) while a batch runs. A re-run fires nothing.
jetonomy_reputation_changed already carried the object a change was about. Votes now add voter_id, reports add reporter_id, and an upheld report names the flag, so a listener can tell one member's award from another's on the same object and take back exactly one when a vote is withdrawn. Additive: nothing that read the context before changes. The hook docblock and reference now describe the context.
The 'post removed' reputation penalty was applied before jetonomy_content_moderated fired, so a listener taking the participation award back (a points plugin) ran after the penalty had already been cut, and the two together could push a small balance below zero. The penalty now follows the event: listeners settle first and the penalty is taken from what is left.
A community set to Private still served /community-sitemap.xml and its child sitemaps to logged-out visitors, listing every public space and topic URL, and robots.txt kept advertising it. Both now follow one rule, Sitemap_Emitter::enabled() (SEO toggle on and community public), the same visibility rule the space RSS feed uses. Verified logged out in Private mode: index and both child sitemaps 404, robots.txt has no line; in Public mode they return 200. The admin and developer docs described a WordPress core sitemap provider that does not exist; both now describe the real sitemap.
…tate)

A topic's author is followed automatically, but clicking Following to unfollow deleted the row and the author kept getting a bell notice and an email for every reply, because the notifier told the topic author without looking at the follow state. Unfollow now keeps the author's row as notify_via 'none' (enum widened by migration 2.0.8, metadata-only, DB version 2.0.8), the notifier skips the author while it is set, and every subscription reader (is_subscribed, find_for, list/count, fan-out, followed topics) ignores 'none'. Follow flips it back. Mentions and moderation notices still arrive; imported topics with no row keep notifying their author; other members' unfollows still delete the row. Verified live: follow, unfollow, reply, mention, re-follow, imported, non-author follower, and the Follow/Following button after reload.
The wp-admin inline edit saved an empty topic title (and an empty body) while the REST edit refused it, and its 'Saved!' message was written inside the panel that had just closed, so nobody saw it. Both edit paths now use one validator, Post::title_update_error (empty or whitespace-only is refused, the length rule still applies), the admin handlers refuse a blank body the way REST does, a 4xx now shows the server's own message instead of a generic one, the topic row shows 'Saved!' beside its title, and the feedback has the success and error colours it never had. Verified in the browser for topics and replies (empty, whitespace, valid, repeat save, 390px) and over REST.
…, no automatic demotion

The Permissions screen showed four thresholds per level but Level 1 ignored reputation and Levels 2 and 3 ignored replies received, 'posts' counted topics only so a member who only answers questions never left Level 0, and the docs promised demotion that never happens. Owner decisions: check every figure shown (a figure left at 0 is not checked), count topics plus replies written, relabel the column 'Topics and Replies Written', stop requiring replies received at Level 1 by default, and keep levels up-only with the docs corrected (an admin lowers a level by hand). Communities that saved their own thresholds keep them. Verified on the real sweep: a reply-only member reaches Level 1 (Level 0 on the old code), a manually set level is never lowered, an owner-set replies-received threshold is enforced and clearing it lets the member through.
Trust_Evaluator only sees the stats it is handed; topics plus replies written is decided where the sweep builds them. TrustSweepTest runs the real sweep for a reply-only, a topic-only, a mixed and a four-contribution member and pins that a level set by hand is never lowered. Found by QA: the evaluator tests passed on the old code for the reply-only case.
jetonomy.css and its right-to-left copy are 56 KB gzipped against the portfolio's 35 KB, view.js is 57 KB against 40 KB. Owner decision 2026-11-21: keep each at today's size plus about 10% and plan the split as its own release task, so the gate still fails if they grow. Recorded in .gate-check-allow with the reason.
(1) The reply composer footer is a non-wrapping flex row holding the keyboard hint, the Private toggle and the buttons, so with long text the buttons' container shrank and 'Post Reply' wrapped onto two lines (70px tall on Reign at 768 to 1280). The footer now wraps, its button container never shrinks and button labels stay on one line (45px tall); the phone layout keeps its full-width stacked button. (2) The Members tab search form on the space edit screen had no rule of its own and sat 1px above the table: it now has a 16px gap below it and wraps on a phone. Verified in the browser on Reign at 1280, 768, 641, 640, 390 and 320 and in RTL; minified and RTL copies rebuilt.
Vote::cast() reads the existing vote before its transaction and takes no lock, so two parallel requests from one member (two tabs, the app and the web) both found no row and both inserted. The unique key let one through (there was never a double vote) but wpdb logged 'Duplicate entry' for the loser and the member got a 500 'Failed to record vote.'. The insert now runs with wpdb errors suppressed for that one statement; a duplicate-key failure rolls back and answers as the winner did (vote recorded), and any other failure is still returned as an error and written to the log. Reproduced with 8 parallel processes: old code logged 7 duplicate-entry errors; the fix gives 8 successes, 1 row, 0 log lines.
Clicking the Inline Code button with no text selected inserted an empty <code> and left the caret outside it, so the button looked dead and the next words were plain text (Bold and Italic worked). A bare-cursor click now opens a code run and puts the caret inside it, on a zero-width placeholder; a second click steps out of the run; with text selected it wraps the selection as before. jetonomy_sanitize_editor_content() (the one function every writer's HTML goes through) now drops a run nobody typed into and removes the placeholder everywhere, so it never reaches stored content. Verified in the browser on Reign with the card's steps, and the server function on real samples; unit tests added (not run here: PHPUnit is not installed in this repo).
…mn, rep count on one line

Reproduced on Reign 8.1.1: (1) the Trending block kept its own border, 20px padding, 12px radius, shadow and accent bar inside the theme's widget card, a box in a box with about 227px for text; inside a widget area (.widget, .widget_block, .wp-block-widget-area, aside, footer) it now sits flat, and in page content it keeps its card. (2) Reign's '.footer-wrap a { display: block }' beat the Active Spaces row's flex column on specificity, so the name ran into the description and topic count; a widget-scoped rule restores the column. (3) '1,840 rep' wrapped onto two lines at sidebar width; the count is now nowrap. Verified at 1280, 768 and 390 with no horizontal scroll; minified and RTL copies rebuilt.
…s focus inside

Reporting content you had already reported left the dialog open and dropped focus to <body>: the server answers 409 jetonomy_already_flagged, which the dialog treated as a failure, and the Report button it re-enabled had lost focus because a disabled button cannot keep it. A duplicate report is a finished state: the toast shows the server's message, the dialog closes, focus returns to the trigger and a reported post shows its reported state. Any other failed submit keeps the dialog open and puts focus back on its Report button. Verified in the browser on Reign: already reported, a blocked request, and Escape still closes.
… is hidden

QA found that reporting a USER twice closed the dialog with focus on <body>: the Report item is inside the 'more' dropdown, which has closed by the time the dialog does, and a hidden element cannot take focus. The shared dialog primitive (jetonomyTrapDialog and the confirm/alert close) now restores focus through one helper that falls back to the menu's own toggle button when the opener is not visible. Applies to every dialog opened from a menu item. Verified in the browser on a profile: first report and duplicate report both land focus on the visible 'more' button.
With 'Show private spaces to logged-out visitors' on, the home page and category grids marked a private space with the lock badge, but the search results used their own copy of the space card that skipped the badge helper, so a visitor searching for a space saw a private space that looked identical to an open one. The search cards now render the same badge row (Private, type, member) through jetonomy_render_space_meta_badges, with the same one-query viewer-role warm-up the grids use. Verified logged out at 1280 and 390, a public space (no badge) and a member's view (Private, Forum, Member).
human_time_diff() says '24 hours' for a wait of 23h59m59s and '1 day' at exactly 24 hours, so the same daily limit read differently from one request to the next. The refusal text is built in one place (Rate_Limiter::message), so the fix is there: a wait in the last half hour of the day reads as one day. Verified on real rate-limit windows from 1 minute to 24 hours.
… login

Measured at 390px with elementFromPoint, the card's numbers reproduced: 'Top Members' name links had a 23px tap extent because the ellipsis box is overflow:hidden and clipped its own 40px hit layer, and Popular Tags chips had about 33px because 5px gaps let neighbouring hit layers overlap. On touch layouts the name box now has the tap height as padding balanced by a negative margin (the row stays the same height) and the tag row gap is wider: 41px and 40px. In RTL, code blocks inherited direction: rtl and rendered ';const a = 1', and the @mention login showed as 'alice@': code blocks and the login are now direction: ltr with unicode-bidi: isolate, with rtl:ignore so the generated RTL stylesheet keeps them LTR. Verified in the browser at 390 and 1280 and in an RTL page (Arabic paragraphs stay RTL).
…login

The login card linked Register only when wp_registration_url() differed from the default, but User Registration & Membership never filters register_url: it redirects wp-login.php?action=register to its own page, so the card kept its short inline form while every other sign-up link went to the plugin's page (Zoho 42607). The decision is now one helper, Jetonomy\external_registration_url(): a changed register_url, or User Registration & Membership's member registration page (only while that plugin is active), or the new jetonomy_external_registration_url filter for any other plugin; an empty result keeps the inline form. No new stored setting. Verified on a stack with stand-ins: default site inline tab; register_url filter, the new filter and the User Registration case all link out; the old code left the inline tab for the User Registration case. Not run against the real plugin (not installed here).
… hit areas no longer overlap

A right-aligned dropdown wider than the room left of its button (a 220px profile menu, button 194px from the edge) was clamped to the 8px gutter, so on a phone it sat at the screen edge over the stats, detached from its button. The shared positioner now switches to the button's other edge when that side fits and only clamps when neither does; every dropdown that uses it (post, reply, space, profile) benefits. Menu rows are 44px on touch layouts (were 40). Popular Tags rows get a 16px gap so neighbouring 40px hit layers no longer overlap: all 48 corner probes at 390px land on their own chip. Verified old vs new at 390: panel 8-220 vs 163-375 for a button at 163-214. Not verified: the post and reply menus (not rendered for the test user), a 320px phone where neither side fits (clamped as before), RTL with a panel that overflows.
The chip hit layer follows --jt-tap (40px here), under the card's 44px floor, and QA's corner probe at +-20px missed 31 of 60 corners. Chips now use a 44px tap size (this also widens chips narrower than 44px) and the row gap is 18px so neighbouring 44px layers cannot overlap (27 + 18 >= 44). Verified at 390px: 0 of 48 corner probes miss at +-18, +-20 and +-21px.
Edit Profile > Privacy has 'Show when I'm online' (on by default, one usermeta key, like the email pause switch). Off: no dot and no last-seen time for other members (the member and staff still see their own time), and the member stops seeing others' status. Both checks sit in the two existing choke points, UserProfile::is_online() and last_seen_for_viewer() (now decided by is_online), so the profile, replies, sidebar, member lists and REST payloads all obey it. With BuddyNext active BN owns presence: no Jetonomy toggle is shown, PATCH show_online is ignored, the dot follows BN's PresenceService, and a member who hid their status before BN was switched on stays hidden (one way). Also on REST: show_online on the profile read and PATCH /users/me. Verified with a viewer matrix (nobody hidden; maya hides; both hide) on dot, model last-seen and REST, and with a BuddyNext stand-in (the real BN stack was not touched). Not verified: dark mode, RTL, 390px of the Privacy section, the real BuddyNext.
A table printed a boolean false as an empty cell, so 'no' looked like missing data (webhooks list showed a blank include_private). Base_Command::render_list now shows yes/no for table, csv and other non-structured formats and keeps real booleans in json and yaml.
…e; honest online-status hint

Free: the 'announcement' notification type (member preferences list, community notification contract so BuddyNext's bell and settings mirror it), the profile notification-types filter (jetonomy_profile_notification_types; Pro adds its row only while Site announcements is enabled), and two keyset recipient helpers (SpaceMember::user_ids_after, UserProfile::site_user_ids_after). The hide-online hint now says moderators and admins can still see when members were last active, and the docs match (QA review).
…h, Sign in)

The phone bar had no way to start a topic, Leaderboard held a slot that browsing spaces needs, and Search duplicated the header. Members now get Home, Spaces (their spaces), a raised centre New (inside a space it opens that space's composer; elsewhere it opens the member's spaces, where each starts a topic), Alerts (with the unread badge) and Me, a button that opens a sheet: My profile, My topics, Bookmarks, Leaderboard, Settings, plus the top-nav-only links (Moderation, Pro Messages) added once. Guests get Home, Search and a raised Sign in. The tabs are one list that the jetonomy_mobile_tabs filter can reorder or extend. The bar and every rule that depends on it stay inside the existing not-BuddyNext block, so BuddyNext still gets no second bar or padding. Me is a button rather than a link (it never navigates by itself; a real click was being taken by the client router). Sheet rows are 44px. Verified at 390 and 320 (labels one line, no overflow), in a space (New goes to that space), the sheet (items, keyboard, Escape returns focus, a link navigates), guest bar, tablet width unchanged. Not verified: RTL, dark, the real BuddyNext (no bar there by construction), a theme that adds its own bottom bar. Known: no owner reorder setting yet (filter only), MediaVerse's floating chat button overlaps the Me tab, and the New tab outside a space needs a space chooser.
…rphan rows

Paging: ( page - 1 ) * per_page overflowed to a float for a page such as
9223372036854775807, which fataled typed model calls (GET /spaces,
/spaces/{id}/members, /join-requests, /invites, /moderation/queue) and put a
negative OFFSET into SQL. One helper, jetonomy_page_offset(), caps the offset
at JETONOMY_MAX_OFFSET (half of PHP_INT_MAX, so offset + page size still
fits); get_pagination() caps a direct offset too. Every REST, admin screen,
privacy exporter and reorder offset now goes through it.

Missing spaces: Space::missing_error() is the one 404 (jetonomy_space_not_found).
A space ban, a topic (Post::create, so abilities, CLI and split too), a reply
split into a missing space and a join request (CLI request-join) are refused
instead of storing a row for a space that does not exist. The media upload
tag drops a missing space like any space the uploader cannot post in.
qa-actions RF11 covers the ban (fails on the old code: 201 and one row).
…any accent

- New --jt-accent-ink / --jt-accent-ink-hover tokens: the accent used as
  text, outline or focus ring. Light = the accent; dark lifts it to OKLCH
  lightness 0.72 or more, so the default #0073aa reads on #1f1f1f (View all
  hover 2.48 -> 7.29, Confirm ring 2.75 -> 7.29, space-card Edit hover
  border 2.94 -> 6.79). Reign's dark accent is already lighter: unchanged.
- Dark --jt-accent-strong mixes from the ink (4.44 -> passes on tinted cards).
- Category chips and the chip toggle use --jt-border-strong (1.24 -> 3.45).
… in every browser

Template_Loader::accent_fg_tokens() applies the CSS rule (white while the
fill luminance is 0.1833 or less, else black) to the accent and its hover
fill. Used by the palette picker and the BuddyX / BuddyX Pro colour bridge;
a non-hex value emits nothing so the CSS derivation stays in charge. Coral
#ef5455 now gets black at rest and white on hover (4.63 vs 4.53).

Docs: theming page states the relative colour syntax limit (Chrome 119+,
Safari 16.4+, Firefox 128+; white fallback #1d7cd5 4.29, #ef5455 3.46) and
lists the fg and ink tokens.
… media library

- Every front-end list (community home, spaces, topics, categories, tags,
  leaderboard, search, bookmarks, drafts, subscriptions, notifications,
  profiles, moderation, members) computes its offset with
  jetonomy_page_offset(). A huge ?pg= or ?spg= was a fatal TypeError (500).
- The media library caps the page before WP_Query multiplies it, and
  GET /media uses the capped offset: no float-to-int warning on PHP 8.5.
- Admin "1-20 of N" counters use the same helper.
…pace has one error code

- A silence, site ban or IP ban sent with a space_id that does not exist is
  refused like a space ban: 404 jetonomy_space_not_found on REST and WP-CLI
  (the CLI now passes the space to the same check), and Restriction::ban()
  stores nothing. Before, REST answered 201 and stored an orphan row.
- Public error code change: every 404 for a missing or hidden space (read
  routes, join, the get-space/join-space abilities, CLI request-join) now
  answers jetonomy_space_not_found instead of jetonomy_not_found. Hidden and
  missing spaces still answer alike. REST API docs list the code.
- RF11 checks each type on REST, WP-CLI and the model separately.
- --jt-border-strong is held to 3:1 for any host text colour: light caps
  its luminance at 0.24, dark floors OKLCH lightness at 0.62 (50% of
  Reign's #404855 was 2.5:1).
- Light --jt-accent-ink is the accent scaled in linear sRGB to luminance
  0.1828 at most, 4.5:1 on white; #0073aa and Reign #1d76da keep their
  hex. accent_ink_tokens() writes the same pair as hex under LIGHT_ROOT
  for the Appearance picker and the theme bridge. --jt-accent-strong now
  mixes from the ink.
- Muted text is held to 4.5:1 (light max 0.16, dark min 0.72).
- Reply FAB, mobile primary tab and BP forum button hovers use the hover
  fill with its own label (--jt-accent-hover-fg).
- Post actions and user links no longer fade with opacity (4.17:1 on
  Reign light); declined idea pill uses body text.
- Confirm dialog buttons get a --jt-focus-ring focus-visible outline.
The delete-topic and space-delete dialogs had no accessible name; they are
now labelled by their message, and described by it only when a title names
them.
Each result now names the theme, version, body background and the
resolved Jetonomy colours per mode, and hostCss injects CSS into every
run (for example a stock-Reign stand-in).
- The .jt-app button reset now paints border-color with --jt-border-strong,
  so every Jetonomy button that draws a border gets the control edge
  (the Pro PDF card, the core Search button in a Jetonomy sidebar, the
  category chip toggle) instead of the 1.18:1 hairline.
- Light accent ink is held to luminance 0.17: 4.5:1 on white and on the
  subtle surfaces (Reign #1d76da becomes #1b72d3 as ink, fills unchanged;
  #0073aa unchanged). PHP ink matches; tests updated.
- Light secondary/tertiary text held to 0.13, dark floors raised (text
  0.76, control edge 0.68) so hover tints and "Not now" pass.
- Text on tints (editor toolbar, declined idea pill, accepted reply
  author, unread notification) uses the clamped secondary text.
- Login block fields are scoped under .jt-login-form so a theme's
  input[type=text] rule loaded later cannot replace the edge.
- An open state that times out or misses, or a page that fails to load,
  is listed in `missed` and fails the run.
- `absentOk` states (Jetonomy community nav, register tab) are listed
  under `absent` when a host shell replaces them; a present trigger that
  does not open still fails. Per-width entries for bell (1280) and tab
  menu (390).
- A text link whose only edge is one border side (divider) and a core
  block's own field (theme form styles) are listed, not counted.
- Off-screen controls (spam honeypot) are skipped; the seed site's
  cookie banner is hidden so it cannot cover menus at 390.
- Host header reports loggedIn.
- seed-qa-content.php adds a PDF attachment for the Pro PDF card.
- A core block button inside Jetonomy (`.jt-app button.wp-element-button`,
  the Search block button in a sidebar) gets a 1px --jt-border-strong
  edge on any theme; Twenty Twenty-Five set border none and the reset
  strips its fill, leaving 1.0:1.
- Dark tag chip hover (and its count) takes the full text colour: a light
  accent's muted tint is a mid tone (#ffd34d measured 4.21:1).
- The Open idea pill text uses the clamped secondary colour (3.84:1 with
  a #6b7280 host text, now 4.82:1).
…xture

- A core-block button inside Jetonomy markup with no edge and no fill
  now fails instead of passing as text-only; host-field stays for the
  core block's input only, which Jetonomy does not restyle.
- seed-qa-content.php creates a placeholder PNG when the media library
  is empty (or exits non-zero without GD), so the lightbox state opens
  on a fresh install; tags the fixture topic "dark-mode" so search
  results show tag chips.
…gy and data-layer findings

- WPCS: mixed && / || made explicit in the media controller, loop count moved out of the loop condition,
  translator comments placed directly before each string, header tab indentation.
- PHPStan: Free stubs for the optional BuddyNext presence service and the runtime offset constant.
- Terminology: admin and member strings use the configured labels; REST schema and API parameter text marked.
- Data layer: the scheduler backend may query Action Scheduler's own tables, which no model owns.
- Format strings: the queue's log matcher regex no longer reads as a printf placeholder.
- qa discovery reads notification defaults as the notifier does (Settings::read), not the raw option.
- Contract audit: six verified false positives baselined with their reasons.
- Tests: the veto test mentions a real member in a real space so it can fail; the set-based cancel and the
  two-runner push test no longer depend on rows other tests leave in the shared queue table.
- Security record for 2.1.0.
Version 2.1.0 in the plugin header, JETONOMY_VERSION, readme Stable tag and package.json. Changelog in the
action-prefix format. What's New in 2.1.0 docs page. POT regenerated (2660 strings); all 10 locales merged,
filled and compiled (.mo and script JSON).
…ript rebuilt

wp i18n make-pot warned on seven strings that carried different translator comments in different files; each now
has one comment covering every use. msgids are unchanged, so no translation changes; POT and PO comments refreshed.
setup-wizard.min.js was built before the sample-data confirm (ask once, then send force) and is rebuilt.
…saves without a period warning; blank custom number test
@vapvarun
vapvarun merged commit 320857f into main Nov 24, 2026
46 checks passed
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