I've installed a plugin (HC custom WP-Admin url) locally and I didn't have any problems. I tried to install it on my server and I get the following error:

Fatal error: Cannot redeclare get_file_description() (previously declared in /home/USERNAME/public_html/wp-admin/includes/file.php:58) in /home/USERNAME/public_html/wp-admin/includes/file.php on line 71

Please note I DID post an error on that plugin's page. I'm posting again here because I suspect it isn't specific to that plugin, but rather a permission problem preventing the plugin from being installed properly. Has anybody had a similar problem?

The installation claims to be complete, but after the installation, the whole site breaks. I can't even logout. The only way i found to get the site running again is to rename the plugin folder. There's an error generated and WP deactivates the plugin and everything works again.

  • The plugin installs and activates just fine on latest WP version and error message doesn't seem to be coming from its file.
    – Rarst
    Sep 12, 2013 at 13:31
  • Hey Rarst, thanks for your quick reply! I'm running the same version locally and on the server... Sep 12, 2013 at 13:37

1 Answer 1


That plugin uses a really convoluted method to find & include file.php:

if (file_exists(dirname(__FILE__) . $DS . '..' . $DS . '..' . $DS . '..' . $DS . 'wp-admin' . $DS . 'includes' . $DS . 'file.php'))
    include(dirname(__FILE__) . $DS . '..' . $DS . '..' . $DS . '..' . $DS . 'wp-admin' . $DS . 'includes' . $DS . 'file.php');
  return; // if hierarchy is messed up, don't go further

My guess is that it considered your local environment to be "messed up" and didn't try to include() the file. The thing is, file.php isn't meant to be loaded on the fly like that, and you're seeing what happens when a plugin tries to load it after WordPress itself already has.

The plugin author should be checking if( !isset( $wp_file_descriptions ) ) before doing the include() or checking function_exists( 'get_home_path' ) which is the actual function they're trying to use from there. If one of those things exists, WordPress has already included the file and there's no need to do it again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.