8. The questions
● How do I make WordPress secure
●
What are your tips for secure WordPress
●
How do I chose save plugins and themes
● How do you manage to work remotely?
●
Are there any other Bulgarians at Automattic?
13. Story #1 The ID
● 7 year old legacy code
● Entire table described in the code
● We have items with ids 5 and 6. We need to
add 7.
● The 5 and 6 were repeated 135 times in the
code.
14. Story #1 The ID
● One new object
● A few helpers
● 135 removed magic numbers
● One changeset
● 0 unit tests
● What could possibly go wrong?
16. Story #1 Lessons
● Pleasepleaseplease, no magic numbers
● Atomic commits, please!
● Long functions are hard to understand
● Stats monitoring
● Legacy is code for which we don't have tests
17. Story #2 The Notification
● Montreal
●
1+ million emails
●
1+ million discount coupons (10-ish previously)
● Friday
● What could possibly go wrong?
18. Story #2 The Notification
● Queries that work with small tables:
SELECT * FROM table
SELECT * FROM table ORDER BY whatever
LIMIT 200, 100
19. Story #2 The Notification
● Queries that don't work with large tables:
SELECT * FROM table
SELECT * FROM table ORDER BY whatever
LIMIT 200000, 100
20. Story #2 The Notification
● Fetching big amounts of data breaks things
●
Offsetting breaks things
●
The coupons weren't really used in the past
and didn't really work
● Repeating millions of anything means a lot of
time
23. Offsets
SELECT * FROM ...
WHERE `id` > 1093029
ORDER BY `id` LIMIT 20
SELECT `deadline` FROM ...
WHERE `date` BETWEEN '2014-06-20'
AND ...
24. Offsets
SELECT * FROM ...
WHERE `id` > 1093029
ORDER BY `id` LIMIT 20
SELECT `deadline` FROM ...
WHERE `date` BETWEEN '2014-06-20'
AND ...
25. Offsets
SELECT * FROM `table` JOIN (
SELECT `id` FROM `table`
ORDER BY `whatever`
LIMIT 5000,50
) as `b` USING `id`
26. Story #3 The A/B Test
● A/B test is showing different things to users and
measuring effect
● We use Kissmetrics
● We've had 5 different A/B testing classes
27. Story #3 The A/B Test
● Feature-rich classes
●
Many levels of abstraction
●
Expressive names
● Many filters and actions
● What could possibly go wrong?
28. Story #3 The A/B Test
class Server_Side_Experiment_Visitor extends
Server_Side_Experiment_Base {
...
29. Story #3 The A/B Test
● Wrong results, no one knows why.
30. Story #3 The A/B Test
● Wrong results, no one knows why.
31. Story #3 The A/B Test
A new colleague joins and writes this:
ab_test(
'test-teh-button',
array(
'orange',
'blue',
)
);
// return 'orange'
32. Story #3 Lessons Learned
● KISS. Simplest solution worked
●
Kissmetrics rocks
●
A/B test everything
33. Story #4 Barry
<bazza> howdy
<dzver> hi, did I break anything?
<bazza> your blog looks hacked
34. Story #4
● Unique passwords
●
2-factor auth
●
Come to WordCamp Europe and maybe watch
Barry live :-)
●
#praythatbarrycomestowceurope
35. Summary
● KISS. Simple queries. Simple code.
●
DRY. Repetition fails.
●
A/B test. Unit test. Test!
●
Launch your next project on Friday at 7pm.
36. My name is Veselin
I code for food.
Ask me anything!