• Hey guys, the plugin is generating an error on our site, breaking our dashboard and some functionality on the front end. Here’s the dump:

    An error of type E_ERROR was caused in line 6400 of the file public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php. Error message: Uncaught TypeError: array_sum(): Argument #1 ($array) must be of type array, null given in public_html/wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php:6400

    I’ve applied a fix which sorts out the issue but just flagging for a future release.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support mansary

    (@mansary)

    Dear@rocodes ,

    Thank you for reporting this issue and for taking the initiative to investigate and apply a temporary fix.

    Based on the error log, it appears that array_sum() is receiving a null value instead of an array under certain conditions, which is causing the fatal error. We appreciate you bringing this to our attention, as it helps us improve the plugin’s stability and compatibility.

    To assist our developers in identifying the root cause and evaluating a permanent fix for a future release, could you please share the exact modification or patch you applied? Additionally, it would be helpful if you could provide the following details:

    • CTX Feed version
    • WooCommerce version
    • WordPress version
    • PHP version
    • Any specific steps that consistently reproduce the issue

    We have forwarded your report to our development team for review. Once we receive the additional information, we will investigate further and keep you informed of any updates or improvements that may be included in an upcoming release.

    Thank you again for your valuable feedback and for helping us improve CTX Feed.

    Kind regards,

    Thread Starter Rohan

    (@rocodes)

    Sure:

    • CTX Feed: 6.6.38
    • Woo: 10.9.1
    • WP: 7.0
    • PHP: 8.2.31
    • Visit the admin dashboard. Other dashboard widgets lock up and fail to load. Not sure if it’s a plugin conflict or not, but after addressing the issue in the error log it fixed the issue as mentioned.

    The code fix applied was in /wp-content/plugins/webappick-product-feed-for-woocommerce/includes/helper.php on line 6397 (replaced the function with the following)

    if ( ! function_exists( 'woo_feed_calculate_rating' ) ) {
    function woo_feed_calculate_rating( $ratings ) {
    if ( ! is_array( $ratings ) ) {
    return 0;
    }

    $ratings = wp_parse_args(
    $ratings,
    array(
    1 => 0,
    2 => 0,
    3 => 0,
    4 => 0,
    5 => 0,
    )
    );

    $total_ratings = array_sum( $ratings );
    if ( 0 === (int) $total_ratings ) {
    return 0;
    }

    $weighted_sum =
    ( 5 * (int) $ratings[5] ) +
    ( 4 * (int) $ratings[4] ) +
    ( 3 * (int) $ratings[3] ) +
    ( 2 * (int) $ratings[2] ) +
    ( 1 * (int) $ratings[1] );

    return round( $weighted_sum / $total_ratings, 1 );
    }
    }
    Plugin Support mansary

    (@mansary)

    Dear @rocodes

    Thank you for the details.

    We have acknowledged the issue and expect to include a fix in an upcoming release. We appreciate you bringing this to our attention and helping us improve the plugin.

    Best regards,

    Plugin Support mansary

    (@mansary)

    Hi @rocodes

    We have released a new version of CTX Feed that includes a fix for this issue. Could you please update the plugin to the latest version and let us know if the issue has been resolved on your end?

    Thank you,

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

You must be logged in to reply to this topic.