• WordPress “fatal” error. Plugin loop failed to run.

    error message
    Warning: A non-numeric value encountered in /home/fxecad5/public_html/wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/my-downloads.php on line 15

    environment
    WordPress version 5.3.2
    Current theme: The Core Child (version 1.002i)
    Current plugin: My Downloads Shortcode for WooCommerce (version 1.6.0)
    WooCommerce Version 3.9.2
    PHP version 7.3.11

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Pramschufer

    (@mattpramschufer)

    That’s very strange. On your product do you have a download limit set? Can you try this for me and on line 14 of /home/fxecad5/public_html/wp-content/plugins/woocommerce-my-downloads-shortcode/tpl/my-downloads.php could you add the following code and then let me know what the results are when you view that page again.

    
    echo '<pre>';
    var_dump($items);
    var_dump($downloadLimit);
    var_dump($download['downloads_remaining']);
    echo '</pre>';
    die();
    
    Thread Starter isaaa

    (@isaaa)

    After making this change, my page with the shortcode returned empty.
    I put shortcode on a new page and previewed.
    Results
    =======
    array(1) {
    [339]=>
    object(WC_Order_Item_Product)#5291 (11) {
    [“extra_data”:protected]=>
    array(9) {
    [“product_id”]=>
    int(0)
    [“variation_id”]=>
    int(0)
    [“quantity”]=>
    int(1)
    [“tax_class”]=>
    string(0) “”
    [“subtotal”]=>
    int(0)
    [“subtotal_tax”]=>
    int(0)
    [“total”]=>
    int(0)
    [“total_tax”]=>
    int(0)
    [“taxes”]=>
    array(2) {
    [“subtotal”]=>
    array(0) {
    }
    [“total”]=>
    array(0) {
    }
    }
    }
    [“data”:protected]=>
    array(11) {
    [“order_id”]=>
    int(8664)
    [“name”]=>
    string(11) “Dorme WA-03”
    [“product_id”]=>
    int(7541)
    [“variation_id”]=>
    int(0)
    [“quantity”]=>
    int(1)
    [“tax_class”]=>
    string(0) “”
    [“subtotal”]=>
    string(2) “41”
    [“subtotal_tax”]=>
    string(1) “0”
    [“total”]=>
    string(1) “0”
    [“total_tax”]=>
    string(1) “0”
    [“taxes”]=>
    array(2) {
    [“total”]=>
    array(0) {
    }
    [“subtotal”]=>
    array(0) {
    }
    }
    }
    [“cache_group”:protected]=>
    string(11) “order-items”
    [“meta_type”:protected]=>
    string(10) “order_item”
    [“object_type”:protected]=>
    string(10) “order_item”
    [“id”:protected]=>
    int(339)
    [“changes”:protected]=>
    array(0) {
    }
    [“object_read”:protected]=>
    bool(true)
    [“default_data”:protected]=>
    array(11) {
    [“order_id”]=>
    int(0)
    [“name”]=>
    string(0) “”
    [“product_id”]=>
    int(0)
    [“variation_id”]=>
    int(0)
    [“quantity”]=>
    int(1)
    [“tax_class”]=>
    string(0) “”
    [“subtotal”]=>
    int(0)
    [“subtotal_tax”]=>
    int(0)
    [“total”]=>
    int(0)
    [“total_tax”]=>
    int(0)
    [“taxes”]=>
    array(2) {
    [“subtotal”]=>
    array(0) {
    }
    [“total”]=>
    array(0) {
    }
    }
    }
    [“data_store”:protected]=>
    object(WC_Data_Store)#5248 (4) {
    [“instance”:”WC_Data_Store”:private]=>
    object(WC_Order_Item_Product_Data_Store)#5812 (4) {
    [“internal_meta_keys”:protected]=>
    array(20) {
    [0]=>
    string(9) “_order_id”
    [1]=>
    string(5) “_name”
    [2]=>
    string(11) “_product_id”
    [3]=>
    string(13) “_variation_id”
    [4]=>
    string(9) “_quantity”
    [5]=>
    string(10) “_tax_class”
    [6]=>
    string(9) “_subtotal”
    [7]=>
    string(13) “_subtotal_tax”
    [8]=>
    string(6) “_total”
    [9]=>
    string(10) “_total_tax”
    [10]=>
    string(6) “_taxes”
    [11]=>
    string(11) “_product_id”
    [12]=>
    string(13) “_variation_id”
    [13]=>
    string(4) “_qty”
    [14]=>
    string(10) “_tax_class”
    [15]=>
    string(14) “_line_subtotal”
    [16]=>
    string(18) “_line_subtotal_tax”
    [17]=>
    string(11) “_line_total”
    [18]=>
    string(9) “_line_tax”
    [19]=>
    string(14) “_line_tax_data”
    }
    [“meta_type”:protected]=>
    string(10) “order_item”
    [“object_id_field_for_meta”:protected]=>
    string(13) “order_item_id”
    [“must_exist_meta_keys”:protected]=>
    array(0) {
    }
    }
    [“stores”:”WC_Data_Store”:private]=>
    array(20) {
    [“coupon”]=>
    string(24) “WC_Coupon_Data_Store_CPT”
    [“customer”]=>
    string(22) “WC_Customer_Data_Store”
    [“customer-download”]=>
    string(31) “WC_Customer_Download_Data_Store”
    [“customer-download-log”]=>
    string(35) “WC_Customer_Download_Log_Data_Store”
    [“customer-session”]=>
    string(30) “WC_Customer_Data_Store_Session”
    [“order”]=>
    string(23) “WC_Order_Data_Store_CPT”
    [“order-refund”]=>
    string(30) “WC_Order_Refund_Data_Store_CPT”
    [“order-item”]=>
    string(24) “WC_Order_Item_Data_Store”
    [“order-item-coupon”]=>
    string(31) “WC_Order_Item_Coupon_Data_Store”
    [“order-item-fee”]=>
    string(28) “WC_Order_Item_Fee_Data_Store”
    [“order-item-product”]=>
    string(32) “WC_Order_Item_Product_Data_Store”
    [“order-item-shipping”]=>
    string(33) “WC_Order_Item_Shipping_Data_Store”
    [“order-item-tax”]=>
    string(28) “WC_Order_Item_Tax_Data_Store”
    [“payment-token”]=>
    string(27) “WC_Payment_Token_Data_Store”
    [“product”]=>
    string(25) “WC_Product_Data_Store_CPT”
    [“product-grouped”]=>
    string(33) “WC_Product_Grouped_Data_Store_CPT”
    [“product-variable”]=>
    string(34) “WC_Product_Variable_Data_Store_CPT”
    [“product-variation”]=>
    string(35) “WC_Product_Variation_Data_Store_CPT”
    [“shipping-zone”]=>
    string(27) “WC_Shipping_Zone_Data_Store”
    [“webhook”]=>
    string(21) “WC_Webhook_Data_Store”
    }
    [“current_class_name”:”WC_Data_Store”:private]=>
    string(32) “WC_Order_Item_Product_Data_Store”
    [“object_type”:”WC_Data_Store”:private]=>
    string(18) “order-item-product”
    }
    [“meta_data”:protected]=>
    array(0) {
    }
    }
    }
    NULL
    string(0) “”

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Plugin loop fails with error non-numeric vale’ is closed to new replies.