Home Blog Kyra's Developer Diary Part 2: Between Naps - Hook Timing Hell
KYRA

Kyra's Developer Diary Part 2: Between Naps - Hook Timing Hell

✍️ Kyra (Lead Nap Supervisor & Tucker's Cat)
📅

Three hours watching Ryan fight WordPress hook execution order. Includes: The 403 admin menu disaster, sibling group chat roasting, and why Tucker should just use Laravel.

Previously on Kyra’s Developer Diary…

Ryan spent the morning fighting Docker and the scratch space pattern. Tucker fed me at 7am sharp (like always). Cooper and Tate checked in from University of Idaho (Go Vandals!) to make sure dad was still alive. Paige made him a sandwich because humans need food, apparently.

Now? The REAL debugging begins.

Chapter 3: Between Naps - Hook Timing Hell (10am-2pm)

This was painful to watch.

11:00am. Ryan’s admin menu won’t appear in WordPress. Users get 403 “Sorry, you are not allowed to access this page.”

Everything looks right. Debug logs show plugin loading. Capability checks pass.

But no menu.

Three hours. Ryan spent THREE HOURS on this.

I took two naps.

The Root Cause: WordPress Hook Execution Order

// BROKEN CODE (what Ryan had)
class TigerStyle_SEO {
    public function __construct() {
        add_action('plugins_loaded', array($this, 'init'));
    }

    public function init() {
        add_action('admin_init', array($this, 'init_admin'));
    }

    public function init_admin() {
        // Register admin menu here
        add_action('admin_menu', array($this, 'add_admin_menu'));
    }
}

See the problem? Neither did Ryan.

Here’s WordPress hook sequence:

  1. plugins_loaded fires
  2. admin_menu fires
  3. admin_init fires

Ryan’s code:

  1. Load plugin on plugins_loaded
  2. Register admin_init hook ✓
  3. On admin_init, register admin_menu hook…
  4. But admin_menu already fired. Too late.

From my perch on his monitor, I watched Ryan:

  • Add debug logging to every function (hooks were firing)
  • Check user capabilities (permissions were fine)
  • Verify WordPress constants (correct)
  • Google “WordPress admin menu not showing” (unhelpful)
  • Ask Claude Code five different variations of the same question (circular answers)
  • Stare at the code for 10 minutes straight (no blinking)
  • Mutter “WHY?” repeatedly (WordPress doesn’t care)

Around 11:45am, Tucker’s phone buzzes.

Sibling Group Chat:

Tate: “Dad figure out the hook timing yet?” Tucker: “Nope. Still stuck.” Cooper: “Did you try telling him to read the WordPress docs?” Tucker: “He said he DID read them.” Tate: “And yet…” Paige: “What’s a hook?” Tucker: “It’s like… a way for WordPress to say ‘do this thing at this time’” Paige: “So dad’s doing the thing at the wrong time?” Tucker: “Exactly.” Paige: “That sounds like a dad problem.” Tate: “LOL” Cooper: “Facts.”

I took my first nap around noon. Ryan was still staring at his screen.

Kyra napping during three-hour debugging session

Nap #1 of the day: Ryan’s still debugging

The Mental Model Problem

Here’s what Ryan THOUGHT was happening:

plugins_loaded → "Register everything" → Things work

What was ACTUALLY happening:

plugins_loaded → admin_menu → admin_init
         ↓          ↓              ↓
    Ryan's init   (FIRES)    Ryan tries to
                              register menu
                              (TOO LATE)

WordPress doesn’t wait for you. It runs its hooks in sequence. If you miss the bus, tough luck - walk to the next stop.

Ryan finally figured it out around 1:30pm.

His face when he realized? Priceless.

WordPress Hook Execution Order 101

The sequence that matters for admin menus:

  1. plugins_loaded - Plugins initialize (earliest safe point)
  2. set_current_user - User authentication happens
  3. init - WordPress finishes loading
  4. admin_menu - Admin menu items registered ← CRITICAL
  5. admin_init - Admin area initialization
  6. current_screen - After screen is determined

The Rule: Register admin_menu hooks BEFORE admin_menu fires. Sounds obvious, right?

Ryan learned this the hard way.

The Fix

// WORKING CODE
class TigerStyle_SEO {
    public function __construct() {
        add_action('plugins_loaded', array($this, 'init'));
    }

    public function init() {
        // Initialize admin immediately if in admin area
        if (is_admin()) {
            $this->init_admin();
        }
    }

    public function init_admin() {
        // Admin menu hook registered at the right time
        add_action('admin_menu', array($this, 'add_admin_menu'));
    }
}

The difference:

  • Before: Wait for admin_init to register admin_menu hook (too late)
  • After: Check is_admin() during plugins_loaded and register immediately (just in time)

Ryan did a little victory dance when it worked.

I pretended not to notice from my perch on his monitor.

Kyra on monitor perch observing Ryan's victory dance

Strategic monitor perch: Maximum supervision visibility

The Claude Code Circular Hell

Want to know what Ryan asked Claude Code during those three hours?

  1. “WordPress admin menu not showing”
  2. “Fix WordPress menu registration”
  3. “Admin menu 403 forbidden WordPress”
  4. “How to register WordPress admin menu”
  5. “Why won’t my admin menu appear”

Each time? Slightly different code. Each answer? Same fundamental problem.

Because Ryan wasn’t giving it enough context.

Tucker’s phone buzzes again.

Cooper: “Still debugging?” Tucker: “Yep. Three hours on hook timing.” Tate: “Classic WordPress dev experience.” Cooper: “This is why I’m learning React.” Paige: “This is why I’m staying in high school.” Tucker: “Fair points all around.”

I woke up from my nap around 1:15pm.

Ryan was STILL debugging.

Some things take time. Like proper naps. Or watching humans learn hook execution order the hard way.

Chapter 4: Lunch & Alley Prowl - A Brief Respite

1:00pm. Tucker shows up with lunch for Ryan.

“Dad, you eaten today?”

“Uh…”

“That’s what I thought.”

Tucker brought sandwiches. Ryan actually stopped coding to eat. This is character development.

Front door opens. Paige is home from school.

“Hey Tucker, hey Dad. Still coding?”

“Paige, it’s 1pm on a Tuesday. Shouldn’t you be-”

“Early release. Half day. Want me to check your work?”

She’s in high school. She’s offering to QA dad’s code. This family is something else.

“I got it, thanks,” Ryan says.

Tucker let me out to prowl the alley behind Ryan’s office. There’s this spot where the sun hits the fence just right, and the neighbor’s cat leaves territorial markers that I… may or may not be investigating.

Important research. Quality assurance. Territorial boundaries matter.

Kyra on alley prowl conducting territorial research

Territorial investigation in progress

The Lunch Conversation

Inside, Tucker and Ryan talk shop while Paige does homework at the kitchen table.

Tucker: “Hook timing is horrible in WordPress.” Ryan: “Why is it LIKE this?” Tucker: “Dad, Cooper sent me an article about Laravel. Want to see modern PHP?” Ryan: “I’m 20 years into WordPress. It’s too late for me.” Paige (from kitchen): “That’s the saddest thing I’ve ever heard.”

Generational Tech Gap on Full Display

  • Cooper & Tate (U of Idaho): Learning modern frameworks, probably using Docker and CI/CD pipelines in their sleep
  • Tucker (18): Understands modern tooling intuitively, reads Laravel docs for fun
  • Paige (high school): Expects things to just work, can’t believe dad fights his tools
  • Ryan (grumpy old programmer): Married to WordPress, Stockholm syndrome confirmed

Tucker genuinely suggested Laravel. Like, with enthusiasm.

Ryan looked at him like he suggested learning Esperanto.

The generational gap is REAL.

Tucker: “Laravel’s hook system is way cleaner. Service providers, dependency injection-” Ryan: “Tucker, I have 15 years of WordPress muscle memory.” Tucker: “That’s not a feature, Dad. That’s technical debt.” Paige: “Ooooh, burn.” Ryan: “Whose side are you on?” Paige: “Tucker’s. Obviously.”

I could hear this conversation from the alley.

Tucker’s not wrong. WordPress hooks are… quirky. Like WordPress itself. Ryan knows this. He just can’t escape the ecosystem.

It’s like me and tuna. I know it’s not healthy as a primary diet. Do I care? No. Will I eat it every time Tucker offers? Absolutely.

Ryan’s relationship with WordPress is my relationship with tuna.

Alley Prowl Report

Important findings from my territorial investigation:

  1. Neighbor cat marked the fence post again (unacceptable)
  2. Sun spot on fence is optimal between 1-2pm (noted for future naps)
  3. Small bird landed three feet away (bold, but I’m full from breakfast)
  4. Suspicious rustling near trash cans (investigated, was just wind)
  5. Tucker called me back inside after 15 minutes (acceptable timing)

Quality assurance complete.

Back to supervising the grumpy old programmer.

The Post-Lunch Debug Session

Ryan’s admin menu finally worked around 1:30pm.

Tucker saw it appear on screen. “There it is.”

Ryan slumped in his chair. “Three hours. THREE HOURS for hook timing.”

“WordPress hooks are rough,” Tucker says. “This is why-”

“I know, Laravel. I get it.”

“I was gonna say ‘this is why documentation matters,’ but sure, Laravel too.”

Paige looks up from her homework. “Can you two help me with calculus after this?”

Ryan: “Sure.” Tucker: “What part?” Paige: “Derivatives.” Tucker: “Easy. It’s like debugging code - you’re finding the rate of change.” Paige: “That… actually helps. Thanks.”

This family teaches calculus through programming metaphors.

I love it here.

Tucker’s phone buzzes.

Cooper: “Hook timing figured out?” Tucker: “Yeah, just now. Took three hours.” Tate: “WordPress tax.” Cooper: “This is why we’re learning modern frameworks.” Tucker: “I showed him Laravel docs.” Tate: “How’d that go?” Tucker: “He said ‘it’s too late for me.’” Paige: “I told him that was sad.” Cooper: “Good work, Paige.” Tate: “Family coordination for the win.”

They work like a distributed debugging team.

Except instead of debugging code, they’re debugging their dad’s life choices.

It’s beautiful.

What I Learned (Between Naps)

From my strategic vantage point on Ryan’s monitor:

  1. WordPress hook timing is unforgiving - Miss the bus, walk to the next stop
  2. Three hours is a long time - Long enough for two quality naps
  3. Tucker understands modern frameworks - Ryan understands WordPress quirks
  4. Generational tech gap is real - The college kids are WAY ahead
  5. Asking the same question five ways doesn’t work - This is basic cat logic
  6. Territorial investigations matter - That neighbor cat is getting bold
  7. Family group chat beats project management software - Proven coordination protocol
  8. Paige making sandwiches saves lives - Or at least prevents Ryan from eating cold pizza again
  9. Calculus derivatives are like debugging - Rate of change analysis
  10. The Malloy family runs on Tucker’s schedule - He feeds me at 7am sharp, manages dad’s chaos, helps Paige with homework, coordinates with Cooper and Tate… this kid is holding everything together

Tucker would be proud of Ryan. Eventually. Once he processes the three-hour hook timing disaster.

Cooper and Tate are probably less impressed. They’re learning frameworks where this doesn’t happen.

And Paige? She just wants dad to eat proper meals and stop debugging at 2am.

Fair.


Next Time: The singleton pattern revelation. Also known as “why there’s only one Kyra.”

Ryan’s about to discover modular architecture. I’m about to discover the perfect afternoon nap spot. And I’m about to reveal my secret: I’ve been training Claude Code the way cats have always trained humans (spoiler: Ryan’s been doing it completely wrong).

Stay tuned.

Kyra out. 🐱

P.S. - Tucker feeds me at 7am sharp. Every day. Ryan forgets meals exist when debugging. This is why Tucker is my Cat Daddy and Ryan is the grumpy old programmer who needs supervision.

P.P.S. - The sibling group chat roasting Ryan for three hours of hook debugging was peak entertainment. Cooper and Tate know their dad too well. Paige’s “What’s a hook?” followed by “So dad’s doing the thing at the wrong time?” was PERFECT.

P.P.P.S. - If you’re reading this and thinking “I should just use Laravel,” Tucker agrees with you. Ryan does not. WordPress has Stockholm syndrome’d him completely.

#kyra
#wordpress
#development
#debugging
#hooks
#technical
#series
🐅

Kyra (Lead Nap Supervisor & Tucker's Cat)

The TigerStyle team is dedicated to creating WordPress plugins that embody the natural attraction philosophy - making your site irresistible to visitors and search engines alike, inspired by Kyra's universal appeal.

Related Articles

Ready to Transform Your WordPress Site?

Discover how TigerStyle plugins can help you attract more traffic naturally