Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Better test for updated content. #4

Open
mattheu opened this issue Sep 17, 2018 · 1 comment
Open

Better test for updated content. #4

mattheu opened this issue Sep 17, 2018 · 1 comment

Comments

@mattheu
Copy link

mattheu commented Sep 17, 2018

The test page is created once and only updated with the content included in the code when the plugin is updated.

However there are 2 issues with the way this is done right now.

Firstly, if you add/remove theme support for align-wide, and the content has already been created, it will NOT be modified to include the tests for wide aligned blocks.

Secondly, because the plugin relies on the hook upgrader_process_complete, if you update the plugin in any way other than using the admin UI - it will not be updated. (e.g if updating manually, or through composer)

I think you could handle this in a way that is more compatible with both of these use cases. Some ideas:

  • Use a filter on the content to ensure the bundled content is always used.
  • Store a hash of the content in post meta and use this to track which version of the content is stored and only update if it has changed.
@richtabor
Copy link
Contributor

Intersting points @mattheu! Those are good ideas.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants