Bedrock
WordPress core and plugins installed through Composer, with config kept in environment files instead of a hand-edited wp-config.php.
Case study · Practice build · WordPress
A personal-loans website built the way a WordPress agency would — Bedrock, DDEV and Git, a hand-coded theme, and a custom plugin for the repayment calculator, a multi-step application and an encrypted admin review area.
I wanted to practise WordPress the way agencies and in-house teams run it — not a one-click install with a page builder, but a version-controlled project with its dependencies managed by Composer and a reproducible local environment.
The subject is an Australian-style personal-loans site, because it needs more than pages: a live repayment calculator, an application form that collects sensitive personal details, and a secure place for staff to review them.
WordPress core and plugins installed through Composer, with config kept in environment files instead of a hand-edited wp-config.php.
A Docker-based local environment — PHP 8.4, nginx and MariaDB — so the setup is the same on any machine.
Only my own code and config are committed; WordPress core, vendor packages and uploads stay out of the repo.
One command creates the pages, loan product pages, menus and reading settings on a fresh install.
defer so it never blocks the page from rendering.
Both features live in a custom plugin and drop onto any page with a shortcode —
[lendly_calculator] and [lendly_apply]. Every rate, fee,
loan amount and term comes from a settings screen, so nothing is hard-coded in the theme.
The loan
Limited to the minimum and maximum set in the plugin settings.
About you
Date of birth must show the applicant is 18 or over; mobile must be a valid Australian number.
Where you live
Residential status and a four-digit postcode.
Money
“So we only lend what you can comfortably repay.”
Review
A summary of every answer before it's sent as JSON to the plugin's REST endpoint.
Each step is validated before moving on, with errors shown next to the field and focus moved to the first input of the new step. The calculator works out amortised repayments weekly, fortnightly or monthly, with fees included, and shows the comparison rate.
A WordPress nonce must match, a hidden honeypot field catches bots, and each connection is limited to 5 applications an hour.
Every field is checked again on the server, never trusting the browser — amounts, ages, phone numbers, postcodes and allowed options.
Personal details are encrypted with libsodium before they touch the database. Only the amount, term, purpose and status are stored in plain columns.
The rate limit uses a keyed hash of the IP, so the real address is never stored. A consent timestamp is saved with each application.
wp_lendly_applications
public static function encrypt( string $plaintext ): string {
$nonce = random_bytes( SODIUM_CRYPTO_SECRETBOX_NONCEBYTES );
$cipher = sodium_crypto_secretbox( $plaintext, $nonce, self::key() );
return 'v1:' . base64_encode( $nonce . $cipher );
}
lendly_manage_applications capability, not just “is an admin”.lendly_application_created hook is ready for a CRM or credit-check integration.