npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-plugin-wp

v0.20.2

Published

Yeoman generator for WordPress plugins.

Downloads

8

Readme

generator-plugin-wp Build Status

Yeoman generator for WordPress plugins.

Getting Started

Pre-requisites: You'll need node which comes with npm.

If you don't have Yeoman installed:

npm install -g yo

To install generator-plugin-wp from npm, run:

npm install -g generator-plugin-wp

To use generator-plugin-wp, cd to your WordPress plugins folder and:

yo plugin-wp

You'll be prompted with steps for creating your plugin.

Sub-generators

Once your nifty new plugin has been generated, cd into your new plugin's directory. While in the plugin directory, you can run additional commands called sub-generators to automatically generate files to enhance your plugin.

For the names of the include, cpt, options, and widget subgenerators remember that the plugin prefix will be added to the class name so no need to include the original plugin name there. Think of it as the file name for each instead.

Tests

By default the plugin generator adds some built in tests for you to add on to as you develop your plugin. To run these tests run the install-wp-tests.sh script in the bin folder with the proper database details for your local setup.

Once you've run the install-wp-tests.sh script you can run just phpunit in the main folder of your plugin.

If you don't want tests included in your plugin when it is generated run the main generator with the --notests option.

PHP 5.2

By default PHP 5.2 is not supported in the generated plugin. To generate a plugin with PHP 5.2 support, run the main generator with the --php52 option.

CMB2

CMB2 is included by default with the options sub-generator. It can also be a useful tool with CPT and taxonomy sub-generators using the --cmb2 flag.

Adding Packages with Composer

If you chose composer as the autoloader option during the plugin's initiation, you can use composer to add additional dependencies.

Let's cd into our new plugin's directory and add CMB2:

composer require webdevstudios/cmb2

CMB2 will now appear under vendor

-plugins
  -wds-foo-plugin
    -vendor
      -webdevstudios
        -cmb2

Contributors

The following humans contributed to this awesome generator:

CamdenSegal, jtsternberg, jazzsequence, binarygary, bradp, JeffreyNaval, gregrickaby, DevNIX, JPry, RC Lations, tnorthcutt, aubreypwd, JeffMatson