Code Monkey home page Code Monkey logo

wp-plugin-starter's Introduction

WP Plugin Starter

Welcome to the WP Plugin Starter repository on GitHub. Here you can browse the source, look at open issues and use this template to bootstrap your next WordPress plugin development.

Installation

Requirements

WP Plugin Starter requires the following dependencies:

Quick Start

Click "Use this template" at the top of this page, or click here to create your repo and clone locally to your wp-content/plugins directory. After that you'll need to do a four-step find and replace on the name in all the templates.

  1. Search for WP Plugin Starter to capture the plugin name and replace with: Plugin Name.
  2. Search for WP_Plugin_Starter to capture the plugin namespace and replace with: Plugin_Name.
  3. Search for wp-plugin-starter to capture the plugin slug, textdomain, etc. and replace with: plugin-name.
  4. Search for WPS_ (in uppercase) to capture constants and replace with: PLUGIN_NAME_.

Then, rename the plugin main file wp-plugin-starter.php to use the plugin's slug. Next, update or delete this readme.

Setup

To start using all the tools that come with WP Plugin Starter you need to install the necessary Node.js and Composer dependencies:

$ composer install
$ npm install

Without performing this step, if you try to activate the plugin it will simply show an admin notice.

Available CLI commands

WP Plugin Starter comes packed with CLI commands tailored for WordPress plugin development:

  • npm run build - builds the code for production.
  • npm run start - starts the build for development.
  • npm run format - formats files in the entire project’s directories.
  • npm run lint:js – lints JavaScript files in the entire project’s directories.
  • npm run lint:css – lints CSS and SCSS files in the entire project’s directories.
  • npm run lint:php – lints PHP files in the entire project’s directories.
  • composer makepot : Generates a .pot file in the languages/ directory.
  • composer makepot-audit: Generates a .pot file in the languages/ directory and run audit.

Now you're ready to go! The next step is easy to say, but harder to do: make an awesome WordPress plugin. :)

Good luck!

wp-plugin-starter's People

Contributors

renovate-bot avatar shivapoudel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wp-plugin-starter's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency lint-staged to v13

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

composer
composer.json
  • composer/installers 1.11.0
  • wp-cli/i18n-command 2.2.6
  • wp-coding-standards/wpcs 2.3.0
  • dealerdirect/phpcodesniffer-composer-installer 0.7.1
  • phpcompatibility/phpcompatibility-wp 2.1.1
  • sirbrillig/phpcs-variable-analysis 2.11.0
npm
package.json
  • @wordpress/element 2.20.2
  • @wordpress/i18n 3.19.2
  • @wordpress/browserslist-config 3.0.3
  • @wordpress/eslint-plugin 9.0.4
  • @wordpress/prettier-config 1.0.3
  • @wordpress/scripts 15.0.0
  • husky 6.0.0
  • lint-staged 10.5.4
  • optimize-css-assets-webpack-plugin 5.0.4
  • prettier 2.0.5
  • rtlcss-webpack-plugin 4.0.6
  • node >=10.0.0
  • npm >=6.9.0
nvm
.nvmrc

  • Check this box to trigger a request for Renovate to run again on this repository

Looks like a class vs. is an autonomous object

Hello @shivapoudel!

Why is it popular in the WordPress ecosystem to write code in a class-like structure - e.g. Plugin.php - without the OOP data + code (object) structure?

WordPress is procedural, the hook system is procedural, themes are procedural.

What do you think about using namespaced functions?
There could be simple names such as function start() :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.