0
0
Wordpressframework~10 mins

Plugin conflicts and troubleshooting in Wordpress - Interactive Code Practice

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

Complete the code to deactivate a plugin in WordPress.

Wordpress
deactivate_plugins('[1]');
Drag options to blanks, or click blank then click option'
Aplugin-slug/plugin-file.php
Bwp-config.php
Cfunctions.php
Dindex.php
Attempts:
3 left
💡 Hint
Common Mistakes
Using theme files like functions.php instead of plugin file path.
Using configuration files like wp-config.php.
2fill in blank
medium

Complete the code to check if a plugin is active.

Wordpress
if (is_plugin_active('[1]')) {
  // Plugin is active
}
Drag options to blanks, or click blank then click option'
Awp-settings.php
Bakismet/akismet.php
Cstyle.css
Dindex.php
Attempts:
3 left
💡 Hint
Common Mistakes
Using theme files or WordPress core files instead of plugin file path.
Using only the plugin folder name without the main file.
3fill in blank
hard

Fix the error in the code to properly deactivate all plugins.

Wordpress
foreach ($plugins as $plugin) {
  [1]($plugin);
}
Drag options to blanks, or click blank then click option'
Aactivate_plugins
Bdelete_plugins
Cinstall_plugins
Ddeactivate_plugins
Attempts:
3 left
💡 Hint
Common Mistakes
Using activate_plugins instead of deactivate_plugins.
Trying to delete plugins instead of deactivating.
4fill in blank
hard

Fill both blanks to create a list of active plugins and check if a specific plugin is active.

Wordpress
$active_plugins = [1]('active_plugins');
if (in_array('[2]', $active_plugins)) {
  // Plugin is active
}
Drag options to blanks, or click blank then click option'
Aget_option
Bget_plugins
Cakismet/akismet.php
Dhello-dolly/hello.php
Attempts:
3 left
💡 Hint
Common Mistakes
Using get_plugins() which returns all plugins, not active ones.
Using wrong plugin file names.
5fill in blank
hard

Fill all three blanks to properly log plugin conflicts by hooking into WordPress.

Wordpress
add_action('[1]', function() {
  $conflicts = get_option('[2]');
  error_log('Plugin conflicts: ' . [3]);
});
Drag options to blanks, or click blank then click option'
Aadmin_init
Bplugin_conflicts
Cprint_r($conflicts, true)
Dwp_loaded
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong hook names like wp_loaded which runs too early.
Logging array directly without converting to string.