A pair of scripts that make it easier to manage the development of a WordPress plugin in Github, and then periodically deploy to the WP.org plugin repo (SVN).
I’ve long wanted to be able to do some simple, operated-powered searches within WordPress (especially relevant in a project I’m working on at Automattic). After a conversation with Allen, where he wanted to do the same thing, I figured I’d just whip up a quick plugin to see how hard it’d be. Turns out the answer is “not very”.
Simple Search Operators is a quick plugin that expands the functionality of the default search system in WordPress so that you can use a few useful operators (might look at adding some more at some point) [all links in the following list go to live searches on this site, using that operator]:
author:beauwill limit results to posts written by the author with the username/slug ‘beau’
tag:burritowill only return posts which are tagged with ‘burrito’
cat:posts) to search for posts categorized as ‘posts’
tag:burritofriday cancun author:beauto search for posts containing ‘cancun’, written by ‘beau’, tagged as ‘burritofriday’
- Not heavily tested! May well be capable of generating server-melting queries
- Only supports one of each operator for now
- Operators and freeform searches may be combined (e.g.: “tag:burrito cancun”)
- Does not support spaced strings for operators, so you can only do things where a no-space string attached to an operator will get you what you want
- Because of the way it manipulates query variables, might mess with other plugins or themes in adverse ways. Like I said, not heavily tested.
- Not available via the WP Plugin Repo yet; will get it up there once it’s baked a little bit
If you’d like to give it a shot, please do. If you’d like to add more operators; shoot me a pull request and we can expand this out a bit.
Through some lucky scheduling, I was able to attend both LevelUp Con and WordCamp Saratoga in a single trip. I spoke at WordCamp about how to build a quick Backbone.js application which used WordPress as the backend (interfacing via the REST API). I thought my talk went OK, although I didn’t love it to be honest, and in hindsight I kind of wish I’d dived a bit harder into some better examples of how Backbone works with Views and whatnot. Here are the slides I used:
And if you’re interested in the code, it’s all available via Github. I got a few nice bits of feedback as well, so that was good:
— Leon Shelhamer (@francismhwhite1) October 14, 2014
— Priscila Dias (@pmdias) October 11, 2014
— Mubashar Iqbal (@mubashariqbal) October 11, 2014
Checked in at Creative Density Coworking.
#WordPress Happy Hour with Arestad.
DISCLAIMER: These are my personal thoughts only, based on what I’m seeing around the web over the last few years.
- If you’re trying to provide any custom functionality for WordPress, you pretty quickly end up doing it in PHP because that’s where all of the internal APIs and functionality resides.
That’s been a fine approach for the last 10 years, but I believe that things are changing, and we need to change with them to remain relevant. Full page reloads with heavy server-based everything is no longer really acceptable for a solid UX. With that in mind, here’s a possible future for WordPress, extrapolated out from where some things seem to be going (on the wider web, not necessarily currently within WordPress development):
Plugins would create additional endpoints within the backend API, or would supplement existing ones (e.g. post/meta) with additional data and/or actions. They could also be implemented via pure JS, depending on what they were built to do. Themes could potentially be built using no PHP at all — making queries directly to the API via JS, and then using something like Mustache to template the output back to the user. This would have SEO ramifications, but we can always figure something out there, and search engines are constantly improving.
Unfortunately a crucial point where backwards compatibility would be important would be the Post Editor, which is also where some big performance/UX improvements could potentially be seen by switching to a largely JS-powered UI.
I don’t know if this is really where WordPress will go, or if it is, exactly how it will get there. There’s a project currently to build a core REST API which I’m eagerly observing and will be trying to get more involved in. It has the potential to become the kernel of the future of WordPress if it’s done right. This is going to be a long road either way, so I’m excited for where we can all go from here.
Do you think WordPress can (or should) move in this direction?
Back in April, this blog celebrated 10 years of existence, and it’s been almost five years since the theme on this site changed. Yesterday I decided to just go ahead and flip the switch on something I’ve been working on here and there since late last year. It’s a complete new, very experimental theme that I call “Homeroom“.
There are some specific things driving what I was aiming for with Homeroom:
- First and foremost, a lot of the decisions are based around the intention that it would use Keyring and the Social Importers to pull in my content from all over the web. With that much data being collected and displayed here, I realized I couldn’t go exactly with a traditional blog layout, and had to get a bit creative with some types of data.
- It’s intentionally heavily integrated with Jetpack (although it works without it). Jetpack powers the comments, infinite scroll, sharing buttons and more. I’ve taken care to try to make that integration feel as native as possible (although I know there’s more to be done there).
- Homeroom started out as an _s-based theme, although it’s been pretty radically modified from there.
- I’m using a technique that I’ll call “post lookahead” when going through the loop to check the next post, and do some things like collapse sequential posts if they’re the sam type of thing.
- I wanted something with a bit of a timeline feel, since it’s now collecting some much data, and it’s all sequential; I wanted to show the relationship of different things along that sequence of time.
It’s not particularly beautiful because, well, I’m not a designer In the near future I’ll be talking to some friends who are though, so hopefully I can get some advice on improving things there. I’ve been mainly focused on getting it working the way that I wanted it to. Here are some other bits that might be interesting:
- Allows custom Header and Backgrounds via wp-admin
- Options (currently defined in a file, because I haven’t built a UI) to control some preferences around stuff like hiding Foursquare check-ins until a set amount of time after they happened (to help avoid the creepers!).
- Heavy use of Post Formats
- Ability to hide Twitter replies, which you probably don’t want showing up on your site.
- There’s the beginnings of a front-end post box (partially inspired by o2), although it doesn’t actually work yet
- Handles Foursquare checkins differently. Rather than showing them all as individual posts, it “collects” them and shows a single, multi-point map at the end of each day.
- Shows a map automatically on any post using the WordPress-recommended postmeta fields.
- Using the new taxonomy introduced in Keyring Social Importers 1.4, allows you to easily filter your display based on where posts were imported from.
- Includes a custom icon font from IcoMoon to display social icons indicating where things were imported from.
- Search results use a Masonry-based layout so that you can quickly scan the results. Unfortunately something is broken with the search mechanism on this site right now, so that’s not working
- Automatically lists out child-pages when you view a Page that has them, for example my Projects page.
- Dynamic heading re-writes: format your posts for individual viewing, and the H1 etc tags are automatically “stepped down” on listing pages to maintain hierarchy
- Has some fun mapping stuff for TripIt in particular, which draws out a “flight path” between airports. Check it it out in my TripIt section. Here’s a fun one.
- Uses Photon to apply some effects to images in places
- Borrows liberally from the styling of sites like Instapaper and Readability.
There’s still a lot of work to go, both on the theme itself and the importers that power a lot of the content. I wanted to get this online because I knew that’d motivate me to spend more time on it. I’m also hoping that other folks might be interested and/or have some ideas on ways to improve the theme. I haven’t got all of my content imported yet (that takes a while ), but you’ll see more and more things fill in over the coming week hopefully.
If you’ve got any ideas for improvements, I’d love to hear them down in the comments!
Checked in at South 4th Bar & Cafe.
L337 #WordPress meetup
I just realized that I never posted anything about speaking at WordCamp San Francisco. This was my 8th WordCamp SF (I’ve been to every one since the first, in 2006), and the second one at which I have spoken. Matt invited me to give a short introduction to the work we’re doing with o2, which is the next generation of P2. It’s not available for external (non-Automattic) use yet, so I had to settle for a relatively surface introduction, and couldn’t give people a link to download it or anything which was a bit of a pity, but it still got a good reception.
o2 is a pretty different approach to building on top of WordPress, and has meant a steep learning curve for my team and me. We’ve been digging deep into the world of front-end development, and ramping up quickly on Backbone.js, Underscore.js and a bunch of new development approaches and workflows. It’s been really fun. I’ll let the presentation do the talking though (you can also watch it on WordPress.tv):
And here are the slides I used, which you can also see on Slideshare.net.
We’re really excited to get o2 out into other people’s hands, but we’ve got a lot to build still before other people can experience it in a similar way to how we do at Automattic. The future is bright.