SlideShare a Scribd company logo
VersionPress
NAHLÉDNĚTE ZA OPONU
Jan Voráček
Dotazy
https://sli.do/#wcphadev
VersionPress
Open-source verzovací plugin
Sebemenší změna na webu = nová verze
Umožňuje týmová workflows
https://sli.do/#wcphadev
Největší výzvy
Unikátní identifikace databázových entit
Cizí klíče ve WP
Špatný návrh databáze / zneužívání základních tabulek
Sledování všech změn
Formát vhodný pro ukládání / přenos / mergování
Vlastní tabulky pluginů / témat vzhledů
https://sli.do/#wcphadev
Databáze
Smutný příběh jednoho CMS
https://sli.do/#wcphadev
Unikátní identifikace entit
Your site
Staging
Production
New post (nav_menu_item)
ID: 13
Your site
New post (page)
ID: 13
?
https://sli.do/#wcphadev
Unikátní identifikace entit
https://sli.do/#wcphadev
Unikátní identifikace entit
Your site
Staging
Production
New post (nav_menu_item)
ID: 13
Your site
New post (page)
ID: 13
?
https://sli.do/#wcphadev
Unikátní identifikace entit
Your site
Staging
Production
New post (nav_menu_item)
ID: 13
VPID: A34B38985CD356
Your site
New post (page)
ID: 13
VPID: 8356A35CD4B389
✓
https://sli.do/#wcphadev
Unikátní identifikace entit
New post (nav_menu_item)
ID: 13
VPID: A34B38985CD356
Your site
New post (page)
ID: 13
VPID: 8356A35CD4B389
Post (nav_menu_item)
ID: 14
VPID: A34B38985CD356
Post (page)
ID: 13
VPID: 8356A35CD4B389
https://sli.do/#wcphadev
Unikátní identifikace entit
New post (nav_menu_item)
ID: 13
VPID: A34B38985CD356
Your site
New post (page)
ID: 13
VPID: 8356A35CD4B389
Post (nav_menu_item)
ID: 14
VPID: A34B38985CD356
Post (page)
ID: 13
VPID: 8356A35CD4B389
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
schema.php:
CREATE TABLE $wpdb->postmeta (
meta_id bigint(20) unsigned NOT NULL auto_increment,
post_id bigint(20) unsigned NOT NULL default '0',
meta_key varchar(255) default NULL,
meta_value longtext,
PRIMARY KEY (meta_id),
KEY post_id (post_id),
KEY meta_key (meta_key($max_index_length))
) $charset_collate;
https://sli.do/#wcphadev
Cizí klíče
post:
table: posts
id: ID
…
postmeta:
id: meta_id
parent-reference: post_id
references:
post_id: post
value-references:
meta_key@meta_value:
_thumbnail_id: post
_menu_item_object_id: '@vp_get_menu_reference'
https://sli.do/#wcphadev
Cizí klíče
post:
table: posts
id: ID
…
postmeta:
id: meta_id
parent-reference: post_id
references:
post_id: post
value-references:
meta_key@meta_value:
_thumbnail_id: post
_menu_item_object_id: '@vp_get_menu_reference'
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
post:
table: posts
id: ID
…
postmeta:
id: meta_id
parent-reference: post_id
references:
post_id: post
value-references:
meta_key@meta_value:
_thumbnail_id: post
_menu_item_object_id: '@vp_get_menu_reference'
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
wp_posts
wp_term_taxonomy
wp_posts
https://sli.do/#wcphadev
Cizí klíče
post:
table: posts
id: ID
…
postmeta:
id: meta_id
parent-reference: post_id
references:
post_id: post
value-references:
meta_key@meta_value:
_thumbnail_id: post
_menu_item_object_id: '@vp_get_menu_reference'
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
https://sli.do/#wcphadev
Cizí klíče
[
0 => false,
'auto_add' => [
0 => 2
]
]
https://sli.do/#wcphadev
Cizí klíče
option:
table: options
vpid: option_name
value-references:
option_name@option_value:
site_icon: post
page_on_front: post
page_for_posts: post
default_category: term
default_email_category: term
widget_nav_menu[/d+/]["nav_menu"]: term
widget_pages[/d+/]["exclude"]: post
nav_menu_options["auto_add"][/d+/]: term
featured-content["tag-id"]: term
theme_mods_*["nav_menu_locations"][/.*/]: term
https://sli.do/#wcphadev
DB návrh WP / pluginů
„12 tabulek by mělo stačit každému" – Autor neznámý
https://sli.do/#wcphadev
DB návrh WP / pluginů
Post Types:
◦ post
◦ page
◦ attachment
◦ revision
◦ nav_menu_item
◦ custom_css
◦ customize_changeset
https://sli.do/#wcphadev
DB návrh WP / pluginů
{
"widget_text[2]": {
"starter_content": true,
"value": {
"encoded_serialized_instance":
"YToyOntzOjU6InRpdGxlIjtzOjc6IkZpbmQgVXMiO3M6NDoidGV4dCI7czoyMDA6IjxwPjxzdHJvbmc+QWRkcmVzczwvc3Ryb25nPjxiciA
vPjEyMyBNYWluIFN0cmVldDxiciAvPk5ldyBZb3JrLCBOWSAxMDAwMTwvcD48cD48c3Ryb25nPkhvdXJzPC9zdHJvbmc+PGJyIC8+TW9
uZGF5Jm1kYXNoO0ZyaWRheTogOTowMEFNJm5kYXNoOzU6MDBQTTxiciAvPlNhdHVyZGF5ICZhbXA7IFN1bmRheTogMTE6MDBBTSZ
uZGFzaDszOjAwUE08L3A+Ijt9",
"title": "Find Us",
"is_widget_customizer_js_value": true,
"instance_hash_key": "d16b28dc2af40b7d8ee54668bd545ed1"
},
"type": "option",
"user_id": 1
},
"widget_search[3]": {
"starter_content": true,
"value": {
"encoded_serialized_instance": "YToxOntzOjU6InRpdGxlIjtzOjY6IlNlYXJjaCI7fQ==“,
customize_changeset in wp_posts
https://sli.do/#wcphadev
DB návrh WP / pluginů
{
"widget_text[2]": {
"starter_content": true,
"value": {
"encoded_serialized_instance":
"YToyOntzOjU6InRpdGxlIjtzOjc6IkZpbmQgVXMiO3M6NDoidGV4dCI7czoyMDA6IjxwPjxzdHJvbmc+QWRkcmVzczwvc3Ryb25nPjxiciA
vPjEyMyBNYWluIFN0cmVldDxiciAvPk5ldyBZb3JrLCBOWSAxMDAwMTwvcD48cD48c3Ryb25nPkhvdXJzPC9zdHJvbmc+PGJyIC8+TW9
uZGF5Jm1kYXNoO0ZyaWRheTogOTowMEFNJm5kYXNoOzU6MDBQTTxiciAvPlNhdHVyZGF5ICZhbXA7IFN1bmRheTogMTE6MDBBTSZ
uZGFzaDszOjAwUE08L3A+Ijt9",
"title": "Find Us",
"is_widget_customizer_js_value": true,
"instance_hash_key": "d16b28dc2af40b7d8ee54668bd545ed1"
},
"type": "option",
"user_id": 1
},
"widget_search[3]": {
"starter_content": true,
"value": {
"encoded_serialized_instance": "YToxOntzOjU6InRpdGxlIjtzOjY6IlNlYXJjaCI7fQ==“,
customize_changeset in wp_posts
https://sli.do/#wcphadev
DB návrh WP / pluginů
{
"widget_text[2]": {
"starter_content": true,
"value": {
"encoded_serialized_instance":
"YToyOntzOjU6InRpdGxlIjtzOjc6IkZpbmQgVXMiO3M6NDoidGV4dCI7czoyMDA6IjxwPjxzdHJvbmc+QWRkcmVzczwvc3Ryb25nPjxiciA
vPjEyMyBNYWluIFN0cmVldDxiciAvPk5ldyBZb3JrLCBOWSAxMDAwMTwvcD48cD48c3Ryb25nPkhvdXJzPC9zdHJvbmc+PGJyIC8+TW9
uZGF5Jm1kYXNoO0ZyaWRheTogOTowMEFNJm5kYXNoOzU6MDBQTTxiciAvPlNhdHVyZGF5ICZhbXA7IFN1bmRheTogMTE6MDBBTSZ
uZGFzaDszOjAwUE08L3A+Ijt9",
"title": "Find Us",
"is_widget_customizer_js_value": true,
"instance_hash_key": "d16b28dc2af40b7d8ee54668bd545ed1"
},
"type": "option",
"user_id": 1
},
"widget_search[3]": {
"starter_content": true,
"value": {
"encoded_serialized_instance": "YToxOntzOjU6InRpdGxlIjtzOjY6IlNlYXJjaCI7fQ==“,
customize_changeset in wp_posts
https://sli.do/#wcphadev
Workflows
WordPress na steroidech
https://sli.do/#wcphadev
Úložiště dat
Databáze
◦ Obtížné verzování
◦ Slabší programovací jazyk
◦ Složité diffy
◦ Běžné média soubory >> běžné DB řádky
Filesystém
◦ Verzování => Git
◦ PHP > PL/SQL
◦ Diffy => Git
◦ Počet běžných DB řádek >> počet souborů
https://sli.do/#wcphadev
Formát pro ukládání
Soubory se nemění
DB záznamy je potřeba šikovně diffovat
◦ Řádek v DB == soubor
◦ Sloupec v DB == řádek v souboru
◦ DDL? JSON? Serializovaný objekt?
https://sli.do/#wcphadev
Formát pro ukládání – INI !!!
[8CFC6D1208DC4D0F877039A3B8300366]
post_date = "2016-02-11 17:29:03”
post_date_gmt = "2016-02-11 17:29:03”
post_content = "live"
post_content_filtered = ""
post_title = "Added on LIVE"
post_excerpt = ""
post_status = "publish"
post_type = "post"
comment_status = "open"
ping_status = "open"
post_password = ""
post_name = "added-on-live"
to_ping = ""
pinged = ""
menu_order = 0
post_mime_type = ""
guid = "http://3D13C49A-BE86-4C8B-B4ED-D83222FFB296"
vp_post_author = "528E14A1AAD04CC08121DD631B2F6591"
vp_post_parent = 0
vp_term_taxonomy[0] = "752CC32F4AF842A79BEF42454E130743"
https://sli.do/#wcphadev
Formát pro ukládání
commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5
Author: admin <jan@voracek.net>
Date: Sat Feb 18 01:08:31 2017 +0100
[VP] Unapproved comment for post 'Vítejte!'
VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62
VP-Comment-Author: A WordPress Commenter
VP-Comment-PostTitle: Vítejte!
X-VP-Version: DEV
X-VP-Environment: default
--- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
+++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
@@ -9,7 +9,7 @@
comment_content = "Hi, this is a comment..."
comment_karma = "0"
-comment_approved = "1"
+comment_approved = "0"
comment_agent = ""
comment_type = ""
vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6"
https://sli.do/#wcphadev
Formát pro ukládání
commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5
Author: admin <jan@voracek.net>
Date: Sat Feb 18 01:08:31 2017 +0100
[VP] Unapproved comment for post 'Vítejte!'
VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62
VP-Comment-Author: A WordPress Commenter
VP-Comment-PostTitle: Vítejte!
X-VP-Version: DEV
X-VP-Environment: default
--- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
+++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
@@ -9,7 +9,7 @@
comment_content = "Hi, this is a comment..."
comment_karma = "0"
-comment_approved = "1"
+comment_approved = "0"
comment_agent = ""
comment_type = ""
vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6"
https://sli.do/#wcphadev
Zobrazení změn v GUI
commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5
Author: admin <jan@voracek.net>
Date: Sat Feb 18 01:08:31 2017 +0100
[VP] Unapproved comment for post 'Vítejte!'
VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62
VP-Comment-Author: A WordPress Commenter
VP-Comment-PostTitle: Vítejte!
X-VP-Version: DEV
X-VP-Environment: default
--- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
+++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
@@ -9,7 +9,7 @@
comment_content = "Hi, this is a comment..."
comment_karma = "0"
-comment_approved = "1"
+comment_approved = "0"
comment_agent = ""
comment_type = ""
vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6"
https://sli.do/#wcphadev
https://sli.do/#wcphadev
Zobrazení změn v GUI
commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5
Author: admin <jan@voracek.net>
Date: Sat Feb 18 01:08:31 2017 +0100
[VP] Unapproved comment for post 'Vítejte!'
VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62
VP-Comment-Author: A WordPress Commenter
VP-Comment-PostTitle: Vítejte!
X-VP-Version: DEV
X-VP-Environment: default
--- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
+++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini
@@ -9,7 +9,7 @@
comment_content = "Hi, this is a comment..."
comment_karma = "0"
-comment_approved = "1"
+comment_approved = "0"
comment_agent = ""
comment_type = ""
vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6"
Zobrazení změn v GUI
actions.yml:
comment:
tags:
VP-Comment-PostTitle: /
VP-Comment-Author: comment_author
actions:
create: New comment for post '%VP-Comment-PostTitle%'
edit:
message: Edited comment for post '%VP-Comment-PostTitle%'
priority: 12
delete: Deleted comment for post '%VP-Comment-PostTitle%
trash: Comment for post '%VP-Comment-PostTitle%' moved to trash
untrash: Comment for post '%VP-Comment-PostTitle%' moved from trash
approve: Approved comment for post '%VP-Comment-PostTitle%'
unapprove: Unapproved comment for post '%VP-Comment-PostTitle%'
https://sli.do/#wcphadev
Zobrazení změn v GUI
actions.yml:
comment:
tags:
VP-Comment-PostTitle: /
VP-Comment-Author: comment_author
actions:
create: New comment for post '%VP-Comment-PostTitle%'
edit:
message: Edited comment for post '%VP-Comment-PostTitle%'
priority: 12
delete: Deleted comment for post '%VP-Comment-PostTitle%
trash: Comment for post '%VP-Comment-PostTitle%' moved to trash
untrash: Comment for post '%VP-Comment-PostTitle%' moved from trash
approve: Approved comment for post '%VP-Comment-PostTitle%'
unapprove: Unapproved comment for post '%VP-Comment-PostTitle%'
https://sli.do/#wcphadev
Zobrazení změn v GUI
comment:
tags:
VP-Comment-PostTitle: /
VP-Comment-Author: comment_author
actions:
unapprove: Unapproved comment for post '%VP-Comment-PostTitle%'
https://sli.do/#wcphadev
Zobrazení změn v GUI
comment:
tags:
VP-Comment-PostTitle: /
VP-Comment-Author: comment_author
actions:
unapprove: Unapproved comment for post '%VP-Comment-PostTitle%'
Author: admin <jan@voracek.net>
Date: Sat Feb 18 01:08:31 2017 +0100
[VP] Unapproved comment for post 'Vítejte!'
VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62
VP-Comment-Author: A WordPress Commenter
VP-Comment-PostTitle: Vítejte!
https://sli.do/#wcphadev
Zobrazení změn v GUI
comment:
tags:
VP-Comment-PostTitle: /
VP-Comment-Author: comment_author
actions:
unapprove: Unapproved comment for post '%VP-Comment-PostTitle%'
Author: admin <jan@voracek.net>
Date: Sat Feb 18 01:08:31 2017 +0100
[VP] Unapproved comment for post 'Vítejte!'
VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62
VP-Comment-Author: A WordPress Commenter
VP-Comment-PostTitle: Vítejte!
https://sli.do/#wcphadev
Sledování změn
Na úrovni DB
◦ Monkey patching wp-db.php / db.php drop-in
◦ create, edit, delete
Pomocí filtrů
add_filter('vp_entity_action_post', function ($action, $oldEntity, $newEntity) {
if ($action === 'edit') { // determine more specific edit action
$diff = EntityUtils::getDiff($oldEntity, $newEntity);
if (isset($diff['post_status']) && $diff['post_status'] === 'trash') {
return 'trash';
}
if (isset($diff['post_status']) && $oldEntity['post_status'] === 'trash') {
return 'untrash';
}
https://sli.do/#wcphadev
Rozšiřitelnost VersionPressu
schema.yml
◦ DB schéma – tabulky, cizí klíče, ignorované entity, atd.
actions.yml
◦ Seznam možných akcí + textová reprezentace
shortcodes.yml
hooks.php
◦ PHP hooky na WP i VP akce
https://sli.do/#wcphadev
Tipy pro vývojáře
https://sli.do/#wcphadev
Tipy pro vývojáře pluginů
Nezneužívejte základní tabulky WP
Používejte cizí klíče v DB
Vytyčte v kódu si jasnou hranici mezi WP a vlastním pluginem
Testujte svůj kód
Testujte integraci s WP
Přečtěte si Clean Code, The Clean Coder, Test Driven Development by Example, Data Modeling Essentials
https://sli.do/#wcphadev

More Related Content

What's hot

Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
Wataru OKAMOTO
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
Otto Kekäläinen
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
Otto Kekäläinen
 
WPDay Bologna 2013
WPDay Bologna 2013WPDay Bologna 2013
WPDay Bologna 2013
Danilo Ercoli
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
Otto Kekäläinen
 
wp-cli
wp-cliwp-cli
Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014
Stéphane Bégaudeau
 
WordPress Security: Defend yourself against digital invaders
WordPress Security:Defend yourself against digital invadersWordPress Security:Defend yourself against digital invaders
WordPress Security: Defend yourself against digital invaders
Vladimír Smitka
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
Alessandro Bellini
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temy
Juraj Kiss
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
Michael Enslow
 
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Andrea Cardinali
 
Advanced Chrome extension exploitation
Advanced Chrome extension exploitationAdvanced Chrome extension exploitation
Advanced Chrome extension exploitation
Krzysztof Kotowicz
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
Leigh Dodds
 
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Mateusz Kwasniewski
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
xsist10
 
Drupal Development Tips
Drupal Development TipsDrupal Development Tips
Drupal Development Tips
Chris Tankersley
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
guest60c7659
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
IT Event
 

What's hot (20)

Mastering WordPress Vol.1
Mastering WordPress Vol.1Mastering WordPress Vol.1
Mastering WordPress Vol.1
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
WPDay Bologna 2013
WPDay Bologna 2013WPDay Bologna 2013
WPDay Bologna 2013
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
 
wp-cli
wp-cliwp-cli
wp-cli
 
Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014Modern Web Application Development Workflow - EclipseCon France 2014
Modern Web Application Development Workflow - EclipseCon France 2014
 
WordPress Security: Defend yourself against digital invaders
WordPress Security:Defend yourself against digital invadersWordPress Security:Defend yourself against digital invaders
WordPress Security: Defend yourself against digital invaders
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temy
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
 
Advanced Chrome extension exploitation
Advanced Chrome extension exploitationAdvanced Chrome extension exploitation
Advanced Chrome extension exploitation
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...Enterprise makeover. Be a good web citizen, deliver continuously and change y...
Enterprise makeover. Be a good web citizen, deliver continuously and change y...
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
 
Drupal Development Tips
Drupal Development TipsDrupal Development Tips
Drupal Development Tips
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
 

Similar to Nahlédněte za oponu VersionPressu

Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
Paul Bearne
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
Netvibes
 
Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11
Michelangelo van Dam
 
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
Hayato Mizuno
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
William Chong
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
Walter Ebert
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with Jekyll
Eric Lathrop
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
Chris Scott
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
Brandon Dove
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
Walter Ebert
 
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
cehwitham
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
Chris Scott
 
High Performance Snippets
High Performance SnippetsHigh Performance Snippets
High Performance Snippets
Steve Souders
 
Mojolicious
MojoliciousMojolicious
Mojolicious
Lenz Gschwendtner
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Doris Chen
 
Custom post-framworks
Custom post-framworksCustom post-framworks
Custom post-framworks
wcto2017
 
Custom post-framworks
Custom post-framworksCustom post-framworks
Custom post-framworks
Kiera Howe
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
LumoSpark
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
Nicholas Zakas
 

Similar to Nahlédněte za oponu VersionPressu (20)

Vagrant WordCamp Hamilton
Vagrant  WordCamp HamiltonVagrant  WordCamp Hamilton
Vagrant WordCamp Hamilton
 
Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007Netvibes UWA workshop at ParisWeb 2007
Netvibes UWA workshop at ParisWeb 2007
 
Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11
 
"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド"今" 使えるJavaScriptのトレンド
"今" 使えるJavaScriptのトレンド
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with Jekyll
 
You're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp OrlandoYou're Doing it Wrong - WordCamp Orlando
You're Doing it Wrong - WordCamp Orlando
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
WordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwaltenWordPress mit Composer und Git verwalten
WordPress mit Composer und Git verwalten
 
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
Making WordPress Your CMS and Automatically Updating a Self Hosted WordPress ...
 
You're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp AtlantaYou're Doing it Wrong - WordCamp Atlanta
You're Doing it Wrong - WordCamp Atlanta
 
High Performance Snippets
High Performance SnippetsHigh Performance Snippets
High Performance Snippets
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Custom post-framworks
Custom post-framworksCustom post-framworks
Custom post-framworks
 
Custom post-framworks
Custom post-framworksCustom post-framworks
Custom post-framworks
 
Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)Web development automatisation for fun and profit (Artem Daniliants)
Web development automatisation for fun and profit (Artem Daniliants)
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 

Recently uploaded

Camunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptxCamunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptx
ZachWylie3
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
Priyanka Aash
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
FIDO Alliance
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
DianaGray10
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
AmandaCheung15
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
softsuave
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
bellared2
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
SubhamMandal40
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
BrainSell Technologies
 
Feature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptxFeature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptx
ssuser1915fe1
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
Jimmy Lai
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
bhumivarma35300
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
shanihomely
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
Ivanti
 
kk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdfkk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdf
KIRAN KV
 
Redefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI CapabilitiesRedefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI Capabilities
Priyanka Aash
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
shyamraj55
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
Razin Mustafiz
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
BrainSell Technologies
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
Steven Carlson
 

Recently uploaded (20)

Camunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptxCamunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptx
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
 
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
UX Webinar Series: Drive Revenue and Decrease Costs with Passkeys for Consume...
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
 
Zaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdfZaitechno Handheld Raman Spectrometer.pdf
Zaitechno Handheld Raman Spectrometer.pdf
 
Step-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From ScratchStep-By-Step Process to Develop a Mobile App From Scratch
Step-By-Step Process to Develop a Mobile App From Scratch
 
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
Russian Girls Call Navi Mumbai 🎈🔥9920725232 🔥💋🎈 Provide Best And Top Girl Ser...
 
Sonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdfSonkoloniya documentation - ONEprojukti.pdf
Sonkoloniya documentation - ONEprojukti.pdf
 
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdfAcumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
Acumatica vs. Sage Intacct vs. NetSuite _ NOW CFO.pdf
 
Feature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptxFeature sql server terbaru performance.pptx
Feature sql server terbaru performance.pptx
 
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python CodebaseEuroPython 2024 - Streamlining Testing in a Large Python Codebase
EuroPython 2024 - Streamlining Testing in a Large Python Codebase
 
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
High Profile Girls call Service Pune 000XX00000 Provide Best And Top Girl Ser...
 
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
Premium Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Service ...
 
Patch Tuesday de julio
Patch Tuesday de julioPatch Tuesday de julio
Patch Tuesday de julio
 
kk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdfkk vathada _digital transformation frameworks_2024.pdf
kk vathada _digital transformation frameworks_2024.pdf
 
Redefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI CapabilitiesRedefining Cybersecurity with AI Capabilities
Redefining Cybersecurity with AI Capabilities
 
Integrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecaseIntegrating Kafka with MuleSoft 4 and usecase
Integrating Kafka with MuleSoft 4 and usecase
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
 
Acumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptxAcumatica vs. Sage Intacct _Construction_July (1).pptx
Acumatica vs. Sage Intacct _Construction_July (1).pptx
 
Vulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive OverviewVulnerability Management: A Comprehensive Overview
Vulnerability Management: A Comprehensive Overview
 

Nahlédněte za oponu VersionPressu

  • 3. VersionPress Open-source verzovací plugin Sebemenší změna na webu = nová verze Umožňuje týmová workflows https://sli.do/#wcphadev
  • 4. Největší výzvy Unikátní identifikace databázových entit Cizí klíče ve WP Špatný návrh databáze / zneužívání základních tabulek Sledování všech změn Formát vhodný pro ukládání / přenos / mergování Vlastní tabulky pluginů / témat vzhledů https://sli.do/#wcphadev
  • 5. Databáze Smutný příběh jednoho CMS https://sli.do/#wcphadev
  • 6. Unikátní identifikace entit Your site Staging Production New post (nav_menu_item) ID: 13 Your site New post (page) ID: 13 ? https://sli.do/#wcphadev
  • 8. Unikátní identifikace entit Your site Staging Production New post (nav_menu_item) ID: 13 Your site New post (page) ID: 13 ? https://sli.do/#wcphadev
  • 9. Unikátní identifikace entit Your site Staging Production New post (nav_menu_item) ID: 13 VPID: A34B38985CD356 Your site New post (page) ID: 13 VPID: 8356A35CD4B389 ✓ https://sli.do/#wcphadev
  • 10. Unikátní identifikace entit New post (nav_menu_item) ID: 13 VPID: A34B38985CD356 Your site New post (page) ID: 13 VPID: 8356A35CD4B389 Post (nav_menu_item) ID: 14 VPID: A34B38985CD356 Post (page) ID: 13 VPID: 8356A35CD4B389 https://sli.do/#wcphadev
  • 11. Unikátní identifikace entit New post (nav_menu_item) ID: 13 VPID: A34B38985CD356 Your site New post (page) ID: 13 VPID: 8356A35CD4B389 Post (nav_menu_item) ID: 14 VPID: A34B38985CD356 Post (page) ID: 13 VPID: 8356A35CD4B389 https://sli.do/#wcphadev
  • 13. Cizí klíče schema.php: CREATE TABLE $wpdb->postmeta ( meta_id bigint(20) unsigned NOT NULL auto_increment, post_id bigint(20) unsigned NOT NULL default '0', meta_key varchar(255) default NULL, meta_value longtext, PRIMARY KEY (meta_id), KEY post_id (post_id), KEY meta_key (meta_key($max_index_length)) ) $charset_collate; https://sli.do/#wcphadev
  • 14. Cizí klíče post: table: posts id: ID … postmeta: id: meta_id parent-reference: post_id references: post_id: post value-references: meta_key@meta_value: _thumbnail_id: post _menu_item_object_id: '@vp_get_menu_reference' https://sli.do/#wcphadev
  • 15. Cizí klíče post: table: posts id: ID … postmeta: id: meta_id parent-reference: post_id references: post_id: post value-references: meta_key@meta_value: _thumbnail_id: post _menu_item_object_id: '@vp_get_menu_reference' https://sli.do/#wcphadev
  • 17. Cizí klíče post: table: posts id: ID … postmeta: id: meta_id parent-reference: post_id references: post_id: post value-references: meta_key@meta_value: _thumbnail_id: post _menu_item_object_id: '@vp_get_menu_reference' https://sli.do/#wcphadev
  • 21. Cizí klíče post: table: posts id: ID … postmeta: id: meta_id parent-reference: post_id references: post_id: post value-references: meta_key@meta_value: _thumbnail_id: post _menu_item_object_id: '@vp_get_menu_reference' https://sli.do/#wcphadev
  • 25. Cizí klíče [ 0 => false, 'auto_add' => [ 0 => 2 ] ] https://sli.do/#wcphadev
  • 26. Cizí klíče option: table: options vpid: option_name value-references: option_name@option_value: site_icon: post page_on_front: post page_for_posts: post default_category: term default_email_category: term widget_nav_menu[/d+/]["nav_menu"]: term widget_pages[/d+/]["exclude"]: post nav_menu_options["auto_add"][/d+/]: term featured-content["tag-id"]: term theme_mods_*["nav_menu_locations"][/.*/]: term https://sli.do/#wcphadev
  • 27. DB návrh WP / pluginů „12 tabulek by mělo stačit každému" – Autor neznámý https://sli.do/#wcphadev
  • 28. DB návrh WP / pluginů Post Types: ◦ post ◦ page ◦ attachment ◦ revision ◦ nav_menu_item ◦ custom_css ◦ customize_changeset https://sli.do/#wcphadev
  • 29. DB návrh WP / pluginů { "widget_text[2]": { "starter_content": true, "value": { "encoded_serialized_instance": "YToyOntzOjU6InRpdGxlIjtzOjc6IkZpbmQgVXMiO3M6NDoidGV4dCI7czoyMDA6IjxwPjxzdHJvbmc+QWRkcmVzczwvc3Ryb25nPjxiciA vPjEyMyBNYWluIFN0cmVldDxiciAvPk5ldyBZb3JrLCBOWSAxMDAwMTwvcD48cD48c3Ryb25nPkhvdXJzPC9zdHJvbmc+PGJyIC8+TW9 uZGF5Jm1kYXNoO0ZyaWRheTogOTowMEFNJm5kYXNoOzU6MDBQTTxiciAvPlNhdHVyZGF5ICZhbXA7IFN1bmRheTogMTE6MDBBTSZ uZGFzaDszOjAwUE08L3A+Ijt9", "title": "Find Us", "is_widget_customizer_js_value": true, "instance_hash_key": "d16b28dc2af40b7d8ee54668bd545ed1" }, "type": "option", "user_id": 1 }, "widget_search[3]": { "starter_content": true, "value": { "encoded_serialized_instance": "YToxOntzOjU6InRpdGxlIjtzOjY6IlNlYXJjaCI7fQ==“, customize_changeset in wp_posts https://sli.do/#wcphadev
  • 30. DB návrh WP / pluginů { "widget_text[2]": { "starter_content": true, "value": { "encoded_serialized_instance": "YToyOntzOjU6InRpdGxlIjtzOjc6IkZpbmQgVXMiO3M6NDoidGV4dCI7czoyMDA6IjxwPjxzdHJvbmc+QWRkcmVzczwvc3Ryb25nPjxiciA vPjEyMyBNYWluIFN0cmVldDxiciAvPk5ldyBZb3JrLCBOWSAxMDAwMTwvcD48cD48c3Ryb25nPkhvdXJzPC9zdHJvbmc+PGJyIC8+TW9 uZGF5Jm1kYXNoO0ZyaWRheTogOTowMEFNJm5kYXNoOzU6MDBQTTxiciAvPlNhdHVyZGF5ICZhbXA7IFN1bmRheTogMTE6MDBBTSZ uZGFzaDszOjAwUE08L3A+Ijt9", "title": "Find Us", "is_widget_customizer_js_value": true, "instance_hash_key": "d16b28dc2af40b7d8ee54668bd545ed1" }, "type": "option", "user_id": 1 }, "widget_search[3]": { "starter_content": true, "value": { "encoded_serialized_instance": "YToxOntzOjU6InRpdGxlIjtzOjY6IlNlYXJjaCI7fQ==“, customize_changeset in wp_posts https://sli.do/#wcphadev
  • 31. DB návrh WP / pluginů { "widget_text[2]": { "starter_content": true, "value": { "encoded_serialized_instance": "YToyOntzOjU6InRpdGxlIjtzOjc6IkZpbmQgVXMiO3M6NDoidGV4dCI7czoyMDA6IjxwPjxzdHJvbmc+QWRkcmVzczwvc3Ryb25nPjxiciA vPjEyMyBNYWluIFN0cmVldDxiciAvPk5ldyBZb3JrLCBOWSAxMDAwMTwvcD48cD48c3Ryb25nPkhvdXJzPC9zdHJvbmc+PGJyIC8+TW9 uZGF5Jm1kYXNoO0ZyaWRheTogOTowMEFNJm5kYXNoOzU6MDBQTTxiciAvPlNhdHVyZGF5ICZhbXA7IFN1bmRheTogMTE6MDBBTSZ uZGFzaDszOjAwUE08L3A+Ijt9", "title": "Find Us", "is_widget_customizer_js_value": true, "instance_hash_key": "d16b28dc2af40b7d8ee54668bd545ed1" }, "type": "option", "user_id": 1 }, "widget_search[3]": { "starter_content": true, "value": { "encoded_serialized_instance": "YToxOntzOjU6InRpdGxlIjtzOjY6IlNlYXJjaCI7fQ==“, customize_changeset in wp_posts https://sli.do/#wcphadev
  • 33. Úložiště dat Databáze ◦ Obtížné verzování ◦ Slabší programovací jazyk ◦ Složité diffy ◦ Běžné média soubory >> běžné DB řádky Filesystém ◦ Verzování => Git ◦ PHP > PL/SQL ◦ Diffy => Git ◦ Počet běžných DB řádek >> počet souborů https://sli.do/#wcphadev
  • 34. Formát pro ukládání Soubory se nemění DB záznamy je potřeba šikovně diffovat ◦ Řádek v DB == soubor ◦ Sloupec v DB == řádek v souboru ◦ DDL? JSON? Serializovaný objekt? https://sli.do/#wcphadev
  • 35. Formát pro ukládání – INI !!! [8CFC6D1208DC4D0F877039A3B8300366] post_date = "2016-02-11 17:29:03” post_date_gmt = "2016-02-11 17:29:03” post_content = "live" post_content_filtered = "" post_title = "Added on LIVE" post_excerpt = "" post_status = "publish" post_type = "post" comment_status = "open" ping_status = "open" post_password = "" post_name = "added-on-live" to_ping = "" pinged = "" menu_order = 0 post_mime_type = "" guid = "http://3D13C49A-BE86-4C8B-B4ED-D83222FFB296" vp_post_author = "528E14A1AAD04CC08121DD631B2F6591" vp_post_parent = 0 vp_term_taxonomy[0] = "752CC32F4AF842A79BEF42454E130743" https://sli.do/#wcphadev
  • 36. Formát pro ukládání commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5 Author: admin <jan@voracek.net> Date: Sat Feb 18 01:08:31 2017 +0100 [VP] Unapproved comment for post 'Vítejte!' VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62 VP-Comment-Author: A WordPress Commenter VP-Comment-PostTitle: Vítejte! X-VP-Version: DEV X-VP-Environment: default --- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini +++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini @@ -9,7 +9,7 @@ comment_content = "Hi, this is a comment..." comment_karma = "0" -comment_approved = "1" +comment_approved = "0" comment_agent = "" comment_type = "" vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6" https://sli.do/#wcphadev
  • 37. Formát pro ukládání commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5 Author: admin <jan@voracek.net> Date: Sat Feb 18 01:08:31 2017 +0100 [VP] Unapproved comment for post 'Vítejte!' VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62 VP-Comment-Author: A WordPress Commenter VP-Comment-PostTitle: Vítejte! X-VP-Version: DEV X-VP-Environment: default --- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini +++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini @@ -9,7 +9,7 @@ comment_content = "Hi, this is a comment..." comment_karma = "0" -comment_approved = "1" +comment_approved = "0" comment_agent = "" comment_type = "" vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6" https://sli.do/#wcphadev
  • 38. Zobrazení změn v GUI commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5 Author: admin <jan@voracek.net> Date: Sat Feb 18 01:08:31 2017 +0100 [VP] Unapproved comment for post 'Vítejte!' VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62 VP-Comment-Author: A WordPress Commenter VP-Comment-PostTitle: Vítejte! X-VP-Version: DEV X-VP-Environment: default --- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini +++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini @@ -9,7 +9,7 @@ comment_content = "Hi, this is a comment..." comment_karma = "0" -comment_approved = "1" +comment_approved = "0" comment_agent = "" comment_type = "" vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6" https://sli.do/#wcphadev
  • 39. https://sli.do/#wcphadev Zobrazení změn v GUI commit ac33c7943bb2d947d0e9769b70dd2f2cfe56b7c5 Author: admin <jan@voracek.net> Date: Sat Feb 18 01:08:31 2017 +0100 [VP] Unapproved comment for post 'Vítejte!' VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62 VP-Comment-Author: A WordPress Commenter VP-Comment-PostTitle: Vítejte! X-VP-Version: DEV X-VP-Environment: default --- a/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini +++ b/wp-content/vpdb/comments/32/32EB4B4D4D944039818CF9DF3EB73E62.ini @@ -9,7 +9,7 @@ comment_content = "Hi, this is a comment..." comment_karma = "0" -comment_approved = "1" +comment_approved = "0" comment_agent = "" comment_type = "" vp_comment_post_ID = "A766C62334614A50B67305B56D1C6EA6"
  • 40. Zobrazení změn v GUI actions.yml: comment: tags: VP-Comment-PostTitle: / VP-Comment-Author: comment_author actions: create: New comment for post '%VP-Comment-PostTitle%' edit: message: Edited comment for post '%VP-Comment-PostTitle%' priority: 12 delete: Deleted comment for post '%VP-Comment-PostTitle% trash: Comment for post '%VP-Comment-PostTitle%' moved to trash untrash: Comment for post '%VP-Comment-PostTitle%' moved from trash approve: Approved comment for post '%VP-Comment-PostTitle%' unapprove: Unapproved comment for post '%VP-Comment-PostTitle%' https://sli.do/#wcphadev
  • 41. Zobrazení změn v GUI actions.yml: comment: tags: VP-Comment-PostTitle: / VP-Comment-Author: comment_author actions: create: New comment for post '%VP-Comment-PostTitle%' edit: message: Edited comment for post '%VP-Comment-PostTitle%' priority: 12 delete: Deleted comment for post '%VP-Comment-PostTitle% trash: Comment for post '%VP-Comment-PostTitle%' moved to trash untrash: Comment for post '%VP-Comment-PostTitle%' moved from trash approve: Approved comment for post '%VP-Comment-PostTitle%' unapprove: Unapproved comment for post '%VP-Comment-PostTitle%' https://sli.do/#wcphadev
  • 42. Zobrazení změn v GUI comment: tags: VP-Comment-PostTitle: / VP-Comment-Author: comment_author actions: unapprove: Unapproved comment for post '%VP-Comment-PostTitle%' https://sli.do/#wcphadev
  • 43. Zobrazení změn v GUI comment: tags: VP-Comment-PostTitle: / VP-Comment-Author: comment_author actions: unapprove: Unapproved comment for post '%VP-Comment-PostTitle%' Author: admin <jan@voracek.net> Date: Sat Feb 18 01:08:31 2017 +0100 [VP] Unapproved comment for post 'Vítejte!' VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62 VP-Comment-Author: A WordPress Commenter VP-Comment-PostTitle: Vítejte! https://sli.do/#wcphadev
  • 44. Zobrazení změn v GUI comment: tags: VP-Comment-PostTitle: / VP-Comment-Author: comment_author actions: unapprove: Unapproved comment for post '%VP-Comment-PostTitle%' Author: admin <jan@voracek.net> Date: Sat Feb 18 01:08:31 2017 +0100 [VP] Unapproved comment for post 'Vítejte!' VP-Action: comment/unapprove/32EB4B4D4D944039818CF9DF3EB73E62 VP-Comment-Author: A WordPress Commenter VP-Comment-PostTitle: Vítejte! https://sli.do/#wcphadev
  • 45. Sledování změn Na úrovni DB ◦ Monkey patching wp-db.php / db.php drop-in ◦ create, edit, delete Pomocí filtrů add_filter('vp_entity_action_post', function ($action, $oldEntity, $newEntity) { if ($action === 'edit') { // determine more specific edit action $diff = EntityUtils::getDiff($oldEntity, $newEntity); if (isset($diff['post_status']) && $diff['post_status'] === 'trash') { return 'trash'; } if (isset($diff['post_status']) && $oldEntity['post_status'] === 'trash') { return 'untrash'; } https://sli.do/#wcphadev
  • 46. Rozšiřitelnost VersionPressu schema.yml ◦ DB schéma – tabulky, cizí klíče, ignorované entity, atd. actions.yml ◦ Seznam možných akcí + textová reprezentace shortcodes.yml hooks.php ◦ PHP hooky na WP i VP akce https://sli.do/#wcphadev
  • 48. Tipy pro vývojáře pluginů Nezneužívejte základní tabulky WP Používejte cizí klíče v DB Vytyčte v kódu si jasnou hranici mezi WP a vlastním pluginem Testujte svůj kód Testujte integraci s WP Přečtěte si Clean Code, The Clean Coder, Test Driven Development by Example, Data Modeling Essentials https://sli.do/#wcphadev