Skip to content
Devlom Karol Orzeł
← Blog blog 3 min read

Dom w Łodzi Foundation — a WordPress plugin for gift reservations

A custom WordPress plugin for reserving donated gifts at the Dom w Łodzi Foundation. It replaced a paid inventory plugin: about 4,000 lines of code instead of 75,000.

Dom w Łodzi Foundation — a WordPress plugin for gift reservations

75,000 → 4,000

lines of code after the switch

$0

yearly licence

893

reservations migrated with full history

The Dom w Łodzi Foundation in Łódź, Poland, cares for children who have lost both their health and the care of their families. Its website has a wish list: pyjamas, bed linen, therapy equipment, a birthday cake. A donor picks a gift and reserves it, and the gift disappears from the list so nobody buys it twice. I wrote a custom WordPress plugin for this. It replaced a paid inventory system and has been live since 8 September 2026.

The foundation's gift list with the "Who is it for" filter

The screenshots show sample gifts and fictional donors. I don't publish the foundation's real needs or the details of the people who help.

The brief

The list used to run on WP Inventory Manager with a reservation add-on. It is a large, paid inventory system: about 75,000 lines of code, 12 custom database tables and a licence renewed every year. The foundation used a fraction of it. What it needed was a gift list with categories, a reservation form, a thank-you email and a table showing who reserved what.

Every update of a plugin that size is a risk to the site, and the licence is money a charity would rather spend on the children. So I offered to write a plugin that does only what the foundation actually uses.

How I built it

A gift is an ordinary WordPress post. Title, rich-text description, image, categories, drafts, trash and search are things WordPress already does, so the plugin doesn't rebuild them. It adds one field, how many items are needed, and one table for reservations. That comes to about 4,000 lines of PHP, with no Composer and no build step.

A gift page with the reservation form

Some parts needed more care than they first appear to:

  • The last item. Two people can click "Reserve" in the same second. Checking the stock and taking the item is a single database query, so one person gets the gift and the other sees "Someone was faster".
  • Caching. The foundation's site is cached for a week. If the gift list were cached too, a reserved gift would stay on the page and two people would buy the same thing. The plugin turns caching off on the gift pages only, so the rest of the site stays fast.
  • Spam. Four layers protect the form: a hidden field for bots, a minimum fill-in time, a per-IP limit and optional Cloudflare Turnstile. If Cloudflare doesn't respond, the reservation goes through, because an outage at a third-party service shouldn't cost the foundation a gift.
  • Email. The donor gets a thank-you, and the foundation gets an email with all the details. Hitting reply goes straight to the donor.

The admin panel

The foundation's staff didn't have to learn a new tool. Gifts are added like posts, and the list shows stock at a glance, such as "8 of 12", along with the number of reservations. Stock can be changed in Quick Edit without opening the gift.

The gift list in WordPress admin with stock and reservation counts

Reservations have their own table with filters, search and cancellation. A cancelled reservation puts the item back on the list. The CSV export opens in Excel with Polish characters intact.

The reservations table with CSV export

Migration with full history

I wrote a WP-CLI command that moved over the categories, the gifts with their stock and images, the welcome and thank-you texts, and 893 past reservations. The import has a dry-run mode, and running it again creates no duplicates.

Old gift URLs shared on Facebook and in newsletters redirect to the new ones (301), and the "Give a gift" page works with no change to its content. For donors nothing changed, except that the list is faster.

Mobile

Most donors arrive from Facebook, which means on a phone. On a narrow screen the categories wrap onto several lines and the gifts stack into one column with large images.

The gift list on a phone

The result

The foundation has a gift list that does exactly what it needs, with no yearly licence and about 18 times less code. In the first month after launch, donors reserved 49 gifts through it.

Running a large, paid WordPress plugin just for one feature? Replacing it with a small piece of custom code is often cheaper and safer. See how I handle WordPress maintenance and website development.

My role
Analysis, WordPress plugin, data migration and launch
Stack
WordPress, PHP 8, WP-CLI, Cloudflare Turnstile, LiteSpeed Cache

You might also be interested in

Related pages

blog

Wordpress 5.0 released ! What's new ?

After months of hard work, testing, beta and release candidate versions, Wordpress 5.0 is out ! Interested in new features it can offer ? Take a quick tour belo…

Ready to start?

Contact me and let's discuss your project

Write to me