morehawes / open-currency-converter

💵 WordPress plugin to convert currencies within the text of a post or page.
https://wordpress.org/plugins/artiss-currency-converter/
GNU General Public License v2.0
2 stars 4 forks source link

Uncaught type error on line 115 #57

Open c3piio opened 3 months ago

c3piio commented 3 months ago

Hello, I am getting an Uncaught type error on line 115 in convert-currency.php.

I have a custom plugin that uses the get conversion function like this: $converted_total_raw = get_conversion('number=' . $order_total . '&from=' . $store_currency . '&to=' . $currency_to . '&dp=2');

Everything works on the website but the critical error appears randomly. I have a testing site with the same implementation of open currency converter and the custom plugin, and the error does not occur there.

From the error, is it obvious what could cause this? I haven't been able to pinpoint it.

CRITICAL Uncaught TypeError: Cannot access offset of type string on string in /public_html/wp-content/plugins/artiss-currency-converter/includes/convert-currency.php:115 Stack trace: 0 /public_html/wp-content/plugins/artiss-currency-converter/includes/convert-currency.php(47): occ_perform_conversion() 1 /public_html/wp-content/plugins/artiss-currency-converter/includes/functions.php(32): occ_convert_currency() 2 /public_html/wp-content/plugins/custom-currency-conversion/custom-currency-conversion.php(232): get_conversion() 3 /public_html/wp-includes/class-wp-hook.php(324): get_converted_price_callback() 4 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 5 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action() 6 /public_html/wp-admin/admin-ajax.php(203): do_action() 7 {main}

thrown in /public_html/wp-content/plugins/artiss-currency-converter/includes/convert-currency.php on line 115

Any advice would be appreciated, not sure if it is a problem with the plugin or my config.