Skip to content

Conversation

@superdav42
Copy link
Collaborator

@superdav42 superdav42 commented Jan 1, 2026

Summary by CodeRabbit

  • New Features

    • Added an extension point to trigger page-specific widget registration.
  • Refactor

    • Optimized site count queries to return counts without running full search merges.
    • Exposed a filter for site list bulk actions to allow external customization.
  • Chores

    • Added JS/CSS linting configurations and updated dev scripts to run PHP/JS/CSS linters.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 1, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a page-specific widget registration action, an early-return count path in site retrieval that sums domain counts, exposes bulk actions via a filter, and introduces ESLint/Stylelint configs plus npm scripts for multi-tool linting.

Changes

Cohort / File(s) Summary
Admin Page Widget Registration
inc/admin-pages/class-base-admin-page.php
Adds public function fire_register_widgets_hook(): void and enqueues a load-{$page_hook} action (priority 21) to fire the dynamic wu_page_{$this->id}_register_widgets action with (page id, page hook, page instance).
Site Query Logic
inc/functions/site.php
wu_get_sites() gains an early-count pathway: when query['count'] is present it computes a domain_count (uses wu_get_domains when searching) and returns \WP_Ultimo\Models\Site::query($query) + domain_count, bypassing the domain-merge path for count queries.
List Table Bulk Actions
inc/list-tables/class-site-list-table.php
get_bulk_actions() now returns apply_filters( 'wu_site_list_get_bulk_actions', $actions ), adding an extension point for bulk action modification.
Linting Config & Scripts
.eslintrc.js, .stylelintrc.js, package.json
Adds .eslintrc.js and .stylelintrc.js configs, new devDependencies, and replaces the single lint script with orchestrated lint / lint:fix flows plus specific `lint:php

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Tweaks #251 — Modifies inc/functions/site.php and domain-aware search/merge logic; strongly related to the wu_get_sites() count/search control-flow changes.

Poem

🐇 I hop a tiny action in place,
Count the sites with a quicker pace,
Bulk actions wear a filter new,
Linters tidy the rabbit crew —
Thump! I stamp my foot and dance in grace.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'support multinetwork' is vague and generic. While it relates to the multinetwork theme of the repository, it does not clearly summarize the specific changes made in the pull request, such as the addition of WordPress action hooks, ESLint/Stylelint configuration, or the modifications to site querying and bulk actions. Provide a more specific title that describes the primary changes, such as 'Add WordPress action hook extension point and linting configuration' or similar.
✅ 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: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98c9f50 and 78ff638.

📒 Files selected for processing (1)
  • inc/functions/site.php

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.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ddcfc1 and d2a85b7.

📒 Files selected for processing (3)
  • inc/admin-pages/class-base-admin-page.php
  • inc/functions/site.php
  • inc/list-tables/class-site-list-table.php
🧰 Additional context used
🧬 Code graph analysis (1)
inc/functions/site.php (1)
inc/models/class-site.php (1)
  • Site (26-1942)
⏰ 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). (5)
  • GitHub Check: PHP 8.1
  • GitHub Check: PHP 8.0
  • GitHub Check: Build Plugin for Testing
  • GitHub Check: cypress (8.1, chrome)
  • GitHub Check: cypress (8.2, chrome)
🔇 Additional comments (3)
inc/list-tables/class-site-list-table.php (1)

380-388: LGTM! Good extensibility addition.

The filter wu_site_list_get_bulk_actions is well-documented and allows external modification of bulk actions, improving extensibility for plugins and themes.

inc/admin-pages/class-base-admin-page.php (2)

626-626: LGTM! New hook provides extensibility for widget registration.

The new action hook at priority 21 enables addons to register widgets after the core registration completes.


734-756: LGTM! Well-documented extensibility method.

The fire_register_widgets_hook() method is properly documented and provides a clean extension point for page-specific widget registration via the dynamic action wu_page_{$this->id}_register_widgets.

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

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: 2

🧹 Nitpick comments (1)
.stylelintrc.js (1)

1-36: Consider using 'warn' instead of disabling all rules.

Disabling every Stylelint rule (setting to null) negates the value of introducing the linter. Instead of completely disabling rules, consider:

  1. Setting rules to 'warn' initially to identify issues without blocking CI
  2. Gradually enabling rules as 'error' after addressing violations
  3. Using more targeted overrides for specific legacy files

This approach provides visibility into code quality issues while allowing incremental improvement.

🔎 Example: Convert disabled rules to warnings
 module.exports = {
 	extends: ['@wordpress/stylelint-config'],
 	rules: {
 		// Allow !important for WordPress admin overrides
-		'declaration-no-important': null,
+		'declaration-no-important': 'warn',
 		// Relax selector specificity for admin styling
-		'selector-max-id': null,
+		'selector-max-id': 'warn',
 		// Allow vendor prefixes (handled by build tools if needed)
-		'property-no-vendor-prefix': null,
-		'value-no-vendor-prefix': null,
+		'property-no-vendor-prefix': 'warn',
+		'value-no-vendor-prefix': 'warn',
 		// ... apply same pattern to remaining rules
 	},
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2a85b7 and 98c9f50.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .eslintrc.js
  • .stylelintrc.js
  • package.json
⏰ 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). (3)
  • GitHub Check: cypress (8.1, chrome)
  • GitHub Check: cypress (8.2, chrome)
  • GitHub Check: Build Plugin for Testing
🔇 Additional comments (6)
.stylelintrc.js (1)

37-43: LGTM!

The ignore patterns appropriately exclude minified files, third-party code, and vendor directories from linting.

package.json (2)

6-11: LGTM!

The authors field normalization to structured object format follows npm package.json conventions.


52-59: LGTM! Lint workflow is well-structured.

The multi-tool linting approach with separate commands for PHP, JavaScript, and CSS is clean and maintainable. Using run-p for parallel execution is efficient, and the ignore patterns for minified files are appropriate.

Note: These scripts depend on the .eslintrc.js and .stylelintrc.js configuration files added in this PR.

.eslintrc.js (3)

1-7: LGTM!

The base ESLint configuration correctly sets root: true, extends the WordPress ESLint plugin, and declares appropriate environments for a WordPress plugin (browser and jQuery).


65-71: LGTM!

The ignore patterns appropriately exclude minified JavaScript files, third-party code, and vendor directories from linting.


8-35: The declared globals are actively used in the codebase.

Review of the actual JavaScript files confirms that the globals declared in .eslintrc.js are used throughout the codebase. Examples include:

  • wu_on_load() called in admin.js, list-tables.js, and vue-apps.js
  • wu_settings referenced extensively in functions.js and dashboard-statistics.js
  • wu_format_money(), wu_block_ui(), and other wu_* functions defined and used
  • wp global used via hooks, editor, media, and codeEditor APIs
  • Third-party globals like ClipboardJS, Vue, and Swal used in application code
  • wubox referenced across multiple modules

The extensive globals list does suggest tight coupling and reliance on window-scoped state, which may warrant future refactoring toward more modular patterns. However, all declared globals serve active purposes in the current codebase.

Likely an incorrect or invalid review comment.

Comment on lines +36 to +64
rules: {
// Allow tabs for indentation (matches PHP coding standards)
indent: ['error', 'tab', { SwitchCase: 1 }],
// Disable prettier - too strict for legacy code
'prettier/prettier': 'off',
// Relax some rules for legacy code compatibility
'no-unused-vars': ['warn', { vars: 'all', args: 'none', ignoreRestSiblings: true }],
// Allow console for development
'no-console': 'warn',
// Allow var for legacy code
'no-var': 'warn',
// Prefer const but don't enforce strictly for legacy code
'prefer-const': 'warn',
// Object shorthand is nice but not required for legacy code
'object-shorthand': 'warn',
// Allow snake_case for WP compatibility
camelcase: 'off',
// Allow redeclaring globals (we define them above)
'no-redeclare': 'off',
// Disable strict formatting rules for legacy code
'space-in-parens': 'off',
'comma-dangle': 'off',
quotes: 'off',
semi: 'off',
'padded-blocks': 'off',
'eol-last': 'off',
'space-before-function-paren': 'off',
'space-before-blocks': 'off',
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Reconsider disabling critical rules like 'no-redeclare'.

While relaxing formatting rules for legacy code is understandable, disabling certain rules can introduce bugs:

  1. Line 54 (no-redeclare: 'off'): Disabling this rule allows redeclaring variables, which can cause subtle bugs. The comment suggests it's disabled to allow redeclaring the globals from lines 8-35, but this shouldn't be necessary if globals are properly declared.

  2. Line 40 (prettier/prettier: 'off'): If you're not using Prettier, consider removing it from the extends chain in line 3 (recommended-with-formatting) to avoid loading unused rules.

  3. Formatting rules (lines 56-63): Consider setting these to 'warn' instead of 'off' to maintain visibility into code style issues.

🔎 Recommended changes
 	rules: {
 		// Allow tabs for indentation (matches PHP coding standards)
 		indent: ['error', 'tab', { SwitchCase: 1 }],
 		// Disable prettier - too strict for legacy code
 		'prettier/prettier': 'off',
 		// Relax some rules for legacy code compatibility
 		'no-unused-vars': ['warn', { vars: 'all', args: 'none', ignoreRestSiblings: true }],
 		// Allow console for development
 		'no-console': 'warn',
 		// Allow var for legacy code
 		'no-var': 'warn',
 		// Prefer const but don't enforce strictly for legacy code
 		'prefer-const': 'warn',
 		// Object shorthand is nice but not required for legacy code
 		'object-shorthand': 'warn',
 		// Allow snake_case for WP compatibility
 		camelcase: 'off',
-		// Allow redeclaring globals (we define them above)
-		'no-redeclare': 'off',
+		// Warn on redeclarations instead of allowing them
+		'no-redeclare': 'warn',
 		// Disable strict formatting rules for legacy code
-		'space-in-parens': 'off',
-		'comma-dangle': 'off',
-		quotes: 'off',
-		semi: 'off',
-		'padded-blocks': 'off',
-		'eol-last': 'off',
-		'space-before-function-paren': 'off',
-		'space-before-blocks': 'off',
+		'space-in-parens': 'warn',
+		'comma-dangle': 'warn',
+		quotes: 'warn',
+		semi: 'warn',
+		'padded-blocks': 'warn',
+		'eol-last': 'warn',
+		'space-before-function-paren': 'warn',
+		'space-before-blocks': 'warn',
 	},
🤖 Prompt for AI Agents
.eslintrc.js lines 36-64: the config currently disables critical rules
(no-redeclare, prettier/prettier, and several formatting rules) which can mask
bugs and unused config; re-enable 'no-redeclare' (set to 'error' or at least
'warn') and instead ensure globals are declared in the top-level "globals"
section or via /* global */ comments so redeclaration is not needed; if Prettier
is not used, remove 'recommended-with-formatting' from extends and re-enable the
'prettier/prettier' rule (or set to 'warn') rather than turning it off; change
the formatting rules currently set to 'off' (space-in-parens, comma-dangle,
quotes, semi, padded-blocks, eol-last, space-before-function-paren,
space-before-blocks) to 'warn' to surface style issues while maintaining legacy
flexibility.

Comment on lines +17 to 29
"@eslint/js": "^9.39.2",
"@wordpress/env": "^10.27.0",
"@wordpress/eslint-plugin": "^23.0.0",
"@wordpress/stylelint-config": "^23.29.0",
"clean-css-cli": "^5.6.3",
"cypress": "^14.5.4",
"cypress-mailpit": "^1.4.0",
"eslint": "^8.57.1",
"globals": "^16.5.0",
"npm-run-all": "^4.1.5",
"stylelint": "^16.26.1",
"stylelint-config-standard": "^39.0.1",
"uglify-js": "^3.19.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check npm registry for latest versions
echo "=== Latest versions on npm ==="
npm view eslint@latest version 2>/dev/null || echo "eslint latest check failed"
npm view @eslint/js@latest version 2>/dev/null || echo "@eslint/js latest check failed"
npm view @wordpress/eslint-plugin@latest version 2>/dev/null || echo "@wordpress/eslint-plugin latest"
npm view @wordpress/stylelint-config@latest version 2>/dev/null || echo "@wordpress/stylelint-config latest"
npm view stylelint@latest version 2>/dev/null || echo "stylelint latest check failed"
npm view stylelint-config-standard@latest version 2>/dev/null || echo "stylelint-config-standard latest"
npm view globals@latest version 2>/dev/null || echo "globals latest"
npm view cypress@latest version 2>/dev/null || echo "cypress latest"
npm view clean-css-cli@latest version 2>/dev/null || echo "clean-css-cli latest"
npm view npm-run-all@latest version 2>/dev/null || echo "npm-run-all latest"
npm view uglify-js@latest version 2>/dev/null || echo "uglify-js latest"

echo -e "\n=== Package peer dependencies ==="
npm view @eslint/js@9.39.2 peerDependencies 2>/dev/null || echo "Could not check @eslint/js peerDependencies"
npm view eslint@8.57.1 version 2>/dev/null || echo "Could not verify eslint@8.57.1 exists"
npm view eslint@9 version 2>/dev/null || echo "eslint v9 check"

echo -e "\n=== Check for vulnerabilities in eslint and related packages ==="
npm audit --json 2>/dev/null | python3 -c "import sys, json; data = json.load(sys.stdin); vulns = data.get('vulnerabilities', {}); print('Total vulnerabilities found:', len(vulns)); [print(f'{pkg}: {v}') for pkg, v in list(vulns.items())[:10]]" 2>/dev/null || echo "No npm audit data available"

Repository: Multisite-Ultimate/ultimate-multisite

Length of output: 167


🌐 Web query:

ESLint 8.x end of life date October 2024

💡 Result:

Yes — ESLint v8.x reached end of life on October 5, 2024. [1][2]

Sources:

  • ESLint announcement: "ESLint v8.x end of life is October 5, 2024." [1]
  • ESLint version support page (policy explaining EOL timing). [2]

🌐 Web query:

@eslint/js 9.x peer dependency requirements eslint version

💡 Result:

@eslint/js 9.x does not declare a peerDependency on eslint (the package shows 0 dependencies / no peerDependencies). [1][2]

Sources:

  • @eslint/js on npm (v9.29.0). [1]
  • @eslint/js on npm (v9.9.1). [2]

Upgrade ESLint to version 9.x

ESLint 8.x reached end of life on October 5, 2024. Consider upgrading eslint to version 9.x for continued support and security updates.

Note: The presence of @eslint/js@^9.39.2 alongside eslint@^8.57.1 does not cause compatibility issues—@eslint/js has no peer dependency on the eslint package and can work independently. However, upgrading ESLint itself is still recommended for maintenance and support purposes.

🤖 Prompt for AI Agents
In package.json around lines 17 to 29, eslint is pinned to ^8.57.1 while
@eslint/js is already 9.x; update the eslint dependency to a 9.x release (e.g.
^9.##) in package.json, run npm/yarn install to update the lockfile, run the
lint suite and CI to catch any rule/config incompatibilities, and if tests or
linters surface breaking changes, adjust ESLint config/plugins (parser options,
rules, or plugin versions) accordingly before committing the lockfile changes.

@superdav42 superdav42 merged commit b8de936 into main Jan 1, 2026
11 of 12 checks passed
@superdav42 superdav42 deleted the fix-multinetwork branch January 1, 2026 20:48
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

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.

2 participants