Error in Marketpress Orders Page

Hi there,

On my orders page, the latest order has the following error in the From column:

Warning: Illegal string offset 'name' in /home/xxx/public_html/wp-content/plugins/marketpress/marketpress.php on line 2321

Warning: Illegal string offset 'name' in /home/xxx/public_html/wp-content/plugins/marketpress/marketpress.php on line 2321

Warning: Illegal string offset 'email' in /home/xxx/public_html/wp-content/plugins/marketpress/marketpress.php on line 2321

Warning: Illegal string offset 'email' in /home/xxx/public_html/wp-content/plugins/marketpress/marketpress.php on line 2321
()

I'd appreciate any help you can offer
Colin

  • Kasia Swiderska

    Hello Colin,

    Next step is to exclude the plugin conflict and theme conflict - can you switch for while to one of default WordPress themes (2015, 2016) and deactivate the other plugins?
    I tried to replicate this issue on my testing site, but there was no such error. Could you check what PHP version you have on your server? You can check this in WPMU DEV -> Support -> System info.

    Kind regards,
    Kasia

  • Colin

    Hi again,

    Thanks, I've checked Theme and Plugins and the problem remains. Remember, it's just one order that's experiencing it - all the other orders are fine - so it seems more like a small problem with that order input on it's own. I'd imagine it'd be hard to replicate.

    Going by the error message, what type of input within the order details could cause that?

    PHP version is 5.4.41

    Thanks
    Colin

  • Kasia Swiderska

    Hi Colin,

    Thanks for the information (I'm sorry for the late response I went to holidays).
    Could you be so kind and grant support access to you site? I will take a look on this, and see if something catch my eye.
    Did you upgrade PHP recently? This warning is related to the PHP 5.4 and did not show in previuos versions. (However I also have the 5.4 and don't see this error).

    Kind regards,
    Kasia

  • Vinod Dalvi

    Hi Colin,

    I have tested it on my test site using latest version of MarketPress eCommerce plugin but didin't get the warning messages even setting WP debug to true.

    I think this can be specific to the order which doesn't have user name and email address set in its shipping info like some digital download product but by default in digital download product the email address is requested.

    Could you please try resolving the issue by editing the following marketpress plugin file on line number 2320 as displayed below.

    Marketpress plugin file :
    marketpress/marketpress.php

    Before Editing :

    case "mp_orders_name":
    	echo esc_attr( $meta[ "mp_shipping_info" ][ 0 ][ 'name' ] ) . ' (<a href="mailto:' . urlencode( $meta[ "mp_shipping_info" ][ 0 ][ 'name' ] ) . ' <' . esc_attr( $meta[ "mp_shipping_info" ][ 0 ][ 'email' ] ) . '>?subject=' . urlencode( sprintf( __( 'Regarding Your Order (%s)', 'mp' ), $post->post_title ) ) . '">' . esc_attr( $meta[ "mp_shipping_info" ][ 0 ][ 'email' ] ) . '</a>)';
    	break;

    After Editing :

    case "mp_orders_name":
    	if( isset($meta[ "mp_shipping_info" ][ 0 ][ 'name' ]) ){
    		echo esc_attr( $meta[ "mp_shipping_info" ][ 0 ][ 'name' ] );
    	}
    	if( isset($meta[ "mp_shipping_info" ][ 0 ][ 'name' ]) && isset($meta[ "mp_shipping_info" ][ 0 ][ 'email' ]) ){
    		echo ' (<a href="mailto:' . urlencode( $meta[ "mp_shipping_info" ][ 0 ][ 'name' ] ) . ' <' . esc_attr( $meta[ "mp_shipping_info" ][ 0 ][ 'email' ] ) . '>?subject=' . urlencode( sprintf( __( 'Regarding Your Order (%s)', 'mp' ), $post->post_title ) ) . '">' . esc_attr( $meta[ "mp_shipping_info" ][ 0 ][ 'email' ] ) . '</a>)';
    	}
    	break;

    Alternatively you can just use the attached modified marketpress.php file and replace it with the above file in the marketpress plugin directory.

    Best Regards,
    Vinod Dalvi

  • Vinod Dalvi

    Hi Colin,

    So, somehow the user hasn't entered a name and email? This is worrying as it means I can't follow up and deliver the product to the customers. How could they get through the order process without entering those details? And how can I make sure that it's always entered in future?

    This should not happen as in the checkout process these details are required and even if the product is digital downloadable product then also we request at least his email address as shown in the attached screenshot.

    This may be some kind of issue occurred on your site when this order is placed but we have to reproduce the issue to troubleshoot and resolve it.

    I logged in to your site and found the order ID ebd6913e5b3d doesn't have the user information and this order is placed for the course "Podcast Liberation: Set Your Podcast Free" but i can see the other orders successfully placed for the same course.

    Could you please try enrolling to this course by checking out and let us know whether you can reproduce the issue?

    Regards,
    Vinod Dalv

  • Colin

    I've bought quite a number of test products, and all was well, so I can't reproduce the issue. But, I've only sold around 20 products, so a 1 in 20 failure rate is relatively high....

    What would you be able to do if I were able to reproduce the issue? Could you diagnose it if it happened again? I'm guessing not since you can't diagnose this one? What's the next steps in figuring out why it ocurred?

    Thanks
    Colin

  • Kasia Swiderska

    Hello Colin,

    First step to diagnose it to enable debug mode to save errors to de debug.log file. To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

    define('WP_DEBUG', true);

    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', false );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

    If there will be problem with order in the future (hopefully not) that will be caused by error, then we should have it in the debug.log - and this will help us find reason.

    Kind regards,
    Kasia

  • Colin

    Ok, I've set up the error log now, so should catch future problems.

    Perhaps related to this issue, I'm also getting errors on the order management page. I'm not sure if this was happening before the edits you asked me to make, but I don't think so. Here's the error:

    Warning: explode() expects parameter 2 to be string, array given in /home/thepodca/public_html/wp-content/plugins/marketpress/includes/common/class-mp-order.php on line 553

    Warning: Invalid argument supplied for foreach() in /home/thepodca/public_html/wp-content/plugins/marketpress/includes/common/class-mp-order.php on line 561

    Warning: explode() expects parameter 2 to be string, array given in /home/thepodca/public_html/wp-content/plugins/marketpress/includes/common/class-mp-order.php on line 553

    Warning: Invalid argument supplied for foreach() in /home/thepodca/public_html/wp-content/plugins/marketpress/includes/common/class-mp-order.php on line 561

    Ocurring just below the 'Customer Info' line, as shown in the screenshot below.

  • Colin

    These errors have now disappeared for some reason, but I'm getting some notices when debug info is displayed.
    Notice: Undefined index: YU in /home/thepodca/public_html/wp-content/plugins/marketpress/includes/common/class-mp-order.php on line 562

    Notice: Undefined index: YU in /home/thepodca/public_html/wp-content/plugins/marketpress/includes/common/class-mp-order.php on line 562

    And I'm also getting the 'blank screen' error when trying to edit order information, which I've logged in another thread.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.