Articles - Page 2 of 4 - Ryan Kienstra

static-vs-instance

OOP: Instance Vs. Static

By: Ryan Kienstra on: January 18, 2015  in: OOP For WordPress

By understanding instance vs. static properties, you can write flexible code. And build complex object-oriented programs. If you aren’t familiar with classes and instances, you might read OOP Fundamentals For WordPress. Properties: Instance Vs. Static Instances can store variables called instance properties. They aren’t connected to properties of other instances. But instances can also access […] Read more


OOP Fundamentals

OOP Fundamentals For WordPress

By: Ryan Kienstra on: January 11, 2015  in: OOP For WordPress

You program for WordPress using PHP functions and variables. But you’d like to use object-oriented programming. Maybe you’ve read my guide, OOP With WordPress: Why? In writing functions, you’ve already used: OOP Fundamentals Abstraction Code Reuse Abstraction Functions often have private variables. They can be abstracted from the local scope. Nothing else can access them, […] Read more


OOP With WordPress gears

OOP With WordPress: Why?

By: Ryan Kienstra on: January 9, 2015  in: OOP For WordPress

You’ve been programming with functions and variables. And most of WordPress doesn’t use OOP. So why do you need object-oriented programming? Store variables between functions Reduce arguments Show structure Plugin Example My WordPress plugin Bootstrap Widget Styling filters the markup of widgets. Here’s how to do it without object-oriented PHP: add_filter( 'wp_list_pages' , 'bws_filter_pages_widget_markup' ); […] Read more


Fast WordPress Searches

Fast WordPress Searches

By: Ryan Kienstra on: January 8, 2015  in: WordPress VIP

If you have a lot of content on WordPress, you’ll need a fast way to search it. Maybe you have a directory with an advanced search. WordPress VIP agency 10up recently released their Engineering Best Practices. These have many techniques for fast WordPress searches. Prefer WP_Query To get_posts 10up explains that the get_posts function actually […] Read more


WordPress VIP Unique Standards

WordPress VIP: Unique Standards

By: Ryan Kienstra on: January 6, 2015  in: WordPress VIP

Many of the VIP coding standards are different from self-hosted WP standards. The size and structure of VIP multi-sites often require different coding. Users There’s a single database for all users in WordPress.com. So you can’t do any CRUD operations on it: create, read, update, or delete. To parse the users, call get_users() and operate […] Read more


WordPress VIP caching

WordPress VIP Caching

By: Ryan Kienstra on: January 5, 2015  in: WordPress VIP

Many of the WordPress VIP coding standards¬†are meant to ensure that caching works. So these standards can help most sites that use caching. Batcache is the full-page caching system that WordPress VIP sites use. After a set number of requests for the same page, it saves a copy and serves it to new visitors. It […] Read more


WordPress VIP Similarities

By: Ryan Kienstra on: January 4, 2015  in: Security, WordPress VIP

Some of the coding standards for the WordPress VIP platform are similar to the normal WP standards. Developers with plugins and themes on wordpress.org will know them. But these become more important in the high-volume VIP multi-sites. These practices can improve security and performance of any WordPress site. Remote Requests Use the WordPress APIs, like […] Read more


escaping WordPress output icon

Escaping WordPress Output

By: Ryan Kienstra on: January 3, 2015  in: Security, WordPress VIP

Never assume anything. That’s a core principle of the WordPress VIP Standards. Don’t assume that data is secure. Even if it was validated on input. Even if an¬†administrator entered it. Almost all PHP values should be escaped when they’re echoed. This will guard against malicious scripts. And ensure that the display isn’t broken by the […] Read more


Get Free Updates

  • This field is for validation purposes and should be left unchanged.