Skip to content

Comments

More fixes#266

Merged
superdav42 merged 8 commits intomainfrom
more-fixes
Nov 18, 2025
Merged

More fixes#266
superdav42 merged 8 commits intomainfrom
more-fixes

Conversation

@superdav42
Copy link
Collaborator

@superdav42 superdav42 commented Nov 15, 2025

Summary by CodeRabbit

  • New Features

    • Added MCP Server integration
    • Introduced magic login links for SSO with disabled third‑party cookies
    • Enhanced multi‑network installation support
    • Added admin notice for invalid COOKIE_DOMAIN configuration
  • Bug Fixes

    • Improved redirect handling and SSO with custom domains
    • Fixed template switching and domain mapping/login form handling
    • Optimized admin bar access for single‑blog users
    • Accelerated site creation performance
  • Chores

    • Added project editorconfig and updated changelog/readme (v2.4.8)
    • Removed automated translation workflow and related docs

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates include a new .editorconfig, i18n/branding slug changes, Domain symbol refactors and redirect-filter relocation, removal of a database Engine base class and translation scripts, and SSO/magic-link control-flow and API adjustments (early single-blog redirect, query-arg constant rename, removed query-vars method).

Changes

Cohort / File(s) Summary
Editor configuration
\.editorconfig
Added project-wide editor rules (UTF-8, LF, final newline, trim trailing whitespace, tab indent size 4) with an override for *.{json,yml,yaml} to use 2-space indentation.
i18n / Branding
inc/admin-pages/class-setup-wizard-admin-page.php, inc/apis/trait-mcp-abilities.php
Switched translation domain / MCP ability category slug from 'multisite-ultimate''ultimate-multisite' in messages and ability registrations.
Domain mapping refactor
inc/class-domain-mapping.php
Replaced fully-qualified \WP_Ultimo\Models\Domain references with imported Domain symbol, moved allowed_redirect_hosts filter hookup to init, and updated docblocks/constant usage to Domain::*.
Database engine removal
inc/database/engine/class-base.php
Removed class WP_Ultimo\Database\Engine\Base (file deleted) which extended \BerlinDB\Database\Base and declared protected $prefix = 'wu'.
SSO / Magic links
inc/sso/class-admin-bar-magic-links.php, inc/sso/class-magic-link.php
Added early redirect for users with exactly one blog in show_access_denied_with_magic_links; renamed TOKEN_QUERY_VARTOKEN_QUERY_ARG; removed public add_query_vars() and query-vars filter hookup; updated internal references.
Translation tooling removed
scripts/translate.php, scripts/README-TRANSLATION.md
Deleted the automated translation script and its README, removing MultisiteUltimateTranslator, language map, potrans discovery, translation orchestration, and related methods.
Release notes
readme.txt
Added Version 2.4.8 changelog entries (MCP Server, multi-network support, magic login links, redirect/SSO/domain fixes and improvements).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Browser
  participant App as WP Ultime App
  participant SSO as Magic_Link
  participant AdminBar as AdminBarMagicLinks
  Note over AdminBar,SSO `#D6EAF8`: Early-redirect + token arg rename change

  Browser->>App: Request protected admin page
  App->>AdminBar: show_access_denied_with_magic_links()
  AdminBar->>App: get_user_sites()
  alt user has exactly one blog
    AdminBar->>Browser: Redirect to blog admin URL (302)
    Browser-->>AdminBar: (exit flow)
  else multiple or zero blogs
    AdminBar->>SSO: render denial UI (magic link generation)
    SSO->>SSO: generate_magic_link(token param = TOKEN_QUERY_ARG)
    SSO->>Browser: Provide magic link with TOKEN_QUERY_ARG
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas to focus:
    • inc/database/engine/class-base.php removal: search for any subclasses or references to this base class and verify prefix behavior expectations.
    • inc/sso/class-magic-link.php: public API change (constant rename and removed method) — check external integrations/plugins that may rely on the prior constant or query-vars exposure.
    • inc/class-domain-mapping.php: filter relocation timing (startup → init) and Domain symbol replacements — ensure hook ordering and imports preserve behavior.
    • inc/apis/trait-mcp-abilities.php: changing category slug may affect stored/registered abilities or external lookups.

Possibly related PRs

  • Tweaks #251 — touches the same SUNRISE missing-constant message in inc/admin-pages/class-setup-wizard-admin-page.php; likely related to i18n text changes.

Poem

🐰
I hopped through code with nimble paws,
Swapped names and trimmed some trailing flaws.
One-blog friends now bounce straight in,
Old scripts dusted, edits thin.
Editor neat, the repo chews its carrots!

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'More fixes' is vague and generic, using non-descriptive terms that don't convey meaningful information about the changeset's actual scope. Use a more specific title that describes the main change, such as 'Refactor translation system and update domain mapping' or 'Update text domains and remove translation automation script'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc495f4 and 991a205.

📒 Files selected for processing (1)
  • readme.txt (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
inc/sso/class-admin-bar-magic-links.php (1)

118-121: Consider more explicit array access.

The early redirect for single-blog users is a good UX improvement. However, using current($blogs) depends on the array's internal pointer. Consider using reset($blogs) to be explicit, or use array destructuring for clarity.

Apply this diff for more explicit array access:

 	if ( 1 === count($blogs) ) {
-		wp_safe_redirect(get_admin_url(current($blogs)->userblog_id));
+		wp_safe_redirect(get_admin_url(reset($blogs)->userblog_id));
 		exit;
 	}
inc/sso/class-magic-link.php (1)

33-33: LGTM: Constant renamed consistently throughout.

The rename from TOKEN_QUERY_VAR to TOKEN_QUERY_ARG is applied consistently across all usages. The new name is arguably more accurate since it refers to a query string argument.

Optionally, update the comment at line 28 for consistency:

 	/**
-	 * Query var used for magic link tokens.
+	 * Query argument used for magic link tokens.
 	 *
 	 * @since 2.0.0
 	 * @var string
 	 */

Also applies to: 76-76, 133-133, 191-191, 241-241

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4d6ab1 and cc495f4.

📒 Files selected for processing (10)
  • .editorconfig (1 hunks)
  • inc/admin-pages/class-setup-wizard-admin-page.php (1 hunks)
  • inc/apis/trait-mcp-abilities.php (6 hunks)
  • inc/class-domain-mapping.php (7 hunks)
  • inc/database/engine/class-base.php (0 hunks)
  • inc/sso/class-admin-bar-magic-links.php (1 hunks)
  • inc/sso/class-magic-link.php (5 hunks)
  • readme.txt (1 hunks)
  • scripts/README-TRANSLATION.md (0 hunks)
  • scripts/translate.php (0 hunks)
💤 Files with no reviewable changes (3)
  • scripts/README-TRANSLATION.md
  • inc/database/engine/class-base.php
  • scripts/translate.php
🧰 Additional context used
🧬 Code graph analysis (2)
inc/class-domain-mapping.php (1)
inc/models/class-domain.php (2)
  • Domain (23-689)
  • get_by_domain (633-688)
inc/sso/class-magic-link.php (1)
inc/functions/helper.php (1)
  • wu_request (132-137)
🪛 LanguageTool
readme.txt

[grammar] ~234-~234: Use a hyphen to join words.
Context: ...ded magic login links for SSO when third party cookies are disabled. - New: Added...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: cypress (8.1, chrome)
  • GitHub Check: cypress (8.2, chrome)
🔇 Additional comments (7)
inc/admin-pages/class-setup-wizard-admin-page.php (1)

773-773: LGTM: Translation domain updated consistently.

The text domain change from 'multisite-ultimate' to 'ultimate-multisite' aligns with the broader package rebranding effort across the PR.

inc/apis/trait-mcp-abilities.php (2)

87-96: LGTM: MCP category registration updated consistently.

The category slug has been properly renamed from 'multisite-ultimate' to 'ultimate-multisite' in both the check and registration, ensuring the category is correctly created and referenced.


183-183: LGTM: All MCP ability category references updated consistently.

All individual MCP abilities (get-item, get-items, create-item, update-item, delete-item) now correctly reference the renamed 'ultimate-multisite' category.

Also applies to: 234-234, 292-292, 342-342, 377-377

.editorconfig (1)

1-13: LGTM: Standard EditorConfig setup.

The configuration follows common conventions with sensible defaults: UTF-8 encoding, LF line endings, tab-based indentation for general files, and space-based indentation for JSON/YAML files.

inc/class-domain-mapping.php (3)

12-12: LGTM: Domain symbol imported and used consistently.

Adding the import statement and using the short Domain reference throughout improves code readability and maintainability.

Also applies to: 30-30


56-61: LGTM: Improved redirect host handling.

Moving the allowed_redirect_hosts filter registration to init() ensures that network-wide redirects work correctly in all contexts, not just when domain mapping checks are active. This is a good improvement for reliability.


159-159: LGTM: Consistent use of imported Domain symbol.

All references to Domain::INACTIVE_STAGES and Domain::get_by_domain() now use the imported symbol consistently throughout the file.

Also applies to: 238-238, 284-284

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@superdav42 superdav42 merged commit 4c75bfa into main Nov 18, 2025
9 of 10 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