PHP arrays are great when you’re working with simple data structures, but what if you have a collection of objects that needs to be treated as an array? The ArrayObject class included in Standard PHP Library (SPL) is an excellent solution.
A show of hands, please!
For those of you who distribute their own plugins, who enjoys selecting your plugin files and directories, compressing them and then uploading that zip file to the server for distribution every single time you wanted to release a new version?
My love for Varying Vagrant Vagrants is no secret. Just like Franks Red Hot, I use that s*** on everything. I started using it back in the summer of 2013 and haven’t touched Mamp, Xampp, DesktopServer or Parallels since. Why would I bother when I can have a perfectly configured WordPress installation in two terminal commands?
My little plugin that I created for a former employer, Multisite Maintenance Mode for WordPress has finally been updated. This latest update takes care of some long-standing requests from users in the support forum as well as some emails directly to me. For those who waited so long, I apologize.
Why should you use this plugin?
Many maintenance mode plugins block the content for all visitors. This isn’t terribly useful, especially if you have a high traffic site. More traffic = more money. Most of the time you only need to keep anything in the database from changing. This plugin does just that for WordPress multisite installations.
- Added internationalization functions to all the strings.
- Added a
.potfile to allow others to translate the plugin.
- Now using the proper actions to save the plugin settings.
- Fixed ‘Headers already sent’ error upon save.
- Consolidated the PHP for easier maintenance.
- Added filter
mmm_allow_user_with_capability. Allows you to change the minimum capability required in order to access the WordPress backend.
- Ready for WordPress 4.0
I stared at my laptop in disgust. We had just wasted an hour chasing a problem with a small (but not insignificant) part of our plugin all because we had used a function that wasn’t supported in a certain version of PHP. It was something so simple yet it had a business-halting effect on a number of our users.
Before we get started, I want to apologize for how late this post has come (My talk was on October 1).
Fact: Starting a project sucks
Kind of. Getting that contract signed and seeing that deposit clear the bank is an amazing feeling. What’s next? Getting the client site setup on your computer. That’s the part that sucks. Let’s think about how most of us started with development environments. XAMPP and MAMP are a great start, but it takes up a good amount of time to setup a new WordPress site. How long does it take you to complete the following steps? Continue reading My Talk on WordPress + Vagrant
Setting up your dev environment for each WordPress project is arguably the most difficult step. You have to setup your server configuration, create the database then install WordPress. But wait, there’s more! After all of that you then install your plugins and themes, then add dummy content. Two hours later you have an environment that doesn’t resemble your production server or have all the tools you need for development.
You are a developer, not a server administrator. There’s a better way.
Join me on Oct. 1 at Improving Enterprises (6:15pm) to learn about WordPress development with Vagrant. I’ll show you how to make the setup process quick and painless while giving you the tools you need for effective development. Not a WordPress developer? Even you will come away with knowledge to help you in whatever language or library you choose.
If you’d like to follow along during the talk, I’d suggest getting your laptop setup in advance
You can RSVP here. See you there!
You’ll need to have two things installed on your laptop in order to follow along:
Yeah. That’s it. I hope you weren’t expecting more.
I just wanted to let y’all in on a plugin I made. I call it Multisite Maintenance Mode. It was done two weeks ago but I’m just now getting around to writing about it.
The idea is simple. You have a multisite WordPress installation with many users making content changes at any given moment. You also have about 1 hour of maintenance to perform and you may lose any database changes made during that time. How do you keep others from making those database changes? Simple.
Lock them out
The plugin is fairly straight forward. Any user who is not a super-administrator is redirected to the homepage when they attempt to access the dashboard. A message is also displayed in the admin bar that directs users to an update page of your choosing. Yeah. That’s it. I’m not saying it’s perfect but it gets the job done.
Let me know what you think!
My previous posts in this series have been pretty technical, so for the last two posts I’d like to tone it down and focus on some bigger-picture ideas. This post is about re-thinking how users interact with your theme or plugin.
Prepare your theme/plugin for translation
Do you think your theme users all speak the same language? Think again. As worldwide WordPress usage continues to grow so will the number of users likely to make use of that wonderful theme you just created. Do you need any more encouraging? How about explosive growth in Internet usage in Asia and the Pacific islands. Now, I’m not saying you need to learn 20 languages and translate your theme all on your own (though you could). There are plenty of people out there who are willing to translate your theme as long as you’ve made an effort to follow some WordPress best practices.
WordPress offers a few functions to get your theme or plugin ready for translation and it takes very little effort on your part. Shannon Smith did an excellent touching on almost everything you needed to know about WordPress i18n (that’s internationalization) but I’d like to go over a few things with you. You should use these functions for every hard-coded string in your files. Here’s a simple example:
__( 'Read more', 'textdomain' );
Let’s break this down. ‘Read more’ is the sting you want to translate and ‘textdomain’ is the, we’ll, text domain. It tells WordPress which language files to load. Usually you will change ‘textdomain’ to something unique to your theme/plugin.
I don’t want to spend too long on this topic because there’s still much more to cover. WordPress i18n could take up an entire blog to cover. I just wanted to get you interested.
Make your theme play nice with mobile devices
I don’t know much about you but I can tell you that your site has been viewed on a mobile device. More than once. What did those visitors see? Did they have to pinch, pan and curse just to view your content? If so, you should be converting your site to a responsive design. Now. Not tomorrow. How can you argue with the great Ethan Marcotte? And with the ever-increasing growth of mobile web usage I don’t see how you could continue with a ‘desktop-only’ experience on your site.
That’s all I’m going to say on the subject. It’s 2013. Get with the program.
Create great experiences on the backend
As WordPress continues to grow as an application framework the complexity of the back end will grow along with it. As the director of UI engineering for 10up, Helen Hou-Sandi has brought sanity to what could otherwise be mass chaos for the solutions 10up creates for its clients.
While it’s so easy to be content with the structures built into WordPress, let us all learn from the examples Helen showed us at WordCamp San Francisco. For structured data create meta boxes and fields for easy entry. Make it easy for users to find the content they are looking for by customizing the post lists. When you have the privilege to create plugins that change a great deal of how WordPress operates, push yourself to make custom admin screens that provides the user an exceptional experience. You’ll likely learn new technologies such as AJAX in the WordPress admin and Backbone.js, making you a well-rounded developer.
Do you have other ideas? Share them in the comments.
In the last post in this series I gave you some tools to improve your code. Now I’d like to give you even more tools to improve your processes for pushing your code live. Matt Mullenweg touched on how important process was in the development of MP6. Process isn’t something that can be ignored. I hope that what you’re about to read will make you reconsider the old ways of doing things and push you through your ‘WordCamp Hangover’.
Continue reading Powering Through the WordCamp Hangover: Hone Your Process