sybozz / MVC-WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins following the MVC pattern

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MVC WordPress Plugin Boilerplate

This is a standardized, organized, object-oriented foundation for building high-quality WordPress Plugins based on the WordPress Plugin Boilerplate project but implementing MVC pattern.

Contents

The MVC WordPress Plugin Boilerplate includes the following files:

  • .gitignore. Used to exclude certain files from the repository.
  • README.md. The file that you’re currently reading.
  • A plugin-name directory that contains the source code - a fully executable WordPress plugin.

Features

  • The Boilerplate is based on the Plugin API, Coding Standards, and Documentation Standards.
  • All classes, functions, and variables are documented so that you know what you need to be changed.
  • The Boilerplate uses a strict file organization scheme that correspond both to the WordPress Plugin Repository structure, and MVC pattern.
  • The project includes a .pot file as a starting point for internationalization.

Installation

The Boilerplate can be installed directly into your plugins folder "as-is". You will want to rename it and the classes inside of it to fit your needs.

Note that this will activate the source code of the Boilerplate. The Boilerplate has no real functionality but implements a basic example which adds menu items, registers settings, adds a plugin settings page with a text input box and submit button, it also stores the data introduced into this input.

Recommended Tools

i18n Tools

The WordPress Plugin Boilerplate uses a variable to store the text domain used when internationalizing strings throughout the Boilerplate. To take advantage of this method, there are tools that are recommended for providing correct, translatable files:

Any of the above tools should provide you with the proper tooling to internationalize the plugin.

License

The WordPress Plugin Boilerplate is licensed under the GPL v2 or later.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

A copy of the license is included in the root of the plugin’s directory. The file is named LICENSE.

Important Notes

Licensing

The MVC WordPress Plugin Boilerplate is licensed under the GPL v2 or later; however, if you opt to use third-party code that is not compatible with v2, then you may need to switch to using code that is GPL v3 compatible.

For reference, here's a discussion that covers the Apache 2.0 License used by Bootstrap.

Includes

Note that if you include your own classes, or third-party libraries, there are three locations in which said files may go:

  • plugin-name/includes is where functionality shared between the models, controllers and views resides
  • plugin-name/models is for representing data objects, such as settings, values stored on the database, etc...
  • plugin-name/models/admin represents the admin side of the models.
  • plugin-name/contollers is for updating the state of the model (e.g. updating a setting), it can also send commands to its associated views to change the view's presentation of the model.
  • plugin-name/contollers/admin represents the admin side of the controllers.
  • plugin-name/views is where the output of the model is generated, it uses its controller to get the data from the model and it sends updated values to the controller to be stored by the model.
  • plugin-name/views/admin represents the admin side of the views

Credits

The MVC WordPress Plugin Boilerplate is a version of the WordPress Plugin Boilerplate project started in 2011 by Tom McFarlin and has since included a number of great contributions. In March of 2015 the project was handed over by Tom to Devin Vinson.

The MVC Boilerplate was developed and is being maintained by Roger Rodrigo.

About

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins following the MVC pattern


Languages

Language:PHP 95.4%Language:JavaScript 4.1%Language:CSS 0.5%