Dynamic Hostname
Set hostname dynamically for the development.
The facts
- Active installs
- 300+
- Price
- Free
- Last updated
- 26 Apr 2015
- Added
- Mar 2014
- Requires WP
- 3.8
- Tested up to
- WP 4.2.39
- Downloads
- 26,322
Our analysis
AI-assistedDynamic Hostname is a WordPress plugin designed to automatically change the host name used by WordPress. This is particularly useful when running WordPress across different environments, such as production, development, or staging, ensuring that links remain functional without manual updates.
The plugin temporarily adjusts the host name based on the current server, updating links to content and images accordingly. It also allows for customization through filter hooks, making it suitable for users who need flexibility in managing their site URLs across various setups.
Best for: This plugin is best for developers managing WordPress sites across multiple environments.
What it does well
- ✓Automatically changes the host name based on the current server
- ✓Prevents broken links during site transitions
- ✓Customizable with filter hooks
Where it falls short
- •Limited information available on ratings and active installations
- •Last updated in April 2015, which may affect compatibility with newer WordPress versions
Verdict
Dynamic Hostname provides a practical solution for managing host names in WordPress, though its age and limited updates may be a concern for some users.
From the developer
Takayuki Miyauchi's own description of Dynamic Hostname, lightly tidied.
This plugin changes dynamically and automatically the host name which WordPress uses. For example, when you run WordPress on your different servers, for production, development or staging, the host name will be changed dynamically and each site won’t have broken links. It’s very useful when you use it with Vagrant Cloud.
Some features
- Temporarily changes the host name to the current host name ($_SERVER[‘HTTP_HOST’]).
- Also replaces the host name of the links to the contents and the images in the same site.
- The host name included in the contents on the development server will be changed to the one for the production server. (You don’t need to replace the host name in the database when you move it to the production server.)
- The host name in the editor window is temporarily replaced with the current host name, so when you edit some on the development server, you never have broken links.
Hooks to use for replacing
This plugin uses the filter hooks below to replace the host name in URL.
$hooks = array(
"home_url",
"site_url",
"stylesheet_directory_uri",
"template_directory_uri",
"plugins_url",
"wp_get_attachment_url",
"theme_mod_header_image",
"theme_mod_background_image",
"the_content",
"upload_dir",
"widget_text",
);
Those hooks also have their own filter hooks, so you can customize with other plugins you are using, etc.
add_filter('dynamic_hostname_filters' function($hooks){
$hooks[] = 'some_filter_hook';
return $hooks;
});