• Resolved Paderman

    (@paderman)


    Hello,

    I moved successful the plugin directory in a other directory and I added in wp-config.php following:

    define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/site/plugins' );
    define('WP_PLUGIN_URL', 'https://' . $_SERVER['SERVER_NAME'] . '/wp-content/plugins');

    All moved plugins was reactivated and User Role Editor is shown too, but CSS and JavaScript don’t work like before moving the plugin directory.

    • /wp-admin/users.php?page=users-user-role-editor.php
    • /wp-admin/users.php?page=users-user-role-editor.php&object=user

    Where is the error of that?
    In the files, I couldn’t find anything, can you help please to solve this problem?

    Reason to moving the plugin directory is a restrict FTP access of a user within wp-content and he doesn’t should be access to the plugin directory 😉

    Thank you in advance 🙂

    Edit:
    I see, other plugins have same problem with CSS and JavaScript🤔
    Files CSS/JavaScript were not found, error 404 🤔

    • This topic was modified 4 years, 2 months ago by Paderman.
    • This topic was modified 4 years, 2 months ago by Paderman.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi,

    Why you have different paths:
    1) ‘/site/plugins’ at plugin absolute path
    but
    2) ‘/wp-content/plugins’ at plugin URL?

    Look how plugin builds path to CSS really at the browser page HTML source.

    Thread Starter Paderman

    (@paderman)

    Hello,
    thank you for your reply.

    I found the error 🤔 🙈
    Both path must be identically, then it works 🙈

    define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/site/plugins' );

    WP_PLUGIN_URL', '//' . $_SERVER['SERVER_NAME'] . '/site/plugins');

    It was my mistake 🙈 😬

    For all user that want move the plugin folder:

    $WP_PLUGIN_NEW_PATH = '/new_folder/plugins';
    define('WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . $WP_PLUGIN_NEW_PATH );
    define('WP_PLUGIN_URL', '//' . $_SERVER['SERVER_NAME'] . $WP_PLUGIN_NEW_PATH);

    Note: the double slashes // in WP_PLUGIN_URL stands for http: or https: 😉

    • This reply was modified 4 years, 2 months ago by Paderman.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin useless if plugin dir is moved (CSS/JS)’ is closed to new replies.