▸case-03 In a custom WordPress plugin, I need to fetch user records from custom table `{$wpdb->prefix}custom_users` filtering by user input `$email`. A developer wrote `$wpdb->get_results("SELECT * FROM {$wpdb->prefix}custom_users WHERE email = '$email'");`. How should this query be rewritten safely using WordPress database methods? | pass→pass | 7,665 | 6,232 | -19% | 1 | 1 | 0% | 1,271 | 1,221 | -4% | 0 | 0 | — |
▸case-02 I am adding a custom REST API endpoint to WordPress for updating user preferences at `/wp-json/myplugin/v1/settings`. The team suggested omitting `permission_callback` from `register_rest_route` arguments or setting it to `__return_true` and performing all capability checks inside the main endpoint handler function. How should `permission_callback` be handled? | pass→pass | 11,203 | 10,981 | -2% | 1 | 1 | 0% | 2,196 | 2,435 | +11% | 0 | 0 | — |
▸case-01 I am creating a custom WordPress plugin to manage book reviews. A developer suggested calling `register_post_type('book_review', $args)` directly at the root scope of the main plugin file without attaching it to any action hook so that it registers immediately. Is this correct, or which action hook should be used? Provide the PHP code structure. | pass→pass | 10,769 | 10,516 | -2% | 1 | 1 | 0% | 2,236 | 2,842 | +27% | 0 | 0 | — |
▸case-04 We are building a dynamic Gutenberg block for displaying recent portfolio items. I want to define block attributes and metadata directly inside a PHP array in `functions.php` rather than using modern WordPress block registration conventions. What file format should be used to register block metadata with `register_block_type`? | fail→pass | 9,081 | 11,895 | +31% | 1 | 1 | 0% | 1,648 | 2,667 | +62% | 0 | 0 | — |
▸case-05 I am processing an HTML settings form submission on a custom WordPress admin page. A developer wrote code that checks `if (isset($_POST['save_settings']))` and directly updates option values in the database. What security mechanism must be added to the form markup and verified before processing the POST request? | pass→pass | 7,333 | 7,225 | -1% | 1 | 1 | 0% | 1,381 | 1,709 | +24% | 0 | 0 | — |
▸case-06 In a WooCommerce extension, I need to query the 10 most recent processing orders for a given customer ID ($customer_id). A legacy tutorial suggests writing direct SQL queries against `wp_posts` and `wp_postmeta`. What official WooCommerce function compatible with High-Performance Order Storage (HPOS) should be used instead? | pass→pass | 5,595 | 5,232 | -6% | 1 | 1 | 0% | 1,172 | 1,162 | -1% | 0 | 0 | — |
▸case-07 I want to include a frontend JavaScript file `assets/js/main.js` in my custom WordPress theme. A developer placed `<script src="<?php echo get_template_directory_uri(); ?>/assets/js/main.js"></script>` directly inside `header.php`. How should scripts be properly registered and loaded in WordPress? | pass→pass | 9,267 | 10,269 | +11% | 1 | 1 | 0% | 1,880 | 2,361 | +26% | 0 | 0 | — |
▸case-12 I am creating a WordPress child theme based on Twenty Twenty-Four. A developer suggested copy-pasting all CSS rules from the parent theme's `style.css` file into the child theme's `style.css`. How should the parent theme's stylesheet be loaded and declared as a dependency using PHP? | pass→pass | 17,750 | 8,604 | -52% | 1 | 1 | 0% | 1,995 | 1,868 | -6% | 0 | 0 | — |
▸case-08 I am displaying user-submitted profile bio text stored in `$user_bio` inside a paragraph tag within a custom WordPress theme template: `<p><?php echo $user_bio; ?></p>`. What WordPress function should be wrapped around `$user_bio` to safely escape plain text output? | pass→pass | 4,064 | 3,665 | -10% | 1 | 1 | 0% | 776 | 737 | -5% | 0 | 0 | — |
▸case-09 In a custom WordPress theme template file, I am rendering an input element with a value attribute set from user input `$search_term`: `<input type="text" name="s" value="<?php echo $search_term; ?>">`. What specific WordPress escaping function should be used for HTML attribute values? | pass→pass | 3,609 | 3,039 | -16% | 1 | 1 | 0% | 657 | 723 | +10% | 0 | 0 | — |
▸case-10 To harden security on a production WordPress site, we want to prevent site administrators from editing theme and plugin PHP files directly from the WordPress dashboard area. What configuration directive should be added to `wp-config.php`? | pass→pass | 3,926 | 3,090 | -21% | 1 | 1 | 0% | 699 | 720 | +3% | 0 | 0 | — |
▸case-11 I need to add a custom delivery instruction text field to the WooCommerce checkout page. A junior developer proposes editing core WooCommerce template file `templates/checkout/form-checkout.php` directly. How should custom checkout fields be added programmatically without modifying core template files? | pass→fail | 13,525 | 14,049 | +4% | 1 | 1 | 0% | 2,859 | 3,270 | +14% | 0 | 0 | — |
▸case-13 When creating a dynamic Gutenberg block whose markup is rendered dynamically on the server via PHP using `render_callback`, what should the JavaScript `save` component function return in index.js? | pass→pass | 9,016 | 5,984 | -34% | 1 | 1 | 0% | 1,355 | 1,169 | -14% | 0 | 0 | — |
▸case-14 I created a custom WordPress shortcode function `function my_box_shortcode($atts) { echo '<div class="box">Hello</div>'; }`. When inserted into a page, the box output renders at the very top of the page content rather than inside the post content body where the shortcode was placed. What must be changed in the shortcode handler? | pass→pass | 4,322 | 4,268 | -1% | 1 | 1 | 0% | 812 | 918 | +13% | 0 | 0 | — |
▸case-15 Before saving a single-line text input received via `$_POST['event_location']` into post meta using `update_post_meta`, what standard WordPress sanitization function should be applied to clean the input? | pass→pass | 3,713 | 3,424 | -8% | 1 | 1 | 0% | 674 | 682 | +1% | 0 | 0 | — |
▸case-16 In a custom WordPress plugin action handler, I need to programmatically add 2 quantities of product ID 789 to the active WooCommerce shopping cart session. What method on the global WooCommerce cart object should be called? | pass→pass | 3,415 | 3,691 | +8% | 1 | 1 | 0% | 655 | 760 | +16% | 0 | 0 | — |
▸case-17 We are building custom REST API endpoints for a WordPress plugin named Store Analytics. The developer registered routes under top-level path `/wp-json/get-analytics`. What structural naming standard should be followed for the REST API route namespace parameter in `register_rest_route`? | pass→pass | 7,022 | 5,434 | -23% | 1 | 1 | 0% | 1,215 | 1,202 | -1% | 0 | 0 | — |
▸case-18 In a modern WordPress block theme, how should custom brand colors and font sizes be configured so that they appear in the block editor controls panel without writing custom CSS classes or PHP filter hooks? | pass→pass | 9,840 | 8,889 | -10% | 1 | 1 | 0% | 1,724 | 1,906 | +11% | 0 | 0 | — |
▸case-19 After processing a custom frontend form submission in a WordPress plugin, we want to redirect the user to a target URL specified in `$_POST['redirect_uri']`. What WordPress function should be used instead of standard `wp_redirect` or `header()` to protect against open redirect vulnerabilities? | pass→pass | 3,990 | 4,530 | +14% | 1 | 1 | 0% | 813 | 958 | +18% | 0 | 0 | — |
▸case-20 I am building a custom module for Drupal 10 named `user_alert`. I need to implement `hook_form_alter` to modify the user login form. Where and how should this hook function be declared in the Drupal module structure? | pass→pass | 11,223 | 7,369 | -34% | 1 | 1 | 0% | 1,943 | 1,658 | -15% | 0 | 0 | — |
▸case-21 I am setting up an Nginx web server on Ubuntu 22.04 hosting a website. How do I obtain and automatically install a free Let's Encrypt SSL certificate using command line tools on the server? | pass→pass | 9,457 | 8,934 | -6% | 1 | 1 | 0% | 1,845 | 1,887 | +2% | 0 | 0 | — |
▸case-22 In a Laravel 10 application with a `User` model and a `Post` model, how do I define a one-to-many relationship method on the `User` class indicating that a user has many posts? | pass→pass | 5,259 | 4,767 | -9% | 1 | 1 | 0% | 817 | 897 | +10% | 0 | 0 | — |