• Resolved jayrenn

    (@jayrenn)


    If I go to my site using “https://expedraft.com”, it works fine. But if I (or others in my office) try to go to it just using “expedraft.com”, we get a series of warnings:

    Warning: include_once(<snip>/wp-content/plugins/wordfence/wordfence.php): failed to open stream: No such file or directory in /home/nbranning/expedraft.com/wp-settings.php on line 305
    
    Warning: include_once(): Failed opening '<snip>/wp-content/plugins/wordfence/wordfence.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <snip>/wp-settings.php on line 305
    
    Warning: strpos(): Empty needle in <snip>/wp-includes/plugin.php on line 658

    The last warning is repeated about 30 times.

    I deactivated, deleted, then reinstalled and reactivated Wordfence, but it didn’t solve the problem. Any ideas?

    • This topic was modified 6 years, 5 months ago by jayrenn.

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

Viewing 1 replies (of 1 total)
  • Hi @jayrenn,

    The first error message is the include in Line 305 in wp-settings.php:

    // Load active plugins.
    foreach ( wp_get_active_and_valid_plugins() as $plugin ) {
            wp_register_plugin_realpath( $plugin );
            include_once( $plugin );
    }

    The strpos() call in the WP core function plugin_basename() in Line 658 of plugin.php is:
    `foreach ( $wp_plugin_paths as $dir => $realdir ) {
    if ( strpos( $file, $realdir ) === 0 ) {
    $file = $dir . substr( $file, strlen( $realdir ) );
    }
    }`

    $realdir is from the global $wp_plugin_paths, and that’s the missing “needle” in the message —$realdir shouldn’t be empty when loading plugins.

    For each of the places where you snipped the path, could you confirm that those paths are valid? It is possible that Wordfence is the first plugin loading and causing the first error message. However, if the paths are valid, since the file failing to load is a Wordfence file the issue would likely not Wordfence-specific. In that case, it seems likely that another plugin or mu-plugin is loading part of WordPress too soon.

    • This reply was modified 6 years, 5 months ago by wfchar. Reason: formatting
Viewing 1 replies (of 1 total)
  • The topic ‘include_once failed to open stream on line 305’ is closed to new replies.