• Resolved tom durocher

    (@tdurocher)


    My PHP error log is filled with the following error, which seems to be come from a functions.php file that is a root file that I cannot look at. Here is the error and it seems to be happening extremely frequently, even though the BBpress plugin is working perfectly fine (and so is BSP as far as I can tell):
    08-Feb-2025 23:00:52] WARNING: child 74277 said into stderr: “NOTICE: PHP message: PHP Warning: file_get_contents(/wordpress/wp-content/plugins/bbpress/bbpress.php): failed to open stream: No such file or directory in /wordpress/wp-includes/functions.php on line 6893”

    My host had this to say about the problem, which indicates to me that it cannot be fixed without a plugin code change. Please let me know what if anything I can do in the short term because this is happening once a minute or more, even on loading pages other than the forum:

    The warning indicates that WordPress is trying to read the file /wordpress/wp-content/plugins/bbpress/bbpress.php using file_get_contents(), but the file does not exist. I checked the file, and it actually exists on the server, but upon further investigation, it appears one of the plugins is using ABSPATH to find the file, which would not point them in the right place. 

    The plugin name is bbp-style-pack and here’s the exact code inside wp-content/plugins/bbp-style-pack/bbp-style-pack.php

    89 $plugin_data = get_file_data(ABSPATH . 'wp-content/plugins/bbpress/bbpress.php', array('Version' => 'Version'), false);

    We, like many other managed WordPress solutions, protect the core files with added security and place them in a hidden folder. This path can be found using the ABSPATH constant (because that’s what it is fore), but ABSPATH is not a good tool for finding the wp-content folder because it is not part of the WordPress core files.

    Thanks,
    Tom Durocher

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Robin W

    (@robin-w)

    thanks – who is your hosting company?

    Thread Starter tom durocher

    (@tdurocher)

    Oops, replying to email notifications didn’t work. Here’s my response from last night:

    Flywheel is my host. I forgot to mention it was a WP-centric host. I think they know what they’re talking about here, though I realize it might not (probably wouldn’t) happen on a regular host.

    I’ll also send the rest of their ticket response. It has suggestions for fixing, apparently very simple, but not something I can do outside of the plugin. Wordpress.com has very similar instructions in regard to using ABSPATH.

    If you do need to find the document root of the site, recommended alternatives are:
     
    – Trim .wordpress off of the value returned by get_home_path()
    – Trim wp-content/ off the constant WP_CONTENT_DIR.
    – Use one of these functions: https://codex.wordpress.org/Determining_Plugin_and_Content_Directories
     
    This is very much in the realm of plugin development, so if you’d like to continue using the plugin, you could send the above information to the plugin developers and ask for their assistance.  

    Plugin Author Robin W

    (@robin-w)

    Thanks, I will look at this, but I am away for 2 weeks on Friday, with no computer access, and with 7,000 sites using this plugin, I cannot risk an update until I come back in early March.

    Quite happy that your hoster knows what they are talking about, but some of their solutions are a catch 22 for the purposes I am using it. eg get_home_path() requires WordPress file that is not available when I need to use it, and the recommended solution is to load a wordpress file using ABSPATH which is the cause of the problem. I could use WP_CONTENT_DIR but WordPress say that plugin authors should not be using this etc.

    Quite happy that I should be able to find a solution, but need time to devote to working out the best.

    Thread Starter tom durocher

    (@tdurocher)

    Ok, I understand this is not a good time for an update. Thanks for letting me know. Is there perhaps some setting in BSP I could disable to avoid calling this code so frequently even for non-forum pages? Also, is it possible to say what part of BSP is broken because of not being able to load bbpress.php? As I said, the forums look like they always did to me. I don’t know when this problem first occurred but it hasn’t been there since I started using BSP in 2019.

    Plugin Author Robin W

    (@robin-w)

    no setting, sorry – this is how WordPress works – it is a check on loading plugins which is done on every page,

    the reason you are now seeing this is following WordPress 6.7 which does some things differently.

    That particular check will not affect how you are using bbpress unless you are using an old version.

    Plugin Author Robin W

    (@robin-w)

    I’ve released version 6.2.6 which does that function in a different way, so should take out the issue detailed above.

    Please confirm in due course

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

The topic ‘Cannot find core WP functions.php’ is closed to new replies.