A reusable WordPress AJAX handler class
A WooCommerce store had a live price update that broke half the time, crammed into one function. Here is the small, reusable AJAX handler class I used to replace it, with nonce checks and clean JSON responses.
A WooCommerce store had a live price update that broke half the time, crammed into one function. Here is the small, reusable AJAX handler class I used to replace it, with nonce checks and clean JSON responses.
A client site was grinding to a halt because a plugin forced an MVC structure onto WordPress. Why that fights the platform, and why hooks and filters are the WordPress way.
A client WooCommerce checkout kept throwing a random fatal error. The fix was not more code, it was reading the core files first. Why reading code beats writing more of it.
A client product-filter was a maze of names like $cert_arr and get_stuff(). Reading it took longer than fixing the bug. Why clear variable naming is a professional habit, not a style preference.
A client WooCommerce order emails looked fine in Apple Mail but broke in Gmail. The reason: Gmail strips CSS from the head. Why inlining your styles is the only reliable fix.
Inheriting a plugin with 15 classes crammed into one 3,000-line file is a nightmare to change. How PSR-4 and an autoloader give you a WordPress plugin file structure you can actually navigate.
A client’s site had the same widget code copy-pasted twelve times. Here is how I use an abstract base class so one edit updates every widget instead of twelve.
A client’s WooCommerce product filter kept timing out. The fix was not a faster query but a custom taxonomy, and the real story is about designing instead of copy-pasting.
A plugin stuffed 2MB of logs into one autoloaded option and dragged every page down. Here is how the Options API autoload flag works and how to split the data properly.
Hooks buried in class constructors made a WooCommerce plugin impossible to follow. Here is how a small PHP interface and a hook manager give every class a clear, testable contract.