Support » Plugin: GTM4WP » Plugin causing issue

  • Hello

    For some weeks now, after having the plugin for a long time, is causing a CRITICAL ERROR IN THE PAGE.
    As soon as the plugin is disabled, the page goes back to normal

    this is the error:

    Fatal error: Uncaught TypeError: mysqli::real_connect(): Argument #5 ($port) must be of type ?int, string given in /home/ Stack trace: #0 [internal function]: mysqli->real_connect() #1 /home/ mysqli_query() #2 /home/ wpdb->_do_query() #3 /home/ wpdb->query() #4 /home/ wpdb->get_var() #5 /home/ WC_Customer_Data_Store->get_total_spent() #6 /home/ WC_Data_Store->__call() #7 /home/ WC_Customer->get_total_spent() #8 /home/ gtm4wp_woocommerce_datalayer_filter_items() #9 /home/ WP_Hook->apply_filters() #10 /home/ apply_filters() #11 /home/ gtm4wp_wp_header_begin() #12 /home/ WP_Hook->apply_filters() #13 /home/ WP_Hook->do_action() #14 /home/ do_action() #15 /home/ wp_head() #16 /home/ require_once('/home/') #17 /home/ et_theme_builder_frontend_override_partial() #18 /home/ et_theme_builder_frontend_override_header() #19 /home/ WP_Hook->apply_filters() #20 /home/ WP_Hook->do_action() #21 /home/ do_action() #22 /home/ get_header() #23 /home/ include('/home/') #24 /home/ require_once('/home/') #25 /home/ require('/home/') #26 {main} thrown in /home/ on line 2162
    There has been a critical error on this website.
    Learn more about troubleshooting WordPress.

    I tried disabling the other plugins reported in the error, and the problem remains until I disable yours.
    For us is vital to have your plugin, can you please help us out? This is urgent.
    I tried to contact you via your page form, but is disabled.


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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter thegooddealshop


    Well, we just change the plugin since there is no response.

    Plugin Author Thomas Geiger



    I am here to help, I do my best to reply as quickly as possible but I can rarely reply within some ours. I hope you understand that for me.

    I checked your log and it seems to be causing some trouble when GTM4WP asks WooCommerce about the end total amount of the processed order:

    #7 /home/ WC_Customer->get_total_spent()

    However the specific error message is about a type error while connecting to the database:

    Fatal error: Uncaught TypeError: mysqli::real_connect(): Argument #5 ($port) must be of type ?int, string given in

    GTM4WP does not access, set or change the port of the MySQL connection, therefore I am a but clueless how this is directly connected to this plugin.

    I am very sorry if you need to switch to another solution in order to use Google Tag Manager on your site, but at this point, I do not see how this could be solved in the code of GTM4WP

    In case you haven’t solved it yet. I have had the same error but with other plugins – it seems to manifest with “quick” queries like $wpdb->get_var('...COUNT(*)...');. It appears in core at the moment there is an intermittent connection issue with the ‘null’ being provided in the port. Without editing the WP core files, you can fix it by specifying the port in wp-config.php, for example :

    define('DB_HOST', '');

    change the host and port according to your DB server configuration.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Plugin causing issue’ is closed to new replies.