Recent Changes to generator-plugin-wp

I last went over the features of generator-plugin-wp in May and a lot has changed since then! There are three more sub-generators (and more on the way), the JavaScript workflow is improved, PHPUnit tests are built in for the main plugin generator and all relevant sub-generators, and the PHP include workflow is easier.

New Sub-Generators

Since May three new sub-generators have been added CPT, options, and widget. If you missed it last time: a sub-generator is a secondary generator that can be run on a plugin that was previously generate by generator-plugin-wp. So if I wanted to add a feature to a plugin I’m working on I could run yo plugin-wp:cpt book to add a new include file to my plugin that creates a book CPT.

The CPT sub-generator adds a new php class to the plugin which extends CPT_Core and by default includes CMB2 fields for the new CPT.

The options sub-generator adds a new php class which creates an admin options page with CMB2 available to build it out.

The widget sub-generator adds a new php class with the skeleton code to create a widget.

Using these sub-generators in addition to the previously available include, CSS, and JS sub-generators brings the speed of building out your plugin to a whole new level!

Improved JavaScript Workflow

The JS sub-generator has also been improved. If you read my previous post Modernizing Your WordPress JavaScript, you will know about using Babel and browserify-shim with Browserify to give the best development experience and end product for your plugin’s JavaScript. This workflow is setup automatically when you run yo plugin-wp:js in your plugin directory and select Browserify!

Unit Testing

Unit Testing is great, but unit testing with PHP and WordPress can be confusing at times to get setup. Now generator-plugin-wp includes tests by default whenever you create a new plugin and adds more tests with every sub-generator! Running the tests is as simple as running ./bin/install-wp-test.sh from the main plugin folder in your development environment with your dev database details, and then whenever you want to run the tests, just run phpunit from the plugin’s main folder. For more information on unit testing your plugins check out my previous post.

Improved PHP Include Workflow

Previously whenever you ran any of the PHP sub-generators (include, CPT, options, and widget), you had to manually add the new class to your main plugin class so that it would be included. With 0.9.0 any plugin generated after upgrading to the latest version of generator-plugin-wp will automatically add a statement like $this->admin = new CGS_Admin( $this ); so that the new include’s code is run without needing to make any changes to the main plugin class manually.

Coming Soon

We aren’t done yet! Coming soon we have a couple of new sub-generators: a Simple Page Builder sub-generator which will streamline the integration of Simple Page Builder into your plugin so you can easily add your own page builder parts, and a taxonomy sub-generator which will create a new include class which extends Taxonomy Core to allow for the easy addition of new taxonomies to your plugin.

If you have any ideas on more things that could make creating new plugins even faster please go to our GitHub Issues page or if you are feeling adventurous submit a pull request!

The post Recent Changes to generator-plugin-wp appeared first on WebDevStudios.com.

Powered by WPeMatico

WordCamp New York: WDS is on its way!

WordCamp New York is right around the bend–October 30th-November 1st, 2015! We’ll be enjoying the glorious East Coast autumn and we’re ready to celebrate Halloween with a bunch of fantastic WP folks.

Although I find it hard to believe that any of our regular readers are unfamiliar with WordCamp (come on, now!), for those of you that are completely green: WordCamps are events held all over the world where WordPress nerds unite to share their skills, insights, and learn a whole lot from a bunch of other smarties.

We’re gonna be there! Rami is speaking and I’ll be running around as well. Make sure you catch Rami’s presentation (details below) and say hi to both of us! We’d love to meet ya.

As per usual, here are the details on what you won’t want to miss:

Saturday, October 31st

10:15 AM – HTTPS and You – Eric Andrew Lewis

What exactly is HTTPS, how does it work, and what kind of security does it offer? 

If you haven’t heard of HTTPS, your website is probably sending (and receiving) web content to users over HTTP, an insecure protocol. This is not good. You are exposing your user credentials to nefarious middle-men when logging into wp-admin. 

HTTPS is The Way Forward™ for the web, as various web leaders are penalizing sites that still serve over HTTP. Search Engines are ranking insecure sites lower in search results. Browsers are limiting capabilities and stripping away features from sites serving HTTP.

This talk will focus on what HTTPS is from the very ground up, and some direction on how to set it up for your site.

(Eric will also be available at the Happiness Bar during the day if you want hands-on help migrating your site to HTTPS.)

4 PM – Lessons from Science Fiction and Fantasy We Can Use in Creating Websites – Aaron Jorbin

Science Fiction and Fantasy can teach web creators many valuable lessons. From seeing how Daleks with too narrow of a goal always fail to understanding the Klingons value of honor, to hundreds of other we can become better web creators by borrowing lessons from Science Fiction and Fantasy.

Sunday, November 1st

11:15 AM – The Infuriating Four: The 4 Most Common WordPress Site Problems (and How to Avoid Them) – Rami Abraham

Rami provides a look at the four most common issues seen on WordPress sites, across thousands of WordPress installations. An additional analysis of the 1,500 most recent support tickets received by Maintainn helps further illustrate why these issues occur over and over. Quantitative analysis on this data showed a significant recurrence of four “top” issues. Thankfully, they’re easy to resolve if you know what to look for – even if you’re not a programmer.

Attendees will hopefully leave with a better understanding of how to identify these four issues early, and resolve them when they do occur.

This is explicitly not a code-heavy session (although is recommended for any developer getting started with WordPress), as the goal is for any attendee to be able to identify these issues when they arise on their WordPress sites.

2 PM – WordPress for Government – Cameron Barrett

WordPress has been making great inroads into government agencies, pubic school districts and military institutions. This session will cover the business case(s) why WordPress should be considered and wholeheartedly embraced by those organizations that are spending taxpayer money. Case studies will include a large public school system and the U.S. Army.

Descriptions snagged from the WordCamp NYC website.

If you can’t join us, you can follow along @WordCampNYC or keep tabs on the hashtag #WCNYC. For those of you who are going: We’ll see you then!

 

 

The post WordCamp New York: WDS is on its way! appeared first on WebDevStudios.com.

Powered by WPeMatico