All Projects → iandunn → Wordpress Plugin Skeleton

iandunn / Wordpress Plugin Skeleton

A WordPress plugin skeleton built using object-oriented principles and the MVC pattern.

Projects that are alternatives of or similar to Wordpress Plugin Skeleton

star
An experimental programming language that's made to be powerful, productive, and predictable
Stars: ✭ 88 (-79.72%)
Mutual labels:  object-oriented
Contemplate
Contemplate: Fast, extendable object-oriented and light-weight Template Engine for PHP, Python, Node.js, Browser and XPCOM/SDK JavaScript
Stars: ✭ 15 (-96.54%)
Mutual labels:  object-oriented
30log
30 lines library for object orientation in Lua
Stars: ✭ 313 (-27.88%)
Mutual labels:  object-oriented
crynamo
DynamoDB client for Crystal.
Stars: ✭ 14 (-96.77%)
Mutual labels:  object-oriented
qm
QM model-based design tool and code generator based on UML state machines
Stars: ✭ 54 (-87.56%)
Mutual labels:  object-oriented
p5-HackaMol
Object-Oriented Perl 5, Moose Library for Molecular Hacking
Stars: ✭ 12 (-97.24%)
Mutual labels:  object-oriented
decaf-rs
The Decaf compiler, written in Rust
Stars: ✭ 43 (-90.09%)
Mutual labels:  object-oriented
Gravity
Gravity Programming Language
Stars: ✭ 3,968 (+814.29%)
Mutual labels:  object-oriented
BashClass
BashClass is an Object Oriented Programming language that compiles to BASH 4.4
Stars: ✭ 40 (-90.78%)
Mutual labels:  object-oriented
Goby
Goby - Yet another programming language written in Go
Stars: ✭ 3,296 (+659.45%)
Mutual labels:  object-oriented
blog
My Blog About Computers
Stars: ✭ 106 (-75.58%)
Mutual labels:  object-oriented
Duck
Duck-Typed Programming in C
Stars: ✭ 14 (-96.77%)
Mutual labels:  object-oriented
Stampit
OOP is better with stamps: Composable object factories.
Stars: ✭ 3,021 (+596.08%)
Mutual labels:  object-oriented
FPL
Fortran Parameter List. A fortran dictionary where to put the parameters of your application.
Stars: ✭ 29 (-93.32%)
Mutual labels:  object-oriented
Ruby
The Ruby Programming Language [mirror]
Stars: ✭ 18,713 (+4211.75%)
Mutual labels:  object-oriented
configmanager
Forget about configparser, YAML, or JSON parsers. Focus on configuration. NOT RECOMMENDED FOR USE (2019-01-26)
Stars: ✭ 15 (-96.54%)
Mutual labels:  object-oriented
Infrared4Arduino
An object oriented infrared library for the Arduino
Stars: ✭ 51 (-88.25%)
Mutual labels:  object-oriented
Globjects
C++ library strictly wrapping OpenGL objects.
Stars: ✭ 431 (-0.69%)
Mutual labels:  object-oriented
Monkey
Interpreter with support for class, linq, sql, net, http, fmt, json and A realtime syntax highlighting REPL.
Stars: ✭ 347 (-20.05%)
Mutual labels:  object-oriented
Object Oriented Design
面向对象设计的设计原则和设计模式
Stars: ✭ 313 (-27.88%)
Mutual labels:  object-oriented

WordPress Plugin Skeleton

The skeleton for an object-oriented/MVC WordPress plugin.

Features

  • Clean and organized
  • Designed with object-oriented principles
  • Implements the Model-View-Controller pattern
  • Includes basic classes for:
    • Custom post type and taxonomies
    • A settings page
    • Extra user profile fields
    • WP-Cron jobs
  • Includes examples of common functionality
    • Single and network-wide activation
    • Upgrade routine
    • Shortcodes
    • CSS/JavaScript enqueing
    • Input validation, output sanitization
    • Custom hooks for extensibility
    • JavaScript event handlers
    • A test suite for unit testing with SimpleTest
  • Includes render_template(), a wrapper for rendering view files that allows other plugins and themes to easily modify or completely override the view.

Notes

Installation

  • cd /var/www/vhosts/example.com/content/plugins
  • git clone --recursive https://github.com/iandunn/WordPress-Plugin-Skeleton.git plugin-slug
  • cd plugin-slug
  • git remote rm origin
  • git rm README.md
  • Update bootstrap.php headers
  • Reset version number to 0.1
  • Find/replace class names/slugs
  • git mv files to match class slugs
  • Comment out references to classes that aren't needed now. Delete ones that will never be needed.
  • Rename generic comments, method names, etc to describe their specific implementations.
  • If you're not using a custom post type or something else that updates the rewrite rules, you can comment out the flush_rewrite_rules() call in WordPresPluginSkeleton::activate() and ::deactivate().
  • For unit testing, install SimpleTest for WordPress and use a shortcode like this: [simpletest name="WordPress Plugin Skeleton Unit Test Suite" path="/wordpress-plugin-skeleton/tests/wpps-test-suite.php"]

New Code Checklist

  • Security
    • Input validation for domain correctness and security.
    • Output sanitization when sending untrusted data to browser.
      • All data should be considered untrusted.
      • Escape hardcoded data to future-proof.
    • Pass any manual SQL queries through $wpdb->prepare().
    • Add/check nonces for logged in users when submitting forms and AJAX requests.
    • Make sure current user is authorized to perform the action with current_user_can().
    • If added any kind of custom auth scheme, try to think how you could get around it, then protect against those methods.
  • Add custom actions and filters
  • Write unit and integration tests
  • Throw/catch exceptions when encountering invalid conditions.

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].