Store public API keys based on domain #52
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the WP101 Plugin SaaS generates a unique public API key for each domain/private API key combination, the public API key should be stored in a transient that's keyed to the current domain. This will ensure that if the value of
site_url()
ever changes, the appropriate public API key will be retrieved from the SaaS, fixing #49.Additionally, public API keys are now only cached for 24 hours, enabling older keys to roll off after (for instance) a domain change.