Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @vmarko I have the same issue that @rfair404 reported, wondering if you can help? I am not able to save any API key in the Monitoring/New Relic settings area and the logs are full of the error

    [02-Oct-2024 20:10:41 UTC] PHP Warning: include_once(): Failed opening ‘/home/s21/public_html/wp-content/plugins/’ for inclusion (include_path=’.:/opt/cpanel/ea-php80/root/usr/share/pear’) in /home/s21/public_html/wp-content/plugins/w3-total-cache/Root_Loader.php on line 187

    The plugins folder permissions are fine, and in the w3tc-config/master.php I have

    “extensions.active”: {
    “newrelic”: “w3-total-cache\/Extension_NewRelic_Plugin.php”
    },
    “extensions.active_frontend”: {
    “newrelic”: “*”
    },

    Thank you @yorman, I agree that WordPress is somehow loading the plugin more than once. I don’t think it has anything to do with the sucuriscan_load_plugin_textdomain function itself, it’s just that it’s the first function declared in the file (wrapping it in a if(!function_exists('sucuriscan_load_plugin_textdomain')) just moves the error to the next function)

    It’s not likely to be a problem with Sucuri itself either, since we have an almost identical copy of the site working OK I assume there is some unique combination of factors at play here. I am curious if there is anything about the Sucuri plugin that might hint at why it happens here but not with other plugins that declare functions from their point of entry file. The site is up to date, but it is several years old, maybe some legacy reference to the plugin stuck somewhere?

    This is mostly just a matter of curiosity now so apologies for dragging the conversation on — I’ll update the thread if we find anything meaningful during further debugging, though.

    Hello,

    We are running into the exact same issue that @jaspeer has described. Neither APC, Opcache, or any other PHP accelerators or caches are enabled. We have tried disabling all other plugins, changing themes, etc, all the standard WordPress troubleshooting steps, and the only plugin that this problem seems to exist in out of the 30 or so we’ve had installed is Sucuri Scanner.

    We have an exact copy of this site on a subdomain, on the same server, under the same account with the same settings, and the problem does not exist on this second copy, so it seems to be some combination of the Sucuri plugin and the environment variables or this particular site, rather than just one or the other.

    We more or less host the sites ourselves (up to date cPanel dedicated servers with WHM/root access).

    If there are any additional hints you can share, even a guess at why this only affects the Sucuri plugin but not any others that declare new classes or functions, or if there is anything we can do to provide further clarification, please let me know.

    zimm0r

    (@zimm0r)

    In case you’re still looking (I found your post when I was looking to do the same thing), there’s a filter for that:

    add_filter('woocommerce_style_smallscreen_breakpoint','woo_custom_breakpoint');
    
    function woo_custom_breakpoint($px) {
      $px = '760px';
      return $px;
    }

    The code above in your theme’s functions.php file will change the breakpoint printed out by woocommerce.

    A temporary fix would be to open /wp-includes/post.php, navigate to line 1762, and remove the $wpdb->escape() function from the statement.

    change this:

    $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode("', '", $wpdb->escape($hierarchical_post_types)) . "' ) AND ID != %d AND post_parent = %d LIMIT 1";

    to this:

    $hierarchical_post_types_string = implode("', '", $hierarchical_post_types);
    $hierarchical_post_types_string = addslashes($hierarchical_post_types_string);
    $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . $hierarchical_post_types_string . "' ) AND ID != %d AND post_parent = %d LIMIT 1";

    I found your post looking for the same issue but couldn’t find anything so I made the above changes to fix it.

    Seems like the problem is in $wpdb->escape(), which in 2.8.1 does nothing but addslashes() to the string passed to it.

    On line 1762, though, $hierarchical_post_types is an array… so it’s trying to addslashes() on an array, which is crapping out, which causes the implode to crap out, which results in the error.

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