Top 10 WordPress experienced developer interview questions

Some of questions that I may ask if i am hiring an experienced WordPress developer.

  • About hooks.
  • Type of hooks.
  • Different between filter and action.
  • WordPress setup with CDN
  • About WordPress managed hosting provider like Wpengine
  • Git with wordpress
  • WP CLI.
  • Backup method in wordpress.
  • WordPress site migration without any downtime.

Q1.         What are and define types of hooks in WordPress?

Ans.       Hooks are provided by WordPress to allow your plugin to ‘hook into’ the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion. There are two kinds of hooks:

Actions Hooks: Actions hooks are the hooks that the WordPress core launches at specific points during execution, or when specific events occur. Your plugin can specify that one or more of its PHP functions which are executed at these points, using the Action API.

Filters Hooks: Filters hooks are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen. Your plugin can specify that one or more of its PHP functions which are executed to modify specific types of text at these times, using the Filter API.

Actions Functions:
has_action()
add_action()
do_action()
do_action_ref_array()
did_action()
remove_action()
remove_all_actions()

Filter Functions:
has_filter()
add_filter()
apply_filters()
apply_filters_ref_array()
current_filter()
merge_filters()
remove_filter()
remove_all_filters()


Q2.         What are the template tags in WordPress?

Ans.       A template tag is code that instructs WordPress to “do” or “get” something. Like in header.php  we will use the tag bloginfo(‘name’) to get “Site Title” from wp-options table which is set in Setting > General at WordPress dashboard.

The the_title() template tag is used to display the post title.

wp_list_cats() is  for display categories.

get_header() for getting header.

get_sidebar() for display the sidebar on page.

get_footer() for get the footer content on page.


Q3.         how to write the short code in WordPress php file?

Ans.       Using do_shortcode() function inside of php echo tag. A very simple solution is to use the do_shortcode() function inside a PHP echo tag.

Short code is used in WordPress post or page and text box widget and php file.


Q4.         What are rules to follow in WordPress plugin development?

Ans.      

  • Find a unique name
  • Setup a prefix (related to your brand)
  • Create the plugin’s folder
  • Create sub-folders for PHP files, assets, and translations
  • Create the main plugin file and fill in obligatory header information
  • Create a readme.txt file
  • Use proper constants and functions to detect paths to plugin files
  • Create additional PHP files and include them inside the main one
  • Create activation and deactivation functions
  • Create an uninstall script

Q5.         What are the steps you can take if your WordPress file is hacked?

Ans.      

  • Install security plugin like WP security
  • Re-install the latest version of WordPress
  • Change password and user-ids for all your users
  • Check your themes and plugins are up to date

Q6.         In which cases you don’t see plugin menu?

Ans.       You can’t see your plugin menu when the blog is hosted on freewordpress.com as you cannot add plugin there.  Also, if you do not have an account of an administrator level on your WordPress dashboard, it is not possible to see plugin.


Q7.         What is the difference between the wp_title and the_title tags?

Ans.       wp_title() function is for use outside “The Loop” to display the title of a Page.  the_title() on the other hand is used within “The Loop“.


Q8.         How to modify the parent theme behavior within the child theme?

Ans.       The child theme could optionally override other template files likeauthor.php, category.php, functions.php, style.css etc. The WordPress framework first looks for a template file in the child theme directory and then will pick it up from the parent directory if not found.

For more details: http://code.tutsplus.com/articles/how-to-modify-the-parent-theme-behavior-within-the-child-theme–wp-31006


Reply