Skip to content

WP-CLI --url flag conflict in AnalyticsCommand (gsc inspect_url, pagespeed) #492

@saraichinwag

Description

@saraichinwag

Bug

WP-CLI's global --url parameter (used for multisite site switching) takes priority over the command's --url flag in AnalyticsCommand.php. When running:

wp datamachine analytics gsc inspect_url --url=https://example.com

WP-CLI consumes --url before the command sees it, so the URL never reaches the ability input.

Affected actions

  • gsc inspect_url--url flag (line 46)
  • gsc get_sitemap / submit_sitemap--sitemap-url is fine (no conflict)
  • pagespeed analyze/performance/opportunities--url flag (line 222)

Fix

Rename --url to --inspect-url in the GSC subcommand and --page-url in the PageSpeed subcommand. Update docblocks, examples, and the map_optional mapping accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions