SlideShare a Scribd company logo
1 of 68
Istanbul WordPress Meetup
February 16, 2019
Plugin Development
Mostafa Soufi
Founder and CTO
Customer Support
Navid Kashani
Co-Founder and Project Manager
Plugin Development
Mostafa Soufi
Why We Make Plugins?
Don’t touch WordPress core
What is a Plugin?
WordPress plugins are made up of PHP code and other
assets such as images, CSS, and JavaScript.
Getting Started
$ cd wp-content/plugins
$ mkdir plugin-name
$ touch plugin-name/plugin-name.php
wp-content/plugins/plugin-name/plugin-name.php
Readme file
=== Plugin Name ===
Contributors: (this should be a list of wordpress.org userid's)
Donate link: http://example.com/
Tags: comments, spam
Requires at least: 3.0.1
Tested up to: 3.4
Requires PHP: 5.2.4
Stable tag: 4.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Here is a short description of the plugin.
Folder Structure
plugin-name
├── includes
│ ├── admin
│ │ ├── assets
│ │ │ └── Admin assets
│ │ └── Admin files
│ └── Core files
├── public
│ ├── assets
│ │ └── Front assets
│ └── Front files
└── languages
Suggestions
Enable Debugging Mode
<?php
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
Not to echo <script> and <style> tags directly
<?php
function add_plugin_assets() {
wp_enqueue_style( plugin-css, 'style.css', false );
wp_enqueue_script( 'plugin-js', 'filename.js', false );
}
add_action( 'wp_enqueue_scripts', 'add_plugin_assets' );
Avoid Naming Collisions
Fatal error: Cannot redeclare
subscribe() previously declared
<?php
// wp-content/plugin-1/plugin-1.php
function subscribe() {
return 'foo';
}
// wp-content/plugin-2/plugin-2.php
function subscribe() {
return 'bar';
}
Avoid Naming Collisions
// wp-content/plugin-1/plugin-1.php
namespace Plugin1;
function subscribe() {
return 'foo';
}
// wp-content/plugin-2/plugin-2.php
namespace Plugin2;
function subscribe() {
return 'bar';
}
Prefix Everything
<?php
// Your function
function pn_get_posts()
{
}
<?php
// Your constant
define('PN_VERSION', '1.0);
Check for Existing Implementations
PHP provides a number of functions to verify
the existence of variables, functions, classes,
and constants. All of these will return true if the
entity exists.
For variables: isset()
$data = $wpdb->get_row("SELECT * FROM mytable");
if (isset($data->name)) {
}
$option = get_option('your_option');
if (isset($option['status'])) {
}
Array Object
For functions: function_exists()
<?php
if (!function_exists('is_admin')) {
require_once(ABSPATH . 'wp-admin/includes/load.php');
}
if (!function_exists('post_exists')) {
require_once(ABSPATH . 'wp-admin/includes/post.php');
}
For classes: class_exists()
<?php
if (class_exists('WooCommerce')) {
// code that requires WooCommerce
} else {
// you don't appear to have WooCommerce activated
}
For constants: defined()
<?php
if (!defined('CONSTANT')) {
define('CONSTANT', 'constant_value');
}
Conditional Loading
<?php
if ( is_admin() ) {
// We are in admin mode
require_once( dirname( __FILE__ ) . '/includes/admin/admin.php' );
require_once( dirname( __FILE__ ) . '/includes/admin/setting.php' );
}
Hooks
Action / Filter
Actions
Actions provide a way for running a function at
a specific point in the execution of WordPress
Core, plugins, and themes.
Create a new action
$result = $wpdb->delete( $table, array( 'id' => $id ) );
if ( $result ) {
do_action( 'pluginname_remove', $id );
return true;
}
// Send an email to admin when an item removed.
add_action( 'pluginname_remove', function ( $item_id ) {
wp_mail( 'admin@example.com', "Item {$item_id} removed", 'Email content' );
} );
Filters
Filters provide a way for functions to modify
data of other functions.
Create a new filter
function get_name() {
$value = ‘Sara’;
return apply_filters(‘filter_name’, $value);
}
// Run Filter
add_filter('filter_name', function( $value ){
return 'Hello ' . $value;
});
// Return Sara
echo get_name();
// Return Hello Sara
echo get_name();
Plugin Features
Shortcode
[audio], [caption], [embed], [gallery], [playlist], [video]
Shortcode is the best way to show the PHP
functions in the WordPress Editor and Widgets
Create a new Shortcode
function pn_show_users() {
echo date('Y-m-d');
}
// [pluginname-date]
function shortcode_function( $atts ) {
return pn_show_users();
}
add_shortcode( 'pluginname-date', 'shortcode_function' );
Internationalization (i18n)
Internationalization is the process of developing
your plugin so it can easily be translated into
other languages.
Enable i18n in your plugin
<?php
// Loading a Text Domain
load_plugin_textdomain( 'plugin-name', false, 'plugin-dir'
);
<h2><?php echo __( 'Your Ad here', 'plugin-name' ); ?></h2>
<h2><?php _e( 'Your Ad here', 'plugin-name' ); ?></h2>
Plugin Activation / Deactivation
Activation and deactivation hooks provide ways to perform actions when
plugins are activated or deactivated.
Add rewrite rules, add
custom database tables, or
set default option values.
Activation
Remove temporary data
such as cache, temp files and
directories.
Deactivation
Plugin Activation / Deactivation
<?php
register_activation_hook( __FILE__, 'pluginprefix_function_to_run' );
function pluginprefix_function_to_run() {
// Your code
}
register_deactivation_hook( __FILE__, 'pluginprefix_deactivation' );
function pluginprefix_deactivation() {
// Your code
}
Transients API (Cache)
Is a simple way of storing cached data in the
database temporary by giving it a custom name
and a timeframe after which it will expire and be
deleted.
Set / update the value in transient.
if ( false === ( $query_results = get_transient( 'special_query_results' ) ) ) {
$query_results = new WP_Query( 'cat=5&tag=tech&post_meta_key=featured' );
set_transient( 'special_query_results', $query_results, 12 * HOUR_IN_SECONDS );
}
// Use the data like you would have normally...
print_r($query_results);
Security Notes
Nonces
// Without nonce
http://example.com/wp-admin/post.php?post=123&action=trash
// With nonce
http://example.com/wp-admin/post.php?post=123&action=trash&_wpnonce=b192fc4204
Nonces are generated numbers used to verify origin and
intent of requests for security purposes. Each nonce can only
be used once.
Sanitizing User Data
sanitize_sql_orderby()
sanitize_text_field()
sanitize_textarea_field()
sanitize_title()
sanitize_title_for_query()
sanitize_title_with_dashes()
sanitize_user()
sanitize_email()
sanitize_file_name()
sanitize_html_class()
sanitize_key()
sanitize_meta()
sanitize_mime_type()
sanitize_option()
Checks for invalid
UTF-8
Converts single
< characters to
entity
Strips all HTML
tags
Remove line
breaks, tabs and
extra white space
Blocking direct access
<?php
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
// Your codes...
Prevent direct access provides a simple way to protect your
WordPress PHP files.
Ignite
github.com/veronalabs/ignite
Options Page
Support Namespace
<?php
namespace Ignite;
/**
* Class Option
* @package Ignite
*/
class Option {
Clean Structure
Installing and Creating Table
WP_List_Table
Support WP-REST API
Template Functions
use IgniteOption;
/**
* @param $option_name
*
* @return string
*/
function ignite_get_option( $option_name ) {
return Option::get( $option_name );
}
Answer Questions!
Thank you!
Mostafa Soufi
WordPress: profiles.wordpress.org/mostafas1990
GitHub: github.com/mostafasoufi
Website: soufi.me
Email: mostafa@veronalabs.com
Getting this slide: bit.ly/WP-ISTANBUL
Customer Support
Navid Kashani
When hire your first customer
support agent?
One Important Question:
Quality in Support
So, What can we do?
Focus on your support from day one
Because:
● Support is very expensive
● It can reduce your cost especially in future
● Learn more about your customers & the problem you want
to solve
Do we need to hire a support
person from day one?
NO!
● Improve your support process
● Solve your support request before they are born
So, What should we do?
Step One: Set the Metrics
Good for start:
● Response Time
● Response Quality
Step Two: One Channel
If you have multiple channels of support, integrate them in a
central hub and grant access to your entire team to get an idea
of the latest issues and user's pains. One of the best services
for this is Slack!
Solve your support request
before they are born
Categorize your support requests
User Experience based on
Customer Support
Example
Make Documentation
● Documents
● FAQs
● Videos
● Videos
● Videos
useloom.com
When hire your first customer
support agent?
Question:
When you are ready!
Answer:
Make sure the cost of support doesn’t kill your product or
your team
One More Thing
Your first support person should create Docs,
FAQ, Videos, based on support requests
Thank you!
Navid Kashani
WordPress: profiles.wordpress.org/kashani
GitHub: github.com/navidkashani
Website: navid.kashani.ir
Email: navid@veronalabs.com
Getting this slide: bit.ly/WP-ISTANBUL

More Related Content

What's hot

Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh PollockExtending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh PollockCaldera Labs
 
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackIgnacio Martín
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricksJavier Eguiluz
 
Getting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your lifeGetting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your lifeAJ Morris
 
You Don't Know Query - WordCamp Portland 2011
You Don't Know Query - WordCamp Portland 2011You Don't Know Query - WordCamp Portland 2011
You Don't Know Query - WordCamp Portland 2011andrewnacin
 
Plug in development
Plug in developmentPlug in development
Plug in developmentLucky Ali
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
 
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...andrewnacin
 
Head First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & ApplicationHead First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & ApplicationJace Ju
 
Caldera Learn - LoopConf WP API + Angular FTW Workshop
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCaldera Learn - LoopConf WP API + Angular FTW Workshop
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCalderaLearn
 
Wordpress plugin development tips
Wordpress plugin development tipsWordpress plugin development tips
Wordpress plugin development tipsMindfire Solutions
 
Object Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin DevelopmentObject Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin Developmentmtoppa
 
Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
 Connecting Content Silos: One CMS, Many Sites With The WordPress REST API Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
Connecting Content Silos: One CMS, Many Sites With The WordPress REST APICaldera Labs
 
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...Caldera Labs
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode ChefSri Ram
 

What's hot (20)

The wp config.php
The wp config.phpThe wp config.php
The wp config.php
 
Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh PollockExtending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh Pollock
 
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and Webpack
 
Symfony tips and tricks
Symfony tips and tricksSymfony tips and tricks
Symfony tips and tricks
 
Getting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your lifeGetting Started with WP-CLI, a tool to automate your life
Getting Started with WP-CLI, a tool to automate your life
 
You Don't Know Query - WordCamp Portland 2011
You Don't Know Query - WordCamp Portland 2011You Don't Know Query - WordCamp Portland 2011
You Don't Know Query - WordCamp Portland 2011
 
Plug in development
Plug in developmentPlug in development
Plug in development
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
 
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
WordCamp San Francisco 2011: Transients, Caching, and the Complexities of Mul...
 
Django
DjangoDjango
Django
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Head First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & ApplicationHead First Zend Framework - Part 1 Project & Application
Head First Zend Framework - Part 1 Project & Application
 
Caldera Learn - LoopConf WP API + Angular FTW Workshop
Caldera Learn - LoopConf WP API + Angular FTW WorkshopCaldera Learn - LoopConf WP API + Angular FTW Workshop
Caldera Learn - LoopConf WP API + Angular FTW Workshop
 
Wordpress plugin development tips
Wordpress plugin development tipsWordpress plugin development tips
Wordpress plugin development tips
 
Object Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin DevelopmentObject Oriented Programming for WordPress Plugin Development
Object Oriented Programming for WordPress Plugin Development
 
Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
 Connecting Content Silos: One CMS, Many Sites With The WordPress REST API Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
Connecting Content Silos: One CMS, Many Sites With The WordPress REST API
 
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
 
Zend framework
Zend frameworkZend framework
Zend framework
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Kyiv.py #17 Flask talk
Kyiv.py #17 Flask talkKyiv.py #17 Flask talk
Kyiv.py #17 Flask talk
 

Similar to WordPress Plugin development

Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress PluginBrad Williams
 
Plugging into plugins
Plugging into pluginsPlugging into plugins
Plugging into pluginsJosh Harrison
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28thChris Adams
 
Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Yevhen Kotelnytskyi
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Mike Schinkel
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practicesmarkparolisi
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Paul Bearne
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeRakesh Kushwaha
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011David Carr
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Plugin Development Practices
Plugin Development PracticesPlugin Development Practices
Plugin Development Practicesdanpastori
 
WordPress Plugin Basics
WordPress Plugin BasicsWordPress Plugin Basics
WordPress Plugin BasicsAmanda Giles
 
Laying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentLaying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentTammy Hart
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress PluginAndy Stratton
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stackPaul Bearne
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolGordon Forsythe
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)andrewnacin
 

Similar to WordPress Plugin development (20)

Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Creating Your First WordPress Plugin
Creating Your First WordPress PluginCreating Your First WordPress Plugin
Creating Your First WordPress Plugin
 
Plugging into plugins
Plugging into pluginsPlugging into plugins
Plugging into plugins
 
Getting to The Loop - London Wordpress Meetup July 28th
Getting to The Loop - London Wordpress Meetup  July 28thGetting to The Loop - London Wordpress Meetup  July 28th
Getting to The Loop - London Wordpress Meetup July 28th
 
Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?Как получить чёрный пояс по WordPress?
Как получить чёрный пояс по WordPress?
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
WordPress Structure and Best Practices
WordPress Structure and Best PracticesWordPress Structure and Best Practices
WordPress Structure and Best Practices
 
Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919Childthemes ottawa-word camp-1919
Childthemes ottawa-word camp-1919
 
WordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcodeWordPress basic fundamental of plugin development and creating shortcode
WordPress basic fundamental of plugin development and creating shortcode
 
Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011Introduction to Plugin Programming, WordCamp Miami 2011
Introduction to Plugin Programming, WordCamp Miami 2011
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
09 Oo Php Register
09 Oo Php Register09 Oo Php Register
09 Oo Php Register
 
Plugin Development Practices
Plugin Development PracticesPlugin Development Practices
Plugin Development Practices
 
WordPress Plugin Basics
WordPress Plugin BasicsWordPress Plugin Basics
WordPress Plugin Basics
 
Laying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme developmentLaying the proper foundation for plugin and theme development
Laying the proper foundation for plugin and theme development
 
How To Write a WordPress Plugin
How To Write a WordPress PluginHow To Write a WordPress Plugin
How To Write a WordPress Plugin
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stack
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)Best Practices in Plugin Development (WordCamp Seattle)
Best Practices in Plugin Development (WordCamp Seattle)
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 

Recently uploaded (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 

WordPress Plugin development

Editor's Notes

  1. Hello Everybody I’m Mostafa from VeronaLabs, I’m very happy to be involved in this Meetup. The first part of this presentation is related to Plugin Development and the second part is related to Customer Support which our experience in VeronaLabs. VeronaLabs which over five hundred, thousand active users in Its products and provide high-quality services in WordPress, such as plugins development and custom services.
  2. Well, I want explain to you about the plugin development. Let's started
  3. The first question is why we make plugins? This is a good question and the answer is… Don't touch the WordPress core.
  4. What is a Plugin? WordPress plugins are made up of PHP code and other assets such as images, CSS, and JavaScript.
  5. To make a new plugin, first you need to create a new file in this path. Look at the path.
  6. Readme file The basic information of your plugin available in this file. you can specify some information such as Plugin Name, Contributors, Version, Requires PHP version and Tested version. The readme file is required.
  7. Folder Structure There are many types of folder structure, and I think the structure is optional, It's better you using a standard structure. Look at the slide, there are 3 main directory that have some items.
  8. Suggestions To develop the plugin you need to follow some simple rules. I want to tell you some of them.
  9. Enable Debugging Mode You can see all notice errors when developing. It recommended. The constant of WP_DEBUG available in wp-config.php
  10. Not to echo <script> and <style> tags directly WordPress has useful functions for loading assets and you can use these functions. It’s very simple. Look at the example.
  11. Avoid Naming Collisions It's better you use the namespace in your plugin, It's a good way to avoid naming conflicts in functions and classes name. Take note of the example, there is a fatal error.
  12. The namespace solve this problem. Look at the example, It’s very simple.
  13. Prefix Everything The prefixes are used for functions, classes, and constants name, It's better to use the short name of your plugin for the prefixes.
  14. Check for Existing Implementations PHP provides a number of functions to verify the existence of variables, functions, classes, and constants. All of these will return true if the entity exists.
  15. For variables, you can use the isset. Look at the examples, the first example is for array and second is for the object
  16. For functions, you can use function_exists. Look at the examples.
  17. For classes, you can use class_exists. Look at the example.
  18. For constants, you can use defined, sometimes you should set value for a constant if that doesn't have any value.
  19. Conditional Loading It's better you separate the codes in different environment. this method helps to your plugin to have better performance.
  20. Hooks There are 2 types of hooks in WordPress. Action and Filter Let's get to know more with Hooks
  21. Actions Actions provide a way for running a function at a specific point in the execution of WordPress Core, plugins, and themes. For example, you can send an email when a new item removed in your plugin. Let's see the example.
  22. In this example, we calling a action that send an email.
  23. Filters Filters provide a way for functions to modify data of other functions. Let's see a real example.
  24. Here we have a function that output is Sara. Now we can change the output of this function by apply_filters, the final output will be Hello Sara
  25. Plugin Features I want to tell you about the main features of plugin. Let's see that.
  26. Shortcode Shortcode is the best way to show the PHP functions in the WordPress Editor and Widgets For example you can show a function output in the posts, pages or text widgets.
  27. You should just have to add It. Look at the example, It’s very easy.
  28. Internationalization Internationalization is the process of developing your plugin so it can easily be translated into other languages. Internationalization helps to your plugin to grow up that. this is a fact.
  29. To support Internationalization, only you need to add the text domain in the plugin, and then use these functions for load strings.
  30. Activation and deactivation hooks provide ways to perform actions when plugins are activated or deactivated. For activation you can add rewrite rules, add custom database tables, or set default option values. And for Deactivation you can remove temporary data such as cache, temp files and directories.
  31. Look at the example. The first example is for activation and the second example is for deactivation.
  32. Transients API (Cache) Is a simple way of storing cached data in the database temporary by giving it a custom name and a timeframe after which it will expire and be deleted. For example, you can cache your slow queries. Let’s see an example.
  33. In this example, we have a query that gets the feature posts and the result storing to cache. The query will be updated when cache expires.
  34. Security Notes Security is the most important point because your plugin will be installed on every WordPress.
  35. Nonces Nonces are generated numbers used to verify origin and intent of requests for security purposes. Each nonce can only be used once. Here are 2 URLs with Nonces and without Nonces. Keep in mind after making the Nonce you should verify it.
  36. Sanitizing User Data WordPress has many useful functions for clearing user inputs. With these functions, you can checks for invalid UTF-8, converts single less than characters to entity, strips all HTML tags and remove line breaks, tabs and extra white space.
  37. Blocking direct access Prevent direct access provides a simple way to protect your WordPress PHP files. It’s recommended that you use this command above your PHP files.
  38. Ignite I have a gift for you. this is a starter plugin for development. So let's know more about it.
  39. Options Page You can easily create the settings page with the tab. All type of fields such as text, upload, WP editor and color available in the setting page.
  40. Support Namespace All classes have the namespace.
  41. Clean Structure The main structure of this plugin It's very simple. Look at the file names and folders.
  42. Installing and Creating Table A simple example of creating a table in the database and display that in admin with WP_List_Table class.
  43. Support REST API A simple example to register endpoint for REST API.
  44. Template Functions You can put the theme functions in this file. It's very clean.
  45. Let see your questions.
  46. Hi everyone, my name is Navid Kashani, and I am Project Manager at Veronalabs. Today I want to talk about Customer Support. Let's get started
  47. Customer Support is a vast topic, and we can talk about it all day. However, since we have limited time, Today, I am only going to cover a small area that thought might be more practical for small and medium-sized software companies: When hire your first customer support agent? I think it’s a critical question because it can affect (have a significant impact on) your team and your product.
  48. As you can see on this chart, in the early stages of each product, the founders are usually responsible for customer support. Also, as the product grows, the quality of customer support declines. However, you can solve this by hiring your first customer support agent. But keep it in mind that as the number of users grows the decline in the customer support quality is unavoidable.
  49. I have seen many startups that the cost of their customer support has surpassed their other expenses. Also, it can… And with customer support, you can learn more ...
  50. Because: It increases your burn rate (cost/expenses) in the early days You don’t understand your customer well enough and the problems that you want to solve It creates a gap between your customers and your team. By hiring a customer support agent in the early days, your engineering team will be relieved from learning about the customer’s issues.
  51. There are many ways to address this but on top of the list there are two main categories: One, by improving your support process And two, by addressing your support requests before they are even generated.
  52. These days, there are many support systems available with great data analytics where you can find many useful reports such as the response time, your busiest day, number of replies, and so on.
  53. At VeronaLabs, we created a slack channel and integrated it with our help scout account, Github, and wp.org (RSS). So, all the members of our team can see the users’ requests and problems on daily basis.
  54. In the following slide, I will talk about how to reduce the support request by solving them before they are even generated.
  55. Create a list of tags based on different stages of customer on boarding such as “installation”, “integration”, “feature request”, “can’t find something” and your product features. For example the report section, export functionality or user registration of your product. Believe me, you will be surprised by the results.
  56. One of the best ways to improve the user experience is, customer support, Analyzing the customer’s questions, problems and requests can give a great insight into how to improve an existing product or even create a new one.
  57. WP-Statistics is our most popular plugin in VeronaLabs. One of the main reasons that make it so popular is that users can see all the data that they need in a simple dashboard and a single view without any weird filters or idioms. Let’s see...
  58. You don’t have to learn something new nor you should read the documentation to understand what the metrics are.
  59. I think you already know this view. It’s a screenshot from a Google Analytics page and in my opinion, one of the best tools in the world. In the past few years, we thought about adding more advanced features similar to Google Analytics. We always thought an excellent report page is a page like Google Analytics. However, our user has been telling us differently. Just think about what would happen if we spent a lot of time and energy building another Google Analytics: there probably wouldn't be a WP-statics today.
  60. One of the services we have been using a lot recently for creating videos is Loom (useloom.com). If you haven’t used it already I highly recommend to check it out.
  61. Back to our main question
  62. As I mentioned before, not paying enough attention to this topic can increase the gap between your team and the users which can also cause an increase in your support budget and decline in the quality of your product in the future. And subsequently (later on) it will destroy your product and team.
  63. This is a very important point in order to continue this process in the future. So your employee number one should not be just a simple customer support agent.
  64. (Lets me check the questions) Thank you so much for your time and I hope you have found this presentation useful.