• I did some amateur troubleshooting and it seems that:
    A) The plugin is not looking in the defined “Include-me” folder
    B) If you custom defined a folder the plugin does not recognize the variable
    C) I was able to temporarily resolve the problem by editing the plugin directly

    the file is ‘wp-content/plugins/include-me/plugin.php’

    at the top of the file:

    if (!defined('INCLUDE_ME_DIR')) {
    // define('INCLUDE_ME_DIR', WP_CONTENT_DIR . '/include-me');
    define('INCLUDE_ME_DIR', WP_CONTENT_DIR . '<YOUR PATH HERE>');
    }

    I hope this helps you and the developer.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Stefano Lissa

    (@satollo)

    If you define a custom folder in your wp-config.php, be sure to add the definition before the last line of the file.

    Stefano.

    Thread Starter coreigh

    (@coreigh)

    Okay I did a little more testing.

    In my wp-config.php I have
    define(‘INCLUDE_ME_DIR’, WP_CONTENT_DIR . ‘/mypath/custom-include’);
    as the last line ( I do have a blank line as the actual last line in the file.)

    if I edit your plugin.php file like this:
    if (!defined(‘INCLUDE_ME_DIR’)) {
    // define(‘INCLUDE_ME_DIR’, WP_CONTENT_DIR . ‘/include-me’);
    }

    Then the plugin works. However …

    If I leave the above section uncommented, then the php constant INCLUDE_ME_DIR is OVERWRITTEN! This is not supposed to be possible.

    I am using Apache2 on Ubuntu 18.04 with PHP8

    • This reply was modified 4 years, 7 months ago by coreigh.
    Plugin Author Stefano Lissa

    (@satollo)

    Hi WP_CONTENT_DIR cannot be used inside wp-config.php, it is defined later. You can try with

    define(‘INCLUDE_ME_DIR’, __DIR__ . ‘/wp-content/…..’);

    Thread Starter coreigh

    (@coreigh)

    Okay,

    If I create a folder /wp-content/include-me, and place all my includes in the folder the plugin works. The include-me folder can not be a sym link, and the files inside include-me can not be sym links.

    OR

    If I modify plugin.php and hard code my path in the define() function the plugin works.

    OR

    If I define the constant in the wp-config.php using the __DIR__ constant (as you suggest above) AND modify the plugin.php file to NOT check for ‘INCLUDE_ME_DIR’, then the plugin works.

    So my testing says that the plugin does not work with a custom path unless I modify plugin.php

    It still appears to me that the plugin.php overwrites the INCLUDE_ME_DIR constant.

    Plugin Author Stefano Lissa

    (@satollo)

    Please, check you define in wp-config.php e be sure to rewrite it and not copy and paste it: could be you copied the ‘ from the web and they’re not really single quotes.

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

The topic ‘Provided File does not Exist … error’ is closed to new replies.