You are on page 1of 10

Wordpress Interview

1. You want to schedule a backup of your site database but do not have enough permission to access your
host. of the following choices can help you perform this task?
a) Use phpMyAdmin
b) Install wp database backup plug-in
c) Use cron job to schedule.
Ans. (B)
2. The function_exist() function can be used to check whether a plug-in activated or not?
A) True
B) False
Answer : (A)
3. Image size can be set __________
a) Directly in the posts
b) in the wp-imageresize plug-in
c) in the admin settings
d) a and b
Answer: (C)
4. In order to to display a widget, the user must _____
a) Set he Show Property of the desired widget to true
b) Drag the desired widget of the side bar
c) Add the Desired widget to the post
d) Change the source code
Answer: (b)
5. Which of the following actions must be performed before upgrading WordPress?
a. Back up the site.
b. Ensure that the database user name registered to WordPress has permission to create, modify, and delete
database tables.
c. Deactivate plug-ins.
d. Enable FTP on the site.

e. a, c, and d
f. a, b, and c
Ans: ( f)
6 . Which of the following actions must you perform to move your site from /wordpress to
/blog/wordpress?
a. Change the source code.
b. Update the wp-config.php file.
c. Update the database.
d. The site cannot be moved in that manner.
Ans: ( C)
7. What is the first action you need to take for enabling WordPress MU feature?
a. Enable WordPress MU feature on admin panel
b. Enable Network feature
c. Add this code to wp-config.php file: define( WP_ALLOW_MULTISITE, true );
Ans: (c)
8. Which of the following theme files can be used to customize the page not found error error page?
a. index.php
b. 404.php
c. functions.php
d. page.php
Ans: b:404.php
9. How can a logo be placed on a WordPress header?
a. Manually add the logo to the source code.
b. Upload a new logo in admin settings.
c. Update the logo path in the config file.
Ans: (a)
10. Which of the following tasks must be performed to add a favicon icon to your site?
a. Upload a favicon icon to your site.
b. Add a favicon icon link to the themes header file or update the existing favicon icon link to the new one.
c. Change the favicon icon in admin settings.
d. The favicon icon cannot be changed.
e. a and b
f. b and c

Ans: (e)
11. Which of the following methods can be used to eliminate spam?
a. Using the wp-captcha-free plug-in.
b. Using the askimet plug-in.
c. Using a widget.
d. None of the above.
e. a and b
Ans: (e)
12. In order to display a widget, the user must _________________.
a. set the show property of the desired widget to true
b. drag the desired widget to the side bar
c. add the desired widget to the post
d. change the source code
Ans: (b)
13. You can limit the number of revisions WordPress stores by _____
a. adding the following line to your wp-config.php file: define(WP_POST_REVISIONS, 3);
b. using a plugin
c. changing a setting on admin panel
d. a & b
Ans: (d)
14. Who of the following persons can read a post locked by password?
a. Only administrators, editors and authors
b. Registered users who knows a password
c. Anyone who knows a password
Ans: (c)
15. Which of the following methods is required to post html code for others to read?
a. Replacing special characters with corresponding html codes or character codes.
b. Using the <" code "> tag.
c. Using the <" pre "> tag.
d. None of the above: WordPress auto-replaces special characters with substituted characters.
Ans: (a)
16. Which of the following methods can be used to enable posting via e-mail?
a. Installing the wp-emailpost plug-in.
b. Configuring the feature in admin settings.
c. Using a widget.
d. This feature is not available in WordPress.

Ans: (b)
17. Meta tags can be added to WordPress pages by ________________.
a. using plug-ins
b. adding them to the header.php file
c. updating the database
d. None of the above.
Ans: a, b
18. Conditional tags can be used to _______________________.
a. get all comments from one post
b. get all posts from one category
c. change the content to be displayed
d. None of the above: conditional tags are not available in WordPress.
Ans: (c)
19. What is the right order (by priority in use) to display tag in Template Hierarchy?.
a. tag -{slug}.php, tag-{id}.php, tag.php, index.php
b. tag -{id}.php, tag -{slug}.php, tag.php, index.php
c. tag -{slug}.php, tag -{id}.php, tag.php, archive.php, index.php
d. tag -{slug}.php, tag -{id}.php, tag.php, 404.php
Ans: (c)
20. Which of the following files are required for completing your theme?
a. Index.php
b. Style.css
c. Index.php and style.css
d. Index.php and functions.php
Ans: (c)
21. Which of the following is not valid PHP code?
A) $_10
B) ${MyVar}
C) &$something
D) $10_somethings
E) $aVaR
Ans: (d)
22. What is the difference between print() and echo()?
A) print() can be used as part of an expression, while echo() cant
B) echo() can be used as part of an expression, while print() cant
C) echo() can be used in the CLI version of PHP, while print() cant

D) print() can be used in the CLI version of PHP, while echo() cant
E) Theres no difference: both functions print out some text!
Ans: A & B

23. Consider the following class:


Class Insurance
{
function clsName()
{
echo get_class($this);
}
}
8. $cl = new Insurance();
9. $cl -> clsName();
10. Insurance::clsName();
Which of the following Lines should be commented to print the class name without errors?
a. Line 8 and 9
b. Line 10
c. Line 9 and 10
d. All the three lines 8,9, and 10 should be left as it is.
Ans: d
24) What is the output of the following code?
a. Array ([x]=>9 [y]=>3 [z]=>-7)
b. Array ([x]=>3 [y]=>2 [z]=>5)
c. Array ([x]=>12 [y]=>5 [z]=>-2)
d. Error
e. None of the above
Ans: c

25. 8) What will be the output of the following code?


$var = 10;
function fn ()
{
$var = 20;
return $var;
}
fn ();
echo $var;
a. 10
b. 20
c. Undefined Variable

d. Syntax Error
Ans: a

26. which of the following is a correct declaration?


a. static $varb = array(1,'val',3);
b. static $varb = 1+(2*90);
c. static $varb = sqrt(81);
d. static $varb = new Object;
Ans: a

27. Consider the following two statements:


I while (expr) statement
II while (expr): statement... endwhile;
Which of the following are true in context of the given statements?
a. I is correct and II is wrong
b. I is wrong and II is correct
c. Both I & II are wrong
d. Both I & II are correct
Ans: d

28. What will be the output of the following code?


$Rent = 250;
function Expenses($Other)
{
$Rent = 250 + $Other;
return $Rent;
}
Expenses(50);
echo $Rent;
a. 300
b. 250
c. 200
d. Program will not compile
Ans: b

29. Which of the following regular expressions can be used to check the validity of an e-mail addresses?
a. ^[^@ ]+@[^@ ]+.[^@ ]+$
b. ^[^@ ]+@[^@ ]+.[^@ ]+$
c. $[^@ ]+@[^@ ]+.[^@ ]+^
d. $[^@ ]+@[^@ ]+.[^@ ]+^

Ans: b

30. What will happen at the end of the following sequence of SQL commands?
BEGIN TRANSACTION
DELETE FROM MYTABLE WHERE ID=1
DELETE FROM OTHERTABLE
ROLLBACK TRANSACTION
A) The contents of OTHERTABLE will be deleted
B) The contents of both OTHERTABLE and MYTABLE will be deleted
C) The contents of OTHERTABLE will be deleted, as will be all the contents of MYTABLE whose ID is 1
D) The database will remain unchanged to all users except the one that executes these queries.
E) The database will remain unchanged
Ans (e)

31. What is the behavior of below code:


<?php
add_filter( 'the_content', 'wpcandy_filterhook_signoff' );
function wpcandy_filterhook_signoff ( $content ) {
if ( is_single() ) {
$content .= '<div class="sign-off">Th-th-th-th-th That\'s all, folks!</div>' . "
";
} // End IF Statement
return $content;
} // End wpcandy_filterhook_signoff()
?>

A) Adds a div at the start of the post


B) Adds a div at end the of the post
C) No effect
D) error
Ans (B)
32. What does below code do?

function create_post_type() {
register_post_type( 'acme_product',
array(
'labels' => array(
'name' => __( 'Products' ),
'singular_name' => __( 'Product' )
),
'public' => true,
'has_archive' => true,
)
);
}

A) Defines a new post type and it can be used anywhere


B) Defines a new post type and it needs to be initialized
C) Defines a new post type and it needs to be registered
D) Does nothing
Ans (B)

33. Which is the right way of changing the permalink structure?


A) 301 Redirect
B) 302 Redirect
C) 503
D) 404
Ans A)

34. Consider the below code:

add_action('init','super_plugin_init');
function super_plugin_init(){
//do work

run_sub_process();

}
function run_sub_process(){
//more work
}

When the super_plugin_init method will be called:


A) Only once when the server is started
B) With each request
C) With each method call
D) Never
Ans: (B)
35.
What is the objective of below code:
add_action( 'init', 'init_custom_rewrite' );
function init_custom_rewrite() {
add_rewrite_rule(
'^phones/compare/([^/]*)/?',
'index.php?page_id=XXX&between=$matches[1]',
'top' );
}

A) Rewrite the URL from idex.php?.... to /phone/compare/..


B) Rewrite the URL from /phone/compare/.. to idex.php?....
C) Just a method which can be invoked anytime
D) No objective

Ans (B)

You might also like