Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMSP-995] Notices for low max age values in Page Cache Options (#268)
* add initial admin interface class hook to mu-plugin > 1.4.0 * some more scaffolding * require at least 6.4 * don't show notices if wp_admin_notice doesn't exist * add notice if mu-plugin was not found * add notice if the mu-plugin is old * fix link and change decimal to string * use spaces instead of line breaks * add helper function to get current max age this is either set in the mu-plugin or empty. if empty, it should default to 1 week * add notice if less than 1 week but not == 600 seconds * add docblock * add translator comments * update tested up to and requires at least values in readmes * version bump * bump composer deps * don't display the warnings if we aren't on the pantheon cache admin page * convert static class to a namespace there's no reason to make this a class since we're not using any class features * add a bootstrapper for namespace-only files * lint * escape the wp_die message * use a helper for humanized time calculations * we still need to test the current max age * pass the current max age to the message, too and be specific that we're talking about seconds * use the filterable value for default max age because it could be something different * add a helper function for retrieving the default max age this is helpful so we can always return the filtered value * also display the seconds in the successful test * rank the max age value don't say it's "very low" unless that's actually accurate. * add caching to the ranked compare * make the color more severe if it's a bigger issue * change the color of the admin notice based on the severity of the diff * clear the transient when the option is updated * break notice type into a variable * fix the translator note * keep the rank but hide it from the dom * add unit tests * add initial behat test let's just see if we can assume this will work * fix failing test * specify the element where the notices are * add site health check test * actually save the changes * remove max age check only exists in an html comment anyway * simplify the site health check * add the message when you expand the accordion * add other site health things * change press to click? * add "open the accordion" as a custom step * move behat stuff around * move stuff around again * update the behat.yml * remove custom context and try "when I follow" * move to checking the text inside the elements * target the hidden element * use hidden='hidden' * call it a div * simplify the tests * remove press since we can't actually press * it did actually find the right heading maybe it will find the right text? * add @\since tags * add changelog and upgrade notice * let's try checking for some of the hidden text * period at the end of the sentence * add the ranks back this shows us that our ranking function is working * add the messages * remove age rank tests because goutte doesn't natively interpret html comments * add github testing badge since phpunit is no longer run on circle * add script to maybe skip behat tests if we don't need to run them * add step to workflow * do not run if the circle config changes * also ignore if scripts (that aren't behat-related) have changed * fix the logic (again) * one more flippity flip * remove the "ignoring" message it's actually implied by the fact that is_ignored is checked * use function to determine if a file should be ignored Co-authored-by: Phil Tyler <phil.tyler@pantheon.io> * update changelog to note mu-plugin updates * Update tests/phpunit/test-admin-interface.php * use data providers to simplify the tests --------- Co-authored-by: Phil Tyler <phil.tyler@pantheon.io>
- Loading branch information