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

TutsPlus.com:
WP REST API: Internals and Customization
Apr 14, 2016 @ 11:24:28

TutsPlus.com has posted the latest part of their series focusing on the WordPress REST API. In this new part of the series they look at some of the internals of the API code and the customizations you can make on the data returned.

In the previous part of the series, we learned about creating, updating, and deleting content remotely through the WP REST API. It allows us to create platform-independent applications that work seamlessly with a WordPress powered back-end, providing a rich experience to the user.

In the current part of the series, we will take a look at the internals of the WP REST API and how they work together to power the API. After that, we will learn to modify server responses for the default endpoints to include custom fields.

They walk you through a few different topics around the API including the internal classes that power it, how to modify the server and making custom fields editable. There's a bit of code involved when it comes to modifying the custom fields in the response and registering an editable field. The rest is mostly about configuration and what methods are doing what during the request.

tagged: wordpress tutorial wpapi api rest internals customization fields editable

Link: http://code.tutsplus.com/tutorials/wp-rest-api-internals-and-customization--cms-24945

NetTuts.com:
Kick-Start WordPress Development With Twig: Introduction
Apr 12, 2016 @ 09:14:01

On the NetTuts.com site they've posted the first part of a new series showing you how to combine WordPress and Twig to "kick-start" your development with this popular content management system.

A lot has been written about the future of WordPress, and many believe that it lacks a templating language, especially when platforms like Django, Ruby on Rails, Node.js, Laravel, and even Drupal possess one. Facts like "WordPress powers nearly 25% of the web" make it difficult to question its current PHP-based templating system. But as the modularity in code is still missing, one can ask when the core will have a templating engine.

The good news is right here! The Twig templating engine along with a plugin called Timber can help us write super-clean and modular code in WordPress.

They start with a brief introduction to Twig and a bit of history of where it came from. They also give some reasons of why you might want to use this popular templating engine (besides its popularity, of course). The tutorial then starts in talking about Timber and how it integrates with both WordPress and Twig to render the Twig templates. This first article is more of an introduction to this integration and doesn't contain much in the way of code examples. That will be coming soon in the following parts of the series, though.

tagged: wordpress twig integration tutorial series part1 timber

Link: http://code.tutsplus.com/articles/kick-start-wordpress-development-with-twig-introduction--cms-24781

The Changelog Podcast:
#197: The Future of WordPress and Calypso with Matt Mullenweg
Mar 07, 2016 @ 11:10:13

In episode #197 of The Changelog podcast they're joined by Matt Mullenweg (CEO of Automattic) to talk about the future of WordPress and how the newer "Calypso" interface fits in to the overall picture.

This week we’re joined by Matt Mullenweg, the creator of WordPress and the CEO of Automattic. We discussed the past, present, and future of WordPress. We talked about the role of JavaScript for WordPress, their new REST API, Calypso, and more.

They talk about WordPress in general, Matt's "State of the Word 2015" presentation, beautiful code, and Steve Krug's Advanced Common Sense website as well. You can listen to this latest episode either through the in-page audio player or by downloading the mp3 directly. If you enjoy the show, be sure to subscribe to their feed and get more great shows in the future.

tagged: wordpress thechangelog podcast ep197 mattmullenweg interview calypso

Link: https://changelog.com/197/

Laravel Daily:
Holywar: when to use Laravel vs WordPress?
Feb 18, 2016 @ 11:09:15

On the Laravel Daily site there's an interesting article that shares some opinions on when to use Laravel and when to use WordPress as a base for your applications.

In PHP world there are two big groups of developers – those who work with Content Management Systems (WordPress, Drupal etc.) and those with frameworks (Laravel, Symfony etc.). And rarely people work with both worlds – cause their philosophy is fundamentally different.

But when you get a new project from a client – how to decide whether Laravel is the best choice? Or maybe simple WordPress would be enough and would save time/money? Sometimes it’s not that easy to decide. So here are my tips – questions you need to ask.

In the remainder of the article he suggests four questions to ask yourself to help make the decision one way or another:

  • Content or user actions?
  • Plugins or packages?
  • MVP or serious project?
  • Who will work on the project?

He elaborates on each point with a bit more context and criteria that could help answer the question in your case.

tagged: laravel wordpress usage questions evaluate decision

Link: http://laraveldaily.com/holywar-when-to-use-laravel-vs-wordpress/

Noupe.com:
How Will REST API Affect WordPress Developers?
Feb 03, 2016 @ 10:48:31

On the Noupe.com site they've posted an article talking about the WordPress REST API that's been included by default in the project and how it will affect developers on the platform.

With the advent of WordPress 4.4 last year in December, we saw the inclusion of the first half of REST API in the WordPress Core, and the rest of it is expected to be with us in the upcoming major release of WordPress. [...] The community is abuzz with all talks about how important REST API will soon be for WordPress development, and how it is going to change the way developers code and interact with WP.

So, how is REST API going to affect the WordPress users and developers, and what exactly will we be able to accomplish using it?

In the article they talk about the impact that the API will have on the "rise of Javascript" in the WordPress application and the role PHP could play in it all. They also talk about cross-platform integrations the REST API makes possible, the Calypso interface that was recently announced and how it opens up a new world of mobile application possibilities.

tagged: wordpress api rest impact developers javascript crossplatform calypso mobile

Link: http://www.noupe.com/development/cms/how-will-rest-api-affect-wordpress-developers.html

TutsPlus.com:
Fortifying Security in WordPress, Part 1
Jan 25, 2016 @ 11:19:15

The TutsPlus.com site has posted the first part of a series wanting to help you secure your WordPress installation even more effectively. In part one of the series they cover some of the basics of securing the installation itself and the environment it lives in.

Do you think WordPress is secure? It's OK if you don't, because many people think WordPress is an insecure content management system, yet it's very far from the truth... at least today. [...] I'm sorry if you think the other way, but it doesn't. Frequent patches don't necessarily mean that a piece of software is poorly coded against security threats.

[...] The important thing here is to be responsive and preemptive, and that's something that WordPress excels at. [...] Yet, nothing is a hundred percent secure. We're living in times in which scientists are about to crack the code in our brains! Nothing is impenetrable, including our brains apparently, and WordPress is no exception. But the impossibility of 100% security doesn't mean we shouldn't go for 99.999%.

The remainder of the post is broken down into two different tips with the code/configuration changes and descriptions for what you need to update:

  • Securing the .htaccess File
  • Security Tricks for the wp-config.php File and Its Contents

The second item on that list also gets into some of the constant definitions and some advice on generating good "salt keys" for the configuration.

tagged: tutorial wordpress security series part1 htaccess configuration

Link: http://code.tutsplus.com/tutorials/fortifying-security-in-wordpress-part-1--cms-25403

Laravel News:
WordPress and Laravel
Jan 19, 2016 @ 11:33:11

The Laravel News site has a post sharing some of the tools you can use to connect your Laravel and WordPress applications directly and, potentially, allow for reading and writing between them.

WordPress is one of the most popular open source applications and that means many people are comfortable using its admin to manage their site. There are times when building out a site this is advantageous as it prevents you from having to retrain the user on how to manage content, menus, photos, and more. A popular way of setting up a site like this is to use WordPress as the admin and then build out the frontend in a framework such as Laravel.

For each package they include a brief description of what it has to offer and a code sample of it in use:

They also include links to a few other tutorials showing how to make the integration, some with their own (somewhat simpler) tools to bridge the gap.

tagged: laravel wordpress interoperability library tutorial

Link: https://laravel-news.com/2016/01/wordpress-and-laravel/

NetTuts.com:
WP REST API: Setting Up and Using OAuth 1.0a Authentication
Jan 15, 2016 @ 10:54:12

The NetTuts.com site has a new tutorial posted showing you how to work with the authentication of the WordPress REST API and using its OAuth 1.0a handling. This is part three in their series of tutorials introducing the WordPress REST API.

In the previous part of the series, we set up basic HTTP authentication on the server by installing the plugin available on GitHub by the WP REST API team. [...] For using authentication on production servers, there needs to be a more secure way of sending authenticated requests without risking exposing the login credentials. Thanks to the OAuth authentication method, those requests can be sent without exposing the username and the password in an unsafe manner.

In the current part of the series, we will learn to set up and use the OAuth authentication method to be used with the WP REST API plugin.

They start the tutorial with a brief look at what OAuth is and how it's used to authenticate the end user/client/software/etc. They then walk through the flow of a simple OAuth-based authentication system and the pieces that make it up. Then the article gets into how to install the plugin for your WordPress instance and activate it from the command line. They show how to test that it's enabled and how to use a command line client to create tokens you can then use to access the API in your own clients.

tagged: wordpress tutorial wpapi api rest oauth authentication series part3

Link: http://code.tutsplus.com/tutorials/wp-rest-api-setting-up-and-using-oauth-10a-authentication--cms-24797

NetTuts.com:
WP REST API: Setting Up and Using Basic Authentication
Jan 08, 2016 @ 11:37:58

On the NetTuts.com site there's a tutorial posted showing you how to set up and use basic authentication in the WordPress REST API. This is part two in their series introducing the WordPress REST API.

In the introductory part of this series, we had a quick refresher on REST architecture and how it can help us create better applications. [...] In the current part of the series, we will set up a basic authentication protocol on the server to send authenticated requests to perform various tasks through the REST API.

They talk about the methods that are available for authentication and how to configure your server and WordPress instance to use it. From there they show how to make authenticated requests to the API using various tools:

  • Postman
  • a Javascript framework (jQuery)
  • the command line via curl
  • using the WP HTTP API

Example code and screenshots are provided for each (where appropriate) helping to ensure you're up and working quickly.

tagged: wordpress rest api tutorial authentication basic postman javascript commandline

Link: http://code.tutsplus.com/tutorials/wp-rest-api-setting-up-and-using-basic-authentication--cms-24762

Kinsta Blog:
The Definitive PHP 7.0 & HHVM Benchmark
Dec 09, 2015 @ 09:07:44

On the Kinsta blog Mark Gavalda has shared their latest PHP 7 versus HHVM benchmarks now that the first official stable release of PHP 7 has been unleashed for public consumption. They opted for testing with a large variety of tools and software rather than simple benchmarking scripts to give a more "real world" look at the difference between the two.

To see how much of an improvement we can expect from this new PHP interpreter we put the public release version of PHP 7.0 to test and compared a couple of popular software suites’ performance using PHP 5.6.16, PHP 7.0 and HHVM 3.10.1 on a bare metal server (so virtualization doesn’t interfere with the results). Tested software includes WordPress 4.3.1, Drupal 8, Magento 2.0 CE, OctoberCMS build 309, PyroCMS v3 beta2, and Flarum v0.1.0-beta.4.

The basic tl;dr of the post is that HHVM still performs better for all of the software tested but PHP 7 is not too far off on some of them. They share the specifications of the machine (bare metal) they used for testing and get into the results for each of the seven pieces of software tested. Their results are in transactions per second and both graphed and numeric results are shown. Unfortunately, though, the Flarum software had to be kept on a "pending" list as it doesn't run on either PHP 7 or HHVM properly.

tagged: hhvm php7 benchmark popular software wordpress drupal magento octobercms pyrocms flarum

Link: https://kinsta.com/blog/the-definitive-php-7-final-version-hhvm-benchmark/