Skip to content

Fatal because --exclude does not exclude for version request with --all #412

Closed as not planned
@kkmuffme

Description

@kkmuffme

Bug Report

Describe the current, buggy behavior

wp theme update --all --exclude=foo
wp plugin update --all --exclude=foo

ParseThemeNameInput::check_optional_args_and_all (same for plugin) will try to get update info via themes_api for all themes/updates even the excluded ones.
This is a problem if the theme/plugin is excluded because it will make the updater crash e.g. if it hooks onto filter themes_api_args in the themes_api function, which leads to nothing getting updated
(since the add_filter function has a fatal error)

Describe what you would expect as the correct outcome

Don't check excluded plugins/themes for newer version/updates.

Let us know what environment you are running this on

WP CLI 2.10.0

Provide a possible solution

Change check_optional_args_and_all to skip excluded in $all case?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions