• Resolved nikdow

    (@nikdow)


    The plugin is attempting to load some files with an incorrect URL, e.g.

    https://www.gunumalodge.com.au/home/lamp/wordpress/plugins/nextgen-gallery/static/IGW/Block/editor.css?ver=4.0.3

    the correct URL would be https://www.gunumalodge.com.au/plugins/nextgen-gallery/static/IGW/Block/editor.css?ver=4.0.3

    /home/lamp/wordpress is the linux path.

    It could be that /src/Display/StaticAssets.php is getting an incorrect result in line 24:

    $retval = \str_replace( \wp_normalize_path( WP_PLUGIN_DIR ), WP_PLUGIN_URL, $retval );

    Possibly this problem is due to our non-standard approach to hosting WP, this is from our version of wp-config.php:

    $server_name = $_SERVER['SERVER_NAME'];
    include "/home/lamp/wordpress/configs/" . $server_name; // db configs
    define('WP_CONTENT_DIR', "/home/lamp/wordpress/wp-content/" . $server_name );
    if( ! defined( 'WP_CONTENT_URL') ) define('WP_CONTENT_URL', "https://" . $server_name . "/wp-content/" . $server_name );

    Put a diagnostic into StaticAssets.php below line 24 and see incorrect URLs:
    StaticAssets 25 /home/lamp/wordpress/plugins/nextgen-gallery/static/IGW/Block/build/post-thumbnail.min.js
    as well as correct URLs:
    StaticAssets 25 https://www.gunumalodge.com.au/wp-content/www.gunumalodge.com.au/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js
    Note that the domain name that appears inside the above “correct” url is the actual (correct) URL path, but our VirtualHost adds that component in when a request such as this is made:
    StaticAssets 25 https://www.gunumalodge.com.au/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_addgallery_page/static/media-library-import.js
    So that both forms of URL are served correctly.

    Also note that the plugin directory as defined above includes slinks to plugin code – the code is used by all our WP sites on this server, in a similar way to WP network sites – we only differ in that root owns everything and plugin updates are done outside of WP by a python script.
    lrwxrwxrwx 1 root root 33 Jan 13 2020 nextgen-gallery -> ../../../plugins/nextgen-gallery/

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nikdow

    (@nikdow)

    I have installed a work-around in the apache VirtualHost config:

    RewriteRule ^/home/lamp/wordpress/plugins/(.*)$ /wp-content/%{SERVER_NAME}/plugins/$1
    Plugin Support Michelle D.

    (@devmich)

    Hi @nikdow,

    Thanks for sharing this detailed report! Apologies for the delay.

    I confirmed with our team that NextGEN Gallery is designed for standard WordPress installations, so unfortunately setups with symlinked plugin directories and a custom WP_CONTENT_DIR are outside the scope of what we’re able to support. We do appreciate you flagging it though, and glad the Apache rewrite is working for you!

    I’ll mark as resolved for now but if there’s anything we can help with or if you have further feedback to share, feel free to let us know.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.