0
0
Wordpressframework~10 mins

Why proper deployment prevents issues in Wordpress - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to activate a plugin in WordPress.

Wordpress
activate_plugin('[1]');
Drag options to blanks, or click blank then click option'
Afunctions.php
Bindex.php
Cmy-plugin/my-plugin.php
Dstyle.css
Attempts:
3 left
💡 Hint
Common Mistakes
Using theme files instead of plugin main file
Using index.php which is not a plugin file
2fill in blank
medium

Complete the code to enqueue a stylesheet properly in WordPress.

Wordpress
wp_enqueue_style('[1]', get_template_directory_uri() . '/style.css');
Drag options to blanks, or click blank then click option'
Atheme-style
Bjquery
Cadmin-style
Dplugin-script
Attempts:
3 left
💡 Hint
Common Mistakes
Using script handles for styles
Using unrelated handles like 'jquery'
3fill in blank
hard

Fix the error in the deployment script by completing the missing function name.

Wordpress
function [1]() {
  // Clear cache after deployment
  if (function_exists('wp_cache_clear_cache')) {
    wp_cache_clear_cache();
  }
}
Drag options to blanks, or click blank then click option'
Aupdate_plugins
Bdeploy_site
Creset_theme
Dclear_cache
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated function names
Not matching the function purpose
4fill in blank
hard

Fill both blanks to properly register and enqueue a script in WordPress.

Wordpress
function load_custom_script() {
  wp_register_script('[1]', get_template_directory_uri() . '/js/custom.js', array('jquery'), null, true);
  wp_enqueue_script('[2]');
}
Drag options to blanks, or click blank then click option'
Acustom-script
Bjquery
Dmain-style
Attempts:
3 left
💡 Hint
Common Mistakes
Using different handles for register and enqueue
Using style handles for scripts
5fill in blank
hard

Fill all three blanks to create a safe deployment function that disables debugging and flushes rewrite rules.

Wordpress
function safe_deploy() {
  define('[1]', false);
  flush_rewrite_rules([2]);
  error_reporting([3]);
}
Drag options to blanks, or click blank then click option'
AWP_DEBUG
Btrue
C0
DSAVEQUERIES
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong option names
Not flushing rewrite rules properly
Incorrect error_reporting value