Skip to content
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

Update Plugin Best Practices section on Avoid Naming Collisions to include namespaces as an option #44

Open
jonathanbossenger opened this issue Dec 9, 2024 · 3 comments
Assignees

Comments

@jonathanbossenger
Copy link

Issue Description

The Avoid Naming Collisions section of the Best Practices page in the Plugin developer handbook includes the options to use prefixes, and classes, but not namespaces, to avoid naming collisions.

We do have a section on using namespaces in our coding standards, so it makes sense to add this to our plugin developer handbook as well.

URL of the Page with the Issue

https://developer.wordpress.org/plugins/plugin-basics/best-practices/

Section of Page with the issue

The section Avoid Naming Collisions

Why is this a problem?

It doesn't include namespaces as a solution

Suggested Fix

Add a section on the use of namespaces as an option, after the prefix section. Include details on how to create good namespaces based on the WordPress coding standards

@jonathanbossenger
Copy link
Author

I originally created this issue in the Documentation-Issue-Tracker, but recently discovered the plugin handbook is now managed in this repository, so moving this issue here.

I'm also offering to create this section based on the same content in the lesson on naming collisions created for Learn.WordPress.org.

My next step will be to open a PR for review.

@davidperezgar
Copy link
Member

Indeed, Namespaces are not considered now is a modern way to avoid name collisions. 100% agree for that. I'll be happy to review the PR.

@jonathanbossenger
Copy link
Author

Thank you for confirming @davidperezgar

I am working on other tasks at the moment, and then I'm away for a week, and then it's Christmas/New Year, but I'll do my best to get a PR ready for review before the end of the year.

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

No branches or pull requests

3 participants