Updates from August, 2011 Toggle Comment Threads | Keyboard Shortcuts

  • Andy Skelton 4:52 pm on August 12, 2011 Permalink
    Tags: oop, , rewrite, WCSF2011   

    WCSF 2011 Voodoo 

    Rarst asks: what magic turns pretty permalinks into query variables?

    The setup:

    The magic:

    foreach ( $rewrite as $match => $query ) {
    	if ( preg_match("#^$match#", $request_match, $matches) ) {
    		// Got a match.
    		$this->matched_rule = $match;

    The real voodoo is in creating the rewrite rules. Example: bbPress

    • register_post_types
    • register_taxonomies
    • add_rewrite_tags
    • generate_rewrite_rules

    Exercise: optimize parse_request by restructuring the rules into a tree.

    Nacin suggests: wp-hackers Skip Main Query

    • the grand scheme of things (png, blog post)
    • $wp->init()
    • class freshlypressed_wp extends wp
    • wp() calls $wp->main()
    • $wp->main() calls $this->parse_request()
    • $this is a freshlypressed_wp


    • Can’t extend a variable class (class my_wp extends $wp_class)
    • No pluggable inheritance chaining
    • No way for several plugins to cooperatively extend a class
  • Andy Skelton 4:38 pm on July 18, 2011 Permalink  

    Shape My WordCamp Talk 

    Now that Jane’s announcement has made it official, I need to prepare for my talk at WordCamp San Francisco. The working title is “Deep Voodoo: How the innermost innards of WordPress work” and the working content is nil.

    This is where you come in. As a core contributor or plugin developer, you are aware of areas in WordPress code that scare you. I’ve been there and back again. I’ve digested, debugged and patched some of the most labyrinthine logic. I’ve even written some of the worst of it. On Saturday, August 13, I will try to make sense of it for everyone.

    Please take a minute to recall something in the core code of WordPress that really stumps you. Ask me about it. I will try to work all of your comments into my talk, provided that I can’t answer it with a quick reply, a link to the Codex or a Google search.

    If this gambit of asking for questions beforehand fails, maybe I’ll just give a tour of my personal favorite fork of WordPress in which every function block is shaped like a pony. (Please don’t let that happen.)

    • Michael Fields 4:43 pm on July 18, 2011 Permalink | Reply

      An overview of the list table classes would be killer :)

      • Andy Skelton 5:04 pm on July 18, 2011 Permalink | Reply

        Are you still stumped after reading the codex page?

        • Michael Fields 5:49 pm on July 18, 2011 Permalink | Reply

          I’m sure I could figure it out :) Thanks! I honestly never sought out the documentation. After re-reading your post, I can think of two other things that might be a better fit. I’ve been able to figure these out on my own, but not without a bit of pain and trial and error. 1. Creating custom Walker Classes. 2. Hooking into / re-purposing the media upload modal. IMHO, this stuff is rather voodoo-ish.

      • Matthew Muro 5:07 pm on July 18, 2011 Permalink | Reply

        I recommend the Custom List Table Example plugin http://wordpress.org/extend/plugins/custom-list-table-example/

        I just used it to help me on my latest plugin and it’s super useful.

    • Rarst 5:25 pm on July 18, 2011 Permalink | Reply

      I had once tried to do interesting stuff with feed caching… Several attempts failed miserably. It’s not that SimplePie is complex, but as third party library it is very different from WP. And then WP interfaces with it by plugging in caching classes that change SimplePie’s file-based caching mechanisms into file-like abstraction based on WP’s transients… Ouch. Maybe not as complex, as fragile and hard to deal with.

      And of course there is rewrite stuff. I cannot even formulate what exactly I had trouble understanding when I went in that corner so I will put it under “everything”.

      PS both of these were while back when I wasn’t spending that much time deep inside core… might make sense to revisit feeds

    • Mike Schinkel 7:03 pm on July 18, 2011 Permalink | Reply

      There are three things that I struggle with, in order of interest:

      1.) Caching – How does caching work and if you are writing plugins how best to use it?

      2.) Admin Menus – There are some things that seem impossible to do, but Nacin said on Twitter there were possible (though he’s never followed up to explain.) See here http://core.trac.wordpress.org/ticket/16050 and/or email me if you’d like me to elaborate.

      3.) Walkers – How to extend them without having to duplicate so much code that’s already in WordPress and/or how to best hook into them?

      Thanks in advance.

    • mitcho (Michael 芳貴 Erlewine) 7:44 pm on July 18, 2011 Permalink | Reply

      +1 on Rewrite.

      • Andy Skelton 8:16 pm on July 18, 2011 Permalink | Reply

        Rewrite is very broad. I would be happy to cover specific parts of rewrite. Any task or feature in particular?

        • Rarst 7:45 am on July 19, 2011 Permalink | Reply

          How about by what magic nice pretty permalink gets turned into query variables.

    • Matthew Muro 7:13 am on July 19, 2011 Permalink | Reply

      I’d like to see more about transients and providing your own update process for private plugins.

      • Rarst 7:47 am on July 19, 2011 Permalink | Reply

        What do you find complex about transients? I dealt with them a lot, maybe can point out stuff to check out (thanks for link to that tables plugin!).

  • Andy Skelton 5:17 am on August 14, 2007 Permalink  

    My Musical Interlude at WordCamp 2007 

    John Pozadzides’ camera had the best view of WordCamp and he did a fine job of filming (and he kindly edited my floundering after) my performance. Thanks, John!

    Set list:

    1. Brooke’s Song by Andy Skelton
    2. Deserve by Andy Skelton
    3. Political Science by Randy Newman
    • John Pozadzides 10:08 am on August 14, 2007 Permalink | Reply

      It was my pleasure. :-) Thanks for getting up on stage and entertaining us all. It was a welcome break and I hope you do it again next year!


    • Maya 4:29 pm on August 14, 2007 Permalink | Reply

      Cool! I actually missed the live one so it was good to finally see it!

    • Brooke Kuhlmann 10:11 am on August 15, 2007 Permalink | Reply

      Mind if I link/embed this video on my Day 6 post as well? I’ll double check with John for permission too.

    • Scott 3:07 pm on August 15, 2007 Permalink | Reply

      I wish you had smashed your guitar when you finished. :(

  • Andy Skelton 1:58 am on June 21, 2007 Permalink  

    More WordCamp Road Trip Plans 

    Planning continues: map, calendar.

    Through my new couchsurfing.com account I have begun to make lodging arrangements.

    I’m planning to lodge and ride for a few days with WordPresser and motorcyclist Brooke Kuhlmann. He plotted a scenic route to cover the 1,300 miles between Colorado City and San Francisco.

    Are you interested in joining the road trip to WordCamp? If enough people get involved we might even call it a rally. Cars are welcome, too. :-)

    • Brooke Kuhlmann 8:08 am on June 22, 2007 Permalink | Reply

      Thanks Andy! Yeah, this is going to be a great trip. So anyone reading, feel free to join us. I’ve posted additional details (at least starting from the Colorado Springs area) on my site too.

  • Andy Skelton 3:05 pm on June 9, 2007 Permalink  

    Riding to WordCamp 

    WordCamp 2007 is coming up! Instead of flying to San Francisco, I’m planning a motorcycle trip around the country. I hope to meet other bloggers along the way. Please take a look at the trip plans and let me know if you think we can meet up somewhere along the way.

    • Brooke Kuhlmann 7:15 pm on June 20, 2007 Permalink | Reply

      Andy, maybe we can meet up? I noticed that you are traveling through Denver to WordCamp. Depending on the logistics, maybe I can ride with you into San Francisco?

    • PJ at Ferodynamics 10:08 am on June 26, 2007 Permalink | Reply

      I’d love to go, but I’m at a wedding in Michigan that weekend. *cry*

      PS: I’m in Austin too.

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc

Get every new post delivered to your Inbox.

Join 2,058 other followers