WP-Coupon-Sync is a standalone PHP CLI application that synchronizes coupons from affiliate networks into a WordPress installation. It uses WP‑CLI to interact with WordPress and loads configuration variables from an .env file.
- Brand Retrieval: Retrieves brand (coupon store) data from WordPress via WP‑CLI.
- Affiliate Integration: Integrates with affiliate networks (currently ADCELL is implemented).
- Coupon Synchronization: Creates and updates coupon posts in WordPress.
- Modular Architecture: Designed for easy extension to add additional affiliate network integrations.
- Environment Configuration: All sensitive and environment-specific configuration is managed through an
.envfile.
- PHP 8.3 or higher
- WP-CLI installed on your system
- Composer
- Clone the Repository:
git clone https://github.com/ju-nu/wp-coupon-sync.git
- Change to the Project Directory:
cd wp-coupon-sync - Install Dependencies:
composer install
- Set Up Environment Variables:
- Copy the sample environment file:
cp .env.example .env
- Edit the
.envfile with the correct configuration values for your environment.
- Copy the sample environment file:
- Make the CLI Script Executable:
chmod +x bin/coupon-sync.php
Run the CLI application manually:
./bin/coupon-sync.phpOr configure it with Supervisor. For example, create a Supervisor configuration similar to:
[program:wp-coupon-sync]
command=/usr/bin/php /path/to/wp-coupon-sync/bin/coupon-sync.php
autostart=true
autorestart=true
stderr_logfile=/var/log/wp-coupon-sync.err.log
stdout_logfile=/var/log/wp-coupon-sync.out.logThis project is licensed under the MIT License.