Skip to content

Conversation

@up1512001
Copy link
Member

@up1512001 up1512001 commented Oct 13, 2025

This PR adds the new Template Sharing feature and includes major improvements to the plugin’s structure, performance, and user experience.

Key Changes

  • Added Template Sharing feature with a new Templates post type (auto-creates a default template).
  • Separated Patterns and Templates REST APIs for better structure.
  • Added Utils and Constants classes for reusable logic.
  • Rebuilt Settings page using Gutenberg components.
  • Added activation modal for site type selection.
  • Added Settings link on the Plugins page.
  • Fixed release workflow and added pot command for translations.
  • Updated terminology to “Governing Site / Brand Site”.
  • Resolved PHPCS issues and plugin checker warnings.
  • Prefixed all options with onedesign_ and set autoload = false.

Technical Updates

  • Improved cleanup in uninstall.php.
  • Added new helper functions and updated documentation.
  • Updated webpack.config.js with new entry points.
  • Added dompurify dependency for HTML sanitization.
  • Updated translation files and developer docs.

Closes

Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@up1512001 up1512001 requested a review from Copilot October 14, 2025 05:13
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 involves a comprehensive refactoring and feature addition to the OneDesign plugin codebase. The purpose is to refactor patterns that share code, migrate from PHP-based settings to React/Gutenberg components, add template management functionality, and fix WordPress debug warnings.

Key changes include:

  • Added template management functionality with new REST endpoints and UI components
  • Migrated from "consumer/dashboard" terminology to "brand/governing" site terminology throughout the codebase
  • Refactored REST API structure by splitting into separate classes for patterns, templates, and basic options
  • Added new React components for settings management and template library functionality

Reviewed Changes

Copilot reviewed 58 out of 60 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webpack.config.js Added new entry points for templates, patterns, settings, and plugin admin interfaces
uninstall.php Enhanced cleanup function with return type and expanded options cleanup including new template-related options
readme.txt Updated terminology from "Dashboard/Consumer" to "Governing/Brand" sites throughout documentation
package.json Added dompurify dependency for HTML sanitization
onedesign.php Added new constant definition for plugin basename
languages/onedesign.pot Updated translation strings and added new template-related translations
inc/traits/trait-singleton.php Fixed package name case in documentation
inc/helpers/custom-functions.php New helper functions for template parsing, API key validation, and content processing
inc/classes/rest/ Split REST functionality into separate classes for patterns, templates, and basic options
inc/classes/post-type/ Added new Template post type and updated meta fields terminology
inc/classes/plugin-configs/ New configuration classes for constants and secret key management
inc/classes/class-utils.php New utility class with site type checking and content modification functions
inc/classes/class-settings.php Simplified settings class with React component integration
inc/classes/class-rest.php Refactored to orchestrate REST class instances and add CORS headers
inc/classes/class-plugin.php Enhanced plugin loader with better organization of class loading
inc/classes/class-hooks.php Added template creation hooks and site selection modal functionality
inc/classes/class-cpt-restriction.php Extended CPT restrictions to include Template post type
inc/classes/class-assets.php Enhanced asset management with new scripts for templates and settings
docs/DEVELOPMENT.md Updated project structure documentation
composer.json Added autoloading for helper functions and new pot generation script
assets/src/ Extensive new React components for template management, settings, and patterns interface
Comments suppressed due to low confidence (1)

assets/src/js/utils.js:1

  • The function file_exists is being called but the method name in the comment above indicates it should be \file_exists. Should use the global namespace function consistently.
import DOMPurify from 'dompurify';

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@up1512001 up1512001 marked this pull request as ready for review October 14, 2025 05:53
@up1512001 up1512001 changed the title chore: refactor code base and fix code issues chore: template sharing, core refactor, and UI improvements Oct 14, 2025
up1512001 and others added 3 commits October 15, 2025 12:30
Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com>
Co-authored-by: Vishal Kakadiya <vishalkakadiya123@gmail.com>
up1512001 and others added 2 commits October 16, 2025 10:20
Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com>
Co-authored-by: Vishal Kakadiya <vishalkakadiya123@gmail.com>
Copy link
Collaborator

@vishalkakadiya vishalkakadiya left a comment

Choose a reason for hiding this comment

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

@up1512001 One minor comment, through the PR is approved.

@up1512001 up1512001 requested a review from Copilot October 16, 2025 16:17
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 65 out of 67 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com>
Co-authored-by: Vishal Kakadiya <vishalkakadiya123@gmail.com>
@up1512001 up1512001 merged commit 33da12c into main Oct 17, 2025
5 checks passed
@up1512001 up1512001 deleted the chore/refactor-code branch October 17, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants