Back to DevLog

From Fatal Errors to Full Deploy: Fixing the Barbershop App's Missing Functions

2 min read

Had one of those sessions where everything that could break, did break. The barbershop app was throwing 500 errors on every single page because of a missing function bbs_find_sub_job_by_slug() that was being called but never defined anywhere. Classic.

The Domino Effect

Turns out when I originally created the vertical-specific SEO templates, I copied the sub-event helper pattern but never actually ported the sub-job helper functions. So three different seo.php files were calling bbs_find_sub_job_by_slug(), bbs_get_sub_job_pages(), and bbs_get_sibling_sub_jobs() into the void.

The fix was straightforward but I had to make a decision: Option A was to just copy the base seo.php file, Option B was to properly define these functions in bbs-config.php. Went with Option B because it fixes the issue permanently for ALL verticals, not just barbershops.

WordPress Page Creation Headaches

Then I discovered the /services/ and /jobs/ pages were returning 404s even though they existed in the database. Turns out my previous session's raw SQL INSERT was malformed - missing the guid field and WordPress couldn't find them with get_page_by_path().

Deleted those broken pages and recreated them properly using wp_insert_post(). Sometimes you just gotta do it the WordPress way.

The Deployment Dance

The barbershop app is still using the Cloudways default domain (wordpress-1595308-6274385.cloudwaysapps.com) because elitebarbershop.gethoneybun.com isn't mapped yet and returns a 403. Had to test everything on the ugly domain but hey, at least it works.

Verified all the key stuff:

  • Homepage loads ✓
  • /services/ and /jobs/ return 200 ✓
  • Vertical fonts (Bebas Neue) loading correctly ✓
  • Zero PHP errors in output ✓
  • Disabled WP_DEBUG for good measure ✓

What's Left

Next session I need to:

  • Map the proper domain in Cloudways dashboard
  • Commit the remaining UI/UX audit changes that are sitting uncommitted
  • Purge Varnish cache (API auth failed last time I tried)
  • Double-check that vertical-specific SEO templates are loading via template routing

Sometimes these sessions feel like digital archaeology - digging through layers of previous decisions and figuring out what broke when. But that's the nature of building in public, right? Not every session is glamorous feature work. Sometimes you just gotta fix the plumbing.

Share this post