Support » Plugin: Enable Media Replace » Plugin directory name change error

  • If you change the name of the plugin directory, for example to add the version, you get the WordPress error “You do not have sufficient permissions to access this page.”

    This is because the plugin directory is hard coded in all of the links to upload media.

    It should be replaced with something like the following:

    $plugin_dir = basename(plugin_dir_path(__FILE__));
      upload.php?page=$plugin_dir/...

    http://wordpress.org/plugins/enable-media-replace/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think I’m encountering this issue. We put our /uploads/ in a separate area on server and define ‘WP_CONTENT_DIR’ and ‘PLUGINDIR.’ I’m pretty sure the plugin used to work with this config but now it does not replace old links or have the correct URL for the newly uploaded file. On attachment page file URL shows as: http://sitename.com/wp-content/uploads/my-full-defined-file-path/uploads/2013/11/file.jpg
    rather than what they should http://sitename.com/wp-content/uploads/2013/11/file.jpg and it didn’t seem to update the URL to the old media or remove it from the file system. The actual file uploads to the correct location but the reference to it is off.

    Update: must be different issue, b/c changing the way I defined my plugin location fixed this. Thanks!

    I had the same issue, this occured with a renamed wp-content folder. Setting the following in wp-config.php solved this:

    define( 'WP_PLUGIN_DIR', dirname(__FILE__) . '/path/to/plugins' );
    define( 'WP_PLUGIN_URL', 'http://www.yoursite.com/path/to/plugins' );

    WP_PLUGIN_DIR is the path relative to wp-config’s location and WP_PLUGIN_URL is the full URL of the directory’s location on the server, including “http://”.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin directory name change error’ is closed to new replies.