Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirCommerce

Note

AirCommerce was made as an in-house solution to a customer requirement and may not receive updates.
Need something for your team? Reach out at me@addi.lol.
Want to add something? Fork and make a PR!

Sync WooCommerce Memberships data to Airtable with per-field mapping.

AirCommerce is a WordPress plugin that bridges your WooCommerce Memberships store and Airtable, letting you push membership records into any Airtable base on a configurable schedule with full control over which fields get synced and where they land.

Features

  • Per-field mapping -- visually map 21+ WooCommerce Membership fields (name, email, status, billing info, plan details, dates) to any Airtable column
  • Three sync modes -- real-time (on membership create/update/delete), scheduled batch (15min / 30min / hourly / daily), and manual full sync
  • Encrypted API key storage -- your Airtable token is encrypted at rest with AES-256-CBC using your site's AUTH_KEY
  • Smart batching -- automatically chunks records into groups of 10 per Airtable's API limits, with rate-limit handling and 429 retry logic
  • Upsert support -- configurable merge key ensures existing Airtable records are updated rather than duplicated
  • Admin logging -- color-coded sync log with summary cards showing last sync time, total memberships, and next scheduled run
  • Zero external dependencies -- no Composer, no npm, no build step. Drop it in and go.

Requirements

Requirement Version
WordPress 5.8+
PHP 7.4+ (with OpenSSL)
WooCommerce 5.0+
WooCommerce Memberships Required (active)
Airtable account Personal Access Token

Installation

  1. Copy the aircommerce/ folder into wp-content/plugins/
  2. Activate AirCommerce from the WordPress Plugins page
  3. The plugin automatically creates its log table and registers its cron schedule on activation

Configuration

  1. Go to AirCommerce > Settings in the WordPress admin sidebar
  2. Enter your Airtable Personal Access Token and click Test Connection
  3. Select a Base and Table from the dropdowns
  4. Choose a sync frequency
  5. Navigate to AirCommerce > Field Mapping
  6. Enable the fields you want to sync and map each one to an Airtable column
  7. Select a merge key (the unique field used for upsert matching)
  8. Optionally trigger an immediate sync from AirCommerce > Sync Log

Available Fields

Category Fields
Membership membership_id, user_id, user_email, first_name, last_name, display_name, plan_name, plan_id, plan_slug, status, start_date, end_date, cancelled_date, paused_date
Billing billing_phone, billing_city, billing_state, billing_postcode, billing_country, billing_company, billing_address_1, billing_address_2

Project Structure

aircommerce/
├── aircommerce.php                # Plugin entry point & bootstrap
├── uninstall.php                  # Cleanup on plugin deletion
├── includes/
│   ├── class-aircommerce.php      # Core singleton, wires up all components
│   ├── class-admin.php            # Admin pages, settings UI, AJAX handlers
│   ├── class-airtable-client.php  # Airtable REST API client
│   ├── class-field-mapper.php     # WooCommerce <-> Airtable field mapping
│   ├── class-logger.php           # Custom DB table logger
│   ├── class-membership-data.php  # WooCommerce Membership data extraction
│   └── class-sync-engine.php      # Sync orchestration (real-time, batch, manual)
└── assets/
    ├── css/admin.css              # Admin styles
    └── js/admin.js                # Admin JavaScript

How It Works

Real-time sync hooks into WooCommerce Memberships events (wc_memberships_user_membership_saved, status changes, and trashed posts) to push changes to Airtable as they happen.

Batch sync runs on WP-Cron at your chosen interval, picking up any memberships modified since the last run and syncing them incrementally.

Manual sync processes all memberships in your store in a single operation, triggered from the admin UI.

All sync operations use Airtable's upsert API with your configured merge key, so records are matched and updated rather than duplicated.

Uninstall

When the plugin is deleted through WordPress (not just deactivated), uninstall.php cleans up all stored options, transients, cron schedules, and drops the custom log table.

License

GPL-2.0-or-later

Author

Addison LeClair

About

Sync WooCommerce Subscriptions to Airtable bases

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages