0
0
Wordpressframework~20 mins

Automated backup strategies in Wordpress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
WordPress Backup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary benefit of using automated backup plugins in WordPress?

Consider why WordPress users prefer automated backup plugins over manual backups.

AThey reduce the risk of data loss by scheduling regular backups without user intervention.
BThey improve website loading speed by optimizing images automatically.
CThey automatically update all installed plugins without user approval.
DThey allow users to edit WordPress core files directly from the dashboard.
Attempts:
2 left
💡 Hint

Think about what happens if you forget to back up your site manually.

component_behavior
intermediate
2:00remaining
What happens when a WordPress backup plugin is configured to store backups on a remote server?

Choose the correct behavior of a backup plugin when set to save backups remotely.

ABackups are converted into images and emailed to the admin.
BBackups are saved only on the local server and not sent anywhere else.
CBackups are deleted immediately after creation to save space.
DBackups are uploaded to the specified remote location like Dropbox or Google Drive automatically.
Attempts:
2 left
💡 Hint

Think about what 'remote server' means in this context.

📝 Syntax
advanced
2:00remaining
Which WordPress hook is best to trigger a custom backup function automatically after a post is published?

Identify the correct WordPress action hook to run a backup function right after a post is published.

Aadd_action('publish_post', 'custom_backup_function');
Badd_action('wp_head', 'custom_backup_function');
Cadd_action('save_post', 'custom_backup_function');
Dadd_action('init', 'custom_backup_function');
Attempts:
2 left
💡 Hint

Look for a hook that runs specifically when a post is published.

🔧 Debug
advanced
2:00remaining
Why does this WordPress backup plugin code fail to upload backups to remote storage?

Review the code snippet and select the reason it fails to upload backups remotely.

function upload_backup() {
  $backup_file = '/backups/site.zip';
  $remote_path = 'dropbox:/site_backups/';
  // Missing authentication token
  dropbox_upload($backup_file, $remote_path);
}
Wordpress
function upload_backup() {
  $backup_file = '/backups/site.zip';
  $remote_path = 'dropbox:/site_backups/';
  // Missing authentication token
  dropbox_upload($backup_file, $remote_path);
}
AThe backup file path is incorrect and does not exist.
BThe function lacks authentication credentials required to access Dropbox API.
CThe remote path uses an invalid protocol 'dropbox:' which is unsupported.
DThe function is missing a return statement.
Attempts:
2 left
💡 Hint

Think about what is needed to connect to a remote service securely.

state_output
expert
2:00remaining
What is the state of the backup schedule after running this WordPress cron setup code?

Analyze the code and determine how often the backup runs after this setup.

if (!wp_next_scheduled('daily_backup_event')) {
  wp_schedule_event(time(), 'hourly', 'daily_backup_event');
}

add_action('daily_backup_event', 'perform_backup');

function perform_backup() {
  // Backup logic here
}
Wordpress
if (!wp_next_scheduled('daily_backup_event')) {
  wp_schedule_event(time(), 'hourly', 'daily_backup_event');
}

add_action('daily_backup_event', 'perform_backup');

function perform_backup() {
  // Backup logic here
}
AThe backup never runs because the event is not scheduled properly.
BThe backup runs once daily because the event name includes 'daily'.
CThe backup runs every hour because the event is scheduled with 'hourly' recurrence.
DThe backup runs every minute due to a default WordPress setting.
Attempts:
2 left
💡 Hint

Check the recurrence parameter in the scheduling function.