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

Plugin definition discovery: local location outside of <plugin>/.versionpress #1176

Closed
borekb opened this Issue Dec 26, 2016 · 5 comments

Comments

Projects
5 participants
@borekb
Copy link
Member

borekb commented Dec 26, 2016

#1036 implements a discovery method that expects plugin definition files (schema.yml, actions.yml etc.) to be located at <some-plugin>/.versionpress. There should also be an external location from where the definitions could be loaded, two initial candidates being:

wp-content/plugins/.versionpress
wp-content/vpdb/.versionpress (or some other folder name)

I like the plugins folder better because not everything in a plugin definition is tied to a DB and vpdb is very database-specific.

Inside it, it would probably just be directories for plugins so the complete example would look like:

wp-content/plugins/.versionpress
    akismet/
        schema.yml
        actions.yml
    woocommerce/
        schema.yml
        actions.yml
    ...

After this is implemented, there will be an online repo of these definitions, sort of like DefinitelyTyped for TypeScript. VersionPress will be downloading plugin definitions from that repo to this local structure. See #1243.


🏁 PR #1246

@unclhos

This comment has been minimized.

Copy link
Contributor

unclhos commented Dec 26, 2016

Also need to determine how to deal with plugin versions and force rediscovery of plugins that already have definitions downloaded. Ideally this would happen during the plugin upgrade hook, but if new definitions aren't ready, should be able to force it some way (CLI with eventual GUI).

@pavelevap

This comment has been minimized.

Copy link
Contributor

pavelevap commented Dec 26, 2016

Yes, subdirectory /.versionpress is currently not very friendly and my definition files are deleted everytime when plugin is updated automatically :-)

I would suggest wp-content/.versionpress/ because there will be also definition files for themes (see #1164) and not only plugins. So, we can have wp-content/.versionpress/plugins and wp-content/.versionpress/themes. And also wp-content/plugins is default WP directory, maybe some conflicts may appear?

As regards versioning, maybe we could take inspiration from WP language packs and their API (it looks like similar feature = languages for plugins and themes)? There are no versions but only date of modified files.

@borekb

This comment has been minimized.

Copy link
Member Author

borekb commented Dec 27, 2016

@unclhos Note that this issue is not about the online plugin repo, that will be dealt with in a separate issue. But point taken.

@borekb

This comment has been minimized.

Copy link
Member Author

borekb commented Dec 27, 2016

@pavelevap Do you know if a slug is unique across plugins and themes on wordpress.org? In other words, can there be https://wordpress.org/plugins/example/ and https://wordpress.org/themes/example/ at the same time? That would influence the decision somewhat.

@pavelevap

This comment has been minimized.

Copy link
Contributor

pavelevap commented Dec 27, 2016

I do not think that slug is unique, see for example:

https://wordpress.org/plugins/genius/
https://wordpress.org/themes/genius/

There are different APIs and it is also probably reason for plugins and themes subdirectories inside languages directory.

Another problem are premium/custom plugins and themes, they can eventually share the same slug as in official directories (they usually want to avoid that, but it can happen sometimes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment