Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Delicious Brains Blog:
Hey WordPress Plugin Developers, Stop Supporting Legacy PHP Versions In Your
Mar 23, 2018 @ 09:46:06

On the Delicious Brains site they have a new post that makes a suggestion to the WordPress plugin developers out there: stop supporting legacy versions of your plugins and move on.

I recently saw this tweet from Danny van Kooten which reminded me of one of the many major gripes developers have with WordPress – supporting ancient PHP versions:

"STOP SUPPORTING PHP 5.2 IN YOUR NEW PROJECTS. No one using it is actively installing plugins, trust me."

Yes, (unbelievably) WordPress still supports installations of PHP 5.2.4! As plugin developers, we can’t change that over night but we have the power to stop supporting these legacy versions in our plugins where we have control over the codebase.

He talks about how, despite the fact that the WordPress project itself strives for ultimate backwards compatibility, it's just not run on older versions of PHP as much. They share some statistics about the number of WordPress installs on each version of PHP starting with v5.2. The results show that the overwhelming majority are on v5.6 with a split between <=5.3 and >=7.0 for the remainder. They also share some statistics from their own plugins finding that the >=7.0 takes the lead.

The post then shares some of the reasons for making the upgrade to only support newer versions of the language including security updates, speed and developer experience. It finishes up with some of the steps to follow to inform users of the intent to deprecate old support and when to make the move.

tagged: wordpress legacy plugin support opinion version

Link: https://deliciousbrains.com/legacy-php-version-support/

Ivan Enderlin:
How Automattic (WordPress.com & co.) partly moved away from PHPUnit to atoum?
Mar 22, 2018 @ 12:08:37

In a post to his blog Ivan Enderlin talks about a move that his team at Automattic (the company behind WordPress) made away from using PHPUnit for their application testing over to atoum and some of the reasoning behind it.

Few months ago at tagged: wordpress testing unittest atoum phpunit comparison migration

Link: https://mnt.io/2018/02/26/how-automattic-partly-moved-away-from-phpunit-to-atoum/

QuickerWP.com:
Make your WordPress blog fly with these speedy plugins and tweaks
Mar 22, 2018 @ 11:05:43

On the QuickerWP blog there's a new post with some recommendations of plugins and techniques you can use to make your WordPress blog "fly" (increase the overall performance).

WordPress sites are notorious for their poor loading times. The platform itself comes with very few optimizations, and once you start adding plugins, things will only go south from there. [...] Most of the performance penalties actually come from having too many plugins installed, a poorly optimized site configuration, and a theme that does not optimize loading speeds (most of them don’t).

[...] It’s rare to see high marks [on Yellow Lab Tools] (a B or A result), but after applying the tweaks listed here, we’ve managed to get our own site to score an A (92/100) result, and surprisingly low loading times. Try it on your site to see how you fare.

They have a list of seven recommendations:

  • Autoptimize plugin
  • WP Fastest Cache plugin
  • PurifyCSS
  • TinyPNG plugin
  • Guetzli (for image optimization)
  • CSS Sprites
  • QuickerWP

Each item in the list comes with a brief description of the enhancement it brings to the table and links to find out more information.

tagged: wordpress blog performance recommendation plugin list top7

Link: https://www.quickerwp.com/make-wordpress-blog-fly-speedy-plugins/

Delicious Brains Blog:
Full Page Caching With Personalized Dynamic Content
Jan 03, 2018 @ 11:19:13

On the Delicious Brains site there's a tutorial posted by Ashley showing you how to set up full page caching with personalized dynamic content instead of the usual package caching of static content every user should see. The post is focused on improving the performance of a WordPress-based site.

We’ve talked a lot about WordPress performance here at Delicious Brains and the importance of page caching. However, implementing a page cache on highly dynamic sites or sites which display personalized content isn’t always easy. Previously, we’ve covered Microcaching for dynamic content, but that still doesn’t help when personalized content is involved.

In this article we’re going to tackle that issue. We’re going to use Easy Digital Downloads and the Themedd theme to build a fictitious online store. This will present us with a few problem areas that mean we can’t perform page caching out-of-the-box.

The tutorial starts by outlining the issues that come up with traditional caching tools and dynamic content. It then gets into the changes required to make it work with the Simple Cache plugin. It shows the code involved in splitting the caching functionality by generic, static page caches and how to inject the dynamic content cache back into the page when a user-specific resource is requested.

tagged: full page caching dynamic content wordpress tutorial inject

Link: https://deliciousbrains.com/page-caching-personalized-dynamic-content/

Delicious Brains Blog:
Using VS Code for WordPress Development
Dec 05, 2017 @ 10:15:42

On the Delicious Brains site there's a tutorial that shows you how to use Microsoft's VS Code IDE for PHP development. They focus more specifically on WordPress development but a lot of the environment setup could be used for any PHP project.

If you keep up with the many different text editors and developer tools available, you may have heard of a newer IDE called Visual Studio Code. VS Code is a free, open source code editor that is lightweight like Sublime Text, but offers many of the same features as bigger IDEs like PhpStorm or WebStorm.

In this article I’ll review some features and extensions of VS Code that I really appreciate, and show you how to make the most out of it for WordPress and general web development.

The tutorial walks you through the installation and integration of various PHP development tools including an "intellisense" extension, XDebug support, a Javascript debugger and a few other helpful extensions. Install instructions are included as well as screenshots/screencasts showing the end result.

tagged: visualstudiocode vscode ide introduction installation setup debug integration wordpress

Link: https://deliciousbrains.com/vs-code-wordpress/

Delicious Brains:
SQL Query Optimization for Faster Sites
Nov 07, 2017 @ 09:53:47

On the Delicious Brains site they've posted a tutorial that provides some helpful tips and tricks for optimizing your SQL queries on your WordPress sites with the help of some basic techniques and software to analyze your current use.

With dynamic database-driven websites like WordPress, you might still have one problem on your hands: database queries slowing down your site.

In this post, I’ll take you through how to identify the queries causing bottlenecks, how to understand the problems with them, along with quick fixes and other approaches to speed things up. I’ll be using an actual query we recently tackled that was slowing things down on the customer portal of deliciousbrains.com.

They then walk through some of the methods for locating the queries that could be causing issues including the use of the QueryMonitor plugin and the MySQL slow query log. They provide some tips for understanding what makes the query slow and how to use the MySQL Workbench tool to determine the structure of the database and look for optimizations. Finally they get into some of the things they did to solve their own issue including adding caching, better understanding the need of the query and "thinking outside the box" with indexes and normalization.

tagged: sql query optimization performance mysqlworkbench slowquerylog mysql wordpress

Link: https://deliciousbrains.com/sql-query-optimization/

Delicious Brains Blog:
How to Develop a WordPress Plugin Using Webpack 3, React and the REST API (pa
Nov 06, 2017 @ 09:46:31

On the Delicious Brains site they've posted the latest part in their "Develop[ing] a WordPress Plugin Using Webpack 3, React and the REST API" series. This is part two of the series, building on the foundation set up in part one of the series. In this second part more work is put into the Webpack setup, the creation of the REST API and the React frontend.

Have you ever wondered how to get React working with the WordPress REST API? If so you’re in the right place – that’s what we’re going to cover in this follow-up to part one of how to develop a WordPress plugin! In our previous post, we explained what Webpack is and got it integrated into our WordPress sample plugin. We also got BrowserSync set up and reloading our app. In this part we’re going to look at how to get the React side of our plugin working with the WordPress REST API so that the plugin actually does something cool.

The tutorial starts with the Webpack changes, mostly configuration updates adding in additional plugins. Next comes the changes for the REST API and working with it to get information from the WordPress backend. After showing you how to test that the API is working as expected they move along to the React changes on the frontend and using components to split up the logic and make it easier to maintain.

tagged: wordpress rest api tutorial webpack react plugin

Link: https://deliciousbrains.com/develop-wordpress-plugin-webpack-react-rest-api-part-2/

Tim MacDonald:
Backup multiple sites and frameworks with 'Laravel Backup'
Nov 01, 2017 @ 10:56:19

In a new post to his site Tim MacDonald covers a Laravel backup package provided from Spatie and how to use it to backup your sites (and not just Laravel ones).

Using Spatie's Laravel Backup package you can backup several sites on a server from a single app install, including Laravel apps and WordPress sites.

Laravel Backup is a fantastic package brought to us by to ever awesome team at Spatie, and is only one of the many great packages they have in the wild. This package makes it super simple to backup your Laravel applications, including all your files and production database, to a 3rd party storage facility, such as Amazon S3.

He then describes his own setup, running a smaller server that hosts several of his sites that use Laravel, WordPress and static content. He needed a backup solution that would allow for him to manage backups for all of them. He then walks through the setup of the package and how to configure it for each site type. The post finishes with the command to execute and run the backup for the site and how to schedule it as a part of the recurring jobs handling.

tagged: laravel backup tutorial introduction setup configure wordpress static

Link: https://timacdonald.me/backup-multiple-sites-frameworks-laravel-backup/

SitePoint PHP Blog:
Git and WordPress: How to Auto-Update Posts with Pull Requests
Oct 24, 2017 @ 11:50:36

On the SitePoint PHP blog editor Bruno Skvorc has posted a tutorial showing how to combine Git and WordPress to make it easier to update posts on the site via pull requests.

At Bitfalls.com, we also use WordPress for now, and use the same peer review approach for content as we do at SitePoint.

We decided to build a tool which automatically pulls content from merged pull requests into articles, giving us the ability to fix typos and update posts from Github, and see the changes reflected on the live site. This tutorial will walk you through the creation of this tool, so you can start using it for your own WordPress site, or build your own version.

He starts by outlining the plan for the process including some of the functionality that will be put to use - like WPGlobus and Markdown files. He then walks you through the creation of an environment for the end WordPress installation (for testing), creates the webhook on the GitHub side to handle the push and the code needed to grab the content and push it into WordPress. He also includes an example of the workflow, showing a PR being created and merged to ensure the flow is functioning as expected.

tagged: wordpress git pullrequest tutorial push publish review

Link: https://www.sitepoint.com/git-and-wordpress-how-to-auto-update-posts-with-pull-requests/

DeveloperDrive:
How to Speed Up WordPress Development and Maintenance with WP-CLI
Oct 05, 2017 @ 11:20:51

The DeveloperDrive site has posted a tutorial for the WordPress users out there showing them how to enhance their workflow with WP-CLI, the command line tool that can be used to administer your WordPress instance without needing to log into the web UI.

As a WordPress developer, you’ve probably installed the WordPress CMS, updated it, and activated themes and plugins hundreds of times. And although these routine development and maintenance tasks are fairly easy to do with WordPress’ graphical user interface, doing them over and over again isn’t very efficient.

The good news is that you can easily and effectively speed up WordPress development and maintenance with the WordPress Command Line Interface (WP-CLI). With this in mind, in this post, we’ll explore the different ways you can use WP-CLI and offer some helpful WP-CLI commands to help you get started with a step in the right direction.

The post starts with a brief introduction to the WP-CLI tool and shows how to get it installed on your system in a Unix-based environment (basically grabbing a phar). It then walks you through some of the features of the tool including:

  • installing a new WordPress instance from scratch
  • keeping it updated
  • managing themes and plugins
  • creating custom post types

Examples of each command line call are included as well as some details about options and what's happening behind the scenes.

tagged: wordpress development wpcli commandline tool tutorial

Link: http://www.developerdrive.com/2017/10/how-to-speed-up-wordpress-development-and-maintenance-with-wp-cli/