Wordpress development 101
-
Upload
commit-software-shpk -
Category
Engineering
-
view
67 -
download
1
Transcript of Wordpress development 101
WORDPRESSDEVELOPMENT 101
June 16, 2016 Commit University
Tirane
I AM MATTEO MAZZONIWeb Developer - since 2005
ICT Consultant - since 2007
OS Java Developer - Freedomotic.com - since 2012
Married, father of 2
Climbing addicted
BackgroundDeployment constraints for the perfect website
ASPECTS WEB DEVELOPERS HAVE TO ORCHESTRATE
VERSATILE Content
Management
GREATUser
eXperienceEASY
maintainablity
EXTREME customization
CONTINUOUS Evolution
WHICH SOLUTION BETTER FITS OUR NEEDS ?
TAILORED
CONS:more difficult to mantain,
time consuming, more expensive,all problems are
up to developers
PROS: Fully cover people’s needs, can be adapted to futureopportunities
INTEGRATE AND ADAPT
PROS:Pick and integrate State Of The Art solutions, build reusable skills, customize what’s necessary
CONS:data is bound to
original model and deep adaption tend to
be a mess
WHICH SOLUTION BETTER FITS OUR NEEDS ?
INTEGRATE AND ADAPT SHOWCASE NOT DATA CENTEREDQUICKLY EXTEND
TAILOREDDATA CENTEREDCUSTOM WORKFLOWS
WE’RE GOING DOWN THE RABBIT’S HOLE AND...
Get to knowWordpress
Explore its architecture
Solve real problems
LET’S SUPPOSE WE GOT THE RED PILL…
WORDPRESS main features
EASE OF USE PLUGINS THEMES
SUPPORT LIGHTWEIGHT
Wordpress The story so far
2001 - born as B22003 - forked as Wordpress2004 - Plugins are introduced 2005 - Theme system and static pages are introduced 2007 - A new UI, autosave, spell check, widgets2009 - introduced a built-in theme installer2010 - Custom post types, custom taxonomies. Multisite2012 - Introduced the theme customizer and theme previewer.2013 - Builtin Audio and Video, Revisions, Automatic updates.2015 - Responsiveness
https://codex.wordpress.org/History
WE’RE GOING TO...
Get to knowWordpress
Explore its architecture
Solve real problems
Dig into WP’s architecture, in order to gain experience on all its features.
“Wordpress is just a blog with steroids”GPdT
HOW COULD IT BE SUCH VERSATILE?
HOW COULD WP BE SUCH VERSATILE?
SIMPLE YET POWERFUL DATABASE STRUCTURE
HOW COULD WP BE SUCH VERSATILE?
POSTSTRUCTURE
HOW COULD WP BE SUCH VERSATILE?
TAXONOMIES
HOW COULD WP BE SUCH VERSATILE?Hooks, Actions, Filters
Every WP activity (e.g. generating a web page) is made of many stages.
Developers can intercept and extend
those stages in order to
accomplish their goals
HOW ?
HOW COULD WP BE SUCH VERSATILE?
HOOKS -> STAGES of page rendering
ACTIONS functions (to be hooked somewhere) that do something
e.g. extend footer data in order to show a credit string
function copyright_note() { echo '<p>Credits 2016 ©right;</p>';}add_action( 'wp_footer', ‘copyright_note' );
HOW COULD WP BE SUCH VERSATILE?
HOOKS -> STAGES of page rendering
FILTERS functions (to be hooked somewhere) that WP passes data through
e.g. check if a new subscriber uses unallowed characters in his username
function my_sanitize_user($user, $raw_user, $strict) { # ...}add_filter('sanitize_user', 'my_sanitize_user', 10, 3);
HOW COULD WP BE SUCH VERSATILE?17 internal API Categories19 Action Categories9 Filter Categories
HOW MANY HOOKS?
http://adambrown.info/p/wp_hooks
They do nothing but mixing
- Hook extensions- API Calls
PLUGINS
Themes mainly redefine page layouts and ease customization.Page templates are defined/overridden using a specific file hyerarchy
e.g./wp-content/themes/my_theme/single.php/wp-content/themes/my_theme/single-product.php/wp-content/themes/my_theme/category.php
THEMES
THEMES - Template hyerarchy
WE’RE GOING TO...
Get to knowWordpress
Explore its architecture
Solve real problems
Learn how to leverage such features and solve common problems using elegant, simple, long lasting solutions.
Before we start
0- Have you got Wordpress?- Install suggested theme
- And required plugins- Get a few plugins:
- Woocommerce- Custom Post Types UI- Child Theme Configurator
- Create a page and set as homepage
Ready!
Problem:
1People want a super stylish, responsive, full-featured layout.
Workflow:- Choose the right theme- Configure it- Adapt css to your needs- Should you need deeper customization,
make a child theme and rely on HOOKS
Problem:
2People have their own data to showcase
Workflow:- Create a new post type- Deploy related taxonomies- Extend posts with extra fields*- Write custom templates
*too much extra fields? Take the blue pill!
Problem:
3People want to introduce extra features
Workflow:- Identify right hooks - Identify involved API calls- Collect functions in a plugin
Problem:
4Theme updates could destroy our customization work, but they are fundamental for our blog security and user experience.
Workflow:- Get used to everyday (weekly) updates- Make a child theme- Update main theme as usual
Problem:
5Keeping a optimal user experience and help us mantain the whole platform with less pain.
Workflow:- Get used to everyday (weekly) updates- Check page load speed and issues- Deploy a caching system (WP plugin or memcache)- Check page speed (again..)- Adapt server-side params to fix/improve
What comes next, depends on you...
Resume
We learnt to:- adapt WP themes- create customized content types- write plugins- modify WP behavior using Hooks/Actions/Filters- enforce maintainability and robustness (in behalf of
software upgrades)- manage basic site optimization as a pre-production task
ANY QUESTION?
You can find me at http://blog.bestmazzo.it@[email protected]
CREDITS
Special thanks to:◇ SlidesCarnival : Presentation template ◇ Gabriel Pulido de Torres: quotes and priceless suggestions