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

Add theme name validation #304

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Add theme name validation #304

merged 3 commits into from
Apr 27, 2023

Conversation

matiasbenedetto
Copy link
Contributor

@matiasbenedetto matiasbenedetto commented Apr 5, 2023

What?

Add theme name validation.
The user won't be able to create a theme using a name if it:

Why?

To early warning theme creators about not valid theme names

Screencast

2023-04-05.15-26-02.mp4

Fixes #299

@carolinan
Copy link

I don't think those guidelines from 2013 are valid anymore. It may be easiest to use the same "blockers" as the uploader in the directory?

@matiasbenedetto
Copy link
Contributor Author

matiasbenedetto commented Apr 6, 2023

It may be easiest to use the same "blockers" as the uploader in the directory?

I have made a quick search and could not find those blockers. Apart from this https://make.wordpress.org/themes/handbook/review/required/#7-naming-spelling-and-trademarks are there any other guidelines that still apply?

@carolinan could you share a link, please?

@carolinan
Copy link

@matiasbenedetto
Copy link
Contributor Author

matiasbenedetto commented Apr 10, 2023

https://meta.svn.wordpress.org/sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

Thanks!

I removed the old naming restrictions from validation.
The restrictions left are just "WordPress" and "Theme" words can't be part of the theme name. And the theme name should not be already in the theme directory.

@madhusudhand
Copy link
Member

And the theme name should not be already in the theme directory.

I don't think this should be a hard restriction to create a theme.

Given that plugin can be used to create themes without restrictions and not every theme is published to .org, this check should only be informative not a requirement.

Anyone should still be able to create a theme with any name of their choice and published it to their own platform.

@carolinan
Copy link

The main reason is that if the theme on wordpress.org has a higher version number, the site will get notifications that there is an update, but it won't be the same theme. This is very annoying and can be devastating if you don't know about it.

@carolinan
Copy link

If we lift the restriction, I think those of us who do submit to .org would like a notice or warning at least.

Copy link
Contributor

@jffng jffng left a comment

Choose a reason for hiding this comment

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

This is working as advertised so I'm giving the ✅

There are a couple ideas I had for improving the UX a bit but these could be done in a follow up if folks agree:

  1. it could be nice to persist the warning if you navigate away from the input
  2. supply a link to the documentation / theme name guidelines if a warning is issued

Regarding 1:

Warning is shown Warning disappears when you navigate away
Screenshot 2023-04-27 at 9 41 17 AM Screenshot 2023-04-27 at 9 41 19 AM

@matiasbenedetto
Copy link
Contributor Author

This is working as advertised so I'm giving the white_check_mark

There are a couple ideas I had for improving the UX a bit but these could be done in a follow up if folks agree:

Thanks for testing!
Yes, feel free to open an issue or a PR to improve that. Seems like a good enhancement.

@matiasbenedetto matiasbenedetto merged commit 2a87033 into trunk Apr 27, 2023
@matiasbenedetto matiasbenedetto deleted the add/theme-name-validation branch April 27, 2023 13:49
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.

Check for available theme name
4 participants