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

Is there an integration as a WordPress plugin available? #1

Open
patrickheck opened this issue Sep 13, 2022 · 2 comments
Open

Is there an integration as a WordPress plugin available? #1

patrickheck opened this issue Sep 13, 2022 · 2 comments

Comments

@patrickheck
Copy link

patrickheck commented Sep 13, 2022

Thanks for your great work with this! I'd like to use this as a way to clean up staging and test environments. Unfortunately, those usually don't have docker or composer available.
So, I was wondering if you know of anyone who integrated your work into a WordPress plugin? I'd prefer to use it as a wp-cli command, since that should still be quite fast.
Thanks!
Patrick

@williarin
Copy link
Owner

Thanks! I haven't used it within WordPress but a couple months ago I made a plugin based on another library I made. You can take a look on how it's done: https://github.com/williarin/wordpress-simple-queries

The plugin is built by Github actions, it creates a prefixed vendor directory so there is no conflict with other plugins, and creates a release with the pre-installed vendors, so you don't need composer when you put it in your WordPress plugins folder.

So if you use this technique to create a plugin based on this lib, you can easily create a WP-CLI command out of it.

  1. Create a composer.json file with Imposter Plugin and this lib as dependencies
    https://github.com/williarin/wordpress-simple-queries/blob/b727da8397314942012781d261d8a0db3dd71aaf/composer.json#L31:L39

  2. Create the plugin php file and your WP-CLI class
    https://github.com/williarin/wordpress-simple-queries/blob/b727da8397314942012781d261d8a0db3dd71aaf/simple-queries.php

  3. Create the final plugin with Github actions
    https://github.com/williarin/wordpress-simple-queries/blob/b727da8397314942012781d261d8a0db3dd71aaf/.github/workflows/build_release.yml

@patrickheck
Copy link
Author

Hi @williarin , thanks a lot for taking the time to reply in such a detailed way. I will try to implement this as soon as I find the time.
Best
Patrick

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

No branches or pull requests

2 participants