Skip to content

Conversation

@s-acv2
Copy link
Contributor

@s-acv2 s-acv2 commented Dec 5, 2025

User Menus 2.0.0 Changelog

Complete rewrite of User Menus plugin with modern architecture.


Version Comparison

v1.3.2 (Old) v2.0.0 (New)
PHP Minimum 5.6 7.4
WordPress Minimum 4.6 6.0
Architecture Procedural/Static Class PSR-4 Namespaced
Frontend jQuery React/TypeScript
Freemius SDK Included Removed

Removed

  • Freemius SDK - Removed entire /freemius/ directory (~100+ files)
    • No more opt-in telemetry prompts on activation
    • No more deactivation feedback modal
    • Reduced plugin size significantly
  • Legacy class structure - Removed JP_User_Menus static class pattern
  • Old includes structure - Removed /includes/classes/ directory

Changed

Architecture

  • Namespace: UserMenus (PSR-4 compliant autoloading)
  • Container Pattern: Dependency injection via Container class
  • Controller Pattern: All features organized as Controllers
  • Services Pattern: Business logic separated into Services

File Structure

Old (v1.3.2):                    New (v2.0.0):
├── freemius/                    ├── classes/
├── includes/                    │   ├── Base/
│   └── classes/                 │   ├── Controllers/
│       ├── admin/               │   ├── Interfaces/
│       ├── menu/                │   ├── Plugin/
│       ├── site/                │   ├── RestAPI/
│       └── user/                │   └── Services/
└── user-menus.php               ├── dist/
                                 ├── inc/
                                 ├── src/
                                 └── user-menus.php

Frontend

  • Menu editor UI rebuilt with React/TypeScript
  • Uses WordPress Components library
  • Compiled assets in /dist/ directory

Meta Key

  • Old: _jp_nav_item_options
  • New: _user_menus_options
  • Migration controller handles data conversion

Added

New User Codes

Code Description
{user_id} Logged-in user's ID
{user_login} Username (alias for {username})
{role} Primary user role (translated)
{roles} All user roles (comma-separated)

Truncation Support

Truncate long names in menu items:

  • {first_name|10} - Limit to 10 characters
  • {first_name|10...} - Limit with ellipsis

User Codes in URLs

Dynamic URLs now supported:

  • https://example.com/profile/?id={user_id}
  • https://example.com/members/{username}/

Private Pages Support

Administrators can now add private pages to menus in the menu editor.

New Controllers

  • PrivatePages - Enables private pages in menu editor
  • Migration - Handles v1.x to v2.0 data migration
  • RestAPI - REST API endpoints for settings/menu items

Build System

  • package.json with @wordpress/scripts
  • TypeScript compilation
  • Modern build toolchain

Migration

The plugin automatically migrates existing menu item settings from _jp_nav_item_options to _user_menus_options on first load after update.


Files Summary

Metric v1.3.2 v2.0.0
PHP Files ~120+ 28
Core Classes 6 20
Freemius Files ~100 0
TypeScript/React 0 Yes

@coderabbitai
Copy link

coderabbitai bot commented Dec 5, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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