wordpress plugin development

16

Upload: arryaas

Post on 08-Jan-2017

718 views

Category:

Software


0 download

TRANSCRIPT

Page 1: WordPress plugin development
Page 2: WordPress plugin development

Plugin Development

A peek into the world of WordPress plugin development

Rakesh Lawaju Abiral Neupane Regan Khadgi

WordCamp Nepal 2015

[email protected] [email protected] [email protected]

Page 3: WordPress plugin development

WordPress plugin & it’s usages?WordPress plugins are bits of software that can be uploaded to extend and expand the functionality of your WordPress site.

- Register post type & taxonomy

- Shortcodes

- Ecommerce feature

- Sliders and gallery

- and many more

Page 4: WordPress plugin development

Let’s startDraw roadmap

Think outside the box

Get a unique name

Files and folder structure

Coding standard

Custom tables?

Don’t forget about security

Extensibility

Translation ready

Page 5: WordPress plugin development

Draw roadmapFailing to plan is planning to fail.

Images Designed by Freepik

Page 6: WordPress plugin development

Think outside the boxGive user some unique feature because there are almost 50000 plugins in WordPress.org

Page 7: WordPress plugin development

Get a unique nameBecause the name matters.

Page 8: WordPress plugin development

Files and folder structureKeep it simple, keep it clean

A plugin can a single .php file or it can be a folder with its main file and other additional required files and folder

Page 9: WordPress plugin development

Coding standardThere are some rules, it's good to follow.

- Single and Double Quotes

- Indentation

- Brace Style

- No Shorthand PHP Tags

- Space Usagehttps://codex.wordpress.org/WordPress_Coding_Standards

Page 10: WordPress plugin development

Custom tables?Think before you add custom tables.

Try to use default WordPress database table, as it might be enough to manage your data. So that you won't have to create extra methods to manage data.

Page 11: WordPress plugin development

Don’t forget about security- Validating and sanitizing is must when user submits data to

WordPress, data is imported from an external feed, or data comes into WordPress

- To prevent issues like Cross-site scripting (XSS) make sure that output are escaped like post title, post meta value, or some other data from the database

- Prevent an unauthorized person from changing your plugin’s settings or performing actions they are not authorized to perform. WordPress offers two ways: nonces and capability checks.

Image from https://pixabay.com/p-538715/

Page 12: WordPress plugin development

ExtensibilityPlugin should allow developers to easily tie their own code.

Page 13: WordPress plugin development

Translation readyDon't lose your potential user

Page 14: WordPress plugin development

How you are offering your plugin?After you have successfully developed a plugin it can be offered in many ways to the users. Some of them are:

- Free

- Freemium

- Premium

Page 15: WordPress plugin development

The sky's the limitand let’s give back to community

Page 16: WordPress plugin development

Hope you found it useful Thank you!