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

[Enhancement] Add custom file output to settings export #61

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

Trisky
Copy link

@Trisky Trisky commented Sep 5, 2023

Description

  1. Currently you cannot export the configuration to a specific file and the generated file name is random.
  2. This makes it very hard to use in scripts. For example if you want to export the settings and import them again in several sites.
  3. Motivation: Be able to export / import settings across multiple sites in your wordpress network to avoid manual work.

I've added a parameter --output-file to wp rocket export so the user can choose where the file will be written. Leaving the parameter empty still works so the original functionality remains intact.

Type of change

Please delete options that are not relevant.

  • Enhancement (non-breaking change which improves an existing functionality).

Is the solution different from the one proposed during the grooming?

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • I have added unit and integration tests that prove my fix is effective or that my feature works.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).
  • Any dependent changes have been merged and published in downstream modules.
  • If applicable, I have made corresponding changes to the documentation. Provide a link to the documentation.

Test summary

  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I validated all Acceptance Criteria of the related issues. (If applicable, provide proof).
  • I validated all test plan the QA Review asked me to.
~ wp rocket export --output-file=asd.json
Success: Successfully exported in asd.json
~ wp rocket export --output-file=/tmp/asd.json
Success: Successfully exported in /tmp/asd.json
~ wp rocket export --output-file=../asd.json
Success: Successfully exported in ../asd.json

If not, detail what you could not test.

Please describe any additional tests you performed.

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

Successfully merging this pull request may close these issues.

1 participant