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
Plugin Search: Add proof of concept #10611
Conversation
This is automated check which relies on |
This PR looks like it might contain user tracking functions. We need to make sure that it is GDPR Compliant. Rules triggering this positive scan:
cc: @pesieminski |
/** | ||
* Put some more appropriate links on our custom result cards. | ||
*/ | ||
public function insert_module_related_links( $links, $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.
We should make sure to add Tracks to these links, so that we understand how people are using it/which links are most useful, and probably also something that indicates whenever one of these cards/results are shown.
Note we're seeing some messages with
|
Conditions to test:
|
I was just playing around with this and noticed that it doesn't kick in/load properly until Jetpack is connected. I think ideally this would be active as long as Jetpack is installed and activated, even before it's connected (to let people know that they've got stuff available, but it's not working yet because they're not connected). |
Just pushed up some things I've had staged for a while along with some other changes. Current status: This now works well both with the ajax-y loading of plugin search, as well as deep linking with the query string search (which would be what happens when you reload a search page). It's also dynamically pulling Jetpack's plugin info in to populate the card, and has a number of other enhancements. What does not exist yet:
None of these I think are strictly necessary, and I think most (all?) could probably be punted to a v1.1 done after we get initial feedback from a first quiet launch / user testing. I believe we're also waiting for a Master Thread post from @jessefriedman but I've not circled back with him directly about that since we spoke just before the holidays. |
Also here: #10611 (comment) Jetpack has a weird state of "inactive" but Jetpack is active. So the "Activate" button should be greyed out and say "Active" like this: |
Just a note, we'll need to confirm that the styles we write for this have commensurate versions in Calypso-ify. |
Activate the module (via debug module list), then Plugins > Add New > search for "contact form"
Add matching to all the modules search terms;
- Manipulate name/description to make it clearer what's going on
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.
Functionally tests well. I only did a light skim of the code review.
I think it's ok to ship it as-is, and iterate on the descriptions/terms during beta.
Caution: This PR has changes that must be merged to WordPress.com |
I think the Fusion diff will apply cleanly if this were rebased |
Where should that get started button lead? I tried searching for "Publicize" when the module was inactive. I then activated the module via the hint card, and the "Get Started" button was linking to |
Do we want to track dismissals as well, to see if some suggestions are not deemed relevant by a lot of users? |
When I click on the card title or the card image, I would expect to learn more about the feature. Instead, the modal that pops up is for the Jetpack plugin itself. Is that okay? Could / should we use the same link we use for the "Learn more" text instead? |
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 will be super useful! Nice work!
I left a few questions in comments above, and inline.
modules/plugin-search.php
Outdated
$jetpack_modules_list = Jetpack_Admin::init()->get_modules(); | ||
|
||
// Never suggest this module. | ||
unset( $jetpack_modules_list['plugin-search'] ); |
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.
We probably do not need this anymore.
JetpackTracking::record_user_event( 'wpa_plugin_search_match_found', array( 'feature' => $matching_module ) ); | ||
|
||
$inject = (array) self::get_jetpack_plugin_data(); | ||
$image_url = plugins_url( 'modules/plugin-search/psh', JETPACK__PLUGIN_FILE ); |
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.
Given that it's a fairly generic image, I wonder if we should add it to the images directory instead; maybe we can re-use it for other things in the future?
$siteFragment = Jetpack::build_raw_urls( get_home_url() ); | ||
switch ( $feature ) { | ||
case 'sharing': | ||
case 'publicize': |
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 don't think that worked in my tests. The "configure" link for Publicize was still the link to the Jetpack Settings screen.
( | ||
Jetpack::is_active() || | ||
( | ||
Jetpack::is_development_mode() && |
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.
Do we need this here, given that we don't seem to initiate anything when the plugin is not connected to WordPress.com?
https://github.com/Automattic/jetpack/pull/10611/files#diff-f33103bd412ed49a26cdf8f3756f0e58R11
beaulebens, Your synced wpcom patch D24833-code has been updated. |
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 looks good for now. Merging and including this in the Beta. we can iterate further in the next few days 👍
This adds a super super ugly/rough proof of concept of making suggestions when people search for functionality that Jetpack already provides. We've seen that people with Jetpack installed and activated often search for Jetpack features (even by name) in the Plugins > Add New screen in wp-admin. This new module attempts to spot those searches, and provide an artificial search result that calls out that what they're looking for is in Jetpack, which they already have, and which is already active. This code is _definitely_ not ready for prime time; it should hook into our existing search terms for settings search, should use better descriptions etc, needs to use real plugin data vs the hardcoded bits I used, and needs to make it really clear that this is an artificial search result, not something coming from the plugin directory directly. ### Testing Instructions 1. Switch to this branch 2. Plugins > Add New 3. Search for something that Jetpack provides (e.g "contact form") 4. See that the first result should be a Jetpack-powered card. ### Proposed changelog entry - When people search plugins for features that Jetpack provides, give them hints. Co-authored-by: Yaroslav Kukharuk <i.kukharuk@gmail.com> Co-authored-by: George Stephanis <georgestephanis@automattic.com> Co-authored-by: Elio Rivero <eliorivero@gmail.com> Co-authored-by: Derek Smart <smart@automattic.com>
Cherry-picked to |
#### Changes proposed in this Pull Request: Follow-up from #10611 #### Testing instructions: * none #### Proposed changelog entry for your changes: * none
public static function dismiss( WP_REST_Request $request ) { | ||
return self::add_to_dismissed_hints( $request['hint'] ) | ||
? rest_ensure_response( array( 'code' => 'success' ) ) | ||
: new WP_Error( 'not_dismissed', esc_html__( 'The card could not be dismissed', 'jetpack' ), array( 'status' => 400 ) ); |
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.
Translators were asking what type of card this is. Please add a context or a translator comment to clarify.
This adds a super super ugly/rough proof of concept of making suggestions when people search for functionality that Jetpack already provides.
We've seen that people with Jetpack installed and activated often search for Jetpack features (even by name) in the Plugins > Add New screen in wp-admin. This new module attempts to spot those searches, and provide an artificial search result that calls out that what they're looking for is in Jetpack, which they already have, and which is already active.
This code is definitely not ready for prime time; it should hook into our existing search terms for settings search, should use better descriptions etc, needs to use real plugin data vs the hardcoded bits I used, and needs to make it really clear that this is an artificial search result, not something coming from the plugin directory directly.
Testing Instructions
Proposed changelog entry