Discussion of new directory submission requirements

As you are probably aware, I have been leading the effort to build a new ClassicPress Directory. You can see the test site at https://test-directory.webby-books.com/

The new Directory will have greater functionality over the current one, including the ability to auto-update the current version of each plugin, theme, or code snippet that it lists. But in order to accomplish this, it will need developers to include two new headers in their software, specifically a Requires CP and a Requires PHP header, to specify the minimum versions of CP and PHP that the software needs. Full details may be found at https://test-directory.webby-books.com/requirements/

You are the leading develop of plugins in the CP Directory, so I hope you will not find it too onerous a burden to add these headers to each of your plugins.

After you have done so, if you bump the version number, then the Directory will automatically update the plugin’s listing within about 6 hours. (Alternatively, you can do this immediately if you login, go to the page listing your software, and hit the Update Download Link button. You already have an account on the test site, but you will need to reset your password to gain access.)

Once we are confident that everything is working fine, we will transfer the test site over to replace the current Directory. Let me know if you have any questions.

4 Likes

I am not opposed to adding new headers, but I think there needs to ne more clarity around exactly which plugin headers are required, what a readme.txt or readme.md should contain and how they are formatted.

As far as I am aware, the readme.txt is used by ClassicPress to show details of the plugin? Or does that come from the update endpoint? If the endpoint, where does the other information come from in the new directory if there is no readme.txt?

The only headers that ClassicPress will require are those specified on the Requirements page I linked to. The CP Requires header tells core that the plugin is a CP plugin and so it should look for updates listed in the CP Directory.

Other headers may be used by WordPress or may be useful for users, so we’re not suggesting you omit them, but they aren’t read by ClassicPress.

In the new Directory, ClassicPress will parse the README.md file in your plugin’s zip file to obtain the details of the plugin. This is written in Markdown, which the Directory will parse into HTML. If you choose not to use that (though the README.md file is built-in to Github repos by default), then the Directory will parse the Description header in the readme.txt file. If this is empty, then we’ll fall back on the README.md file in your plugin’s GitHub repo.

We obtain this information by checking the latest version of your plugin (which we derive from the current download link registered on the Directory) and then looking inside the zip file. If the repos don’t match, or the plugin’s slug doesn’t match, or one of the required headers is missing – or if we can’t find a README.md or readme.txt file – then the plugin’s listing in the Directory will not be updated.

You can see how this is all displayed by checking the test Directory.

Perhaps I should also add that our preference that the new headers are placed in the plugin’s main .php file reflect the approach now being taken by WordPress, which is moving away from relying on the headers in the readme.txt file.

Just want to note one more time that WP core always used the plugin file headers. It briefly had the readme.txt as a fallback for minimum required versions because the people doing it did not know any better, but it was removed. What is shown on the plugins list in the admin comes from the plugin header.
For WP, the readme.txt is only for the WP repo, which populates the plugin’s single page, which is shown in an iframe overlay for View Details by core.

Why you feel the need to repeat yourself beats me. We were talking about the Directory, the analog of which is indeed the WP repo and not core.

Yes, but you had an inaccurate statement in there, so I wanted things clear for those that might not understand how everything works.

No, I didn’t. You just have a very narrow view of what the word WordPress means. You don’t seem to be aware that others use that word differently from you

Requires CP requires the version to be in the format <major>.<minor> without the patch. It totally makes sense for me because of semver.

1 Like

Just wanted to report that we’ve now had several plugins add the new headers, and that the test Directory has automatically picked them up and updated the Directory entries as intended.

2 Likes

Do you have somewhere that you get the current version of CP?
I know that WP had to put a check in for people referring to WP versions that weren’t out yet. (that was for Tested though)

No. Wouldn’t that be for core to check in the user’s site?

I don’t know if you even parse a Tested up to field, but WP does, and they don’t let the dev lie about the version number. That means that it can’t say 6.1 if the latest release of WP is 6.0. To do that, they have to get the latest release number from somewhere.
This is probably moot if CP doesn’t have a field like that.

No, we don’t have such a field.

If CP only requires those three headers where does the data for the plugin details page come from or is this page being removed?

We parse the details from the zip file to which you point in the download link. So the README.md file within the zip file will be where we first look. If it doesn’t exist, then we’ll look at the readme.txt file and, if that doesn’t exist either, then we’ll get the details from the README.md in the plugin’s GitHub repository.

Where is that image from? It has Requires WordPress Version: 1.0.0 which looks like it is using CP version with WP label.

My test site which is running Classicpress 1.4.3.

OK, so not just those three headers is needed. What is there which tells me exactly what I need to include and where?

As I pointed out in my original post (at the top of this thread), a full explanation may be found at https://test-directory.webby-books.com/requirements/