Skip to content

Conversation

@up1512001
Copy link
Member

@up1512001 up1512001 commented Nov 5, 2025

This PR introduces major infrastructure and data management improvements to the OneAccess plugin. It ensures all existing WordPress users are automatically fetched and manageable after installation while transitioning from option-based storage to dedicated database tables for better scalability and performance.

Key Enhancements:

  • Implemented user prefetching, de-duplication, and synchronization logic.
  • Introduced custom database tables (oneaccess_deduplicated_users, oneaccess_profile_requests) replacing option-based storage.
  • Added async processing with WooCommerce Action Scheduler for efficient user syncing.
  • Updated REST API routes with pagination, filtering, and secure permission checks.
  • Refactored user, profile, and notice components to use the new DB structure.
  • Added cleanup routines for custom tables on uninstallation.
  • Removed unused npm dependencies and resolved PHPCS issues.

Closes

@up1512001 up1512001 self-assigned this Nov 5, 2025
@up1512001 up1512001 requested a review from Copilot November 5, 2025 17:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements significant infrastructure changes to the OneAccess plugin, transitioning from option-based storage to database tables for better scalability and performance. The changes include creating custom database tables for deduplicated users and profile requests, implementing async task processing with Action Scheduler, and improving the overall data management architecture.

Key changes:

  • Introduces custom database tables (oneaccess_deduplicated_users and oneaccess_profile_requests) to replace option-based storage
  • Adds the DB class to manage database operations and table creation
  • Implements async processing using WooCommerce Action Scheduler for user synchronization
  • Updates REST API endpoints to support pagination and filtering
  • Refactors template loading mechanism for better organization
  • Removes unused npm dependencies (classnames, clsx, html-react-parser, lodash, prop-types)

Reviewed Changes

Copilot reviewed 30 out of 32 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
uninstall.php Adds cleanup for new custom database tables and refactors option deletion
phpcs.xml.dist Excludes additional PHPCS rules for database operations
package.json / package-lock.json Removes unused npm dependencies
oneaccess.php Loads Action Scheduler, adds template path constant, implements database table creation on activation
inc/classes/plugin-configs/class-db.php New class managing custom database tables and operations
inc/classes/rest/class-users.php Updates endpoints to use database tables instead of options, adds pagination support
inc/classes/rest/class-brand-site.php Updates to use database for profile requests
inc/classes/rest/class-basic-options.php Removes option-based user data cleanup
inc/classes/user/class-profile-request.php Refactors to use database tables for profile requests
inc/classes/user/class-notice.php Updates to query database instead of options
inc/classes/settings/class-brand-site.php Adds hooks for user synchronization and database queries
inc/helpers/custom-functions.php Adds permission check function and Action Scheduler integration
inc/helpers/template-functions.php New helper for template loading
inc/templates/notices/no-assets.php Template for GitHub repository notice
languages/oneaccess.pot Updated translation strings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 11, 2025 11:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 36 out of 38 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 11, 2025 16:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 36 out of 38 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

No idea what's "important" versus what's preexisting tech debt, so I guess don't consider any of this blocking

oneaccess.php Outdated
Comment on lines 20 to 22
use OneAccess\User_Roles;
use OneAccess\Plugin_Configs\DB;

Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldnt be useing any classes here the autoloader hasnt been required yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

any specific reason?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because 1. they're not available to use until they've been required previously. 2. It unnecessary couples the entire plugin loader with two of its implementation details.

Copilot AI review requested due to automatic review settings November 20, 2025 13:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 32 out of 35 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@justlevine justlevine self-requested a review November 20, 2025 15:40
Copilot AI review requested due to automatic review settings November 20, 2025 15:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 32 out of 34 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@justlevine justlevine left a comment

Choose a reason for hiding this comment

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

Nothing left that's too blocking since we're gonna refactor anyway (assuming you'll be available to maintain these "hot spots" until that happens), replied on the remaining open comments to make it your call as to handle or punt.

@up1512001
Copy link
Member Author

@justlevine let's handle those comments as part of the codebase revamp because any way we will be refactoring this whole plugin.

@up1512001 up1512001 merged commit 20bf7e3 into main Nov 24, 2025
11 checks passed
@up1512001 up1512001 deleted the feature/user-pre-fetching branch November 24, 2025 07:44
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.

Fetch and Manage Existing Users After OneAccess Installation

4 participants