SlideShare uma empresa Scribd logo
1 de 47
Baixar para ler offline
The WordPress Hacker’s
                  Guide to the Galaxy()


Saturday, March 2, 13
@rhodesjason
                        github.com/jasonrhodes
                        notrobotic.com


Saturday, March 2, 13
WordPress, as described by various PHP developers


                Terrible design buried under a mountain of spaghetti code

                Reading through [WordPress code] is like jabbing red-hot fire pokeys into your eyes.

                BEHOLD WORDPRESS, DESTROYER OF CPUS

                remote shell with cms on side, aka: shit

                shit plugins

                WordPress is for cat pictures and diary entries.

                code is crapcrapcrap

                F$%@ THAT F$%@ THAT F$%@ THAT F$%@ THAT F$%@ THAT F$%@ THAT

                WordPress is... just adequate



                WordPress is for amateurs.
                WordPress is... terrifyingly insecure.

                No good default caching, it will kill your server if you don’t know what you’re doing

                A really terrible database structure

                Stack Overflow spam questions

                 Not a “real” CMS and definitely not a “real” framework
Saturday, March 2, 13
WORDPRESS IS
             NOT THE DEVIL
Saturday, March 2, 13
WORDPRESS IS
                        PHP
Saturday, March 2, 13
WORDPRESS IS
                        CODE
Saturday, March 2, 13
BETTER CODE
            BETTER PHP
            BETTER WORDPRESS

Saturday, March 2, 13
THE WP
                        HACKER’S
                        GUIDE TO
                        THE GALAXY

Saturday, March 2, 13
+

Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
THE WP
                        HACKER’S
                        GUIDE TO
                        THE GALAXY

Saturday, March 2, 13
FOLDER STRUCTURE



Saturday, March 2, 13
mysite
                        	 	 /wp-admin
                        	 	 /wp-content
                        	 	 /wp-includes
                        	 	 index.php
                        	 	 wp-config.php
                        	 	 wp-{etc}.php

Saturday, March 2, 13
mysite
                        	 	 index.php
                        	 	 /wp



Saturday, March 2, 13
WP GIANTS: MARK JAQUITH




Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
mysite
                	 	 /config
                	 	 	 	 /environments
                	 	 	 	 environment-config.php
                	 	 /public
                	 	 	 	 /content
                	 	 	 	 /wp
                	 	 	 	 index.php
                	 	 	 	 wp-config.php
                    /vendor
Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
LET’S WRITE SOME
                          PLUGIN CODE


Saturday, March 2, 13
Saturday, March 2, 13
YES, PLUGINS
                        (NOT FUNCTIONS.PHP)



Saturday, March 2, 13
Saturday, March 2, 13
MUST USE PLUGINS


Saturday, March 2, 13
content
                           /plugins
                           	 	 cornify.php
                           	 	 /batcache
                           /themes
                           /uploads


Saturday, March 2, 13
content
                            /mu-plugins
                           /plugins
                           	 	 cornify.php
                           	 	 /batcache
                           /themes
                           /uploads
Saturday, March 2, 13
Saturday, March 2, 13
What’s the difference between
                             actions and filters?

                                    Filters filter.
                         Actions (usually) have side effects.


                         http://wp.smashingmagazine.com/2012/02/16/
                                 inside-wordpress-actions-filters/


Saturday, March 2, 13
CALLABLE

      add_action(“action_name”, “function_name”);




Saturday, March 2, 13
array($object, “method_name”)




Saturday, March 2, 13
LET’S USE OOP

Saturday, March 2, 13
WP GIANTS: SCRIBU




Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
LET’S NAMESPACE


Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
MORE GOOD THINGS
                  ‣ Load JS/CSS with enqueue functions
                  ‣ Write tests (PHPUnit and QUnit)
                  ‣ Experiment with WP-CLI
                  ‣ Fun with caching
                  ‣ Use the APIs
                  ‣ Deploy smart
Saturday, March 2, 13
‣   Database API      ‣   Rewrite API
                    ‣   HTTP API          ‣   Settings API
                    ‣   File Header API   ‣   Shortcode API
                    ‣   Filesystem API    ‣   Theme Modification API
                    ‣   Metadata API      ‣   Theme Customization API
                    ‣   Options API       ‣   Transients API
                    ‣   Plugin API        ‣   Widgets API
                    ‣   Quicktags API     ‣   XML-RPC WordPress API




Saturday, March 2, 13
mysite
                	 	 current -> releases/1362181983
                	 	 /releases
                	 	 	 	 /1362181983
                	 	 	 	 /1362153455
                	 	 	 	 /1362141927
                	 	 /shared
                	 	 	 	 /config
                	 	 	 	 /files
Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
@rhodesjason


                        Please rate this talk
                        https://joind.in/8209


                        Slides, notes, example code:
                        http://notrobotic.com/talks/
                        2013-02-20-wpgalaxy.html

Saturday, March 2, 13

Mais conteúdo relacionado

Semelhante a The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]

Testing Drupal with Ghosts and Gherkin
Testing Drupal  with Ghosts and GherkinTesting Drupal  with Ghosts and Gherkin
Testing Drupal with Ghosts and GherkinPhase2
 
0207 - Visualizing Your Graph
0207 - Visualizing Your Graph0207 - Visualizing Your Graph
0207 - Visualizing Your GraphNeo4j
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular APIPhil Calçado
 
The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...
The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...
The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...Ernie Hsiung
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013 Pablo Godel
 
Passing a Front end Developer interview
Passing a Front end Developer interview Passing a Front end Developer interview
Passing a Front end Developer interview tonyfarnsworth
 
Writing & Sharing Great Modules on the Puppet Forge - Puppet Camp Raleigh
Writing & Sharing Great Modules on the Puppet Forge - Puppet Camp RaleighWriting & Sharing Great Modules on the Puppet Forge - Puppet Camp Raleigh
Writing & Sharing Great Modules on the Puppet Forge - Puppet Camp RaleighPuppet
 
RailsConf 2013: RubyMotion
RailsConf 2013: RubyMotionRailsConf 2013: RubyMotion
RailsConf 2013: RubyMotionBrian Sam-Bodden
 
Ruby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionRuby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionEmmanuel Delgado
 
Javascript in the cloud
Javascript in the cloudJavascript in the cloud
Javascript in the cloudMostafa Eweda
 
PyCon talk: Deploy Python apps in 5 min with a PaaS
PyCon talk: Deploy Python apps in 5 min with a PaaSPyCon talk: Deploy Python apps in 5 min with a PaaS
PyCon talk: Deploy Python apps in 5 min with a PaaSAppsembler
 
Make your cheap VM fly
Make your cheap VM flyMake your cheap VM fly
Make your cheap VM flyCode Enigma
 
Drupal: Internet Lego - What is Drupal?
Drupal: Internet Lego - What is Drupal?Drupal: Internet Lego - What is Drupal?
Drupal: Internet Lego - What is Drupal?Eric Aitala
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkJeremy Kendall
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Projectroumia
 
The Future of Content Management
The Future of Content ManagementThe Future of Content Management
The Future of Content ManagementRachel Andrew
 
Laravel and Composer
Laravel and ComposerLaravel and Composer
Laravel and ComposerPhil Sturgeon
 

Semelhante a The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP] (20)

Testing Drupal with Ghosts and Gherkin
Testing Drupal  with Ghosts and GherkinTesting Drupal  with Ghosts and Gherkin
Testing Drupal with Ghosts and Gherkin
 
0207 - Visualizing Your Graph
0207 - Visualizing Your Graph0207 - Visualizing Your Graph
0207 - Visualizing Your Graph
 
Applying Evolutionary Architecture on a Popular API
Applying Evolutionary Architecture on a  Popular APIApplying Evolutionary Architecture on a  Popular API
Applying Evolutionary Architecture on a Popular API
 
The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...
The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...
The Kitchen Sink Talk (Importing, Exporting, Customization & Troubleshooting ...
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013
 
Passing a Front end Developer interview
Passing a Front end Developer interview Passing a Front end Developer interview
Passing a Front end Developer interview
 
Writing & Sharing Great Modules on the Puppet Forge - Puppet Camp Raleigh
Writing & Sharing Great Modules on the Puppet Forge - Puppet Camp RaleighWriting & Sharing Great Modules on the Puppet Forge - Puppet Camp Raleigh
Writing & Sharing Great Modules on the Puppet Forge - Puppet Camp Raleigh
 
RailsConf 2013: RubyMotion
RailsConf 2013: RubyMotionRailsConf 2013: RubyMotion
RailsConf 2013: RubyMotion
 
Ruby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionRuby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacion
 
Javascript in the cloud
Javascript in the cloudJavascript in the cloud
Javascript in the cloud
 
PyCon talk: Deploy Python apps in 5 min with a PaaS
PyCon talk: Deploy Python apps in 5 min with a PaaSPyCon talk: Deploy Python apps in 5 min with a PaaS
PyCon talk: Deploy Python apps in 5 min with a PaaS
 
Make your cheap VM fly
Make your cheap VM flyMake your cheap VM fly
Make your cheap VM fly
 
ADAM
ADAMADAM
ADAM
 
Drupal: Internet Lego - What is Drupal?
Drupal: Internet Lego - What is Drupal?Drupal: Internet Lego - What is Drupal?
Drupal: Internet Lego - What is Drupal?
 
ExtJS WebDriver
ExtJS WebDriverExtJS WebDriver
ExtJS WebDriver
 
Keeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro frameworkKeeping it small - Getting to know the Slim PHP micro framework
Keeping it small - Getting to know the Slim PHP micro framework
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Project
 
Caching tips
Caching tipsCaching tips
Caching tips
 
The Future of Content Management
The Future of Content ManagementThe Future of Content Management
The Future of Content Management
 
Laravel and Composer
Laravel and ComposerLaravel and Composer
Laravel and Composer
 

Último

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Último (20)

Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 

The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]