The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
-
Upload
jason-rhodes -
Category
Technology
-
view
1.140 -
download
0
description
Transcript of The WordPress Hacker's Guide to the \Galaxy() [@MidwestPHP]
The WordPress Hacker’s Guide to the \Galaxy()
Saturday, March 2, 13
@rhodesjasongithub.com/jasonrhodesnotrobotic.com
Saturday, March 2, 13
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
Stack Overflow spam questions
Not a “real” CMS and definitely not a “real” framework
WordPress, as described by various PHP developers
A really terrible database structure
Saturday, March 2, 13
WORDPRESS IS NOT THE DEVIL
Saturday, March 2, 13
WORDPRESS IS
PHPSaturday, March 2, 13
WORDPRESS IS
CODESaturday, March 2, 13
BETTER CODEBETTER PHPBETTER 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
/plugins cornify.php /batcache/themes/uploads
content
Saturday, March 2, 13
/plugins cornify.php /batcache/themes/uploads
content/mu-plugins
Saturday, March 2, 13
Saturday, March 2, 13
Filters filter.Actions (usually) have side effects.
What’s the difference between actions and filters?
http://wp.smashingmagazine.com/2012/02/16/inside-wordpress-actions-filters/
Saturday, March 2, 13
add_action(“action_name”, “function_name”);
CALLABLE
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
‣ Load JS/CSS with enqueue functions
‣Write tests (PHPUnit and QUnit)
‣ Experiment with WP-CLI
‣ Fun with caching
‣ Use the APIs
‣ Deploy smart
MORE GOOD THINGS
Saturday, March 2, 13
‣ Rewrite API‣ Settings API‣ Shortcode API‣ Theme Modification API‣ Theme Customization API‣ Transients API‣ Widgets API‣ XML-RPC WordPress API
‣ Database API‣ HTTP API‣ File Header API‣ Filesystem API‣ Metadata API‣ Options API‣ Plugin API‣ Quicktags 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 talkhttps://joind.in/8209
Slides, notes, example code:http://notrobotic.com/talks/2013-02-20-wpgalaxy.html
Saturday, March 2, 13