-
Notifications
You must be signed in to change notification settings - Fork 22
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 recommendation field and write Plugin_Update recommendation #131
Add recommendation field and write Plugin_Update recommendation #131
Conversation
…ommendation * upstream/master: Revert "Validate MIME type against extensions"
|
||
if ( 1 === $update_count ) { | ||
$this->set_status( 'warning' ); | ||
$this->set_message( "1 plugin has an update available." ); | ||
$this->set_recommendation( "Update the {$outdated_plugin_names} plugin." ); |
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.
Sorry I didn't communicate this well-enough originally. The idea is that doctor
would recommend which WP-CLI command to run next (if possible).
In saying this, we probably need two attributes: recommendation_message
and recommendation_command
.
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.
I see. Should I try to take a stab at a command and extended message for each so that we can see how that plays out?
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.
Go for it!
@@ -20,8 +20,9 @@ class Command { | |||
* ## OPTIONS |
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.
This ## OPTIONS
heading should be below the paragraph text. Can you move it?
…ommendation * upstream/master: Add `--format=count` to supported formats
I added a couple examples in the form of tests. But I had another thought on this. What I was looking for originally was a way to get more information on certain failed checks, particularly the ones where the extra detail (like which PHP files were found in uploads) won't fit nicely in a shorter-style summary "message". What if instead of adding 2 more "recommendation" fields, we did this... Treat the "message" field more like a git commit message. The first line is a summary and should be around 50 (?) characters. After that summary line can be a blank line, and then essentially as much freeform content as you want. It could list out specific plugins/files/themes/etc. in a human readable list, could include reference links, suggestions, etc. By default, only the summary line is shown and maybe a I really like the recommended command idea, and think that's definitely worth playing out (separately). I don't think it will work for all of the checks (ex. php-in-upload), but when it does, people could make pretty slick interactive flows using it (or build an interactive resolution flow into doctor-command itself -- "Want to run So, short version: an expanded, multiline "message" field that only shows first line by default + a separate recommended command field when applicable @danielbachhuber do you have thoughts on this? Let me know if any of that didn't make sense. |
Oh right. I was thinking these could go in a
Correct and correct :) |
Can you give an example of what would be in the |
It would be the file path relative to WordPress root in JSON format. In |
I'm still planning to work on this (we need it), just been caught up in my own stuff. I opened #136 and will probably start over with a new PR when I have time. |
@danielbachhuber let me know how you want to tackle this. I added the field and tested it on one check.
Closes #25