Hi,
I got an error every time I tried to open a product editing page, for example: https://www.peilishop.com/wp-admin/post.php?post=61679&action=edit, below the error message:
Line 2349
Message Uncaught TypeError: mysqli::real_connect(): Argument #5 ($port) must be of type ?int, string given in /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wpdb.php:2349 Stack trace: #0 [internal function]: mysqli->real_connect() #1 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wpdb.php(2349): mysqli_query() #2 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wpdb.php(2263): wpdb->_do_query() #3 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wpdb.php(3107): wpdb->query() #4 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-admin/includes/template.php(720): wpdb->get_col() #5 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-admin/includes/meta-boxes.php(825): meta_form() #6 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-admin/includes/template.php(1456): post_custom_meta_box() #7 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-admin/edit-form-advanced.php(714): do_meta_boxes() #8 /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-admin/post.php(206): require(‘/home/612627.cl…’) #9 {main} thrown
File /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wpdb.php
When I contacted Cloudway, they replied that this plugin “st-woo-swatches” is causing the crash:
[0x00007f3d47c15500] get_available_variation() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-content/plugins/woocommerce/includes/class-wc-product-variable.php:326
[0x00007f3d47c15430] get_available_variations() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-content/plugins/et-core-plugin/packages/st-woo-swatches/public/partials/class-st-woo-shop.php:64
[0x00007f3d47c15140] loop_swatch() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wp-hook.php:324
[0x00007f3d47c15060] apply_filters() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wp-hook.php:348
[0x00007f3d47c14ff0] do_action() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/plugin.php:517
[0x00007f3d47c14f00] do_action() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-content/plugins/et-core-plugin/packages/st-woo-swatches/public/partials/class-st-woo-shop.php:44
[0x00007f3d47c14ea0] {closure}() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wp-hook.php:324
[0x00007f3d47c14dc0] apply_filters() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/class-wp-hook.php:348
[0x00007f3d47c14d50] do_action() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-includes/plugin.php:517
[0x00007f3d47c14c70] do_action() /home/612627.cloudwaysapps.com/eerwjyhrug/public_html/wp-content/themes/xstore/woocommerce/content-product.php:783
Since I’ve never installed this plugin, I am not sure whether this plugin is built into your theme, please let me know if you can fix it. Currently, I am running on the latest PHP 8.2
Thanks,
Jimmy