-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
add warning to settings page if SafeBrowsing is enabled without key #105
Conversation
This configuration is target for removal, so we inform the user that a custom API key must be provided to continue using this feature. The warning will be displayed once after activation (upgrade) and always on the plugin's settings page.
Codecov Report
@@ Coverage Diff @@
## develop #105 +/- ##
=============================================
- Coverage 39.43% 37.94% -1.49%
- Complexity 143 149 +6
=============================================
Files 5 5
Lines 535 556 +21
=============================================
Hits 211 211
- Misses 324 345 +21
Continue to review full report at Codecov.
|
Thanks for the PR! I have tested the PR and it works as expected. The notice is there if the input field is empty. It re-appears if the content of the field is removed again. But I have some remarks:
|
Not really. Would have omitted the variable completely like
Don't know if the behavior is "correct", but this was my intention. But yes, we could always show it.
I personally hate new windows enforcement, but in this case I'd guess about everybody would open it within a new window/tab.
Probably little out of scope for this PR, but definitely a good point. (see #109) |
Codecov Report
@@ Coverage Diff @@
## develop #105 +/- ##
=============================================
- Coverage 39.00% 37.74% -1.26%
- Complexity 143 148 +5
=============================================
Files 5 5
Lines 541 559 +18
=============================================
Hits 211 211
- Misses 330 348 +18
Continue to review full report at Codecov.
|
Yes, go for it! Not important in this case. Readability is not problematic here.
I think it makes sense here. From the Plugin handbook:
As this will break in the next release we should show it sitewide, but with clear instructions on how to solve the situation. The message should remove if not necessary anymore or it was dismissed. Maybe always show on our settings page even if dismissed but not solved. Maybe we should change the link text from "See official documentation." to "See official documentation from Google." (otherwise this could mean our documentation) and maybe we can add a link to our settings page to the notice to make it easier to resolve the issue fast. |
Done. |
LGTM Just one last note: After disabling the safe browsing feature and save the settings the notice is still there (one click or reload later it is gone, but maybe this is confusing as the problem is solved after disabling the feature, so why still the notice?) The dismiss of the notice is not persistent. It comes back on the next admin page. I am not sure if this correct, because the people need to fix this or not ... We should in every case tell this change in a "upgrade notice" in the changelog/readme.txt. Do we need to add, that the users can also disable the feature or is this silly? The patch/branch does not contain the changes of #109 - just FYI. Not sure if this should be the case or not. Just wondered ... |
That's caused by suboptimal processing order. The initial global admin notice hook is done before the options are updated...
Well, we had two variants now:
There a number of ways inbetween. Remembering dismissal requires custom logic and an additional options flag, user meta or similar and that seems overdone for a "feature" that will be gone with the next update. We could add something like after udpate, on the settings page and on the dashboard.
Implicated by "if you want to continue using this feature ...", isn't it?
That's fine, both changes will be visible after the merge. |
Fixed. Slightly reworked the logic, s.t. the notice is always shown on the settings page and on other pages only for users who actually can manage options to not bother regular authors or editors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Thanks for optimizing with my ideas.
Related to #104.
Google Safe Browsing with fallback API key is target for removal, so we inform the user that a custom API key must be provided to continue using this feature.
The warning will be displayed once after activation (upgrade) and always on the plugin's settings page.