Subscribe by Email Error When Sending to a Larger List

I am trying to send to a list of about 1,200. I tested the plugins sending it to about 30 people and it sent fine. FYI, I have it set to send out immediately upon posting. When I added about 1,200 subscribers I get the following error every time I hit publish:

Fatal error: Cannot use string offset as an array in /home/.../public_html/wp-content/plugins/subscribe-by-email/model/model.php on line 457

The post gets published, but the email doesn't go out. I checked the sent statistics and it says it sent to "0" subscribers. Please let me know a fix.

  • Ignacio
    • HummingBird

    Hi @Jason Verdelli.

    I'll add this thread to the bugs list as it needs to be checked deeply but meanwhile you can disable the logs. Fortunately it seems that the logs are failing and not the sending functionality. About line 350 inside inc/mail-templates/mail-template.php you'll see this block:

    if ( $mails_sent == 0 && $mail_log_id == 0 ) {
    	$mail_log_id = $model->add_new_mail_log( $to, $this->subject );
    	if ( ! isset( $mail['status'] ) )
    		$mail['status'] = true;
    	$model->increment_mail_log( $mail_log_id, $mail );
    }
    else {
    	$model->increment_mail_log( $mail_log_id, $mail );
    }

    You'll just need to comment the whole blocK:

    //if ( $mails_sent == 0 && $mail_log_id == 0 ) {
    //	$mail_log_id = $model->add_new_mail_log( $to, $this->subject );
    //	if ( ! isset( $mail['status'] ) )
    //		$mail['status'] = true;
    //	$model->increment_mail_log( $mail_log_id, $mail );
    //}
    //else {
    //	$model->increment_mail_log( $mail_log_id, $mail );
    //}

    This should make at least the plugin to work but you won't see any new logs.

    Regards.
    Ignacio.

  • Brian Durost
    • Recruit

    Ignacio,

    Thank you for providing the short-term fix. It worked. Obviously this is a short-term fix since it doesn't keep track of the log. I appreciate your help in the meantime. Do you have a rough idea when we would expect a fix on this?

    Again, I really appreciate your help.

  • Ignacio
    • HummingBird

    Hi @Jason Verdelli.

    As this is a little urgent I'm working right now on it so I guess we'll have a new release in a few days. I need to touch lot of things in the core and the log system won't work like it was but I'm planning to add text files instead of using tables but you'll be able to check the logs as you were before (maybe with a little more information, still not sure).

    Regards.
    Ignacio.

  • Ignacio
    • HummingBird

    Hey @Jason Verdelli.

    We just released a new version of the plugin. It will update the logs table so would be better if you backup first. Probably you'll loose some information about some of the latest logs, nothing serious as the error you posted above inserted a string bad in the database so you cannot recover that string.

    Logs are now base on a relationship between files and the table and they are erased every 31 days by default but you can change it in the plugin settings.

    Please advice in case you see something weird.

    Regards.
    Ignacio.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.