0
0
Wordpressframework~20 mins

Migration between environments in Wordpress - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
WordPress Migration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens to URLs when migrating a WordPress site to a new domain?

You move your WordPress site from oldsite.com to newsite.com. What must you do to ensure all URLs work correctly?

ADelete all posts and recreate them with the new domain URLs.
BOnly change the domain name in the hosting control panel; WordPress updates URLs automatically.
CUpdate the site URL and home URL in the WordPress database to the new domain.
DNo changes needed; WordPress uses relative URLs that adjust automatically.
Attempts:
2 left
💡 Hint

Think about where WordPress stores the site address and how it builds links.

component_behavior
intermediate
2:00remaining
What is the effect of importing a WordPress database dump without updating serialized data?

You export your WordPress database from the old environment and import it into the new one. You do not update serialized data containing old URLs. What will happen?

AOnly images will fail to load, but links remain correct.
BThe site will work perfectly because serialized data is ignored by WordPress.
CThe database import will fail with a syntax error.
DSome links and settings may break because serialized data length mismatches cause errors.
Attempts:
2 left
💡 Hint

Serialized data stores string lengths. What happens if the string changes but length does not?

🔧 Debug
advanced
2:00remaining
Why does the WordPress site show a blank page after migration?

After migrating your WordPress site to a new server, the site shows a blank white page. Which option is the most likely cause?

APHP memory limit is too low or a fatal PHP error occurred.
BThe database user password is too long.
CThe theme folder is empty but plugins are active.
DThe .htaccess file is missing but WordPress does not use it.
Attempts:
2 left
💡 Hint

Check error logs or enable debugging to find PHP errors.

📝 Syntax
advanced
2:00remaining
Which wp-config.php change is required when migrating to a new database?

You migrate your WordPress site to a new server with a different database name, user, and password. Which wp-config.php snippet correctly updates the database connection?

Adefine('DB_NAME', 'new_db');\ndefine('DB_USER', 'new_user');\ndefine('DB_PASSWORD', 'new_pass');
Bdefine('DB_NAME', new_db);\ndefine('DB_USER', new_user);\ndefine('DB_PASSWORD', new_pass);
CDB_NAME = 'new_db';\nDB_USER = 'new_user';\nDB_PASSWORD = 'new_pass';
Dset('DB_NAME', 'new_db');\nset('DB_USER', 'new_user');\nset('DB_PASSWORD', 'new_pass');
Attempts:
2 left
💡 Hint

Remember how constants are defined in PHP.

state_output
expert
2:00remaining
What is the final site URL after this migration script runs?

Given this PHP snippet run after migrating a WordPress site, what will get_option('siteurl') return?

Wordpress
<?php
update_option('siteurl', 'https://newdomain.com');
update_option('home', 'https://newdomain.com');
$siteurl = get_option('siteurl');
echo $siteurl;
?>
Ahttps://olddomain.com
Bhttps://newdomain.com
Chttp://newdomain.com
DAn empty string
Attempts:
2 left
💡 Hint

What does update_option do to the stored value?