Getting Started with Development
Guide for setting up a local development environment for TenPoint Crossbows.
Prerequisites
Required Software
- PHP: 7.2.5 or higher
- Extensions:
allow_url_fopen,cURLwith OpenSSL+zlib,mbstring,mysqli,zip
- Extensions:
- MySQL/MariaDB: 5.6 or higher
- Web Server: Apache or Nginx
- Node.js: 14.x or higher (for asset compilation)
- Composer: Latest version
- Git: For version control
Recommended Tools
- Laravel Herd: Local PHP development environment (currently in use)
- TablePlus/Sequel Pro: Database management
- VS Code: Code editor with PHP and WordPress extensions
- WP-CLI: WordPress command-line interface
Local Environment Setup
Option 1: Laravel Herd (Current Setup)
Location: Z:\Herd\tenpointcrossbows
Herd Configuration:
- Automatic PHP version management
- Built-in web server
- Database management
- SSL support
Access:
- Local URL:
http://tenpointcrossbows.test(or configured domain) - Database: MySQL via Herd's database service
Option 2: Traditional LAMP/MAMP/WAMP Stack
-
Install web server stack:
- Windows: XAMPP, WAMP
- macOS: MAMP, Laravel Valet
- Linux: LAMP stack
-
Configure virtual host:
<VirtualHost *:80>
ServerName tenpoint.local
DocumentRoot "C:/path/to/tenpointcrossbows"
<Directory "C:/path/to/tenpointcrossbows">
AllowOverride All
Require all granted
</Directory>
</VirtualHost> -
Add to hosts file:
127.0.0.1 tenpoint.local
Database Setup
Create Database
CREATE DATABASE wp_tenpoint CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp_tenpoint'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wp_tenpoint.* TO 'wp_tenpoint'@'localhost';
FLUSH PRIVILEGES;
Import Database
# From production export
mysql -u wp_tenpoint -p wp_tenpoint < production-export.sql
# Or use WP-CLI
wp db import production-export.sql
Update Site URLs
# Using WP-CLI
wp search-replace 'https://tenpointcrossbows.com' 'http://tenpoint.local' --all-tables
# Or SQL
UPDATE wp_options SET option_value = 'http://tenpoint.local'
WHERE option_name IN ('siteurl', 'home');
WordPress Configuration
wp-config.php
<?php
// Database credentials
define('DB_NAME', 'wp_tenpoint');
define('DB_USER', 'wp_tenpoint');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', '');
// Security keys (generate at: https://api.wordpress.org/secret-key/1.1/salt/)
define('AUTH_KEY', 'your-unique-key-here');
define('SECURE_AUTH_KEY', 'your-unique-key-here');
define('LOGGED_IN_KEY', 'your-unique-key-here');
define('NONCE_KEY', 'your-unique-key-here');
// ... etc
// WordPress database table prefix
$table_prefix = 'wp_';
// Development mode
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', true);
// Disable caching for development
define('WP_CACHE', false);
// Disable automatic updates
define('AUTOMATIC_UPDATER_DISABLED', true);
// Memory limit
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');
// That's all, stop editing!
require_once ABSPATH . 'wp-settings.php';
Plugin Dependencies
Install Composer Dependencies
Epicor Integration Plugin:
cd wp-content/plugins/tenpoint-epicor-integration
composer install
Tenpoint Integrator:
cd wp-content/plugins/tenpoint-integrator
composer install
Required Plugins
Core Plugins (must be active):
- WooCommerce 4.0+
- Elementor Pro
- Advanced Custom Fields Pro
- Gravity Forms
Custom Rhino Group Plugins:
- suma-blocks
- suma-cross-sells
- suma-dealer-locator
- suma-downloads
- suma-faqs
- suma-videos
- suma-woo-emails
- tenpoint-epicor-integration
- tenpoint-integrator
Payment Gateways:
- woocommerce-ebizcharge-gateway
- woocommerce-paypal-payments
- paytomorrow
Search & Filtering:
- facetwp (+ addons)
- wp-search-with-algolia
Theme Setup
Theme Location
wp-content/themes/elementor/
Install Node Dependencies
cd wp-content/themes/elementor
npm install
Compile Assets
Development Build:
npm run dev
Production Build:
npm run production
Watch Mode (auto-compile on file changes):
npm run watch
Gulp Tasks (if applicable)
# Install Gulp globally
npm install -g gulp-cli
# Run default tasks
gulp
# Watch mode
gulp watch
Epicor Integration Setup
Sandbox Configuration
-
Navigate to: WP Admin → Epicor Integration → Settings
-
Configure Sandbox Environment:
- Epicor URL:
https://sandbox-erp.tenpointcrossbows.com - Instance:
kineticpilot_sandbox - API Version:
v1 - Username:
api_sandbox_user - Password:
sandbox_password - Company Code:
TENPOINT
- Epicor URL:
-
Service Configuration:
- Orders Service:
Erp.BO.SalesOrderSvc - Parts Service:
Erp.BO.PartSvc - Inventory BAQ:
KP-AVAILINV - Revisions BAQ:
KP-REVS
- Orders Service:
-
Feature Toggles:
- ✅ Detailed Logs
- ✅ Send to Epicor (for testing)
- ✅ Change Order Status
- ✅ Disable SSL Verify (sandbox only, if needed)
-
Generate REST API Token:
- Click "Generate New Token" button
- Copy token for external cron testing
-
Test Connection:
- Click "Test Connection" button
- Verify successful connection to sandbox
Test Order Generation
-
Navigate to: Epicor Integration → Tools
-
Generate Test Orders:
- Batch size: 5-10 orders
- Coupon type: (optional) percent or free_shipping
- Click "Generate Orders"
-
Verify Orders Created:
- Go to: WooCommerce → Orders
- Check for new orders with status
wc-processing
-
Test Manual Export:
- Go to: Epicor Integration → Order Sync Logs
- Click "Run Order Sync Now"
- Review log entries for success/errors
External Services Configuration
Development API Keys
PayPal Sandbox:
- Client ID: (from PayPal Developer Dashboard)
- Secret: (from PayPal Developer Dashboard)
- Mode: Sandbox
PayTomorrow Test:
- Merchant ID: (from PayTomorrow)
- API Key: (test credentials)
Bazaar Voice Staging:
// In theme inc/class-bazaar-voice.php
// Use staging token instead of production
Klaviyo Test Account:
- API Key: (test account)
- List ID: (test list)
Algolia Development:
- Application ID: (from Algolia dashboard)
- Search-Only API Key: (public key)
- Admin API Key: (for indexing)
Debug Tools
Enable WordPress Debug Mode
Already configured in wp-config.php (see above).
View Logs:
wp-content/debug.log
Enable Query Monitor
Install Plugin:
wp plugin install query-monitor --activate
Features:
- Database queries (count, time, duplicates)
- HTTP requests
- Hook execution
- Template usage
- PHP errors
WooCommerce Logging
Location: WooCommerce → Status → Logs
Available Logs:
- Payment gateway logs
- Shipping logs
- Fatal errors
Epicor Integration Logs
File Logs: /wp-content/uploads/suma-tenpoint-epicor-integration/
order/{date}.loginventory/{date}.logepicor/{date}.log
Database Logs: WP Admin → Epicor Integration → Order Sync Logs / Inventory Sync Logs
Development Workflow
Typical Development Cycle
- Pull latest code from repository
- Update database (if schema changes)
- Install/update dependencies:
composer install
npm install - Compile assets:
npm run dev - Enable debug mode (wp-config.php)
- Make code changes
- Test locally
- Commit and push to version control
- Deploy to staging for QA
- Deploy to production after approval
Git Workflow
Branches:
main— Production-ready codestaging— Staging environmentdevelop— Development branchfeature/*— Feature branchesbugfix/*— Bug fix branches
Commit Message Format:
type(scope): subject
body (optional)
footer (optional)
Types: feat, fix, docs, style, refactor, test, chore
Example:
feat(epicor): add batch request optimization
Implement OData $batch requests to reduce HTTP calls from 40 to 1 per order export.
Closes #123
Testing
Manual Testing Checklist
E-Commerce Flow:
- Product browsing
- Search functionality
- Faceted filtering
- Add to cart
- Cart updates
- Checkout process
- Payment processing (test mode)
- Order confirmation
Epicor Integration:
- Generate test orders
- Manual order export
- Manual inventory sync
- Review sync logs
- Verify order meta
- Check Epicor sales orders (sandbox)
Theme Features:
- Responsive design (mobile, tablet, desktop)
- Elementor page builder
- Product pages
- Category archives
- Dealer locator
- Video library
- Downloads center
- FAQs
Browser Testing
Required Browsers:
- Chrome (latest)
- Firefox (latest)
- Safari (latest, macOS/iOS)
- Edge (latest)
Responsive Breakpoints:
- Mobile: 320px - 767px
- Tablet: 768px - 1023px
- Desktop: 1024px+
Common Development Tasks
Clear All Caches
# WordPress object cache
wp cache flush
# WooCommerce transients
wp transient delete --all
# Elementor cache
wp elementor flush-css
# Rewrite rules
wp rewrite flush
# Or use admin panel:
# Epicor Integration → Settings → (Clear Cache button)
Regenerate Product Data
# Reindex Algolia search
# WP Admin → Algolia Search → Re-index
# Regenerate FacetWP indexes
# WP Admin → Settings → FacetWP → Rebuild Index
# Regenerate thumbnails
wp media regenerate --yes
Export/Import Data
# Export database
wp db export backup-$(date +%Y%m%d).sql
# Export specific tables
wp db export backup.sql --tables=wp_posts,wp_postmeta
# Import database
wp db import backup.sql
Update URLs After Database Import
wp search-replace 'https://tenpointcrossbows.com' 'http://tenpoint.local' --all-tables --dry-run
wp search-replace 'https://tenpointcrossbows.com' 'http://tenpoint.local' --all-tables
Troubleshooting Development Issues
White Screen of Death (WSOD)
- Check
wp-content/debug.log - Enable
WP_DEBUG_DISPLAYtemporarily - Review PHP error logs
- Check file permissions (755 for directories, 644 for files)
Plugin Conflicts
- Deactivate all plugins
- Activate one by one to identify conflict
- Check for plugin updates
- Review plugin compatibility
Theme Issues
- Switch to default theme (Twenty Twenty-Four)
- If issue persists, it's not theme-related
- Regenerate Elementor CSS
- Clear browser cache
Database Connection Errors
- Verify database credentials in
wp-config.php - Check database server is running
- Test connection with MySQL client
- Check database user permissions
Asset Compilation Errors
- Delete
node_modules/and runnpm install - Clear npm cache:
npm cache clean --force - Check Node.js version compatibility
- Review webpack/mix configuration
Performance Optimization for Development
Disable Unnecessary Features
wp-config.php:
// Disable automatic updates
define('AUTOMATIC_UPDATER_DISABLED', true);
define('WP_AUTO_UPDATE_CORE', false);
// Disable post revisions
define('WP_POST_REVISIONS', 3);
// Disable trash auto-empty
define('EMPTY_TRASH_DAYS', 0);
// Disable cron
define('DISABLE_WP_CRON', true);
Optimize Database Queries
- Use Query Monitor to identify slow queries
- Add indexes to frequently queried meta keys
- Limit post revisions
- Clean up transients regularly
Next Steps
Support & Resources
Documentation:
- WordPress Codex: https://codex.wordpress.org/
- WooCommerce Docs: https://woocommerce.com/documentation/
- Elementor Developers: https://developers.elementor.com/
Internal Resources:
- Rhino Group GitLab
- Internal wiki
- Team Slack channels
Contact:
- Development Team: [email protected]
- TenPoint Project Lead: (contact info)