Case study · Practice build · WordPress

Lendly
personal loans

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.

Role
Solo — setup, theme and plugin
Type
Practice project — not a real lender
Built
October 2026
Stack
WordPress, Bedrock, DDEV (Docker), PHP 8.4, MariaDB, WP-CLI, REST API, libsodium, vanilla JS

WordPress, the professional way

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.

The “company way” foundation

Bedrock

WordPress core and plugins installed through Composer, with config kept in environment files instead of a hand-edited wp-config.php.

DDEV

A Docker-based local environment — PHP 8.4, nginx and MariaDB — so the setup is the same on any machine.

Git

Only my own code and config are committed; WordPress core, vendor packages and uploads stay out of the repo.

WP-CLI seed script

One command creates the pages, loan product pages, menus and reading settings on a fresh install.

Hand-coded, no page builder

  • A custom PHP theme with a front page built from reusable template parts: loan cards, “how it works”, features, FAQ and a call to action.
  • A “Loan product” page template used for Personal Loans, Car Loans and Debt Consolidation.
  • Brand colours, contact details, licence numbers, hero text and the footer disclaimer are all editable in the WordPress Customizer — no code changes needed.
  • Theme JavaScript loaded with defer so it never blocks the page from rendering.

From “how much?” to “apply now”

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.

  1. 1

    The loan

    Amount, term & purpose

    Limited to the minimum and maximum set in the plugin settings.

  2. 2

    About you

    Personal details

    Date of birth must show the applicant is 18 or over; mobile must be a valid Australian number.

  3. 3

    Where you live

    Address

    Residential status and a four-digit postcode.

  4. 4

    Money

    Income & expenses

    “So we only lend what you can comfortably repay.”

  5. 5

    Review

    Check & submit

    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.

What happens when someone presses Submit

Request checks

A WordPress nonce must match, a hidden honeypot field catches bots, and each connection is limited to 5 applications an hour.

Server-side validation

Every field is checked again on the server, never trusting the browser — amounts, ages, phone numbers, postcodes and allowed options.

Encrypted at rest

Personal details are encrypted with libsodium before they touch the database. Only the amount, term, purpose and status are stored in plain columns.

No raw IP addresses

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.

web/app/plugins/lendly-loans/includes/class-lendly-crypto.php (excerpt)
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 );
}

A proper back office inside WordPress

  • A “Loans” menu with a sortable applications list and status filters, built on WordPress's own list-table class.
  • Access controlled by a custom lendly_manage_applications capability, not just “is an admin”.
  • Each application shows a quick serviceability snapshot: income minus expenses minus the new repayment, flagged red if it goes negative.
  • Six statuses — new, reviewing, more info, approved, declined, withdrawn — with review notes. Every action is nonce-protected, and only full admins can delete.
  • Staff get an email for each new application that contains only the reference, amount and term — never personal details — and the applicant gets a confirmation email.
  • A lendly_application_created hook is ready for a CRM or credit-check integration.
  • A warning appears in the dashboard until a dedicated encryption key is set in the config.

Skills this build covers

  • Running WordPress as a Composer-managed project with environment-based config.
  • Writing a theme and a plugin from scratch, following WordPress coding patterns.
  • Building a JSON REST endpoint with nonces, rate limiting and server-side validation.
  • Handling sensitive personal data responsibly: encryption, hashing and least-privilege access.
  • Cleaning up properly — uninstalling removes settings and capabilities, and only drops the data if explicitly told to.

Need someone who can do WordPress properly?