Support » Plugin: The Events Calendar » Wrong Paths when plugins folder moved

  • Resolved elmar71


    Hi community,

    we just came across a problem, as we are moving our plugins path on the top level.
    In this case the plugins folder is no longer a subfolder of wp-content, but the plugin assumes it should be there anyhow.

    The problem occurs in common/src/Tribe/Assets.php :: maybe_get_min_file()
    around line 184ff in Version 4.5.4

    For all other people that might hit the same problem: the correct code should be

    // Check for all Urls added to the array
    foreach ( $urls as $key => $url ) {
            //set path to file for Windows
            $file = $url;
            //Set variable for content normalized directory
            $normalized_plugin_dir = wp_normalize_path( WP_PLUGIN_DIR );
            //Detect if $url is actually a file path
            if ( false !== strpos( $url, $normalized_plugin_dir ) ) {
                    // Turn file Path to URL in Windows
                    $url = str_replace( $normalized_plugin_dir, plugins_url(), $url );
            } else {
                    // Turn URL into file Path
                    $file = str_replace( plugins_url(), $normalized_content_dir, $url );

    Hope it helps all of you out there!
    Thanks for making this great plugin!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Wrong Paths when plugins folder moved’ is closed to new replies.