SlideShare a Scribd company logo
1 of 50
Download to read offline
The WordPress Hacker’s
                  Guide to the Galaxy()


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


Saturday, March 2, 13
Saturday, March 2, 13
Saturday, March 2, 13
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

More Related Content

Similar to The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP]

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
 
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
 
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
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013 Pablo Godel
 
RailsConf 2013: RubyMotion
RailsConf 2013: RubyMotionRailsConf 2013: RubyMotion
RailsConf 2013: RubyMotionBrian Sam-Bodden
 
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
 
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
 
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
 

Similar to The WordPress Hacker's Guide to the \Galaxy() [@Baltimore PHP] (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
 
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 ...
 
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
 
Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013   Symfony2 and MongoDB - MidwestPHP 2013
Symfony2 and MongoDB - MidwestPHP 2013
 
RailsConf 2013: RubyMotion
RailsConf 2013: RubyMotionRailsConf 2013: RubyMotion
RailsConf 2013: RubyMotion
 
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
 
Passing a Front end Developer interview
Passing a Front end Developer interview Passing a Front end Developer interview
Passing a Front end Developer interview
 
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
 
ADAM
ADAMADAM
ADAM
 
Make your cheap VM fly
Make your cheap VM flyMake your cheap VM fly
Make your cheap VM fly
 
ExtJS WebDriver
ExtJS WebDriverExtJS WebDriver
ExtJS WebDriver
 
Drupal: Internet Lego - What is Drupal?
Drupal: Internet Lego - What is Drupal?Drupal: Internet Lego - What is Drupal?
Drupal: Internet Lego - What is Drupal?
 
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
 
Caching tips
Caching tipsCaching tips
Caching tips
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Project
 
Storyplayer
StoryplayerStoryplayer
Storyplayer
 
The Future of Content Management
The Future of Content ManagementThe Future of Content Management
The Future of Content Management
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
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
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
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
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 
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
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
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...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
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
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
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?
 
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
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
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
 
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() [@Baltimore PHP]