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]

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
Phil Calçado
 
Ruby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacionRuby como-lenguaje-de-programacion
Ruby como-lenguaje-de-programacion
Emmanuel Delgado
 
GitHub Notable OSS Project
GitHub  Notable OSS ProjectGitHub  Notable OSS Project
GitHub Notable OSS Project
roumia
 

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

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

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