Skip to content
Back to skills

Woocommerce Product Image Optimizer

ASecurity

When the user wants to optimize WooCommerce product images based on sales performance data, particularly for variable products with multiple variations. This skill analyzes order history to identify the best-selling variation for each product and automatically updates the main product image to showcase the most popular option. It handles fetching products and orders data, analyzing sales patterns, identifying variation popularity, and updating product images through WooCommerce API. Use when ...

  • 8 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 6, 2026
businessapiperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add zjunlp/Skills --skill woocommerce-product-image-optimizer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Woocommerce Product Image Optimizer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Woocommerce Product Image Optimizer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zjunlp-woocommerce-product-image-optimizer/badge)](https://www.skillsdirectory.com/skills/zjunlp-woocommerce-product-image-optimizer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: woocommerce-product-image-optimizer
description: When the user wants to optimize WooCommerce product images based on sales performance data, particularly for variable products with multiple variations. This skill analyzes order history to identify the best-selling variation for each product and automatically updates the main product image to showcase the most popular option. It handles fetching products and orders data, analyzing sales patterns, identifying variation popularity, and updating product images through WooCommerce API. Use when users mention 'best-selling variation', 'update main product image based on sales', 'product image optimization', or need to align product visuals with customer preferences based on order data.
---
# WooCommerce Product Image Optimizer

## Overview
This skill analyzes WooCommerce order data to identify the best-selling variations for variable products and updates the main product image to showcase the most popular option. This data-driven approach helps improve conversions by aligning product visuals with customer preferences.

## Prerequisites
- WooCommerce API access with appropriate permissions
- Variable products with variations that have distinct images
- Order history data (completed/processing orders)

## Workflow

### 1. Gather Data
- Fetch all published variable products using `woocommerce-woo_products_list`
- Fetch recent orders (completed/processing) using `woocommerce-woo_orders_list`
- For each variable product, fetch its variations using `woocommerce-woo_products_variations_list`

### 2. Analyze Sales Data
- Parse order line items to extract variation sales data
- Count total units sold per variation
- Identify the best-selling variation for each parent product
- Map variation IDs to their corresponding image data

### 3. Update Product Images
- For each product with a best-selling variation:
  - Extract the variation's image ID and URL
  - Update the parent product's main image using `woocommerce-woo_products_update`
  - Set the images array to contain only the best-selling variation's image

## Key Considerations
- Only processes variable products (type: "variable")
- Considers both "completed" and "processing" order statuses
- Handles multiple quantity purchases in orders
- In case of tie in sales, the first variation with highest sales will be selected
- The update replaces all existing product images with the single best-selling variation image

## Error Handling
- Skip products without variations
- Skip variations without images
- Log any API errors during updates
- Continue processing other products if one fails

## Output
- Summary table showing product updates
- Confirmation of successful image changes
- Details of best-selling variations and units sold

Files in this skill

  • SKILL.md2.7 KB
  • references/woocommerce_api_guide.md359 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.