Open smileBeda opened 2 years ago
What you currently see are simply the default data provided by the REST API plus additional metadata. Much of this isn't necessary but, until someone has built the integration — two people have offered but it's not ready yet — I am reluctant to remove anything. Once we know definitively what we need, I can either remove all the other fields or else re-create a new endpoint with precisely what we need. (The latter option would just involve a change of URL for those attempting to use it.)
On specifics:
slug
field was often not the right value for our purposes, so the correct one is the one in the metadata.Sounds good for me @KTS915
just one question. Why are we waiting on core integration, if the integration already exists in form of the plugin? It’s working with existing directory and with GitHub, and I’m about to integrate your new api too.
i mean, I know how folks talk and don’t do. But this one is done. It needs the plugin to be either added as a core plugin or a suggested plugin.
I’ve suggested this in past to Viktor as well, and @xxsimoxx and others agreed with the idea.
this would also allow to actually gather some experience on the (new) api if it gets online and amend it until good. And then once core has an integration we can literally drop the plugin and deliver in core.
it would also avoid having to „bump“ semver, as it wouldn’t be a major change at all.
I think you've misunderstood a little. Having built the new Directory, I'm certainly not keen to have it just wait around until something else is done that might take a long time!
We aren't waiting for someone to build the integration into core before the new Directory can go live. My above comment about core integration was only to explain why the current REST API endpoints expose the data they do.
My next task is actually to import all the data from the current directory into the test site. Unfortunately, I have received that only in the form of two MySQL dumps. I have cleaned up one of them, but some of the necessary data is missing from it. When I've got that added, then I can import it, and then I'll do the same with the second one.
Once that's done, which is probably going to take a couple of weeks, and the changes to developer and category names/slugs are done, and testing shows that all works fine, then I think (a) we go ahead with replacing the current directory and (b) we go with what we have to access it. If core integration is done by then, great. But my guess (like yours) is that that's unlikely so, like @xxsimoxx, I'm currently expecting to be using your plugin.
OK, makes sense to me.
I will leave this ticket open since we have the categories and names to be added, so we can as well use this ticket for tracking that. Feel free to close it though, if you prefer single tasks.
I will add a new layer to my plugin integrating this new API (it will basically just start working whenever the api is online) Adding, removing or changing specific endpoint keys is not a lot of hassle so even if things change, no problem.
PS: To check if the new API is online, all I will do is check if the wp-json URL returns response. That will tell me if the new API is online. Assuming of course, the URL of the dir stays the same. So my plugin will actually switch automatically to the new API as soon that starts responding.
Thanks, that sounds good to me. I'm going to leave this Issue open, so we can track progress here. I don't see any need to fragment it into several smaller things.
I have now imported all the plugins we currently have in the original directory, together with their developers. Some don't have a proper download link, so I have them set as draft and they aren't available via the REST API. I will need to contact their developers to see about fixing this (but then I have to contact all the developers about the headers requirements).
I have also tweaked the fields that are now exposed in the REST API. @smileBeda Could you check whether you now see everything you want and nothing you don't? (FYI, many of the plugins will have the slug
field as blank. That's the next thing I have to complete manually, because I found that the exported data can't be trusted.)
Update: the slug
meta field has now been filled for each plugin.
Update: the slug meta field has now been filled for each plugin.
Great! This closes #35.
I have downloaded and installed the directory plus created a dummy plugin entry (using one of my existing GitHub Plugins). I am mostly interested in the REST API endpoint so to integrate the CP Directory within CP (through my plugin). Thus I loaded the REST API Endpoint and I got this after filling in the Custom Fields manually that I saw are expected.
I saw a couple issues with this information and have a couple doubts.
categories
returns an array of IDs. It would be better to pass a slug and human name because when a third party listens to this data and wants to show what category the plugin is tagged with, they will not know what3
(the ID) is (they would have to somehow query back the main site to find out what category ID 3 is exactly.)author
- it passes the ID (1
in my case). It should pass the name (possibly GitHub user/account name). Perhaps that will be addressed here?template
key which is empty. Not sure that is intended, and for what it is helpful?links
I was not clear about what this is. It seems not needed to me? It points to old WP, and has no relevant information.(Similar for
collection
,self
,wp:term
,about
andwp:attachment
)featured_media
which also seems not needed to me or I misunderstand its purpose.update_uri
- I am not sure what it is for (since we have adownload_link
already).meta
section hasslug
(but we already haveslug
from the post data). Is this intentionally duplicated?I had to fill in the information manually, I suspect it should however pull most of this information (description, version, php requirements, author, etc) from Git?
Thanks!!