Digital Marketing Certification Course Exam Questions & Answers (DMCCEQA)

DMCCEQA.com

LinkedIn WordPress Skill Quiz Answers 2022

The topics in the WordPress assessment include: Development, Themes, General, Performance and Accessibility, Core, Plugins, CSS and JavaScript, Security, Configuration and Users, Internationalization, REST API, LinkedIn WordPress Skill Quiz Answers

According to WordPress PHP coding standards for inline comments, how would you write a single-line comment in a PHP document?

  1. // This is a single line comment
  2. /* * This is a single line comment. */
  3. // This is a single line comment.
  4. <!– This is a single line comment –>

Correct Answer:

  • // This is a single line comment

Akismet is a plugin that comes automatically installed with WordPress. What does it do?

  1. It connects your site to Google Analytics.
  2. It displays a blog feed from websites similar to yours.
  3. It protects your site from comment spam.
  4. It hardens site security by enforcing strong passwords.

Correct Answer:

  • It protects your site from comment spam.

How can you add a custom script that needs to run only on the contact page of a site? The slug of the page is contact.

Link to the script directly from a template named page-contact.php using the get_header() template tag, like this:
get_header( '<script src="/my-script.js"></script>' );
Use functions.php to conditionally load the script by hooking it to wp_enqueue_scripts(), like this:
add_action( 'wp_enqueue_scripts', 'load_scripts' );

function load_scripts() {
    if ( is_page( 'contact' ) ) {
    echo '<script src="/my-script.js"></script>';
    }
}

Use functions.php to conditionally load the script by hooking it to wp_enqueue_scripts(), like this:
add_action( 'wp_enqueue_scripts', 'load_scripts' );
    function load_scripts() {
        if ( is_page( 'contact' ) ) {
        wp_enqueue_script( 'script', get_template_directory_uri() . '/script.js' );
        }
    }
  1.  Link to the script directly from a template named page-contact.php, like this:
  2.  <script src="/my-script.js"></script>

How would you use CSS to ensure your theme was mobile responsive?

  1. Use CSS grid to create responsive layouts.
  2. Use media queries to add breakpoints for different screen sizes.
  3. Use flexbox to create flexible page layouts.
  4. all of these answers

Correct Answer:

  • all of these answers

How would you write a text string containing “Hello World!” in a way that makes it possible for someone else to translate the string into a different language?

  1. apply_filters( ‘Hello World!’, ‘mytextdomain’ );
  2. __( ‘Hello World!’, ‘mytextdomain’ );
  3. $string = “Hello World!”;
  4. esc_html( ‘Hello World!’, ‘mytextdomain’ );

Correct Answer:

  • __( ‘Hello World!’, ‘mytextdomain’ );

If you activate or update a plugin and it breaks your site so that you cannot manage it via wp-admin, how can you disable the plugin?

  1. all of these answers
  2. Access the WordPress install via WP-CLI. Run the following command: wp plugin deactivate offending-plugin.
  3. Access site files via FTP and navigate to /wp-content/plugins/. Delete the folder of the plugin that you would like to disable or simply rename it.
  4. Use phpMyAdmin to change the wp_options table’s active_plugins option value to a:0:{}.

Correct Answer:

  • all of these answers

If you wanted to register a custom post type, which hook would you use?

  1. register_post_type
  2. add_meta_box
  3. wp_head
  4. init

Correct Answer:

  • init

If your WordPress site is seriously compromised, what is the best course of action to return your site to good health?

  1. Determine the date of the attack and restore your site to a backup point prior to that date.
  2. Hire a third-party service to clean up your site because it is difficult for someone who is not a WordPress security expert to find and remove all traces of an attack.
  3. Manually delete suspicious files on the server and delete any database tables that are not core WordPress.
  4. Change your hosting password, your WordPress admin password, and your database password.

Correct Answer:

  • Hire a third-party service to clean up your site because it is difficult for someone who is not a WordPress security expert to find and remove all traces of an attack.

In WordPress, what is the Loop used to do?

  1. It displays a single page.
  2. It displays posts on an archive.
  3. It displays a single post.
  4. all of these answers

Correct Answer:

  • all of these answers

In WordPress, what is the block editor used for?

  1. cropping images in the media library
  2. injecting specialized scripts into the content area
  3. creating a site layout
  4. creating and laying out content

Correct Answer:

  • creating and laying out content

In WordPress, what is true of plugins?

  1. Plugins are available in free or premium (paid) versions.
  2. Plugins can extend WordPress core functionality.
  3. all of these answers
  4. Plugins add site-specific features.

Correct Answer:

  • all of these answers

In a standard template file, how often does the WordPress Loop run?

  1. It runs once per post in the database.
  2. It runs once.
  3. The Loop doesn’t run in template files.
  4. It runs once per fetched post.

Correct Answer:

  • It runs once per fetched post.

In your wp-config.php file, you’ve added the following line of code. What does it do?

define( 'DISALLOW_fiLE_EDIT', true );

  1. prevents any non-admin user from directly editing theme or plugin files
  2. disables the theme and plugin editor in the WordPress admin
  3. disables the ability to edit core WordPress files from either within the WordPress admin or via direct file access
  4. sets read-only permissions on all files in the WordPress install

Explanation: More WordPress Security: Disallow file Edit Setting In WordPress. Setting all files to read-only would make auto-updates impossible.

Correct Answer:

  • disables the theme and plugin editor in the WordPress admin

On a regular WordPress install, what is the difference between transients and the object cache?

  1. Transients are persistent and write to the wp_options. The object cache persists only for the particular page load.
  2. Transients are stored in the WordPress database. The object cache is stored on the server where the WordPress install is located.
  3. Transients are available for the duration of a user session and apply to all page components. The object cache is available only for scripts.
  4. Transients persist only for the particular page load. The object cache is persistent and writes to the wp_options table.

Correct Answer:

The Block API enables developers to register custom blocks in themes or plugins. How would you register a custom block?

  1.  Use the registerBlockName() function.
  2.  Use the createGutenBlock() function.
  3.  Use a block template.
  4.  Use the registerBlockType() function.

The REST API is a simple way to get data in and out of WordPress over HTTP. Applications using the REST API should be written in which programming language?

  1. PHP
  2. any programming language that can make HTTP requests and interpret JSON
  3. Java
  4. Node.js

Correct Answer:

  • any programming language that can make HTTP requests and interpret JSON

The REST API provides public data, which is accessible to any client anonymously, as well as private data available only after authentication. How could you ensure that no one can anonymously access site data via the REST API?

  1. Disable the REST API via the site’s wp-config.php file.
  2. Use the rest_authentication_errors() filter along with the is_user_logged_in() conditional to limit access to logged in users.
  3. Use the rest_authentication_errors() filter along with cookie authentication to limit access to logged in users.
  4. Use the Disable REST API plugin.

Correct Answer:

  • Use the Disable REST API plugin.

The REST API utilizes which data format?

  1. YAML
  2. JSON
  3. TXT
  4. XML

Correct Answer:

  • JSON

Theme developers can take advantage of the Customizer API to give users a way to manipulate basic theme settings. The Customizer API is object-oriented and provides four main objects. What are they?

  1. widgets, containers, sections, settings
  2. containers, hooks, settings, styles
  3. panels, blocks, controls, settings
  4. panels, sections, controls, settings

Correct Answer:

  • panels, sections, controls, settings

WP_Query is the WordPress query class that is used to fetch posts from the database. How would you create a new instance of this class?

  1. $query = new query_posts();
  2. $query = new WP_Query();
  3. $query = query_posts();
  4. $query = get_posts();

Correct Answer:

  • $query = new WP_Query();

What color is the paragraph nested within the div?

<head>
        <style>
                body { color: black; }

                p { color: blue; }

                div { color: green; }

                p { color: red; }
        </style>
</head>
<body>
        <div>
                <p>This is a paragraph inside a div.</p>
        </div>
</body>
</html>
  1. blue
  2. black
  3. red
  4. green

Correct Answer:

  • red

What is a user role that is unique to WordPress Multisite?

  1. Owner
  2. Super Admin
  3. MU Admin
  4. Multisite Master

Correct Answer:

  • Super Admin

What is the core mission of WordPress?

  1. to make free software
  2. to democratize publishing and the freedoms that come with open source
  3. to make money
  4. to encourage blogging

Correct Answer:

  • to make free software

What is the correct order of parameters for the add_action() function?

  1.  add_action( 'example_hook', 'example_function', $accepted_args, $priority )
  2.  add_action( 'example_function', 'example_hook', $priority, $accepted_args )
  3.  add_action( 'example_hook', 'example_function', $priority, $accepted_args )
  4.  add_action( 'example_function', 'example_hook', $priority )

Correct Answer:

  •  add_action( 'example_hook', 'example_function', $priority, $accepted_args )

What is the difference between an action and a filter?

  1. Actions are used to add custom functions and remove WordPress functions. filters are used to make strings translatable for localization.
  2. Actions are used to add or remove code at runtime. filters are used to modify data before it is either displayed in the browser or saved to the database.
  3. Actions are used to assign values to variables at runtime. filters are used to extract data from actions and display it in the browser.
  4. Actions are used to add user-inputted data to the database. filters are used to validate user-inputted data prior to adding it to the database.

Correct Answer:

  • Actions are used to add or remove code at runtime. filters are used to modify data before it is either displayed in the browser or saved to the database.
  • 

    What is the process of marking the code you write so that it is ready for translation?

    1. internationalization
    2. localization
    3. translation
    4. using GlotPress

    Correct Answer:

    • internationalization

    What is the role of a WordPress theme?

    1. controls colors, fonts, and page layouts
    2. adds accessibility enhancements such as keyboard navigation and skip links
    3. ensures a site is mobile responsive
    4. all of these answers

    Correct Answer:

    • all of these answers

    What technique would you use to secure data before rendering it to a user?

    1. escape and sanitize
    2. validate and escape
    3. validate and sanitize
    4. escape and secure

    Correct Answer:

    • validate and sanitize

    What would you do to improve your site’s performance?

    1. Only load scripts and styles on pages where they are needed.
    2. Minify CSS and JavaScript files.
    3. all of these answers
    4. Use a CDN.

    Correct Answer:

    • all of these answers

    What’s the primary difference between template tags prefaced with the versus get_the?

    Options 1:

    1. Template tags prefaced with the _ don’t accept arguments.
    2. Template tags prefaced with the _ can be used directly within a template.
    3. Template tags prefaced with the _ display a value. Template tags prefaced with get_the return a value.
    4. Template tags prefaced with the _ return a value. Template tags prefaced with get_the display a value.

    Correct Answer:

    • Template tags prefaced with the _ display a value. Template tags prefaced with get_the return a value.

    Options 2:

    1. Template tags prefaced with the_ can be used directly within a template. Template tags prefaced with get_the are generally reserved for partial templates.
    2. Template tags prefaced with the_ return a value. Template tags prefaced with get_the display a value.
    3. Template tags prefaced with the_ display a value. Template tags prefaced with get_the return a value.
    4. Template tags prefaced with the_ don’t accept arguments. Template tags prefaced with get_the do accept arguments.

    Correct Answer:

    • Template tags prefaced with the_ display a value. Template tags prefaced with get_the return a value.

    Where can you find the official WordPress documentation and usage guide?

    1. support.wordpress.com
    2. developer.wordpress.com
    3. developer.wordpress.org
    4. support.wordpress.org

    Correct Answer:

    • developer.wordpress.org

    Which WP-CLI command would you use to manage the capabilities of a user role?

    1. wp admin
    2. wp manage
    3. wp cap
    4. wp role

    Correct Answer:

    • wp role

    Which is a best practice for working with WordPress CSS?

    1. Use !important next to styles if they don’t give you the result you want.
    2. Use hyphens in class names.
    3. Use spaces to indent each property.
    4. Avoid CSS shorthand for proper documentation.

    Correct Answer:

    • Use spaces to indent each property.

    Which is not a suggested performance improvement for your WordPress website?

    1. The site should run the most recent version of WordPress.
    2. Remove or inactivate unnecessary plugins.
    3. UTF8 is supported.
    4. Choose a very recent version of PHP.

    Correct Answer:

    • UTF8 is supported.

    Which of the following is NOT a suggested security improvement for your WordPress website?

    1. The site should communicate with WordPress.org.
    2. Remove inactive themes.
    3. Do not output debug information.
    4. WordPress updates are accomplished manually only.

    Correct Answer:

    • WordPress updates are accomplished manually only.

    Which of these is NOT a part of the internationalization and localization process?

    1. using a gettext function to wrap translatable strings when writing code
    2. installing/using the WordPress Multilingual Plugin
    3. using a tool like Poedit to parse source code and extract translatable strings into a POT file
    4. translators translating the POT file into a PO file, one for each language

    Correct Answer:

    • translators translating the POT file into a PO file, one for each language

    Which of these snippets represents a wrapper that calls jQuery safely and doesn’t require repetitive use of the word “jQuery”?

    1. // do stuff
      });
    2. (function($) {
      // do stuff
      })( jQuery );
    3. $(function() {
      // do stuff
      });
    4. jQuery(function($) {
      // do stuff
      });

    Correct Answer:

    • $(function() {
      // do stuff
      });

    Who owns the trademark for WordPress and WordCamp names and logos?

    1. WordPress Foundation (The WordPress Foundation owns and oversees the trademarks for the WordPress and WordCamp names and logos.)
    2. WordPress.com
    3. Matt Mullenweg
    4. Automattic

    Correct Answer:

    • WordPress Foundation (The WordPress Foundation owns and oversees the trademarks for the WordPress and WordCamp names and logos.)

    Within the editor, blocks are rendered as JavaScript. How are blocks rendered on the front end of a site?

    1. as plain HTML
    2. as a React component
    3. as JavaScript comments
    4. as HTML comments

    Correct Answer:

    • as a React component

    You can harden your WordPress site security by adding ____ to your wp-config.php file?

    1. database usernames and passwords
    2. unique keys and salts
    3. accessibility
    4. documentation

    Correct Answer:

    You have a search bar on your site. You would like to use a <label> to make the word “Search” visible to screen readers, but you don’t want to display the word “Search” on the screen. How can you accomplish this?

    1.  Assign an ARIA state of "hidden" to the label, like this: <label state="hidden">Search</label> <input type="text" name="search" id="search" />
    2.  Use the built-in WordPress CSS class .screen-reader-text to hide the text from screen, like this: <label class="screen-reader-text">Search</label> <input type="text" name="search" id="search" />
    3.  Create a custom CSS class to set a large negative value to the text-indent property to hide the text off screen, like this: <label class="hide-this">Search</label> <input type="text" name="search" id="search" />
    4.  The majority of users do not require a screen reader. Remove the label entirely.

    Correct Answer:

    • Use the built-in WordPress CSS class .screen-reader-text to hide the text from screen, like this: <label class="screen-reader-text">Search</label> <input type="text" name="search" id="search" />

    You might see this code in a WordPress plugin. What does it do?

    1. This is how WordPress detects a plugin’s presence. This ensures that the plugin is running from the /wp-content/plugins/ directory. If it is not, the plugin should not run.
    2. This is a way to prevent naming collisions. ABSPATH is the absolute path to the plugin’s directory. If ABSPATH is defined by another WordPress plugin with the same directory slug, the plugin should not run.
    3. This is a security measure. ABSPATH is the absolute path to the WordPress directory. If the file is called directly, ABSPATH will not be defined and therefore the plugin should not run.
    4. This is a compatibility checker. ABSPATH is defined in WordPress core. The plugin checks that the minimum version of WordPress needed to support the plugin is installed. If it is not, the plugin should not run.

    Correct Answer:

    • This is a way to prevent naming collisions. ABSPATH is the absolute path to the plugin’s directory. If ABSPATH is defined by another WordPress plugin with the same directory slug, the plugin should not run.

    Leave a Reply

    Your email address will not be published. Required fields are marked *