Rug Simple
Rug Simple is a WordPress plugin for importing rug product data from a third-party API into WooCommerce. It creates WooCommerce products, maps rug attributes into product meta and taxonomies, imports product images, supports rental/sale product behavior, and provides admin tools for API client setup, product import, and import logs.
by Asif Rasheed · github.com/asifrasheedprovelopers/rug-simple
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/asifrasheedprovelopers/rug-simple/archive/refs/heads/master.zipReadme
Rug Simple
Rug Simple is a WordPress plugin for importing rug product data from a third-party API into WooCommerce. It creates WooCommerce products, maps rug attributes into product meta and taxonomies, imports product images, supports rental/sale product behavior, and provides admin tools for API client setup, product import, and import logs.
Requirements
- WordPress
- WooCommerce
- PHP with standard WordPress HTTP and media functions enabled
- A third-party Rug API base URL
- A valid customer email/API client for the Rug API
Optional integrations:
- Contact Form 7, for rental inquiry forms
- Gravity Forms, for pre-populating product SKU fields
- WOOF/HUSKY product filters, for heading tag customization
Installation
-
Copy the
rug-simplefolder intowp-content/plugins/. -
Add the Rug API base URL to
wp-config.php:define('RUG_BASEURL', 'https://your-api-base-url.com'); -
Activate Rug Simple from Plugins in WordPress admin.
-
Go to Rug Settings and enter the customer email address.
-
Click Create Client to create/validate the API client.
-
Set the product import limit and optional skip value.
-
Click Import Products to import products into WooCommerce.
Features
- Creates simple WooCommerce products from Rug API data.
- Imports product title, description, SKU, regular price, sale price, dimensions, weight, stock data, taxable status, dates, and custom rug metadata.
- Downloads product images into the WordPress Media Library and sets featured/gallery images.
- Creates and assigns WooCommerce categories, product tags, and rug-specific taxonomies.
- Supports rental, sale, and rental-plus-sale product categorization.
- Adds rental inquiry behavior and rental pricing display on product pages.
- Adjusts add-to-cart behavior for rental-only and mixed rental/sale products.
- Adds a Rug Product Category column to the WooCommerce products list.
- Runs a daily WordPress cron task to fetch API updates and insert/update products.
- Stores import logs in
wp-content/rug-import-logs.log. - Provides an Import Logs admin page with a clear-log action.
Custom Taxonomies
The plugin registers these taxonomies for WooCommerce products:
rug_designrug_typerug_colorrug_sizerug_shaperug_patternrug_product_typerug_product_categoryrug_construction_typerug_country_originrug_collection
It also adds index routes for taxonomy landing pages such as /design/, /rug-type/, /color/, /size/, /shape/, /pattern/, /construction/, /country/, /rug-product-category/, and /collection/.
Settings
The Rug Settings page includes:
- Customer email address
- Create Client action
- Delete Client action
- Product import limit
- Product skip value
- Product import action
- Sale/rental display options
- Rug size display format
- Contact form shortcode for rental product pages
Scheduled Updates
On activation, the plugin schedules the rugs_update_products cron event to run daily. The cron job:
- Fetches all products from the API with pagination.
- Compares API update timestamps against existing WooCommerce products.
- Updates changed products.
- Inserts new products.
- Logs the import summary.
The cron event is unscheduled when the plugin is deactivated.
Notes
- The plugin requires
RUG_BASEURL; without it, the plugin shows an admin notice on the Rug Settings page. - Imported products are matched by SKU using the API
IDvalue. - Products without required data, product category, or images are skipped and logged.
- API tokens are stored in WordPress options and refreshed automatically when expired.
License
GPL-2.0+