I gave this talk in a couple of weeks ago at the very first WordCamp Russia 2013 which was a big success (will publish a recap separately).
It covers most of the basics: what is site speed and why it’s important, a little bit of object caching, transient caching, page caching, opcode caching, browser caching, image compression, etc. Before you hit “Play”, please note that the video is in Russian :)
If you have any questions, I’ll happily reply via comments or Twitter, both in English and Russian.
I first thought of making a WordCamp in Russia a little over three years ago, when I was running a web development shop in Moscow. I had filled out my application form and was a single click away from applying. I don’t quite remember what stopped me back then, but whatever it was, thank god!
I had no idea what it is like to organize a WordCamp, in fact, I haven’t been to a single WordCamp back then, except for a live stream or two. A lot of things have changed in the past three years: I attended, spoke and volunteered at quite a few WordCamps, I ran a monthly WordPress meetup for over a year, I made friends with many pro WordCamp organizers across the planet, and today I’m happy to announce that…
WordCamp Russia 2013 is this Saturday! If I had to express my excitement in exclamation marks, the MySQL server would try to return a result set which is too large and fail with a timeout error.
Everything is going fairly smoothly and we’re slowly approaching that OMGWTFBBQ planning phase. Watch out for recap posts in the coming weeks and don’t hesitate to visit us if you’re in Moscow this weekend.
I gave this talk at WordCamp San Francisco 2013. I was so nervous that I said
get_template_fart() instead of
get_template_part() at around 2:43.
Slides and reference links right here. Let me know what you think!
This was my second WordCamp San Francisco, and I absolutely loved it. I haven’t attended too much of the sessions, most notably: Mark Jaquith on deploying, code UX by Nikolay Bachiyski, funny theme stories by Ian Stewart, introduction of the O2 theme by Beau Lebens, roles and caps by Andrew Nacin and obviously State of the Word, by Matt Mullenweg, speaking of which, I was named “recent rockstar” for the 3.6 release cycle (along with quite a few other awesome folks), which I’m so proud of.
I’m speaking about theme development at WordCamp San Francisco this year. I would love to tell you more about it, but I should probably go work on my slides.
Meet Expound — a free magazine theme for WordPress. Freshly baked, straight out of the oven, filled with _s goodness, a responsive layout, wicked support for featured posts and more!
Expound was initially built for WP Magazine, a little blog with a big goal to change the perception of WordPress in Russia. It supports up to five featured posts on the home page, post thumbnails, custom excerpts, threaded comments, a sidebar for your widgets, a related posts section built right in, and an awesome responsive layout to keep your readers reading, wherever they are.
You can get Expound from the WordPress.org repository, and don’t hesitate to give a thumbs up if you like it. Enjoy!
Shortcodes are pretty cool, and the do_shortcode function is pretty neat as it can parse and execute shortcode callbacks from arbitrary strings, but that function invokes a fairly large regex every time it is called.
That regex looks for all registered shortcodes within a string. For each match, it runs a replacement with a callback function, which also take the time to parse the shortcode attributes, before finally calling the actual callback function that’s been registered with
Regular expressions are pretty fast in PHP, especially for short strings, but do we really have to have WordPress do all that extra work, when all we really intended was to call our shortcode callback function?
echo do_shortcode( '[foo]' ); // Boo
echo foo_shortcode_callback(); // Yey!
I ran a quick search in the plugins directory, using the following regex:
Not the best crafted regex, but it’s supposed to look for calls to
do_shortcode followed by a string literal starting with an opening square bracket. Obviously it might get a few false positives for special cases, but it also misses quite a few matches where the shortcode string is put into a variable first.
I found over 600 entries in over 270 plugins, including some of my own. Guilty! So the lesson I learned today is: don’t use
do_shortcode when you can use your callback function directly, which is much more efficient.