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

Drupalize.me:
Learning Drupal 8 from Boilerplate Code
Jul 30, 2015 @ 11:48:06

On the Drupalize.me site they've posted a guide to getting started with Drupal 8 based on the boilerplate code that already comes with the release.

Drupal 8 represents a lot of changes and a steep learning curve for many Drupal developers and themers. While many of these changes are exciting, there are many things to learn just to get started. One way to learn about the code involved with Drupal 8 modules and themes is to take a look at core's modules and themes for examples to follow. Another is to use a code-scaffolding tool like Drupal Console to generate boilerplate code and comments that you can learn from and then customize.

He makes the assumption that you already have a development environment set up and working then helps you install the Drupal Console for use in the rest of the tutorial. You can then use this command line tool to create a new Drupal 8 installation and generate the boilerplate code for a new theme. Finally, they show the creation of the two other related components: a new module and a block plugin instance. These are generate generic code you can use as a reference point for either updating your current Drupal projects or create new ones.

tagged: drupal8 commandline console instance theme plugin block installation

Link: https://drupalize.me/blog/201507/learning-drupal-8-boilerplate-code

Andrew Embler:
Creating a Z-Ray Plugin for Zend Server 8.5
Jul 22, 2015 @ 11:37:45

In this post to his site Andrew Embler shows you how to create a custom Z-Ray plugin for the Zend Server (v8.5) to show some statistics about requests made to the application.

Zend just released version 8.5 of their Zend Server application server. A major part of this release is the plugin gallery, which provides an App store for Zend Server extensions. These extensions can add application-specific debugging features to the Z-Ray Debugger. We've built one such extension specifically for Concrete5. It didn't take long – just a day or two. That said, there were some bumps in the process, as you're working on a platform for which the documentation hasn't quite caught up yet. With that in mind, I'm going to share my process for building the Concrete5 Z-Ray plugin, in the hopes that it might help someone who is building their own Z-Ray plugin for Zend Server.

The post is pretty comprehensive, sharing all the code you'll need to implement the extension along the way. He's broken it up into sections to help make it a bit more manageable:

  • Create Your Directory
  • Place the deployment.json file in the directory
  • Add Additional Items specified by deployment.json
  • Add the Z-Ray specific Directory
  • Create the Z-Ray PHP Class
  • [Adding] The Logo
  • Basic Panel Details: The Pages Panel
  • Advanced Panel Details: The Blocks Panel

Screenshots also accompany some of the steps showing you what the page output should look like once the files and functionality are in place.

tagged: zray plugin zendserver tutorial application server platform

Link: http://andrewembler.com/2015/07/creating-z-ray-plugin-zend-server-85/

Sameer Borate:
Accessing WordPress data using the new REST api
Jul 16, 2015 @ 09:53:57

Sameer Borate has posted an article showing you how to use the WordPress REST API (set up by this plugin) to access the data housed inside your WP installation.

WordPress is without doubt the most used CMS system around. Various sources peg the usage around 20-30% of all web sites. Whatever the correct figure, there is no doubt that the collective content of WordPress sites is enormously large. However almost all content is virtually held in independent WordPress sites with no way to easily access a sites content programmatically. [...] As WordPress is moving towards becoming a fully-fledged application framework, we need new APIs. At present a REST api plugin is available to access your site’s data in simple JSON format, including users, posts, taxonomies and more.

He walks you through the installation of the plugin and how to make a request to the REST API's test endpoint to ensure everything's functioning correctly. He also includes an example request that fetches the contents of a post by it's ID. The tutorial wraps up with a look at authentication and how the plugin provides two kinds of handling: basic authentication (HTTP Auth) and OAuth. You can find out more about the structure and functionality of the API on the project's website.

tagged: wordpress rest api tutorial installation setup plugin

Link: http://www.codediesel.com/wordpress/accessing-wordpress-data-using-the-new-rest-api/

SitePoint WordPress Blog:
The WordPress Plugin Boilerplate Part 2: Developing a Plugin
Jun 30, 2015 @ 10:07:50

The SitePoint WordPress blog has posted the second part of their series covering the creation of a WordPress plugin with the help of the WordPress Plugin Boilerplate. In this latest article they build on the first part of the series and start in on the actual plugin development.

In the first part of my series, an introduction to the WordPress Plugin Boilerplate, we looked at how the code is organised within the Boilerplate. To continue with this series, we’ll apply what we’ve learnt previously to build a real working plugin. We are going to take a look at how quickly we can get our plugin up and running using the Boilerplate code, with as little work as possible. This article will focus on creating and activating the plugin, as well as developing the admin facing functionality of the plugin.

They show you how to create a simple "time since posted" plugin with a few customizations available. They show how to use the Boilerplate generator to set up the basic plugin file structure and installing it on your WordPress application. From there they show you how to create a simple "Settings" page for the plugin and making it work via the functionality Boilerplate offers. The post then shows how to register the plugin, populate the options page and saving the changes the user makes.

tagged: wordpress boilerplate plugin generator tutorial development lastposted

Link: http://www.sitepoint.com/wordpress-plugin-boilerplate-part-2-developing-a-plugin/

SitePoint PHP Blog:
Automated Testing of Drupal 8 Modules
May 04, 2015 @ 11:06:08

The SitePoint PHP blog has a tutorial posted talking about the automated testing of Drupal 8 modules, the components of the popular PHP-based content management system. In it author Daniel Sipos shows how to create a few tests for some functionality created in previous articles.

In this article we are going to look at automated testing in Drupal 8. More specifically, we are going to write a few integration tests for some of the business logic we wrote in the previous Sitepoint articles on Drupal 8 module development. [...] But before doing that, we will talk a bit about what kinds of tests we can write in Drupal 8 and how they actually work.

He makes use of the SimpleTest unit testing tool for PHP (versus something like PHPUnit) as it has become a standard for Drupal's own testing. He talks briefly about what SimpleTest is, how it integrates with Drupal and what kinds of tests already exist. He then gets into testing his own functionality - checking route information, that the page exists, the contents of the resulting page and the addition of a custom block plugin. He shows how to create these simple tests, extending the WebTestBase class, and checking each item on the list. He also includes an example of the resulting output of the successful testing, including time to execute and the detailed results of each test.

tagged: drupal8 automated testing tutorial simpletest introduction exists form custom plugin

Link: http://www.sitepoint.com/automated-testing-drupal-8-modules/

SitePoint PHP Blog:
Creating Custom Field Formatters in Drupal 8
Mar 12, 2015 @ 12:29:01

The SitePoint PHP blog has a new tutorial posted today showing how to create custom field formatters in a Drupal 8 application. Custom formatters allow you to enhance the current functionality of objects in the application and extend them with additional functionality.

With the introduction of annotated plugins, a lot has changed in Drupal 8. We have a more streamlined approach to describing and discovering pieces of functionality that extend the core. Along with many other components, the former Field API (part of the larger and consolidated Entity API) is now based on plugins. In this tutorial we will go through defining a custom field formatter for an existing field (image). What we want to achieve is to make it possible to display an image with a small caption below it. This caption will be the title value assigned to the image if one exists.

They start with a new custom module, starting with just the YAML configuration. Then they help you create the field formatter as a plugin in the "Plugin/Field/FieldFormatter" namespace (code included). They explain how this code works and show how to add it as a hook to make it available to the template layer. Finally they show it in use and how it places the title value into the image caption in the result.

tagged: drupal8 custom field formatter tutorial plugin image title

Link: Creating Custom Field Formatters in Drupal 8

Zend Blog:
Developing a Z-Ray Extension
Feb 25, 2015 @ 11:54:41

Zend recently introduced their Z-Ray inspection tool that allows you to see inside your application and know what's happening in your code, your database and has support for major PHP projects. In this new post to their blog they show you how to develop a custom extension for the Z-Ray system.

One of the coolest features in Z-Ray is the ability to plug in your own extensions. Meaning, you can customize existing Z-Ray panels or add your own personalized Z-Ray panel for displaying information you think is important for developing your specific application. This short tutorial will describe how to write a basic extension for Z-Ray. More specifically, we’ll be writing a Z-Ray extension for WordPress that extracts and displays a list of loaded WordPress plugins.

They give you a list of things you'll need to set up before you can get started including a simple WordPress installation on a Zend Server instance. With these in place they help you create the "zray.php" file to define the extension, how to enable it and setting up a "trace" on a function to hook it into the execution. They then dump the WP plugin information and reformat it a bit to show only the list of names and versions in the output panel. As a last touch, they add a logo to the panel to show in the bottom menubar with the WordPress logo.

tagged: zray zend extension custom wordpress tutorial plugin

Link: http://blog.zend.com/2015/02/25/developing-z-ray-extension

NetTuts.com:
Using Plugins to Speed Up WordPress
Feb 23, 2015 @ 09:54:06

On the NetTuts.com site today they've posted the first part of their "Speeding Up WordPress" series - Using Plugins to Speed Up WordPress. In this start to the series, they show you how to use two methods to speed up your WordPress installation: using caching and database optimization.

One of the most popular talking points in the WordPress community is speeding up WordPress and optimizing web pages. I don't think there is a WordPress blog without an "X Tips to Speed Up WordPress" article. Don't get me wrong, it's a good thing. But we need better articles about this topic instead of dull plugin round-ups. This may look like yet another "tips for speeding up WordPress" tutorial, but in this three-part series, we're going to go through every aspect of optimizing and speeding up your WordPress website.

They start with caching and show how do both client and server-side caching using techniques both inside and outside of WordPress itself. They also link to two plugins to help with the server-side handling. Following the caching talk they look at optimizing the database. They point you towards the WP-Optimize plugin as the best way to squeeze the most performance from your database (without breaking how WordPress works).

tagged: plugin wordpress speed optimizae cache database

Link: http://code.tutsplus.com/tutorials/using-plugins-to-speed-up-wordpress--cms-22055

JetBrains Blog:
Laravel Development using PhpStorm
Jan 21, 2015 @ 09:03:16

The JetBrains blog has posted about an update to their popular PHPStorm IDE tool. In this new post they talk about the next level of integration they've introduced for those developing Laravel-based applications.

Last summer, we introduced support for Blade, the template language used by Laravel. Support for artisan, the command line tool for Laravel developers, is baked into PhpStorm as well. Using the Laravel plugin and the Laravel IDE helper, we can further extend PhpStorm's support for Laravel applications.

They walk you through each of these two new updates, showing what kind of features they enable and some screenshots of the interface in use. For more information and to check out other features in this new plugin/helper setup, see this documentation page.

tagged: development phpstorm laravel plugin helper integrate

Link: http://blog.jetbrains.com/phpstorm/2015/01/laravel-development-using-phpstorm/

NetTuts.com:
Using Google Two-Factor Authentication With WordPress
Jan 05, 2015 @ 13:38:39

NetTuts.com has a new tutorial for the WordPress users out there wanting to enhance the security of their application. In it they show you how to set up Google's two-factor authentication as a part of your standard login prompt.

Brute force login attacks targeting WordPress sites are quite common, such as in April 2013 when more than 90,000 sites were targeted. There are a handful of good ways to protect yourself against these attacks: choosing a strong administrator password and installing a plugin that guards against brute force logins, such All in One WP Security or BruteProtect Changing the default wp-admin url with a plugin such as HC Custom URL. However, I prefer to use a two-factor authentication method that requires a code from my phone to complete the login process.

Thanks to a handy WordPress plugin, adding in support is relatively easy. They walk you through the installation of the plugin, activation and how to set up your Google Authenticator (or similar) application on your mobile device via a scannable QR code.

tagged: wordpress twofactor plugin login googleauthenticator

Link: http://code.tutsplus.com/tutorials/using-google-two-factor-authentication-with-wordpress--cms-22263