WordPress Quality Control & Assurance 5 — Questions and Answers
Question 1: A theme QA audit reveals the theme does not call wp_head() in its header template. What critical functionality does this break?
- Sidebar widget rendering
- Plugin-injected scripts, styles, and meta tags (Correct answer)
- The WordPress admin toolbar
- Custom post type archives
Correct answer: Plugin-injected scripts, styles, and meta tags
wp_head() is the hook that plugins and WordPress core use to inject scripts, stylesheets, and meta tags into the <head> section.
Question 2: During QA for a WordPress update, which step should be performed on a staging environment BEFORE applying updates to production?
- Disable all security plugins first
- Test the update, run functional checks, and verify no plugin conflicts (Correct answer)
- Apply the update during peak traffic hours for faster feedback
- Increase PHP memory limit to avoid errors during update
Correct answer: Test the update, run functional checks, and verify no plugin conflicts
Testing updates on staging and verifying functionality and plugin compatibility prevents downtime and broken production sites.
Question 3: Which WordPress hook is the correct place to run QA-related code that must execute after all plugins are loaded?
- plugins_loaded (Correct answer)
- init
- wp_loaded
- after_setup_theme
Correct answer: plugins_loaded
The plugins_loaded hook fires immediately after all active plugins are loaded, making it the earliest safe point to interact with plugin functions.
Question 4: When checking a custom REST API endpoint for proper authentication QA, which function verifies that the current user has a specific capability?
- is_user_logged_in()
- current_user_can() (Correct answer)
- wp_verify_nonce()
- auth_redirect()
Correct answer: current_user_can()
current_user_can() checks whether the currently authenticated user has a specific capability, and is the standard capability check for REST permission callbacks.
Question 5: In WordPress multisite QA, which function checks if the current site is the network's main site?
- is_main_site() (Correct answer)
- is_network_admin()
- is_multisite()
- is_super_admin()
Correct answer: is_main_site()
is_main_site() returns true only when the current site is the primary site of the WordPress multisite network.
Question 6: A QA tester discovers that a plugin uses file_get_contents() to fetch a remote URL on every page load. What is the quality concern?
- It violates the GPL license
- It introduces an uncontrolled external HTTP dependency that slows page load and can cause failures (Correct answer)
- It bypasses WordPress nonce verification
- It prevents the plugin from working in multisite
Correct answer: It introduces an uncontrolled external HTTP dependency that slows page load and can cause failures
Synchronous remote requests on every page load create a performance bottleneck and can cause timeouts if the remote server is unavailable.
Question 7: Which WordPress function should be used in QA scripts to cleanly uninstall a plugin and remove all its data?
- deactivate_plugins()
- delete_plugins()
- uninstall_plugin() (Correct answer)
- remove_plugin_data()
Correct answer: uninstall_plugin()
uninstall_plugin() runs the plugin's uninstall routine, which is responsible for removing its data from the database when fully removing a plugin.
A theme QA audit reveals the theme does not call wp_head() in its header template.
What critical functionality does this break?