Skip to content

Conversation

@justlevine
Copy link
Collaborator

What

This PR rescaffolds plugin boilerplate to follow latest plugin best practices.

Includes:

  • Updated configs
  • Composer/NPM deps cleanup
  • GH Actions
  • Updated docs.
  • Wrapped Autoloader.

Why

Related Issue(s):

How

This PR does not include any formatting/remediations from fixing the linting.

Testing Instructions

Screenshots

Additional Info

Checklist

  • I have read the Contribution Guidelines.
  • I have read the Development Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint etc.).
  • My code has detailed inline documentation.
  • I have updated the project documentation as needed.

Copilot AI review requested due to automatic review settings November 24, 2025 22: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

This PR rescaffolds the plugin to align with modern WordPress plugin development best practices, including updated tooling, configurations, and build processes.

  • Updated build configuration from nested assets/build/js and assets/build/css structure to a flat build/ directory
  • Implemented comprehensive testing infrastructure with PHPUnit, PHPStan, and enhanced PHPCS rulesets
  • Added GitHub Actions workflows for automated testing and releases

Reviewed changes

Copilot reviewed 29 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webpack.config.js Simplified output paths from nested structure to flat build/ directory
tests/bootstrap.php Added PHPUnit test bootstrapper
phpunit.xml.dist Added PHPUnit configuration
phpstan.neon.dist Added PHPStan static analysis configuration
phpcs.xml.dist Expanded PHPCS ruleset with VIP, Slevomat, and Plugin Check standards
package.json Updated dependencies, scripts, and added TypeScript support
composer.json Enhanced with PHPStan, additional coding standards, and test dependencies
onedesign.php Refactored plugin loader with namespace and custom Autoloader wrapper
inc/Autoloader.php Added custom autoloader wrapper with graceful error handling
inc/classes/class-assets.php Updated asset paths to match new build structure
docs/* Updated development documentation with comprehensive setup instructions
.github/workflows/* Added automated testing and release workflows
Configuration files Updated ignore patterns and editor configurations
Comments suppressed due to low confidence (1)

phpcs.xml.dist:1

  • The pattern 'node_modules (?)' contains an unusual '(?)' suffix. This should likely be 'node_modules/**' or just 'node_modules'.

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

justlevine and others added 4 commits November 25, 2025 00:46
Co-authored-by: Copilot <[email protected]>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@justlevine justlevine requested a review from up1512001 November 24, 2025 23:01
@justlevine justlevine mentioned this pull request Nov 24, 2025
6 tasks
Copy link
Member

@up1512001 up1512001 left a comment

Choose a reason for hiding this comment

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

@justlevine Added few doubts/feedbacks.

cancel-in-progress: true

on:
release:
Copy link
Member

Choose a reason for hiding this comment

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

can we do this on tag instead of release so that we can directly generate plugin zip with dev tags also from our branch for efficient QA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What about it makes QA more efficient?

(In general, this plugin is just POC, so I'd much rather an intentional GH-hosted release process and only create a tag on GH release instead of first creating tags > deriving the release > releasing. )

# - Runs PHPUnit tests (with coverage if enabled).
# - Uploads code coverage report to Codecov.io (if coverage is enabled).
# - Uploads HTML coverage report as an artifact (if coverage is enabled).
phpunit:
Copy link
Member

Choose a reason for hiding this comment

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

not sure for this as in any module we are not writing unit test cases so in future are we planning to add unit test cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If this goes from POC to plugin we will.

Also, my bigger intent for this entire PR is using this (and the other One* plugins) as boilerplate for future plugins. Unit tests are only optional for direct client work, never again for publicly released plugins.

$error_message = __( 'OneDesign: The Composer autoloader was not found. If you installed the plugin from the GitHub source code, make sure to run `composer install`.', 'onedesign' );

if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
error_log( esc_html( $error_message ) ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- This is a development notice.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for surfacing that discussion🙇

Indeed the pattern is fine, and is used by several canonical and noncanonical plugins.

"uninstall.php"
],
"dependencies": {
"@wordpress/api-fetch": "^7.35.0",
Copy link
Member

Choose a reason for hiding this comment

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

did we tested plugin with updated dependencies, because I think that should be separate part. 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes they've been tested and confirmed compatible.

(Also we don't bundle the @wordpress dependencies, so in general nonbreaking changes are safe, and breaking ones you just need to confirm that we're not relying on anything that was removed)

@justlevine justlevine requested a review from up1512001 November 25, 2025 17:10
up1512001
up1512001 previously approved these changes Nov 25, 2025
@justlevine justlevine merged commit b561a3f into develop Nov 26, 2025
7 of 10 checks passed
@justlevine justlevine deleted the chore/rescaffold branch November 26, 2025 08:20
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.

3 participants