The document outlines 10 questions that an interviewer asks developers during the hiring process. It discusses filtering for candidates that understand WordPress fundamentals like hooks, taxonomies, and common functions. The questions assess a candidate's troubleshooting ability and critical thinking. They are also tested on security best practices like sanitization. Successful candidates demonstrate expertise in WordPress APIs for tasks like scheduled updates and caching data. The interview aims to evaluate a developer's technical skills and problem-solving approach, as well as their strategic insights about trends in the industry.
6. 1. Does the candidate ^get ̄ the
platform?
2. How much does he/she already know
about building on WordPress?
3. Does the candidate think critically
about his/her work?
7. There¨s not always one right answer.
... But there are better and worse answers.
... And there are some very wrong answers.
... Saying ^I¨m not familiar with that ̄ is
better than making something up.
9. Question #1
Tell me what a ^hook ̄ is, and talk
about the two basic hooks in
WordPress, and the difference
between them.
10. Question #1
Tell me what a ^hook ̄ is, and talk about the two basic hooks in WordPress, and the difference between them.
A killer feature that gets customers
addicted.
wrong answer
11. Question #1
Tell me what a ^hook ̄ is, and talk about the two basic hooks in WordPress, and the difference between them.
A way to extend WordPress. The
two types are plug-ins and themes.
wrong answer
12. Question #1
Tell me what a ^hook ̄ is, and talk about the two basic hooks in WordPress, and the difference between them.
A hook is a
technique used to
alter or augment the
behavior of software.
13. Question #1
Tell me what a ^hook ̄ is, and talk about the two basic hooks in WordPress, and the difference between them.
WordPress has
^action ̄ hooks and
^?lter ̄ hooks.
14. Question #1
Tell me what a ^hook ̄ is, and talk about the two basic hooks in WordPress, and the difference between them.
Action are hooks that WordPress launches at speci?c
intervals during execution.
add_action
?(
?'hook_name',
?'your_function_name',
?[priority],
?[accepted_args]
?);
15. Question #1
Tell me what a ^hook ̄ is, and talk about the two basic hooks in WordPress, and the difference between them.
Filters are functions that WordPress passes data through, at
certain points in execution, just before taking some action
with the data.
add_filter
?(
?'hook_name',
?'your_filter',
?[priority],
?[accepted_args]
?);
27. Question #4
Explain what sanitizing and
validating data means, and apply
that to WordPress.
28. Question #4
Explain what sanitizing and validating data means, and apply that to WordPress.
Checking database integrity and ensuring nothing has been
corrupted.
wrong answer
29. Question #4
Explain what sanitizing and validating data means, and apply that to WordPress.
Testing data to make sure it¨s what you expected.
good layman explanation... tell me more
30. Question #4
Explain what sanitizing and validating data means, and apply that to WordPress.
Untrusted data comes from many sources (users, third party
sites, your own database!, ...) and all of it needs to be
validated both on input and output.
31. Question #4
Explain what sanitizing and validating data means, and apply that to WordPress.
WordPress includes a large number of helper functions and
methods to ensure that output and input data is safe.
HTML Fragments, e.g. wp_kses()
Text nodes, e.g. esc_html()
Attribute
32. Question #4
Explain what sanitizing and validating data means, and apply that to WordPress.
Examples of validation / sanitizing helpers:
HTML: wp_kses( $string, $allowed_html, $allowed_protocols )
Text nodes & attributes: esc_html( $text )
URLs: esc_url( $url, (array) $protocols )
Database: wpdb->insert( $table, (array) $data )
Filesystem: validate_?le( $?lename, (array) $allowed_?les )
33. Question #5
Say a client needs to selectively
exclude posts from their blog
home. Speci?cally, how would you
achieve that?
34. Question #5
Say a client needs to selectively exclude posts from their blog home. Speci?cally, how would you achieve that?
User approach: I would add a new category called ^Exclude
From Home ̄ for the authors.
not bad... but not great
35. Question #5
Say a client needs to selectively exclude posts from their blog home. Speci?cally, how would you achieve that?
User approach: I would add a new custom meta box with an
^Exclude from home page ̄ checkbox.
good enough answer
36. Question #5
Say a client needs to selectively exclude posts from their blog home. Speci?cally, how would you achieve that?
User approach (bonus points): I would hook into
post_submitbox_misc_actions to add a checkbox to
the ^publish ̄ box with an ^Exclude from home ̄ option.
37. Question #5
Say a client needs to selectively exclude posts from their blog home. Speci?cally, how would you achieve that?
Technical approach: Inside the loop, I would write an ^if ̄
statement checking my criteria around the post output.
very wrong answer
38. Question #5
Say a client needs to selectively exclude posts from their blog home. Speci?cally, how would you achieve that?
Technical approach: I would do a new post query at the top
of my home.php template, excluding posts based on my
criteria.
wrong answer
39. Question #5
Say a client needs to selectively exclude posts from their blog home. Speci?cally, how would you achieve that?
Technical approach: I would use pre_get_posts to hook
into the post query, check if the query is for the blog home,
and alter the query to exclude posts based on my approach
before it executes.
function
?exclude_category(
?$query
?)
?{
?
?
?
?if
?(
?$query-?\>is_home()
?&&
?$query-?\>is_main_query()
?)
?{
?
?
?
?
?
?
?
?$query-?\>set(
?'cat',
?'-?\1,-?\1347'
?);
?
?
?
?}
}
add_action(
?'pre_get_posts',
?'exclude_category'
?);
41. Question #6
Tell me about your favorite function / class / API in WordPress.
media_sideload_image($file,
?$post_id,
?$desc);
Download an image from the speci?ed URL and attach it to a post.
42. Question #6
Tell me about your favorite function / class / API in WordPress.
human_time_diff(
?$from,
?$to
?);
Determines the difference between two timestamps.
The difference is returned in a human readable format such as "1
hour", "5 mins", "2 days".
43. Question #6
Tell me about your favorite function / class / API in WordPress.
wp_list_pluck(
?$list,
?$field
?);
Pluck a certain ?eld out of each object in a list
44. Question #6
Tell me about your favorite function / class / API in WordPress.
_doing_it_wrong(
?$function,
?$message,
?$version
?)
Trigger a user error if WP_DEBUG is true.
(technically internal only)
45. Question #7
Say you needed to retrieve some
data from a remote source once a
day. Tell me about some of the
WordPress APIs you¨d use.
46. Question #7
Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress
APIs you¨d use.
I would use wp_schedule_event() (the WP-Cron APIs)
to schedule the daily update.
add_action('my_hourly_event',
?'do_this_hourly');
function
?my_activation()
?{
? if
?(
?!wp_next_scheduled(
?'my_hourly_event'
?)
?)
?{
?
? wp_schedule_event(
?time(),
?'hourly',
?'my_hourly_event');
? }
}
add_action('wp',
?'my_activation');
function
?do_this_hourly()
?{
? //
?do
?something
?every
?hour
}
47. Question #7
Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress
APIs you¨d use.
I would use wp_remote_post() (part of the WP HTTP
API) to remotely fetch the data.
$response
?=
?wp_remote_post(
?$url,
?array(
? 'method'
?=>
?'POST',
? 'timeout'
?=>
?45,
? 'redirection'
?=>
?5,
? 'httpversion'
?=>
?'1.0',
? 'blocking'
?=>
?true,
? 'headers'
?=>
?array(),
? 'body'
?=>
?array(
?'username'
?=>
?'bob',
?'password'
?=>
?'1234xyz'
?),
? 'cookies'
?=>
?array()
?
?
?
?)
);
48. Question #7
Say you needed to retrieve some data from a remote source once a day. Tell me about some of the WordPress
APIs you¨d use.
Extra credit: I would use the set_transient() (the
Transients API) to cache the remote data after processing it.
set_transient(
?'processed_remote_data',
?$processed_data,
?60*60*24
?);
50. Question #8
Tell me what you the most
interesting trend or ^thing to
watch ̄ in our space is.
51. Question #8
Tell me what you the most interesting trend or ^thing to watch ̄ in our space is.
Mobile ?rst & the evolution of responsive design. The idea of
^progressive enhancement ̄, and what designing for mobile
?rst really means. Image and advertising challenges in
responsive technologies.
52. Question #8
Tell me what you the most interesting trend or ^thing to watch ̄ in our space is.
HiDPI (^retina ̄). We still need to solve technical hurdles (e.g.
image uploads in WordPress), and at some point this is going
to be a major requirements. It seems like Responsive Design
circa 2009.
53. Question #8
Tell me what you the most interesting trend or ^thing to watch ̄ in our space is.
Meaningful social media integration. Really innovative social
media integration with content, especially within in e-
commerce, is still a relatively new frontier.
54. Question #8
Tell me what you the most interesting trend or ^thing to watch ̄ in our space is.
Explosion of devices. There are new challenges we haven¨t fully
wrapped our heads around as we have so many different
screen sizes and types emerges, each with - potentially -
their own browser quirks.
55. Question #8
Tell me what you the most interesting trend or ^thing to watch ̄ in our space is.
Typography. Foundries are maturing, @font-face has
essentially been universally adopted.
56. Question #9
What frustrates you about
WordPress? What¨s something that
you think needs to change?
57. Question #9
What frustrates you about WordPress? What¨s something that you think needs to change?
Taxonomy / term architecture could be improved.
No term meta data, strange artifacts due to way tags and
categories of the same name are linked.
58. Question #9
What frustrates you about WordPress? What¨s something that you think needs to change?
There are no formal methods to create direct relationships
between two content objects (post objects).
59. Question #9
What frustrates you about WordPress? What¨s something that you think needs to change?
User interface for managing widgets and menus* can be
clumsy. Awkward drag and scroll.
60. Question #9
What frustrates you about WordPress? What¨s something that you think needs to change?
Some areas don¨t handle con?icts in plug-in well -
for example registering two custom menu items in
the same spot.
62. Question #10
Why do you want to work day in and out with WordPress?
^It¨s become the dominant CMS on the web. And growing. ̄
63. Question #10
Why do you want to work day in and out with WordPress?
^It¨s the only platform where customers don¨t call me back
in every month asking for a retraining. ̄
64. Question #10
Why do you want to work day in and out with WordPress?
^Because I believe in the freedoms in open source, and
WordPress is an awesome open source platform. ̄
65. Question #10
Why do you want to work day in and out with WordPress?
^The community. ̄
66. 10 Questions I Ask Every
Developer
@jakemgold ? @10up ? 10up.com