Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

Upwork WordPress Test Answers - part 3

1. You can limit the number of revisions WordPress stores by _____

<b>Note:</b> Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can't assign them the same slug.
Answers: • adding the following line to your wp-config.php file: define('WP_POST_REVISIONS', 3);
2. Which of the following will hash a string/password to its md5 equivalent?
Answers: • wp_generate_password()

3. Which conditional tag checks if the dashboard or the administration panel is attempting to be displayed by returning "true' (if the URL being accessed is in the admin section) or "false" (for a front-end page).
Answers: • is_admin()

4. Which of the following functions are used to add administration menu item in WordPress ?
Answers: • add_menu_page();

5. Which of the following WordPress Multisite functions allows for getting content from one blog and display it on another?
Answers: • switch_to_blog()

6. What is the BEST way to get last inserted row ID from Wordpress database ?
Answers: • Straight after the $wpdb->insert() insert, the following code should be added: $lastid = $wpdb->insert_id;

7. Which of the follow is a Wordpress alternatives for Ruby on Rails?
Answers: • Refinery

8. Which of the following code snippets can be used to create custom POST status in wordpress 3.0 +?
Answers: • register_post_status()


9. How can the upload media panel be included in a Wordpress template/plugin?
Answers: • By using function wp_enqueue_script('media-upload')

10. What are the database privileges that are required for WordPress?
Answers: • select, insert, delete, update, create, drop and alter

11. Which of the following is an example of a WordPress plugin that provides multilingual capabilities?
Answers: • qTranslate

12. Which of the following functions can be used to create a WordPress page?
Answers: • wp_insert_post()

13. Which function is used to display the name of current page in wordpress?
Answers: • get_the_title()

14. Which of the following methods can be used to make permalinks SEO friendly?
Answers: • Configuring the feature in the admin settings.

15. User Level 7 converts to _________?
Answers: • Editor

16. Which of the following is the correct way to add custom excerpts length identifiers in Wordpress?
Answers: • By adding excerpt_length filter in function.php

17. Which of the following is the correct sequence of steps to adapt a WordPress plugin to a multisite?
Answers: • 1. Use $wpdb to iterate through all blogs 2. Hook according to the $blog_id 3. Install the plugin as Network only 4. Uninstall depends the specific plugin

18. On which of the following databases can WordPress be installed by default?
Answers: • MySQL

19. Which of the following actions must be performed to import data from wordpress.com?
Answers: • Login to wordpress.com, then the export data using the export tool, then import an exported xml file to the site.

20. Meta tags can be added to WordPress pages by ________________.
Answers: • a and

21. Which of the following codes will return the current plugin directory in WordPress?
Answers: • <?php plugin_basename($file); ?>

22. WordPress's requirements are modest. At minimum, which of the following standards should your server support for WordPress 3.1?
Answers: • PHP version 4.3 or greater, MySQL version 4.1.2 or greater

23. Which of the following will give the option to add inline Ajax for comment posting?
Answers: • Using the Ajax Comment Posting plugin

24. What is the limitation to the depth of your categories?
Answers: • No limit levels

25. Can the contents of the wp-content folder be moved or renamed without changing any settings?
Answers: • Yes

26. Which of the following code snippets best protects a system from SQL injections?
Answers: • mysql_real_escape_string()

27. Which of the following role levels has the highest privilege?
Answers: • Level_10

28. How can the Home link be disable from the Wordpress top nav?
Answers: • By adding this code in functions.php function page_menu_args( $args ) { $args['show_home'] = FALSE; return $args; } add_filter( 'wp_page_menu_args', 'page_menu_args' );

29. Which of the following is the correct way to retrieve a featured image from a post?
Answers: • <?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>

30. Which of the following will correctly load localized (translated) text for a WordPress plugin?
Answers: • function load_theme_textdomain('tutsplus', $lang_dir); { $lang_dir = get_template_directory() . '/lang'); custom_theme_setup(); } add_action('after_setup_theme', 'custom_theme_setup');

31. Image size limits can be set _______________.
Answers: • in the admin settings

32. How can a user be found through its meta data?
Answers: • get_users($args)

33. Which PHP method(s) can be used to send form data that is persistent across succeeding page views (such as for a language selection feature) in WordPress?
Answers: • SESSION or COOKIE

34. Which of the following will call the WordPress media uploader form element?
Answers: • <form enctype="multipart/form-data" method="post" action="<?=bloginfo("siteurl");?>/wp-admin/media-upload.php?inline=&upload-page-form=" class="media-upload-form type-form validate" id="file-form">

35. Which of the following is the correct way to print the slug property of $firstTag object in this code snippet?

$tags = wp_get_post_tags($post->ID);
$firstTag = $tags[0];
Answers: • $firstTag->slug

36. Which of the following code snippets is the correct way to get content from Tinymce via javascript ?
Answers: • tinymce.activeEditor.getContent();

37. Is super cache a built-in plugin of WordPress?
Answers: • No

38. A possible way to allow the display of several authors' names on one post is to ______
Answers: • use a plug-in

39. In which way MD5 hash does wordpress stores and represents?
Answers: • In Hex string

40. What is the first action you need to take for enabling WordPress MU feature?
Answers: • Add this code to wp-config.php file: define( 'WP_ALLOW_MULTISITE', true );

41. What is Automated Testing in Wordpress?
Answers: • Automated testing is running test cases where manual intervention is not required to run each one.

42. Which of the following snippets disable depreciated warnings in Wordpress like this one ?

"Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647"
Answers: • error_reporting(E_ALL ^ E_DEPRECATED);

43. One possible way to collect realtime statistics about traffic on a WordPress site is:
Answers: • using a plugin

44. _____________ can publish, edit, and delete their own posts. They cannot write pages. They can upload some kinds of media files, and they are allowed to use only the limited set of HTML tags.
Answers: • Author

45. How can an <li> tag's class and ID attributes be removed from menu items and page lists?
Answers:
• add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); function my_css_attributes_filter($var) { return is_array($var) ? array() : ''; }

46. ____________ can publish, edit, and delete posts and pages written by any user. They can upload some kinds of files, and they can write HTML without restrictions. They can manage links and categories, and they can moderate comments. Editors and administrators are also the only users allowed to read private posts and pages.
Answers: • Editor

47. Which of the following will show the most recent post (by date) from a custom taxonomy?
Answers: • select * from wp_posts where ID in( select ID from ( select wp_posts.ID , wp_posts.post_date, d.name from wp_posts as a join wp_term_relationships as b on ( a.ID = b.object_id) join wp_terms as d on (c.term_id = d.term_id) where c.taxonomy = 'post-series' group by d.name having (wp_posts.post_date = max(wp_posts.post_date)) )tmp)

48. What are the correct steps in wordpress plugin development:
Answers: • Step 1 - Create your file and let it be known as a plugin Step 2 – Create the objects of your plugin Step 3 – Adding your actions and filters Step 4 – Adding settings/options to your plugin Step 5 - Finishing the code

49. What is the output of the following code?

<ul id="sortable">
<li id="1">example 1</li>
<li id="2">example 2</li>
<li id="3">example 3</li>
<li id="4">example 4</li>
</ul>

$(document).ready(function(){
$('#sortable').sortable({
update: function(event, ui) {
var newOrder = $(this).sortable('toArray').toString();
$.get('saveSortable.php', {order:newOrder});
}
});
});
Answers: • Saves sortable positions to data base based on the user input

50. Which of the following is the correct way to assign a category to a Wordpress post?
Answers: • wp_set_post_categories($postId,$categories)

51. Conditional tags can be used to _______________________.
Answers: • change the content to be displayed

52. Which of the following commands can change the ownership of WordPress directory to www-data (for Apache)?
Answers: • sudo chown -Rf www-data *

53. How can a custom content filter be added?
Answers: • By using add_filter('the_content','my_custom_filter')

54. How can a post ID be retrieved from the permalink?
Answers: • url_to_postid($permalink)

55. Which of the following is the correct way to redirect the default login and registration page URL to a custom login and registration page URL?
Answers: • add_action('init','possibly_redirect'); function possibly_redirect(){ global $pagenow; if( 'wp-login.php' == $pagenow ) { wp_redirect('Your custom url'); exit(); } }

56. How can a WordPress template be integrated inside a codeigniter framework using WordPress functions like wp_header,wp_footer,wp_sidebar?
Answers: • Include the file wp-blog-header.php from WordPress installation directory to codeigniters index.php and create template inside codeigniter's view.

57. What is the first action you need to take for enabling the WordPress multisite (MS) feature?
Answers: • Add this code to wp-config.php file: define( 'WP_ALLOW_MULTISITE', true );

58. Which of the functions below is required to create a new taxonomy?
Answers: • register_taxonomy

59. Which of the following actions cannot be hooked in with add_submenu_page() function?
Answers: • admin_submenu

60. Which of the following is the correct way to filter the content for a few posts?
Answers: • By using apply_filters(filter,postId)

61. What is the function of add_filter in WordPress?
Answers: • All of the above.

62. Which of the following code snippets will create plugins back-end page without showing it as menu item?
Answers: • add_submenu_page with parent slug = null

63. ____________ can manage their own profiles, but can do virtually nothing else in the administration area.
Answers: • Subscriber

64. Are categories and tags available for pages?

<b>Note:</b> Categories must have distinct slugs. Even if two categories have different parents and would therefore have different permalinks, you can't assign them the same slug.
Answers: • No

65. Which of the following is the correct way to get WordPress Post ID from the Post title?
Answers: • $page = get_page_by_title( 'Home' ); $page_id = $page->ID;

66. Which of the following will correctly add custom mod rewrite rules to .htaccess from a WordPress plugin?
Answers: • $custom_mod_rewrite = new custom_mod_rewrite; register_activation_hook( __FILE__, array($custom_mod_rewrite, 'flush_rewrite_rules')); register_deactivation_hook( __FILE__, array($custom_mod_rewrite, 'flush_rewrite_rules')); add_action('generate_rewrite_rules', array($custom_mod_rewrite, "generate_rewrite_rules")); class custom_mod_rewrite { function __construct() { $this->wp_rewrite = & $GLOBALS["wp_rewrite"]; } }

67. Which of the following is the correct code to get an array of every image uploaded to a particular post?
Answers: • $images = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );

68. Which of the following will echo the base URL of a WordPress site?
Answers: • <?php echo get_bloginfo('url') ?>

69. Which of the following functions are used when adding CSS and jQuery codes on a WordPress plugin?
Answers: • wp_enqueue_style


70. In order to display a widget, the user must _________________.
Answers: • drag the desired widget to the side bar

No comments:

Post a Comment