Lubinik Learning

Training mode

Security, Data & Permissions

Time remaining:

0 / 17 answered

  1. 1. Which statements about WordPress nonces are correct?

    Select all correct answers.

    Which statements about WordPress nonces are correct?
    Hint

    A nonce verifies intent, not the user’s role or capabilities.

  2. 2. Which output-escaping pairs are appropriate for their context?

    Select all correct answers. The values are dynamic and are about to be rendered.

    Which output-escaping pairs are appropriate for their context?
    Hint

    Visible HTML text and a URL attribute require different escaping functions.

  3. 3. What is the difference between sanitizing and escaping data?

    Choose the most accurate statement for WordPress development.

    What is the difference between sanitizing and escaping data?
    Hint

    Think about when data enters the system and when it leaves for the browser.

  4. 4. Which function should authorize whether the current user may perform a WordPress operation?

    Choose the function intended for capability checks.

    Which function should authorize whether the current user may perform a WordPress operation?
    Hint

    Roles group capabilities, but code should generally check the required capability.

  5. 5. Why is a valid WordPress nonce not sufficient authorization?

    Why is a valid WordPress nonce not sufficient authorization?
    Hint

    Intent and permission are separate questions.

  6. 6. When is wp_kses_post() appropriate?

    When is wp_kses_post() appropriate?
    Hint

    It is an allow-list HTML filter.

  7. 7. Which checks are important before accepting an uploaded file?

    Which checks are important before accepting an uploaded file?
    Hint

    Client-provided names and MIME values are not enough.

  8. 8. In a REST endpoint, where should resource-specific authorization be enforced?

    In a REST endpoint, where should resource-specific authorization be enforced?
    Hint

    The server must enforce authorization before the main callback.

  9. 9. Which function should be preferred when redirecting to a URL that must stay on an allowed host?

    Which function should be preferred when redirecting to a URL that must stay on an allowed host?
    Hint

    Escaping a string is not the same as validating a redirect destination.

  10. 10. What is the difference between validation and sanitization?

    What is the difference between validation and sanitization?
    Hint

    Reject versus clean.

  11. 11. How should a URL placed inside an HTML href attribute normally be escaped?

    How should a URL placed inside an HTML href attribute normally be escaped?
    Hint

    Use the function designed for URL contexts.

  12. 12. Why is escaping recommended as late as possible?

    Why is escaping recommended as late as possible?
    Hint

    Stored data may be reused in different contexts.

  13. 13. What is a benefit of checking object-level capabilities such as edit_post with an object ID?

    What is a benefit of checking object-level capabilities such as edit_post with an object ID?
    Hint

    Authorization may depend on the object owner and status.

  14. 14. Which API should plugin code use to hash a WordPress-compatible password?

    Which API should plugin code use to hash a WordPress-compatible password?
    Hint

    Do not invent password storage.

  15. 15. Where should API secrets generally not be exposed?

    Where should API secrets generally not be exposed?
    Hint

    Frontend code cannot keep a secret.

  16. 16. Why should an uploaded filename not be trusted as a filesystem path?

    Why should an uploaded filename not be trusted as a filesystem path?
    Hint

    Treat names as input.

  17. 17. Which attack are WordPress nonces primarily intended to mitigate?

    Which attack are WordPress nonces primarily intended to mitigate?
    Hint

    They do not replace validation, escaping or authorization.