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

GitHub slugs and directory slugs #36

Closed
viktorix opened this issue Dec 5, 2022 · 9 comments
Closed

GitHub slugs and directory slugs #36

viktorix opened this issue Dec 5, 2022 · 9 comments
Labels
question Further information is requested

Comments

@viktorix
Copy link
Member

viktorix commented Dec 5, 2022

I noticed that directory post slugs are generated by the post title as it normally would, but the actual slug used in the API is based on the repo slug:
https://staging-directory.classicpress.net/plugins/smtp/

"meta": {
"current_version": "2.1.0",
"git_provider": "github",
"requires_cp": "1",
"download_link": "https://github.com/azurecurve/azrcrv-smtp/releases/download/v2.1.0/azrcrv-smtp.zip",
"requires_php": "7.4",
"slug": "azrcrv-smtp",
"developer_name": "azurecurve",
"category_names": "Tools",
"category_slugs": "tools"
}

Should we use the actual slug in the URL too? A reviewer could verify this during review process when publishing software.

@viktorix viktorix added the question Further information is requested label Dec 5, 2022
@xxsimoxx
Copy link
Member

xxsimoxx commented Dec 6, 2022

For now the page slug is different from the plugin slug and as you said it reflects the plugin name.
As example every CodePotent plugin have a name different from the plugin slug (Shortcodes Everywhere has codepotent-shortcodes-everywhere).
I prefer having the URL matching the name but that's not so important for me.

@viktorix
Copy link
Member Author

viktorix commented Dec 6, 2022

One problem I noticed, the current search doesn't work with API slugs. So if I search for "azrcrv-smtp", it won't find the plugin. We either need to be consistent with slugs or figure out a way to make API slugs searchable.

@viktorix
Copy link
Member Author

viktorix commented Dec 6, 2022

For the issue of searching for plugins using API slug, I was able to fix it by indexing slugs using Relevanssi. See issue #37.

@xxsimoxx
Copy link
Member

xxsimoxx commented Dec 6, 2022

This is also relative to #24 and #23.

We are using Search & Filter plugin. It's a lot of time they are promising v. 3.

The actual functions of this plugin are not 100% what we need, so we will have to decide:

  1. Wait in the hope that v. 3 comes out with what we need
  2. Find out an alternative
  3. Fork the plugin and add what we need.

@viktorix
Copy link
Member Author

viktorix commented Dec 6, 2022

Are we using Search and Filter plugin for APIs? Or is it just that, for searching?

@xxsimoxx
Copy link
Member

xxsimoxx commented Dec 6, 2022

Just for searching.
The REST API endpoint is this:
https://staging-directory.classicpress.net/wp-json/wp/v2/plugins?byslug=azrcrv-smtp

@viktorix
Copy link
Member Author

viktorix commented Dec 6, 2022

Thanks for this. Actually, we're not modifying the plugin but core search. I disabled the plugin and the API still returns correct plugin by slug.

@viktorix
Copy link
Member Author

@xxsimoxx do we agree that keeping directory post slug and Github slug separate/different is the way to go now? So we can close this issue.

@xxsimoxx
Copy link
Member

For me there are no problems in keeping the slugs different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants