Coder Social home page Coder Social logo

uvlabs / wordpress-plugin-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 4.0 142 KB

A WordPress plugin boilerplate inspired by WordPress Plugin Boilerplate Generator structured with MVC, PSR-4 autoloading, and PSR-1 coding style in mind.

Home Page: https://soaringleads.com

Shell 2.10% PHP 93.17% JavaScript 4.74%
hacktoberfest plugin-boilerplate wordpress wordpress-development wordpress-development-kit wordpress-plugin wordpress-plugin-boilerplate

wordpress-plugin-boilerplate's Introduction

A WordPress plugin boilerplate made with PS4 autoloading and MVC design pattern in mind.

Original boilerplate code was made with https://wppb.me/, but changes made to accommodate MVC design pattern and PSR4 autoloading. Some additional tools for WordPress, PHP and JS development were added.

There might be more replacements to be done to get all placeholder text changed but I've tried to list all of them below. Feel free to submit a pull request for any changes.

Steps

Composer

Run composer install

NPM

  • Add relevant info to package.json
  • Run npm install

Replacements:

Search and replaces (ALL SEARCHES SHOULD BE CASE SENSITIVE):

  • Replace 'my_plugin_name' with the Plugin name example Awesome WordPress Plugin (exact match [whole word])

  • Replace 'my_plugin_shortname' with a short lowercase version of the plugin name example awesome_wp_plugin. USE UNDERSCORES for the sparation (exact match [whole word])

  • Replace 'text-domain' with plugin text domain (exact match [whole word])

  • Replace 'PREFIX' with a prefix for constants (loose match, case sensitive)

  • Replace 'prefix_' with a lowercase version of the plugin name example myplugin_ etc. USE UNDERSCORES for the sparation example my_plugin_ (loose match, case sensitive)

  • Replace '_prefix' with lowercase version of plugin name example _my_plugin (loose match, case sensitive)

  • Replace 'prefix-' with a lowercase version of the plugin name example myplugin- etc. USE DASHES for the sparation example my-plugin- (exact match [whole word], case sensitive)

  • Replace 'root' in file name for activator and deactivator classes located in /includes with a lowercase version of the plugin name, example myplugin. USE DASHES for the sparation example my-plugin-

  • Replace RootActivator and RootDeactivator class names with the preferred class names for the activator and deactivator files. (exact match [whole word], case sensitive)

  • Replace 'prefix' in file name for your asset files located in /assets with a lowercase version of the plugin name, example myplugin. USE DASHES for the sparation example my-plugin-

  • Open dist.sh in the bin folder and replace prefix.zip with the name for your dist file that will be created when you run composer dist example myplugin.zip

  • Replace 'Root' with a shortname for plugin example Myplugin. This is used as your namespace prefix. (exact match, whole word)

You need to run composer dumpautoload after making this change to refresh autoload file with correct details.

  • Replace 'plugin_author_name' with your name, (exact match [whole word])

  • Replace 'plugin_author_url' with your website, (exact match [whole word])

  • Replace 'plugin_author_email' with your email address (exact match [whole word])

  • Replace SL_DEV_DEBUGGING with a constant of your choice. This constant should be defined as true in your local wp install's wp-config.php file where you work on the plugin. It is used to set the plugin's main debug constant as true and loads the unminified JS of the plugin while working in your local environment.

Note

If deploying plugin from github then remove the following lines from the .gitignore file:

assets/admin/js/build/
assets/public/js/build/

These are the build files for your JS and should be committed if you're deploying the plugin from github using a plugin like Git Updater.

wordpress-plugin-boilerplate's People

Contributors

uvlabs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wordpress-plugin-boilerplate's Issues

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.