Bulk Credentials Page
Efficiently manage API credentials for multiple sites simultaneously, ideal for initial setup or credential rotation across your site portfolio.
Overview
The Bulk Credentials page provides a spreadsheet-style interface for entering or updating API credentials for all sites at once. Instead of visiting each site individually in the Site Management page, you can:
- View all sites in one table
- Update multiple credentials simultaneously
- Process changes in efficient batches (10 sites at a time)
- Only update sites where credentials actually changed
Access: GSM Middleware → Bulk Credentials (menu position 12)
Permission Required: manage_gsm_middleware
Use Cases:
- Initial setup: Enter credentials for 10+ new sites
- Credential rotation: Update tokens after security policy change
- Platform migration: Switch from old API keys to new OAuth tokens
- Audit: Review which sites have credentials configured
Interface Overview
Page Header
Title: "Bulk Credential Entry"
Description: "Enter API credentials for multiple sites at once. Leave fields blank for sites you don't want to update."
Site Tables
Sites are organized into two separate tables by platform:
- BigCommerce Sites — All sites with
platform = 'bigcommerce' - WooCommerce Sites — All sites with
platform = 'woocommerce'
Each table shows site count in header: "BigCommerce Sites (15)"
BigCommerce Sites Table
Displayed when: One or more BigCommerce sites exist
Columns
| Column | Description | Example |
|---|---|---|
| Site | Site ID and name | #5 My Store |
| Client ID | OAuth API client ID | abcd1234efgh5678 |
| Access Token | OAuth access token | xyz789abc456def... |
Field Specifications
Client ID:
- Format: Alphanumeric string (16-32 characters typical)
- Placeholder: "Enter Client ID"
- Where to find: BigCommerce → Settings → API → Store-level API accounts
- Example:
abcd1234efgh5678
Access Token:
- Format: Long alphanumeric string (64+ characters typical)
- Placeholder: "Enter Access Token"
- Where to find: Generated when creating API account in BigCommerce
- Example:
a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6...
Security Note: Tokens are one-time display in BigCommerce. Copy immediately or regenerate if lost.
WooCommerce Sites Table
Displayed when: One or more WooCommerce sites exist
Columns
| Column | Description | Example |
|---|---|---|
| Site | Site ID and name | #12 WC Store |
| Consumer Key | REST API consumer key | ck_1234567890abc... |
| Consumer Secret | REST API consumer secret | cs_9876543210xyz... |
Field Specifications
Consumer Key:
- Format: Starts with
ck_, followed by 40+ alphanumeric characters - Placeholder: "ck_..."
- Where to find: WooCommerce → Settings → Advanced → REST API → Add key
- Example:
ck_1234567890abcdef1234567890abcdef12345678
Consumer Secret:
- Format: Starts with
cs_, followed by 40+ alphanumeric characters - Placeholder: "cs_..."
- Where to find: Generated alongside consumer key
- Example:
cs_9876543210zyxwvu9876543210zyxwvu98765432
Permissions: Recommend "Read/Write" permissions for full sync capability.
Saving Changes
Save All Changes Button
Location: Bottom of page
Button text: "Save All Changes" (or "Saving..." when processing)
Button style: Primary (blue)
Behavior:
- Compares current values against original values (from initial page load)
- Identifies sites with changed credentials only
- Processes updates in batches of 10 to avoid overwhelming server
- Shows progress message: "Processing batch 2 of 5 (10 sites)..."
- Displays final results with success/error count
Save Process Details
Change Detection:
- Only sites with modified credentials are updated
- If all fields unchanged → Shows info message: "No changes detected"
- Partial changes supported (e.g., only update Client ID, leave token unchanged)
Batch Processing:
- Updates sent in parallel batches of 10 sites
- Prevents timeout on large site portfolios (50+ sites)
- Shows progress for each batch
- Continues even if some sites fail
Success Message:
✓ Successfully saved credentials for 25 site(s). 25 sites updated.
Error Message:
Saved 23 sites, but 2 failed:
Site #5 (Store A): Invalid client ID format
Site #12 (Store B): Unauthorized - check token permissions
Common Workflows
Initial Setup: Adding Credentials for New Sites
Goal: Configure API access for 15 newly added sites
Steps:
- Navigate to Bulk Credentials page
- Prepare credential spreadsheet:
- Export list of site names/IDs
- Collect API credentials from each platform
- Organize in Excel/CSV for easy copy-paste
- For each BigCommerce site:
- Copy Client ID from spreadsheet
- Paste into "Client ID" column
- Copy Access Token
- Paste into "Access Token" column
- Repeat for WooCommerce sites (Consumer Key/Secret)
- Click "Save All Changes"
- Wait for success message: "Successfully saved credentials for 15 site(s)"
- Verify: Go to Site Management → click any site → verify credentials saved
Time savings: ~2 minutes vs. 20+ minutes updating sites individually
Credential Rotation: Updating Tokens After Security Breach
Goal: Replace all compromised API tokens organization-wide
Steps:
- Generate new credentials for all sites:
- BigCommerce: Create new API accounts, delete old ones
- WooCommerce: Regenerate REST API keys
- Navigate to Bulk Credentials page
- For each site, paste only the new token (leave Client ID/Consumer Key unchanged if not compromised)
- Click "Save All Changes"
- Monitor results for any failures
- Test sync on 1-2 sites to verify new credentials work
- Critical: Delete old credentials from platforms immediately after confirming new ones work
Security best practice: Rotate credentials quarterly or after any suspected compromise.
Audit: Reviewing Credential Status
Goal: Identify which sites have missing or incomplete credentials
Steps:
- Navigate to Bulk Credentials page
- Review tables:
- Blank fields = No credentials configured
- Partially filled rows = Incomplete setup (e.g., Client ID but no token)
- Filled rows = Credentials configured
- Document findings:
- Site #5: Missing BigCommerce token
- Site #12: No WooCommerce credentials at all
- Fix issues:
- Enter missing credentials directly in table
- Or go to Site Management for more detailed configuration
- Save and verify
Frequency: Run quarterly audit to catch configuration drift
Bulk Update After Platform Migration
Goal: Update all sites after switching from API v2 to v3 credentials
Scenario: BigCommerce deprecates old API format, requires OAuth
Steps:
- Generate new OAuth credentials for all BigCommerce sites
- Export list: Site ID, Name, New Client ID, New Token
- Navigate to Bulk Credentials page
- Paste all new credentials into BigCommerce table
- Click "Save All Changes"
- Wait for batch processing to complete
- Check for errors (some sites may have API account limits)
- Test sync on few sites to verify migration successful
- Monitor sync health checks for 24-48 hours
Rollback plan: Keep old credentials for 1 week in case revert needed
Partial Update: Fixing Failed Sites
Goal: Update credentials for 3 sites that failed during previous batch save
Steps:
- Note error message from previous save:
Site #5 (Store A): Invalid client ID format
Site #12 (Store B): Unauthorized - check token permissions
Site #18 (Store C): Network timeout - Navigate to Bulk Credentials page
- Only modify failed sites:
- Site #5: Correct Client ID format (remove whitespace)
- Site #12: Generate new token with proper permissions
- Site #18: Re-enter same credentials (network issue, not credential issue)
- Click "Save All Changes"
- Should show: "Successfully saved credentials for 3 site(s)"
Efficiency: No need to re-save working sites
Technical Details
API Endpoints
Load Sites:
- GET
/wp-json/gsm-middleware/v1/sites - Returns all sites with current credential values (masked)
Update Site Credentials:
- PUT
/wp-json/gsm-middleware/v1/sites/{site_id} - Body:
{ bc_client_id, bc_auth_token, wc_consumer_key, wc_consumer_secret } - Returns: Updated site object
Batch Processing:
- Uses
Promise.allSettled()for parallel requests - Batch size: 10 sites per batch
- Continues on partial failure (doesn't stop entire process)
Controller: src/API/Sites_REST_Controller.php
Data Storage
Table: rm_sites
Columns Updated:
| Column | Type | Platform | Encrypted |
|---|---|---|---|
bc_client_id | TEXT | BigCommerce | No |
bc_auth_token | TEXT | BigCommerce | Yes (plugin handles) |
wc_consumer_key | TEXT | WooCommerce | No |
wc_consumer_secret | TEXT | WooCommerce | Yes (plugin handles) |
Encryption: Tokens/secrets are encrypted before database storage using WordPress encryption functions.
Related Documentation:
React Component
Component: assets/js/components/BulkCredentialsPage.jsx
State Management:
sites— All sites from APIcredentials— Current form valuesoriginalCredentials— Initial values (for change detection)loading— Initial load statesaving— Save in progress statemessage— Success/error feedback
Key Features:
- Real-time change detection (compares original vs current)
- Batch processing with progress updates
- Error handling per site (reports which failed and why)
- Auto-masking of existing credentials (shows
•••••••for security)
Security Considerations
Credential Handling
✅ DO:
- Copy credentials directly from source platform (avoid typing manually)
- Use HTTPS for all API communications
- Rotate credentials annually or after suspected compromise
- Limit browser history (use private/incognito mode if concerned)
- Verify SSL certificate valid before entering credentials
❌ DON'T:
- Store credentials in plain text outside WordPress (e.g., Excel files without encryption)
- Share credentials via unencrypted email or chat
- Use same credentials across multiple sites (each site should have unique keys)
- Leave credentials visible on screen when away from desk
- Screenshot credentials for documentation (use placeholder values instead)
Permission Requirements
Who can access:
- Users with
manage_gsm_middlewarecapability - Default: WordPress Administrators only
Who should NOT have access:
- Shop Managers (can view orders but shouldn't manage integrations)
- Editors/Authors (content roles)
- Customers/Subscribers
Audit logging: All credential updates logged in debug.log with user ID and timestamp:
[2024-12-15 10:30:45] GSM Middleware: User #1 updated credentials for site #5
API Key Security Best Practices
For BigCommerce:
- Use store-level API accounts (not app-level)
- Set IP whitelist if server has static IP
- Enable webhook signature validation for incoming webhooks
- Create separate API accounts per environment (dev, staging, prod)
- Delete API account immediately if key compromised
For WooCommerce:
- Use "Read/Write" permissions (not "Read/Write/Delete")
- Enable webhook signature validation
- Use HTTPS for API endpoint (never HTTP)
- Regenerate keys if WooCommerce site migrates to new server/domain
- Monitor API access logs for suspicious activity
Troubleshooting
"No changes detected" When I Changed Values
Cause: Values reverted to original before saving
Solution:
- Make changes again in text fields
- Verify values are different from original (check for extra spaces)
- Click directly in field to ensure it's focused/editable
- Try clicking "Save All Changes" immediately after pasting
Save Fails with "Invalid client ID format"
Cause: Whitespace, invalid characters, or wrong format
Solution:
- Check for leading/trailing spaces (common when copy-pasting)
- Verify format matches platform requirements:
- BigCommerce Client ID: Alphanumeric only
- WooCommerce Consumer Key: Must start with
ck_ - WooCommerce Consumer Secret: Must start with
cs_
- Copy directly from platform (avoid intermediate copy through text editors)
- Remove any line breaks or special characters
Some Sites Save, Others Fail
Cause: Individual site issues (permissions, format, network)
Solution:
- Read error message carefully - identifies which sites failed and why
- Fix only the failed sites (leave successful ones unchanged)
- Click "Save All Changes" again - only failed sites will re-process
- If site repeatedly fails:
- Go to Site Management page
- Update that site individually (provides more detailed error messages)
- Verify credentials work by testing API connection
"Network timeout" During Batch Processing
Cause: Server timeout on large batches or slow network
Solution:
- Reduce number of sites updated at once:
- Update BigCommerce sites first (click Save)
- Then update WooCommerce sites separately
- Increase PHP timeout in
wp-config.php:define( 'WP_TIMEOUT', 120 ); - Check server logs for PHP max_execution_time errors
- Contact hosting provider if timeout persists (may need server configuration change)
Credentials Save But Sync Still Fails
Cause: Credentials saved but invalid/incorrect
Solution:
- Verify credentials in source platform:
- BigCommerce: Settings → API → Store-level API accounts → Verify account active
- WooCommerce: Settings → Advanced → REST API → Check key permissions
- Test API connection from Testing Tools page:
- Run "Test BigCommerce Connection" or "Test WooCommerce Connection"
- Review error message for specific API issue
- Common issues:
- BigCommerce: Wrong store hash, missing OAuth scopes, IP not whitelisted
- WooCommerce: Wrong site URL, HTTPS mismatch, firewall blocking API access
- Regenerate credentials if validation fails consistently
Related Documentation
- Site Management — Detailed per-site configuration
- API Connections — Testing API credentials
- Control Panel — Verify sync status after credential updates
- Database Schema — Credential storage
- Security Best Practices — Credential management guide
Best Practices
- Plan before bulk update — Prepare credential spreadsheet first, then paste all at once
- Test on one site first — Before bulk updating 50 sites, test new credentials on 1-2 sites
- Update during low traffic — Avoid sync disruption by updating credentials during off-peak hours
- Keep old credentials for 24 hours — In case rollback needed due to unforeseen issues
- Document changes — Note date, reason, and number of sites updated in internal changelog
- Verify after save — Check Control Panel health checks to confirm credentials working
- Use private/incognito mode — When entering sensitive credentials to avoid browser history
- Rotate credentials annually — Proactive security measure even if no breach suspected
- Batch by platform — Update all BigCommerce sites together, then all WooCommerce sites
- Monitor for 24-48 hours — Watch sync health and error logs after bulk credential update