Skip to content

Conversation

@jaclync
Copy link
Contributor

@jaclync jaclync commented Jul 24, 2025

Part 3 of WOOMOB-913

Just one review is required.

Description

This is part 3 of the effort to replace plugin matching by name with plugin file name matching. It uses the centralized Plugin enum hiding the file name matching implementation.

Key Changes

  1. Enhanced Plugin enum: Added new plugin cases (blaze, PayPal, etc.) and two new initializers with unit tests
  2. Updated plugin matching logic: Refactored most remaining use cases to use the Plugin enum instead of string plugin name matching

This change improves the reliability of plugin detection for merchants and provides a more robust foundation for future plugin-related features.

Testing steps

Please feel free to pick up one or more of the test cases below.

Testing information

Testing one of the states for each case is fine.

  1. Analytics Hub - Plugin-Dependent Cards

WooCommerce Product Bundles Plugin

  • Test Active State:
    • Install and activate WooCommerce Product Bundles plugin
    • Navigate to dashboard > View all store analytics
    • Expected: Product Bundles analytics card should be visible and functional
  • Test Inactive State:
    • Deactivate (but keep installed) WooCommerce Product Bundles plugin
    • Navigate to dashboard > View all store analytics
    • Expected: Product Bundles analytics card should be hidden/disabled

WooCommerce Gift Cards Plugin

  • Test Active State:
    • Install and activate WooCommerce Gift Cards plugin
    • Navigate to dashboard > View all store analytics
    • Expected: Gift Cards analytics card should be visible and functional
  • Test Inactive State:
    • Deactivate WooCommerce Gift Cards plugin
    • Navigate to dashboard > View all store analytics
    • Expected: Gift Cards analytics card should be hidden/disabled

Google Listings and Ads Plugin

  • Test Active State:
    • Install and activate Google Listings and Ads plugin
    • Navigate to dashboard > View all store analytics
    • Expected: Google Campaigns analytics card should be visible
  • Test Inactive State:
    • Deactivate Google Listings and Ads plugin
    • Navigate to dashboard > View all store analytics
    • Expected: Google Campaigns analytics card should be hidden
  1. Product Filter

WooCommerce Subscriptions Plugin

  • Test Active State:
    • Install and activate WooCommerce Subscriptions plugin
    • Navigate to Products → Filter > Product Type
    • Expected: "Subscription" product types should be available
  • Test Inactive State:
    • Deactivate WooCommerce Subscriptions plugin
    • Navigate to Products → Filter > Product Type
    • Expected: "Subscription" product type should show as "Explore" with promote URL

WooCommerce Product Bundles Plugin

  • Test Active State:
    • Install and activate WooCommerce Product Bundles plugin
    • Navigate to Products → Filter > Product Type
    • Expected: "Bundle" product type should be available
  • Test Inactive State:
    • Deactivate WooCommerce Product Bundles plugin
    • Navigate to Products → Filter > Product Type
    • Expected: "Bundle" product type should show as "Explore"
      with promote URL

WooCommerce Composite Products Plugin

  • Test Active State:
    • Install and activate WooCommerce Composite Products plugin
    • Navigate to Products → Filter > Product Type
    • Expected: "Composite" product type should be available
  • Test Inactive State:
    • Deactivate WooCommerce Composite Products plugin
    • Navigate to Products → Filter > Product Type
    • Expected: "Composite" product type should show as "Explore" with promote URL
  1. Product Password Feature

WooCommerce Version Requirements

  • Test Version 8.1.0+:
    • Ensure WooCommerce plugin is active with version 8.1.0 or higher
    • Edit a product → Product Settings → Visibility
    • Expected: Password protection options should be available via mobile app
  • Test Version Below 8.1.0:
    • Downgrade WooCommerce to version below 8.1.0 (if possible in test environment)
    • Edit a product → Product Settings → Visibility
    • Expected: Should fall back to legacy password handling
  1. Blaze Plugin Integration

Note: I had to comment out some checks in BlazeEligibilityChecker.checkSiteEligibility to reach the Blaze plugin check.

  • Site with Blaze plugin & not Jetpack plugin (which already includes Blaze feature):
    • Expected: the dashboard should have a Blaze card (edit the cards to see the option)
  • Site without Blaze & Jetpack plugin:
    • Expected: the dashboard should not have a Blaze card
  1. Jetpack Plugin Integration

Jetpack plugin state

  • Site with Jetpack plugin:
    • Expected: no Jetpack installation banner
  • Site without Jetpack plugin:
    • Expected: Jetpack installation banner in the dashboard

Screenshots

product filter analytics hub
Simulator Screenshot - iPad (A16) - 2025-07-24 at 11 35 21 Simulator Screenshot - iPad (A16) - 2025-07-24 at 15 19 47

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 24, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr15947-aaf186f
Version22.8
Bundle IDcom.automattic.alpha.woocommerce
Commitaaf186f
Installation URL6nabc7h2bnjlg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jaclync jaclync added the type: technical debt Represents or solves tech debt of the project. label Jul 24, 2025
@jaclync jaclync added this to the 22.9 milestone Jul 24, 2025
@jaclync jaclync modified the milestones: 22.9, 23.0 Jul 24, 2025
@jaclync jaclync requested review from iamgabrielma and staskus July 24, 2025 19:40
Copy link
Contributor

@staskus staskus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good 👍

I picked a few random plugins to confirm the functionality:
✅ Bundles
✅ Gift cards
✅ Blaze
✅ Subscriptions

}

private extension ProductPasswordEligibilityUseCaseTests {
func insertWooCommercePlugin(version: String, active: Bool) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jaclync jaclync merged commit 8f77c38 into trunk Jul 25, 2025
26 of 29 checks passed
@jaclync jaclync deleted the backlog/WOOMOB-913-part-3-replace-plugin-matching-by-name branch July 25, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: technical debt Represents or solves tech debt of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants