Complete the code to deactivate a plugin in WordPress.
deactivate_plugins('[1]');
To deactivate a plugin, you need to specify its main plugin file path relative to the plugins folder.
Complete the code to check if a plugin is active.
if (is_plugin_active('[1]')) { // Plugin is active }
The is_plugin_active function requires the plugin's main file path relative to the plugins folder.
Fix the error in the code to properly deactivate all plugins.
foreach ($plugins as $plugin) { [1]($plugin); }
The function deactivate_plugins is used to deactivate plugins, not activate or delete them.
Fill both blanks to create a list of active plugins and check if a specific plugin is active.
$active_plugins = [1]('active_plugins'); if (in_array('[2]', $active_plugins)) { // Plugin is active }
get_option('active_plugins') returns the list of active plugins. Then in_array checks if a plugin is active.
Fill all three blanks to properly log plugin conflicts by hooking into WordPress.
add_action('[1]', function() { $conflicts = get_option('[2]'); error_log('Plugin conflicts: ' . [3]); });
Hook into admin_init to run code in admin area. Use get_option('plugin_conflicts') to get conflicts. Use print_r with true to convert array to string for logging.