-
Notifications
You must be signed in to change notification settings - Fork 0
chore: template sharing, core refactor, and UI improvements #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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_existsis 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>
assets/src/admin/templates/components/MemoizedTemplatePreview.js
Outdated
Show resolved
Hide resolved
assets/src/admin/templates/components/MemoizedTemplatePreview.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com> Co-authored-by: Vishal Kakadiya <vishalkakadiya123@gmail.com>
Co-authored-by: Utsav Patel <75293077+up1512001@users.noreply.github.com> Co-authored-by: Vishal Kakadiya <vishalkakadiya123@gmail.com>
vishalkakadiya
left a comment
There was a problem hiding this 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.
There was a problem hiding this 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>
This PR adds the new Template Sharing feature and includes major improvements to the plugin’s structure, performance, and user experience.
Key Changes
Technical Updates
Closes