Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Support Plugin Previews in the .org Plugin Directory #885

Closed

Description

@joemcgill

Feature Description

The WP.org Meta team just announced the relaunching of the plugin preview feature, whereby people can try out the plugin in a sandbox using WP Playground before installing. This is pretty cool, but requires plugin devs to opt-in. Here's the post with the details:

https://make.wordpress.org/meta/2023/11/22/plugin-directory-preview-button-revisited/

We should consider adding opt in to Performance Lab and for the standalone plugins.

Activity

  1. added
    Miscellaneous
    on Nov 22, 2023
  2. added this to the PL Plugin 2.8.0 milestone on Nov 22, 2023
  3. swissspidy commented on Nov 27, 2023

    @swissspidy
    Member

    Should be trivial to add in theory, but I don't think it adds any value.

    • The Health Check integrations are useless because Site Health is disabled in Playground.
    • WebP does not seem to be supported, so JPEG-> WebP conversion doesn't work
    • Dominant color is hard to test as a user
  4. mukeshpanchal27 commented on Nov 28, 2023

    @mukeshpanchal27
    Member

    I concur with @swissspidy. The opt-in feature seems to lack value as many of its functionalities are either disabled or non-operational within the playground environment. I conducted tests on it here: playground.wordpress.net/?plugin=performance-lab.

    Could we initiate an issue on the playground to incorporate support for WebP? Additionally, I'm curious to know why the dominant color functionality isn't working on it 🤔.

  5. removed their assignment
    on Nov 28, 2023
  6. felixarntz commented on Nov 28, 2023

    @felixarntz
    Member

    @swissspidy @mukeshpanchal27 Regardless of the actual feature limitations, wouldn't it still be nice to have a preview available that by default leads to the Settings > Performance admin screen? That at least shows folks what the concept behind this plugin is and which features are provided without reading through the readme (individual performance features).

    My only concern is: In Playground the WebP module allows to be activated. Shouldn't it show as disabled with a message if WebP is not supported by the server environment? We should probably implement such a check for the module / plugin.

  7. joemcgill commented on Nov 28, 2023

    @joemcgill
    MemberAuthor

    I think value is a fair question. Personally, I'm also interested in being able to spin up a preview and play with server timing in this environment, but I guess it would be no different than running my own Playground instance locally, since WP is just running inside my local browser (which is still mind boggling).

    Otherwise, I think it's being a good citizen of the community to include this feature on our plugins for visibility.

  8. swissspidy commented on Nov 28, 2023

    @swissspidy
    Member

    Regardless of the actual feature limitations, wouldn't it still be nice to have a preview available that by default leads to the Settings > Performance admin screen? That at least shows folks what the concept behind this plugin is and which features are provided without reading through the readme (individual performance features).

    If looking at the settings screen is deemed helpful, why don't we add screenshots to the plugins page first?

    Right now the Preview feature isn't public anyway, so this is not urgent.

  9. felixarntz commented on Nov 28, 2023

    @felixarntz
    Member

    @swissspidy

    If looking at the settings screen is deemed helpful, why don't we add screenshots to the plugins page first?

    It's not very maintainable and risks having outdated screenshots in the repo. The available modules change, and right now we're even reworking the screen as a whole. Having to update the screenshot is a manual task I think we can avoid, with that preview serving that use-case in an easier and more comprehensive way.

    Right now the Preview feature isn't public anyway, so this is not urgent.

    I thought it was once opted in?

  10. swissspidy commented on Nov 28, 2023

    @swissspidy
    Member

    IIUC once you add a blueprint, plugin committers can see the preview bit it‘s still not live.

    Adding a blueprint for the preview is trivial. If y‘all think it doesn‘t hurt to have a not-so-useful preview, let‘s just add it.

  11. felixarntz commented on Nov 28, 2023

    @felixarntz
    Member

    I'd say +1 to add a blueprint pointing to Settings > Performance.

    My only additional thought is that we should implement a check to indicate when WebP is not supported. It's a separate problem though, so we could also open a separate blocking issue for it, if you prefer.

  12. swissspidy commented on Nov 29, 2023

    @swissspidy
    Member

    It's a separate problem though, so we could also open a separate blocking issue for it, if you prefer.

    +1 to a separate issue, as I don't know how much effort is required to investigate it. I wouldn't consider it blocking though because it's not. The preview is still not fully live after all.

    A minimal blueprint in .wordpress-org/blueprint.json could look like this:

    {
      "$schema": "https://playground.wordpress.net/blueprint-schema.json",
      "landingPage": "\/wp-admin\/admin.php?page=perflab-modules",
      "phpExtensionBundles": [
        "kitchen-sink"
      ],
      "steps": [
        {
          "step": "login",
          "username": "admin",
          "password": "password"
        },
        {
          "step": "installPlugin",
          "pluginZipFile": {
            "resource": "wordpress.org\/plugins",
            "slug": "performance-lab"
          },
          "options": {
            "activate": true
          }
        },
        {
          "step": "setSiteOptions",
          "options": {
            "perflab_modules_settings": "a:2:{s:28:\"images/dominant-color-images\";a:1:{s:7:\"enabled\";b:1;}s:19:\"images/webp-uploads\";a:1:{s:7:\"enabled\";b:1;}}"
          }
        }
      ]
    }

    This installs the plugin and enables the WebP Uploads and Dominant Color Images modules.

    Note: we could add wp-now as a dev dependency too for easier local testing, but for that we would need to bump our archaic node version requirement.

    As for the Site Health modules, I suggest adding can-load.php files to disable them when Site Health is disabled. This should suffice:

    return static function () {
    	return current_user_can( 'view_site_health_checks' );
    };
  13. mukeshpanchal27 commented on Nov 29, 2023

    @mukeshpanchal27
    Member

    If we add can-load.php then it will show message like: X Health Check is already part of your WordPress version and therefore cannot be loaded as part of the plugin. so it may be misguide the user. WDYT?

    When we disable the site health checks, when it disabled then we don't need setSiteOptions step.

  14. swissspidy commented on Nov 29, 2023

    @swissspidy
    Member

    Ah, didn't see the message. That's not great then. I was just looking for a way to disable the checkbox, as it doesn't make sense to show it in that case.

  15. felixarntz commented on Nov 29, 2023

    @felixarntz
    Member

    @mukeshpanchal27 @swissspidy I think despite the limitations of the Playground environment, it would be beneficial to have preview access to our Settings > Performance page.

    For WebP Uploads, it is already indicated that this module will only work if the server supports it. It's not great that Playground doesn't support it, but IMO not a blocker to enabling the preview.

    For the Site Health checks, this is a bit more frustrating, as it affects several modules. Two things regarding your above explorations:

    • I think it would be straightforward to enhance our can-load.php infrastructure so that those callbacks could optionally return a WP_Error object with a custom message. Then we could display that instead of the default, which would fix the concern about the inaccurate message.
    • While it works here, I don't think we should rely on a capabilities check to block module activation, as capabilities are user-specific but modules aren't. How concretely does Playground disable Site Health? While much more specific, I would be in favor of checking for that specifically (e.g. a certain filter callback added, or whichever approach it uses).
  16. swissspidy commented on Nov 29, 2023

    @swissspidy
    Member
    • How concretely does Playground disable Site Health? While much more specific, I would be in favor of checking for that specifically (e.g. a certain filter callback added, or whichever approach it uses).

    Playground patches default-filters.php to remove the add_filter( 'user_has_cap', 'wp_maybe_grant_site_health_caps', 1, 4 ); line.

    So we could also check has_filter( 'user_has_cap', 'wp_maybe_grant_site_health_caps' ); instead.

  17. swissspidy commented on Dec 8, 2023

    @swissspidy
    Member

    Previews are now available on an opt-in basis, see https://make.wordpress.org/meta/2023/12/08/plugin-previews-are-now-available-for-opt-in/

    So after the next plugin release someone needs to turn it on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Miscellaneous

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions