Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to activate a plugin in WordPress.
Wordpress
activate_plugin('[1]');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the full server path instead of relative plugin path.
Using theme folder path instead of plugin path.
✗ Incorrect
The activate_plugin function requires the plugin's main file path relative to the plugins folder.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Including full path starting with 'wp-content/plugins'.
Using theme folder path.
✗ Incorrect
The is_plugin_active function expects the plugin path relative to the plugins directory.
3fill in blank
hardFix the error in the code to properly install a plugin from a ZIP file.
Wordpress
$result = install_plugin('[1]');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using local file system paths instead of URLs.
Using relative paths without URL.
✗ Incorrect
The install_plugin function requires a URL to the ZIP file for remote installation.
4fill in blank
hardFill both blanks to activate a plugin only if it is not already active.
Wordpress
if () { activate_plugin('[2]'); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the activation function in the condition instead of the check function.
Using incorrect plugin path format.
✗ Incorrect
Use is_plugin_active to check if the plugin is active before activating it.
5fill in blank
hardFill all three blanks to safely deactivate a plugin.
Wordpress
if ([1]('[2]')) { [3]('[2]'); }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using activation function instead of deactivation.
Not checking if plugin is active before deactivating.
✗ Incorrect
First check if the plugin is active, then deactivate it using deactivate_plugins.