Category Archives: Uncategorized

Customizer Features for WordPress 4.3 Kickoff

Here are the features I have suggested/proposed during the WordPress 4.3 kickoff:

Partial Refresh

This greatly improves performance of previewing changes in the Customizer for non-postMessage transport settings (JS-applied changes) by just refreshing the area of the page that has been changed. As such it eliminates some of the need to do postMessage in the first place, while also reducing the amount of duplicated logic that would have to be implemented in JS to mirror what is being done in PHP. This resurrects some code from the old Widget Customizer feature plugin developed for 3.9. Writeup and feature plugin are available.

Transactions

A low-level re-architecture of the Customizer plumbing that has a lot of side benefits and bugfixes, introducing some exciting possibilities for future feature plugins like scheduled settings, setting revisions, and drafted/pending settings. Partial Refresh is a dependency for this. Pull request available, but needs refresh. See proposal.

Concurrency/Locking

This is an important one for a client project I’m involved with, and so I’m having to prioritize it. I’m working on a client site that will have many users in the Customizer at a time, and given the way the Customizer is currently implemented (as with most areas of WP), there is no concurrency/locking support. So I’m working on adding locking at the control/setting level. See #31436.

(Cross-posted in comment.)

WordCamp Sydney talk: Customize all the things!

Today at WordCamp Sydney, I speak on The Customizer:

The Customizer is one of the least known yet most powerful features of WordPress. We need to get past thinking of it as the “Theme Customizer” which only good for tweaking colors and a limited number of settings. No, the Customizer provides a framework for live-previewing any change to WordPress.

In WordPress 3.9 I led development of incorporating Widget management to the Customizer, and I’d like to get on a soapbox to get people excited about developing their own custom controls for the Customizer.

Here’s my presentation:

I’m also happy that we at XWP (X-Team WP) and Stream are among the sponsors of the WordCamp:

I'm speaking at WordCamp Sydney September 27-28, 2014 I'm sponsoring at WordCamp Sydney September 27-28, 2014

Re: Edit WordPress Posts and Postmeta in the Customizer

I couldn’t reply to Jeff’s comment on Sarah’s WP Tavern post because of a Jetpack problem, so I’m posting it here:

With the Front-end Editor using the Customizer as a framework, I wonder if the interface will look similar to this experiment? I hope not.

This plugin is really a prototype to demonstrate how the Customizer can be used to preview changes to posts/postmeta at an architectural level. Hardly any consideration has been given to UI, which Avryl has been doing a great job with in her Front-end editor.

Ultimately, I’m interested to see how the Front-end Editor comes into play when previewing a post or writing a draft post. Will we be able to use it to write a post or will the editor be refrained from use until after a post/page is published?

You can use this Customize Posts plugin to edit drafts as well. Just create a new post post, save a draft, and then click Preview. You can then click Customize in the admin bar to then access that post from the Customizer and you can make changes, including transitioning the post draft to a published post. This relates to a previous prototype I worked on in the Customizer Everywhere plugin, which replaces the “Preview” button with a “Preview & Customize” button.

In this case and as I’ve seen mentioned already, editing should be done inline and not with boxes popping up around the content.

In terms of a prototype which demonstrates how inline editing can be added to the Customizer, see my other prototype: Customize Inline Editing.

Regularly cleaning up /tmp on a DreamHost VPS

I ran into a problem recently where I was no longer able to upload a file via PHP. I checked the server error log, and I saw entries like:

ModSecurity: Input filter: Failed writing X bytes to temporary file

Looking at my /tmp directory it contained 128MB of data. Apparently ModSecurity tries to prevent the filesystem from being maliciously filled up.

If you try to manually clean up just with a rm -rf /tmp/*, it will fail because the files are owned by dhapache and are not writable by anyone else. But, with DreamHost VPS, you have the ability to add admin users (aka sudoers). As an admin user, you can then set up a cron to automatically clear out the /tmp directory of old files:

su myadminuser
sudo crontab -e

Then in the editor which opens, add this line:

0 0 * * * find /tmp -mtime +5 -exec rm -rf {} \;

This will delete all files under /tmp which haven’t been modified in 5 days; it will happen every day at midnight.

My X-Team Superhero Identity Revealed

Tonight we at X-Team had a very special meeting: the induction ceremony for new superheroes! X-Team employees are given superhero identities, and I was next in line for induction along with Wojtek Zając and Ben King. Our meeting was extra special because five of us have been together in Los Angeles this month working for a client on-site, and so we were able to meet in person while we logged in to our chat room to join up with everyone else around the world. So my superhero identity is:

Thunderboy

Thunderboy(Weston) is a highly intelligent and technologically resourceful elemental of Nordic descent who can manipulate, control weather and transcommunicate (via electronic voice) through his thundercloud static field. With his static field, he also is able to create lightning bolts and move within them, allowing him to travel at impressive speed.

The name is extra meaningful as it was the superhero name that I went by as a kid, so things have come full circle! Along with my name and description, I was also given a badge depicting my superhero self (right), and incidentally my mask actually looks quite similar to Condorman’s, my favorite old superhero movie. Thanks so much to my coworkers at X-Team for the effort that went into this and for making me feel so part of the team. It’s truly an honor to be working with you, such a talented international team!

Here’s the slightly-abridged transcript of our chat for the induction with the unveiling of my superhero:

tine: …and we have one more superhero to induct today.
tine: this is someone who was a superhero coming in, but sealed his superhero status within the first week of working with us.
tine: someone who’s taking us all by STORM and made a BIG, BIG impression.
tine: for this superhero, we travel back to the U.S, and to the Westcoast..and we welcome…

weston: yay!
benking gave weston a high five!
david gave weston a high five!
tine gave weston a high five!
adi gave weston a high five!
marconi gave weston a high five!
hz gave weston a high five!
dargaud gave weston a high five!
wojtek gave weston a high five!
vio gave weston a high five!
tine: @weston, you shall now be known as…
tine: DRUMROLL PLEASE
marconi: druuuuuuummmmmuuummmmummm
tine: daruuuuuumdrummmmmmmdrummmm
wojtek: come on Tine we’re drumrolling here 😛
tine: druuuuuuuuuuuuuuuumdarrrummm
tine: drrrrrrrrrrr
tine: uuuuuuuuum
tine: ruum
wojtek: Tine!!! 😀
Benking faints with anxiety
tine: Thunderboy
wojtek: yay 🙂
marconi: la la la la la la Thunder!
tine: Thunderboy is a highly intelligent and technologically resourceful elemental of Nordic decent who can manipulate, control weather and transcommunicate (via electronic voice) through his thundercloud static field. With his static field, he also is able to create lightning bolts and move within them, allowing him to travel at impressive speeds.
weston: That’s the superhero name I had as a kid 🙂
Thunderboy
vio gave weston a high five!
marconi gave weston a high five!
benking: woe nice one weston
josh gave weston a high five!
josh: nice!!
adi gave weston a high five!
hz gave weston a high five!
tine gave weston a high five!
adi: congrats @weston
tine: Welcome to the league, @weston!
weston: Awesome, I like it!
weston: Thanks all!
marconi can’t wait to see the new superheroes with their new avatars 🙂
tine: @wojtek, @benking, @weston – you are all amazing, and well-deserving of your new superhero statuses. Wield your new powers with care, but put them to good use!
dave: Welcome!!! The league has gone to a whole new level with these new heroes!