Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Remove Classic Editor from Top Free Plugins #65459

Closed ianstewart closed 2 years ago

ianstewart commented 2 years ago

If we're featuring our top free plugins, we should curate the list, and feature Classic Editor less prominently in the list.

image

cpapazoglou commented 2 years ago

@gcsecsey using ES can we exclude specific plugins from category searches?

gcsecsey commented 2 years ago

@cpapazoglou we have a ticket where we will implement categories based on categories/tags/taxonomies that are indexed: https://github.com/Automattic/wp-calypso/issues/63167 I'd add this ticket as a follow-up to that because we'll need to see which source cats/tags can we use from both WPORG and WCCOM.

Without ES

At the moment, the issue of serving categories from ES is planned for a later phase, because we don't yet have even a working MVP for categories, just the search pages. As this issue is considered a bug, I think we should also come up with a temporary solution to blacklist/hide these plugins in Calypso.

With ES

We can maintain a blacklist of plugin IDs or plugin slugs, either globally or by category. Then we can add a filter to the ES query to filter out the blacklisted products.

Kibana example

Featured plugins from WPORG

GET jetpack-search-20/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "blog_id": {
              "value": "108986944"
            }
          }
        },
        {
          "term": {
            "taxonomy.plugin_section.slug": "featured"
          }
        }
      ]
    }
  },
  "fields": [
    "title_html", "slug"
  ],
  "_source": false
}

Featured plugins without the Classic Editor

GET jetpack-search-20/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "blog_id": {
              "value": "108986944"
            }
          }
        },
        {
          "term": {
            "taxonomy.plugin_section.slug": "featured"
          }
        }
      ],
      "must_not": [
        {
          "term": {
            "slug": {
              "value": "classic-editor"
            }
          }
        }
      ]
    }
  },
  "fields": [
    "title_html", "slug"
  ],
  "_source": false
}
cpapazoglou commented 2 years ago

Can we easily make such modifications from Calypso?

gcsecsey commented 2 years ago

Yes, we can definitely filter the results from the client side. My only concern with this would be overfetching, because we'd need to fetch results which won't be ultimately used. However, the current solution uses the default page size of 24 on WPORG.

CleanShot 2022-10-11 at 15 01 05@2x

Since we know that we'll only display 6 results on the section, we can still safely lower this, considering that some results will be filtered on the client.

cpapazoglou commented 2 years ago

Yes, we can definitely filter the results from the client side.

By client side, I meant altering the ES query which should respect the pagination - not a JS filter function.

gcsecsey commented 2 years ago

Oh I see, I thought you meant it as a temporary solution until these results are served through ES. It's a good point, after https://github.com/Automattic/wp-calypso/issues/63167 is released, we can update the filters from Calypso! 👍

gcsecsey commented 2 years ago

Diff raised: D90153-code

gcsecsey commented 2 years ago

Changes deployed in r254691-wpcom