wp-media / wp-rocket-cli

WP CLI interface for the WP Rocket plugin
74 stars 37 forks source link

Closes #25 Clean command needs to clean minify folder #40

Closed crystinutzaa closed 3 years ago

crystinutzaa commented 3 years ago

Closes https://github.com/wp-media/wp-rocket-cli/issues/25

I reproduced easily the issue and it simply needed to clean the minify folder and to regenerate the unique key for minify_css and minify_js.

crystinutzaa commented 3 years ago

@wp-media/qa this one is ready for QA

piotrbak commented 3 years ago

@crystinutzaa @Tabrisrp I believe we should also clear the minified files for multisite: https://github.com/wp-media/wp-rocket-cli/blob/192f1e09b0855fe164d4ac7e639a9ac00201fd86/command.php#L116

Not sure what about this, as I don't know this function: https://github.com/wp-media/wp-rocket-cli/blob/192f1e09b0855fe164d4ac7e639a9ac00201fd86/command.php#L148

Should I QA it like it's and create another issue, or we'll take care of it within this one?

remyperona commented 3 years ago

Yes in that part that is handling multisite, we should also clear the minify files for each indeed.

crystinutzaa commented 3 years ago

@Tabrisrp & @piotrbak please recheck it. I added only in Multisite the cleaning of the min files. In multi-language websites I don't think we need to clean the min files.

piotrbak commented 3 years ago

@Tabrisrp @crystinutzaa Here are my comments:

  1. When clearing the specific permalink, the cache is not preloaded because we use rocket_clean_files not rocket_clean_post. When using the id, it's preloaded. Should I create a GH issue for this?
  2. When clearing the language version, we're getting a fatal error. That's because this function doesn't exist rocket_clean_domain_for_selected_lang. Should I create a GH issue for this, or we can handle this in this PR?
  3. We should remove the space after the comma from the example" wp rocket clean --permalink=http://example.com, http://example.com/category/(.*)
  4. When running on a multisite, WP Rocket is disabled on blog_id=2, we can still run the wp rocket clean --blog_id=2 and output the success message. Even if nothing was cleared since WPR is disabled for this site. That's because the rocket_clean_domain is available from the blog_id=1. Do we want to handle this?

Happy scenarios worked as expected.

remyperona commented 3 years ago

@piotrbak

  1. This is the same behaviour on the plugin itself, so imo it's fine.

For the other points, I pushed a commit to fix them. Can you retry 2 and 4?