Challenge - 5 Problems
WordPress Image Optimization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding WordPress Image Sizes
In WordPress, what is the purpose of the add_image_size() function?
Attempts:
2 left
💡 Hint
Think about how WordPress creates different image versions for different uses.
✗ Incorrect
The add_image_size() function lets you define new image sizes that WordPress will create when you upload images. This helps serve optimized images for different parts of your site.
❓ component_behavior
intermediate2:00remaining
Behavior of Lazy Loading in WordPress
What happens when you enable native lazy loading for images in WordPress?
Attempts:
2 left
💡 Hint
Lazy loading delays image loading until needed.
✗ Incorrect
Native lazy loading delays loading images until they are near the visible part of the page, which reduces initial page load time and saves bandwidth.
📝 Syntax
advanced2:00remaining
Correct Syntax for WebP Support in WordPress
Which code snippet correctly enables WebP image support in WordPress by adding WebP to allowed mime types?
Attempts:
2 left
💡 Hint
Check the correct hook and mime type for WebP.
✗ Incorrect
The mime_types filter is used to add new mime types. The correct mime type for WebP is image/webp. The function must return the modified array.
🔧 Debug
advanced2:00remaining
Debugging Image Compression Plugin Conflict
A WordPress site uses two image compression plugins. After activating both, images are not compressed properly. What is the most likely cause?
Attempts:
2 left
💡 Hint
Think about how plugins might interfere with each other.
✗ Incorrect
When two plugins try to compress images on upload, they can conflict and prevent proper compression. It's best to use only one compression plugin at a time.
❓ state_output
expert3:00remaining
Result of Custom Image Size Usage in Theme
Given this code in a WordPress theme's functions.php:
What will be the output behavior when displaying the post thumbnail?
add_image_size('custom-thumb', 300, 200, true);
the_post_thumbnail('custom-thumb');What will be the output behavior when displaying the post thumbnail?
Wordpress
add_image_size('custom-thumb', 300, 200, true); the_post_thumbnail('custom-thumb');
Attempts:
2 left
💡 Hint
Check the meaning of the last parameter in add_image_size.
✗ Incorrect
The last parameter true enables hard cropping, so the image is cropped to exactly 300x200 pixels when displayed.