How wakeforestuniversity/wordpress-contractor-base works
Project type and purpose
• This is a WordPress codebase (theme or plugin) managed via Composer and meant to run inside a standard WP installation.
• It includes custom templates, integration tests, and provisioning scripts for a Vagrant-based dev environment (VVV).
Break down the file structure into logical components
• Top-level bootstrap & entrypoint:
• index.php – front controller for incoming HTTP requests
• bootstrap.php – early initialization (autoload Composer, set up paths)
• .htaccess – Apache rewrite rules for “pretty” permalinks
• Dependency management:
• composer.json – PHP dependencies and custom installer settings
• vendor/ (installed by Composer, not shown in tree)
• Templates & business logic:
• /templates – custom page‐ and email‐templates used by theme/plugin
• test-*.php – standalone scripts exercising fundraising/payment flows
• Environment provisioning:
• /provision/vvv-init.sh – Vagrant VVV setup script
• /provision/vvv-nginx-default.conf – Nginx site config
• wp-cli.yml – default WP-CLI settings for interacting with the site
• Miscellaneous metadata:
• .gitignore, VERSION, CHANGELOG.md, README*.md
README for additional clues
• Setup revolves around Composer + VVV for local dev.
Main components & interactions
a. Dev Environment Layer
• Host OS (macOS/Linux/Windows)
• Vagrant / VirtualBox or VVV container
• Nginx (provisioned via vvv-nginx-default.conf)
• PHP-FPM
• MySQL (provided by VVV)
• WP-CLI
b. Application Layer
• WordPress Core (hooks, plugin system, DB abstraction)
• Custom WFU Code
• index.php → hands off to WordPress loader
• bootstrap.php → autoloads Composer and core plugin classes
• /templates → custom templates invoked via WP filters/templates API
• Composer Packages (third-party libraries)
c. Testing Layer
• test-fundraising.php, test-payment.php, etc.
• These scripts invoke WordPress+WFU codepaths to simulate donation/payment flows
d. External Dependencies
• Packagist / Composer installer extender (for custom installers)
• Any payment or fundraising APIs (implied by payment tests)
Architectural patterns & principles
• Front-controller: index.php delegates to WordPress API
• Dependency injection/autoload via Composer (bootstrap.php)
• Infrastructure-as-code for local dev (VVV provisioning scripts)
• Clear separation of concerns: templates vs. core logic vs. tests