• Resolved alx359

    (@alx359)


    Have installed Query Monitor, and during Abandoned Cart Recovery for WooCommerce de/activation the following fatal error happens:

    Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'IF' at line 1
    in /public_html/wp-includes/class-wpdb.php on line 2357

    Call stack:

    mysqli_query()
    wp-includes/class-wpdb.php:2357
    wpdb::_do_query()
    wp-includes/class-wpdb.php:2271
    wpdb::query()
    wp-includes/class-wpdb.php:3156
    wpdb::get_results()
    wp-admin/includes/upgrade.php:2998
    dbDelta()
    wp-content/plugins/woo-abandoned-cart-recovery/includes/plugin.php:120
    WACV\Inc\Plugin::create_database()
    wp-content/plugins/woo-abandoned-cart-recovery/includes/plugin.php:67
    WACV\Inc\Plugin::single_active()
    wp-content/plugins/woo-abandoned-cart-recovery/includes/plugin.php:62
    WACV\Inc\Plugin::activate()
    wp-content/plugins/woo-abandoned-cart-recovery/woo-abandoned-cart-recovery.php:114
    WACVPInit_F::wacv_activate()
    wp-includes/class-wp-hook.php:341
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:365
    WP_Hook::do_action()
    wp-includes/plugin.php:522
    do_action()
    wp-admin/includes/plugin.php:703
    activate_plugin()
    wp-admin/plugins.php:60

    The “IF NOT EXISTS” seems to be the culprit. dbDelta( $query ) should be doing that check already anyway.

    The suggested changes to woo-abandoned-cart-recovery\includes\plugin.php that fixed the issue for me:

    $query = "CREATE TABLE IF NOT EXISTS {$abd_record_tb} // line ~92
    to:
    $query = "CREATE TABLE {$abd_record_tb}

    $query = "CREATE TABLE IF NOT EXISTS {$guest_record_tb} ( // line ~124
    to:
    $query = "CREATE TABLE {$guest_record_tb} (

    $query = "CREATE TABLE IF NOT EXISTS {$mail_log_tb} ( // line ~158
    to:
    $query = "CREATE TABLE {$mail_log_tb}

    $query = "CREATE TABLE IF NOT EXISTS {$cart_log_tb} ( // line ~176
    to:
    $query = "CREATE TABLE {$cart_log_tb} (
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alx359

    (@alx359)

    This is a non-issue. The reason was a redundant wp-content\db.php remaining from another plugin that’s creating havoc. My apologies.

    angelagrey

    (@angelagrey)

    Hi,

    Thanks for the update and for letting me know. I’m glad you were able to identify the cause.

    If you need any further assistance, feel free to reach out anytime.

    Best regards

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

You must be logged in to reply to this topic.