SlideShare uma empresa Scribd logo
1 de 19
1
A new way to develop with
WordPress!
2
1. Introduction
2. Classic WordPress workflow
3. The Composer way
a. Overview
b. Integrating with WordPress
c. WordPress Packagist
4. Enter Bedrock
a. Overview
b. Working on your project
c. PhpDotEnv
d. Deploying your project
e. Multisite
5. Theming with Twig and Timber
a. Overview
b. Templating files
c. Bonus (Debug bar)
Table of content
6. Developing plugins with Herbert
a. Overview
b. Basis
7. References
3
A report on 1 july 2016 suggest
that WordPress powers
26.6% of the internet.
Introduction
4
How to?
1. Download WordPress
2. Push WordPress using FTP
3. Install WordPress (generate wp-config.php)
4. Install plugins/themes using FTP or backend
5. Update manually plugins/themes
Classic WordPress workflow
Issues
1. Updating WordPress/plugins can break site
2. Manually keep track of WordPress and
plugins/themes versions (on Git)
3. Deploys can be cumbersome (hours)
4. Configuring WordPress in multiple environments
is difficult (wp-config.php, unversioned)
5
Tools
● Git
● Composer
● WordPress Packagist
Advantages
● Dependencies explicitly declared in a single place (composer.json)
● Installing/Updating handled by Composer
● Project locked onto specific versions
● Don’t need to include the actual 3rd party code in your version control repository
The Composer way: Overview
6
Dependencies
● WordPress itself
● Plugins
● Themes
● Private repos
Structure
The Composer way: Integrating with WordPress
Composer.json
➔ auto-updating fork (syncs every 15 minutes
with the official WP repo) that includes
composer.json
{
"require": {
"php": ">=5.4",
"johnpbloch/wordpress": "~4.5"
},
"extra": {
"wordpress-install-dir": "wp"
}
}
.
├── wp
├── wp-content
├── index.php
└── wp-config.php
➔ require johnpbloch/wordpress-core-installer
7
➔ Mirror of the WordPress plugin directory as a
Composer repository
The Composer way: WordPress Packagist
{
"extra": {
"installer-paths": {
"content/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
],
"content/plugins/{$name}/": [
"type:wordpress-plugin"
],
"content/themes/{$name}/": [
"type:wordpress-theme"
]
}
}
}
{
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
}
]
}
1. Add the repository to your composer.json
2. Add the desired plugins and themes
3. Run
composer require wpackagist-plugin/contact-
form-7
Extra: customize installer paths
composer update
8
Features
● Better folder structure
● Dependency management with Composer
● Easy WordPress configuration with environment specific files
● Environment variables with Dotenv
● Autoloader for mu-plugins (use regular plugins as mu-plugins)
● Enhanced security (separated web root and secure passwords with wp-password-bcrypt)
Requirements
★ PHP >= 5.6
★ Composer
Enter Bedrock: Overview
9
Enter Bedrock: Working on your project
Installation
1. composer create-project roots/bedrock
2. Copy .env.example to .env
3. Vhost => /path/to/site/web/
4. http://example.com/wp/wp-admin
.
├── config
│ ├── application.php
│ └── environments
│ ├── development.php
│ ├── production.php
│ └── staging.php
├── vendor
├── web
│ ├── app
│ │ ├── mu-plugins
│ │ ├── plugins
│ │ ├── themes
│ │ └── uploads
│ ├── wp
│ └── wp-config.php
Folder structure of Bedrock
10
Configuration and environment variables
Enter Bedrock: PhpDotEnv
DB_NAME=database_name
DB_USER=database_user
DB_PASSWORD=database_password
DB_HOST=database_host
WP_ENV=development
WP_HOME=http://example.com
WP_SITEURL=${WP_HOME}/wp
# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'
Stage Switcher
➔ A WordPress plugin that allows you to
switch between different environments
from the admin bar.
➔ https://roots.io/plugins/stage-switcher/
Installation
composer require roots/wp-stage-switcher
11
How to?
Enter Bedrock: Deploying your project
Migrating an existing project to Bedrock
1. Install Bedrock
2. Configure WordPress
3. Install plugins/themes with Composer
composer install
12
Features
● Better folder structure
● Dependency management with Composer
● Easy WordPress configuration with environment specific files
● Environment variables with Dotenv
● Autoloader for mu-plugins (use regular plugins as mu-plugins)
● Debug Bar plugin
● Developer plugin
● Stage Switcher plugin
● MultisiteDirectoryResolver: filters that correct directory paths
● Koodimonni composer lang support
Installation
Enter Bedrock: Multisite
composer create-project gwa-bedrock-multisite-
skeleton
13
Advantages Of Using A Templating Language
1. Concise
2. Template orientated
3. Full-featured
4. Easy to learn
5. Extensibility
6. Fast
Theming with Twig and Timber: Overview
Timber presentation
1. Integrates the Twig engine into WordPress
2. Creates a foundation WordPress data set
3. Handles the rendering of Twig templates
Installing Timber
composer require wpackagist-plugin/timber-
library
14
PHP files are only concerned with
collating the required data
Theming with Twig and Timber: Templating files
<?php
/**
* The main template file.
*/
// set up page data
$data = Timber::get_context();
$data['posts'] = Timber::get_posts();
$data['page'] = 'home';
// render using Twig template index.twig
Timber::render('twig/index.twig', $data);
{% extends 'twig/base.twig' %}
{% block content %}
<!-- start the loop -->
{% for post in posts %}
{{ include( 'twig/content.twig', ignore_missing = true )
}}
{% else %}
{{ include( 'twig/content-none.twig' ) }}
{% endfor %}
{% if posts %}{{ function( 'bosco_paging_nav' ) }}{% endif %}
{% endblock %}
Timber methods to get the generic data and then renders
the index.twig template
15
Let’s have a look at the base template
Theming with Twig and Timber: Templating files
{% import 'twig/macros.twig' as macros %}
{{ function( 'get_header' ) }}
<div id="primary" class="content-area">
<div id="main" class="site-main" role="main">
{% block content %}{% endblock %}
</div><!-- #main -->
</div><!-- #primary -->
{{ function( 'get_sidebar' ) }}
{{ function( 'get_footer' ) }}
OK, But PHP And Twig? Isn’t That Doubling-Up?
1. Checking is_singular
2. Checking page type:
a. is_single
b. is_page
c. is_home
d. is_category
e. is_tag
f. is_author
// render using Twig template index.twig
Timber::render('twig/' . $template . '.twig',
$data);
16
What is WordPress Debug Bar?
● debug menu to the admin bar
● Shows query, cache, other helpful
debugging information
How To install?
https://wordpress.org/plugins/debug-bar/
Theming with Twig and Timber: Bonus (Debug Bar)
What is Timber Debug Bar?
● current template name
● absolute location on your server
● full contents of the context
How To install?
https://wordpress.org/plugins/debug-bar-timber/
composer require wpackagist-plugin/debug-bar
composer require wpackagist-plugin/debug-bar-
timber
17
Overview
● OOP
● MVC
● Twig template engine
● Composer
● Laravel Eloquent ORM
Requirements
➔ PHP 5.4+
➔ WordPress 3.4+
Installation
Developing plugins with Herbert: Overview
composer require getherbert/herbert-plugin
Features
● Config
● Routes
● Panels
● Enqueue (JS + CSS scripts)
● Helper
● Controllers
● Views
● Input (GET; POST)
● API
● Shortcodes
● Activate & Deactivate
● Messages (notifications)
● Widgets
● Saving data (Eloquent ORM)
● Custom Post Types
18
Naming your Plugin
Developing plugins with Herbert: Basis
.
├── app
│ ├── Helper.php
│ ├── api.php
│ ├── enqueue.php
│ ├── panels.php
│ ├── routes.php
│ ├── shortcodes.php
│ └── widgets.php
├── resources
│ ├── assets
│ └── views
├── composer.json
├── herbert.config.php
└── plugin.php
/**
* @wordpress-plugin
* Plugin Name: My Plugin
* Plugin URI: http://plugin-name.com/
* Description: A plugin.
* Version: 1.0.0
* Author: Author
* Author URI: http://author.com/
* License: MIT
*/
Folder structure of your Plugin
19
● https://roots.io/using-composer-with-wordpress/
● https://roots.io/bedrock/
● https://roots.io/bedrock/docs/
● https://roots.io/plugins/stage-switcher/
● https://css-tricks.com/intro-bedrock-wordpress/
● https://premium.wpmudev.org/blog/simplify-your-wordpress-theming-with-twig-and-timber/
● http://getherbert.com
● https://github.com/studio24/wordpress-multi-env-config
References

Mais conteúdo relacionado

Mais procurados

Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Shinya Ohyanagi
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
Controlling Arduino With PHP
Controlling Arduino With PHPControlling Arduino With PHP
Controlling Arduino With PHPThomas Weinert
 
Asynchronous I/O in PHP
Asynchronous I/O in PHPAsynchronous I/O in PHP
Asynchronous I/O in PHPThomas Weinert
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationrjsmelo
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5Wim Godden
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and coPierre Joye
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)julien pauli
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...it-people
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Zephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensionsZephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensionsMark Baker
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challengervanphp
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13julien pauli
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
Cli the other SAPI confoo11
Cli the other SAPI confoo11Cli the other SAPI confoo11
Cli the other SAPI confoo11Combell NV
 

Mais procurados (20)

Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
PHP5.5 is Here
PHP5.5 is HerePHP5.5 is Here
PHP5.5 is Here
 
Controlling Arduino With PHP
Controlling Arduino With PHPControlling Arduino With PHP
Controlling Arduino With PHP
 
Asynchronous I/O in PHP
Asynchronous I/O in PHPAsynchronous I/O in PHP
Asynchronous I/O in PHP
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your applicationRedis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and co
 
Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)Php in 2013 (Web-5 2013 conference)
Php in 2013 (Web-5 2013 conference)
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
New in php 7
New in php 7New in php 7
New in php 7
 
Zephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensionsZephir - A Wind of Change for writing PHP extensions
Zephir - A Wind of Change for writing PHP extensions
 
React PHP: the NodeJS challenger
React PHP: the NodeJS challengerReact PHP: the NodeJS challenger
React PHP: the NodeJS challenger
 
PHP Tips for certification - OdW13
PHP Tips for certification - OdW13PHP Tips for certification - OdW13
PHP Tips for certification - OdW13
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
groovy & grails - lecture 2
groovy & grails - lecture 2groovy & grails - lecture 2
groovy & grails - lecture 2
 
Cli the other SAPI confoo11
Cli the other SAPI confoo11Cli the other SAPI confoo11
Cli the other SAPI confoo11
 

Destaque

Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackDavid Sanchez
 
Prot. 121 17 pl autoriza o poder executivo municipal a realizar obras de p...
Prot. 121 17   pl  autoriza o poder executivo municipal a realizar obras de p...Prot. 121 17   pl  autoriza o poder executivo municipal a realizar obras de p...
Prot. 121 17 pl autoriza o poder executivo municipal a realizar obras de p...Claudio Figueiredo
 
Licencia creative commons - TI4
Licencia creative commons - TI4Licencia creative commons - TI4
Licencia creative commons - TI4tatisaleja
 
Ejemplo Impress
Ejemplo ImpressEjemplo Impress
Ejemplo Impressjfjaraiz
 
Презентация к открытому уроку
Презентация к открытому урокуПрезентация к открытому уроку
Презентация к открытому урокуHanovaSveta
 
Trabajo individual quidam
Trabajo individual quidamTrabajo individual quidam
Trabajo individual quidamLaura Armo
 
Cross-Cultural Competence - CLS
Cross-Cultural Competence - CLSCross-Cultural Competence - CLS
Cross-Cultural Competence - CLSGbolahan Olarewaju
 
TI Quidam / José Alejandro Brescia Sellés
TI Quidam / José Alejandro Brescia SellésTI Quidam / José Alejandro Brescia Sellés
TI Quidam / José Alejandro Brescia SellésChechi Brescia
 
Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...
Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...
Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...Neil Keane
 
Modern Control Matlab_Dr. Khaki Seddigh
Modern Control Matlab_Dr. Khaki SeddighModern Control Matlab_Dr. Khaki Seddigh
Modern Control Matlab_Dr. Khaki SeddighSomayeh Norouzi
 
Introduction To Mechanical Smoke Control CPD Presentation
Introduction To Mechanical Smoke Control CPD PresentationIntroduction To Mechanical Smoke Control CPD Presentation
Introduction To Mechanical Smoke Control CPD PresentationAxair Fan (UK) Ltd.
 

Destaque (20)

Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStack
 
PHP 7
PHP 7PHP 7
PHP 7
 
Nouveautés php 7
Nouveautés php 7Nouveautés php 7
Nouveautés php 7
 
PHP 7 - Think php7
PHP 7 - Think php7PHP 7 - Think php7
PHP 7 - Think php7
 
Prot. 121 17 pl autoriza o poder executivo municipal a realizar obras de p...
Prot. 121 17   pl  autoriza o poder executivo municipal a realizar obras de p...Prot. 121 17   pl  autoriza o poder executivo municipal a realizar obras de p...
Prot. 121 17 pl autoriza o poder executivo municipal a realizar obras de p...
 
Licencia creative commons - TI4
Licencia creative commons - TI4Licencia creative commons - TI4
Licencia creative commons - TI4
 
Vaccines
VaccinesVaccines
Vaccines
 
Ejemplo Impress
Ejemplo ImpressEjemplo Impress
Ejemplo Impress
 
Презентация к открытому уроку
Презентация к открытому урокуПрезентация к открытому уроку
Презентация к открытому уроку
 
Trabajo individual quidam
Trabajo individual quidamTrabajo individual quidam
Trabajo individual quidam
 
Five key elements to create a culture of accountability
Five key elements to create a culture of accountabilityFive key elements to create a culture of accountability
Five key elements to create a culture of accountability
 
Cross-Cultural Competence - CLS
Cross-Cultural Competence - CLSCross-Cultural Competence - CLS
Cross-Cultural Competence - CLS
 
TI Quidam / José Alejandro Brescia Sellés
TI Quidam / José Alejandro Brescia SellésTI Quidam / José Alejandro Brescia Sellés
TI Quidam / José Alejandro Brescia Sellés
 
Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...
Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...
Presentation @ #cesicon 2017 on the Provision of Computer Science in Upper Se...
 
Modern Control Matlab_Dr. Khaki Seddigh
Modern Control Matlab_Dr. Khaki SeddighModern Control Matlab_Dr. Khaki Seddigh
Modern Control Matlab_Dr. Khaki Seddigh
 
La segunda república española
La segunda república españolaLa segunda república española
La segunda república española
 
Introduction To Mechanical Smoke Control CPD Presentation
Introduction To Mechanical Smoke Control CPD PresentationIntroduction To Mechanical Smoke Control CPD Presentation
Introduction To Mechanical Smoke Control CPD Presentation
 
Introduce php7
Introduce php7Introduce php7
Introduce php7
 
What’s New in PHP7?
What’s New in PHP7?What’s New in PHP7?
What’s New in PHP7?
 
PHP7 e Rich Domain Model
PHP7 e Rich Domain ModelPHP7 e Rich Domain Model
PHP7 e Rich Domain Model
 

Semelhante a A new way to develop with WordPress!

Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress developmentSteve Mortiboy
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1Wataru OKAMOTO
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!David Gibbons
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Bastian Grimm
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsDECK36
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Maurizio Pelizzone
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201ylefebvre
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentBrad Williams
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern developmentRoman Veselý
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with DockerHanoiJUG
 
Serving Moodle Presentation
Serving Moodle PresentationServing Moodle Presentation
Serving Moodle Presentationwebhostingguy
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdevFrank Rousseau
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019Anam Ahmed
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress pluginAnthony Montalbano
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 

Semelhante a A new way to develop with WordPress! (20)

Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 
Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
 
How to Webpack your Django!
How to Webpack your Django!How to Webpack your Django!
How to Webpack your Django!
 
Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012Advanced WordPress Optimization - iGaming Supershow 2012
Advanced WordPress Optimization - iGaming Supershow 2012
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress Use Symfony2 components inside WordPress
Use Symfony2 components inside WordPress
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern development
 
Improve your Java Environment with Docker
Improve your Java Environment with DockerImprove your Java Environment with Docker
Improve your Java Environment with Docker
 
Serving Moodle Presentation
Serving Moodle PresentationServing Moodle Presentation
Serving Moodle Presentation
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
Wordpress as a framework
Wordpress as a frameworkWordpress as a framework
Wordpress as a framework
 
vitepress-en.pdf
vitepress-en.pdfvitepress-en.pdf
vitepress-en.pdf
 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
 
WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019WordPress At Scale. WordCamp Dhaka 2019
WordPress At Scale. WordCamp Dhaka 2019
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 

Último

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...SofiyaSharma5
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 

Último (20)

Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
Low Rate Young Call Girls in Sector 63 Mamura Noida ✔️☆9289244007✔️☆ Female E...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 

A new way to develop with WordPress!

  • 1. 1 A new way to develop with WordPress!
  • 2. 2 1. Introduction 2. Classic WordPress workflow 3. The Composer way a. Overview b. Integrating with WordPress c. WordPress Packagist 4. Enter Bedrock a. Overview b. Working on your project c. PhpDotEnv d. Deploying your project e. Multisite 5. Theming with Twig and Timber a. Overview b. Templating files c. Bonus (Debug bar) Table of content 6. Developing plugins with Herbert a. Overview b. Basis 7. References
  • 3. 3 A report on 1 july 2016 suggest that WordPress powers 26.6% of the internet. Introduction
  • 4. 4 How to? 1. Download WordPress 2. Push WordPress using FTP 3. Install WordPress (generate wp-config.php) 4. Install plugins/themes using FTP or backend 5. Update manually plugins/themes Classic WordPress workflow Issues 1. Updating WordPress/plugins can break site 2. Manually keep track of WordPress and plugins/themes versions (on Git) 3. Deploys can be cumbersome (hours) 4. Configuring WordPress in multiple environments is difficult (wp-config.php, unversioned)
  • 5. 5 Tools ● Git ● Composer ● WordPress Packagist Advantages ● Dependencies explicitly declared in a single place (composer.json) ● Installing/Updating handled by Composer ● Project locked onto specific versions ● Don’t need to include the actual 3rd party code in your version control repository The Composer way: Overview
  • 6. 6 Dependencies ● WordPress itself ● Plugins ● Themes ● Private repos Structure The Composer way: Integrating with WordPress Composer.json ➔ auto-updating fork (syncs every 15 minutes with the official WP repo) that includes composer.json { "require": { "php": ">=5.4", "johnpbloch/wordpress": "~4.5" }, "extra": { "wordpress-install-dir": "wp" } } . ├── wp ├── wp-content ├── index.php └── wp-config.php ➔ require johnpbloch/wordpress-core-installer
  • 7. 7 ➔ Mirror of the WordPress plugin directory as a Composer repository The Composer way: WordPress Packagist { "extra": { "installer-paths": { "content/mu-plugins/{$name}/": [ "type:wordpress-muplugin" ], "content/plugins/{$name}/": [ "type:wordpress-plugin" ], "content/themes/{$name}/": [ "type:wordpress-theme" ] } } } { "repositories": [ { "type": "composer", "url": "http://wpackagist.org" } ] } 1. Add the repository to your composer.json 2. Add the desired plugins and themes 3. Run composer require wpackagist-plugin/contact- form-7 Extra: customize installer paths composer update
  • 8. 8 Features ● Better folder structure ● Dependency management with Composer ● Easy WordPress configuration with environment specific files ● Environment variables with Dotenv ● Autoloader for mu-plugins (use regular plugins as mu-plugins) ● Enhanced security (separated web root and secure passwords with wp-password-bcrypt) Requirements ★ PHP >= 5.6 ★ Composer Enter Bedrock: Overview
  • 9. 9 Enter Bedrock: Working on your project Installation 1. composer create-project roots/bedrock 2. Copy .env.example to .env 3. Vhost => /path/to/site/web/ 4. http://example.com/wp/wp-admin . ├── config │ ├── application.php │ └── environments │ ├── development.php │ ├── production.php │ └── staging.php ├── vendor ├── web │ ├── app │ │ ├── mu-plugins │ │ ├── plugins │ │ ├── themes │ │ └── uploads │ ├── wp │ └── wp-config.php Folder structure of Bedrock
  • 10. 10 Configuration and environment variables Enter Bedrock: PhpDotEnv DB_NAME=database_name DB_USER=database_user DB_PASSWORD=database_password DB_HOST=database_host WP_ENV=development WP_HOME=http://example.com WP_SITEURL=${WP_HOME}/wp # Generate your keys here: https://roots.io/salts.html AUTH_KEY='generateme' SECURE_AUTH_KEY='generateme' LOGGED_IN_KEY='generateme' NONCE_KEY='generateme' AUTH_SALT='generateme' SECURE_AUTH_SALT='generateme' LOGGED_IN_SALT='generateme' NONCE_SALT='generateme' Stage Switcher ➔ A WordPress plugin that allows you to switch between different environments from the admin bar. ➔ https://roots.io/plugins/stage-switcher/ Installation composer require roots/wp-stage-switcher
  • 11. 11 How to? Enter Bedrock: Deploying your project Migrating an existing project to Bedrock 1. Install Bedrock 2. Configure WordPress 3. Install plugins/themes with Composer composer install
  • 12. 12 Features ● Better folder structure ● Dependency management with Composer ● Easy WordPress configuration with environment specific files ● Environment variables with Dotenv ● Autoloader for mu-plugins (use regular plugins as mu-plugins) ● Debug Bar plugin ● Developer plugin ● Stage Switcher plugin ● MultisiteDirectoryResolver: filters that correct directory paths ● Koodimonni composer lang support Installation Enter Bedrock: Multisite composer create-project gwa-bedrock-multisite- skeleton
  • 13. 13 Advantages Of Using A Templating Language 1. Concise 2. Template orientated 3. Full-featured 4. Easy to learn 5. Extensibility 6. Fast Theming with Twig and Timber: Overview Timber presentation 1. Integrates the Twig engine into WordPress 2. Creates a foundation WordPress data set 3. Handles the rendering of Twig templates Installing Timber composer require wpackagist-plugin/timber- library
  • 14. 14 PHP files are only concerned with collating the required data Theming with Twig and Timber: Templating files <?php /** * The main template file. */ // set up page data $data = Timber::get_context(); $data['posts'] = Timber::get_posts(); $data['page'] = 'home'; // render using Twig template index.twig Timber::render('twig/index.twig', $data); {% extends 'twig/base.twig' %} {% block content %} <!-- start the loop --> {% for post in posts %} {{ include( 'twig/content.twig', ignore_missing = true ) }} {% else %} {{ include( 'twig/content-none.twig' ) }} {% endfor %} {% if posts %}{{ function( 'bosco_paging_nav' ) }}{% endif %} {% endblock %} Timber methods to get the generic data and then renders the index.twig template
  • 15. 15 Let’s have a look at the base template Theming with Twig and Timber: Templating files {% import 'twig/macros.twig' as macros %} {{ function( 'get_header' ) }} <div id="primary" class="content-area"> <div id="main" class="site-main" role="main"> {% block content %}{% endblock %} </div><!-- #main --> </div><!-- #primary --> {{ function( 'get_sidebar' ) }} {{ function( 'get_footer' ) }} OK, But PHP And Twig? Isn’t That Doubling-Up? 1. Checking is_singular 2. Checking page type: a. is_single b. is_page c. is_home d. is_category e. is_tag f. is_author // render using Twig template index.twig Timber::render('twig/' . $template . '.twig', $data);
  • 16. 16 What is WordPress Debug Bar? ● debug menu to the admin bar ● Shows query, cache, other helpful debugging information How To install? https://wordpress.org/plugins/debug-bar/ Theming with Twig and Timber: Bonus (Debug Bar) What is Timber Debug Bar? ● current template name ● absolute location on your server ● full contents of the context How To install? https://wordpress.org/plugins/debug-bar-timber/ composer require wpackagist-plugin/debug-bar composer require wpackagist-plugin/debug-bar- timber
  • 17. 17 Overview ● OOP ● MVC ● Twig template engine ● Composer ● Laravel Eloquent ORM Requirements ➔ PHP 5.4+ ➔ WordPress 3.4+ Installation Developing plugins with Herbert: Overview composer require getherbert/herbert-plugin Features ● Config ● Routes ● Panels ● Enqueue (JS + CSS scripts) ● Helper ● Controllers ● Views ● Input (GET; POST) ● API ● Shortcodes ● Activate & Deactivate ● Messages (notifications) ● Widgets ● Saving data (Eloquent ORM) ● Custom Post Types
  • 18. 18 Naming your Plugin Developing plugins with Herbert: Basis . ├── app │ ├── Helper.php │ ├── api.php │ ├── enqueue.php │ ├── panels.php │ ├── routes.php │ ├── shortcodes.php │ └── widgets.php ├── resources │ ├── assets │ └── views ├── composer.json ├── herbert.config.php └── plugin.php /** * @wordpress-plugin * Plugin Name: My Plugin * Plugin URI: http://plugin-name.com/ * Description: A plugin. * Version: 1.0.0 * Author: Author * Author URI: http://author.com/ * License: MIT */ Folder structure of your Plugin
  • 19. 19 ● https://roots.io/using-composer-with-wordpress/ ● https://roots.io/bedrock/ ● https://roots.io/bedrock/docs/ ● https://roots.io/plugins/stage-switcher/ ● https://css-tricks.com/intro-bedrock-wordpress/ ● https://premium.wpmudev.org/blog/simplify-your-wordpress-theming-with-twig-and-timber/ ● http://getherbert.com ● https://github.com/studio24/wordpress-multi-env-config References