WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Subscribe2 Fatal error after 8.9 upgrade (15 posts)

  1. derekmacewen
    Member
    Posted 1 year ago #

    Installed 8.9 version. when I add a new post, I get this error:
    Fatal error: Call to undefined function mb_encode_mimeheader() in /home/peiwebs/public_html/peicurling.com/wp-content/plugins/subscribe2/classes/class-s2-core.php on line 354

    I tried deleting the plugin (after saving my subscriber list) and re-installing, but I still get the same error.

    I note the following in changelog.txt - looks like a call to this was just added:
    * Use mb_encode_mimeheader on email sender name - thanks to xl32

    http://wordpress.org/extend/plugins/subscribe2/

  2. derekmacewen
    Member
    Posted 1 year ago #

    I worked around the problem for now by removing the function call to mb_encode_mimeheader() in lines 354 and 355:

    354 $header['From'] = $this->myname . " <" . $this->myemail . ">";
    355: $header['Reply-To'] = $this->myname . " <" . $this->myemail . ">";

    Apparently, mb_encode_mimeheader() is a PHP function which "encodes a given string str by the MIME header encoding scheme".

    I found the following: http://stackoverflow.com/questions/5796679/mb-encode-mimeheader-in-php which suggests that it is not compiled by default into PHP installs, which is probably my problem. I will try to figure out how to add it to my PHP when I have time. Looks like this could affect other users too, as it is not part of the default PHP install.

    From: http://www.php.net/manual/en/mbstring.installation.php

    "mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option."

  3. mattyrob
    Member
    Plugin Author

    Posted 1 year ago #

    @Derek,

    Thanks for the follow up information, I'll see if I can add some checks for the next release.

  4. derekmacewen
    Member
    Posted 1 year ago #

    Great - for now, I have now rolled back to 8.8.

  5. mattyrob
    Member
    Plugin Author

    Posted 1 year ago #

    @Derek,

    I've fixed the issue in my development code like this:

    if ( function_exists('mb_encode_mimeheader') ) {
    	$header['From'] = mb_encode_mimeheader($this->myname, 'UTF-8', 'Q') . " <" . $this->myemail . ">";
    	$header['Reply-To'] = mb_encode_mimeheader($this->myname, 'UTF-8', 'Q') . " <" . $this->myemail . ">";
    } else {
    	$header['From'] = $this->myname. " <" . $this->myemail . ">";
    	$header['Reply-To'] = $this->myname . " <" . $this->myemail . ">";
    }
  6. derekmacewen
    Member
    Posted 1 year ago #

    Thx. I will wait until it is rolled into the next release, but that should fix it! For some reason, I can't find the "multibyte" module in my PHP optional install modules, so I am stuck with the "else" version for now, unless I want to raise a ticket (and probably pay some money) with my server host.

  7. MaaaXaaaM
    Member
    Posted 1 year ago #

    Hi
    i have the same problem so i have two way:
    .downgrade to the v8.8-->i cam't find it...anyone can halp me?
    .find where i have to add the piece of code, i mean which file i need to change?

    thanks a lot in advance

  8. MaaaXaaaM
    Member
    Posted 1 year ago #

    /class-s2-core.php
    :)

  9. rockmouseman
    Member
    Posted 1 year ago #

    How do you get back to 8.8?

    Mattyrob - what do you do with that "if/else" statement?

  10. MaaaXaaaM
    Member
    Posted 1 year ago #

    if you find that version upload to domain via FTP and manually install

    the if else says that if you have the function avaiable you''use it, otherwise you'll not use it
    if you are sure that you don't have the function avaiable on your server you could just delete the call to function as explained in the second post. i tried and it works well

  11. mattyrob
    Member
    Plugin Author

    Posted 1 year ago #

    @rockmouseman,

    In another thread your error appears to be a different one so this fix might not be necessary for you.

    But, all older version of the code are available here:
    http://wordpress.org/extend/plugins/subscribe2/developers/

  12. amesy
    Member
    Posted 11 months ago #

    Hi mattyrob please help

    i've tried every debug i can find and i cant get this plugin ot auto send when new posts are created.

    i posted this up on stackoverflow...

    v8.9 Subscribe2 plugin is not auto sending emails when a new post is created.

    this is the error from the logs...

    Subscribe2 has an error in the logs: (/var/www/vhosts/iglobal.amese.co.uk/statistics/logs): view /var/www/vhosts/Cloud2.mydomain.co.uk/subdomains/folder/iglobal/wp-content/plugins/subscribe2/classes/class-s2-core.php +432

    i was also told by my hosting company that there was a null value for the email type, as in the whether the email is html or plain text and that value was not being stored.

    the website is currently on a dev area on a sub domain. i've tested the auto-post with an email at the domain where the subdomain is and i tested it with my gmail email.

    what i've done to DEBUG...

    installed email log plugin
    rolled back to version 8.8 and have same problem.
    deactivated every single other plugin and tried to resend.
    spoke to my hosting company who gave me the error log
    checked the version number against a know working plugin on another WordPress site i have installed and that works.
    experimented with 0 and 1 recipients with settings.
    experimented with other settings with subscribe2 including html and plain text.
    made sure no categories were excluded.
    uninstalled the plugin and reinstalled it.

  13. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    @amesy,

    There were 2 potentially critical errors in 8.9 that were fixed in 8.9.1, have you tried that version?

    Also, the error log points to a line that works with password protected posts so that doesn't really help with what the hosting company were reporting.

    I need more information about your theme (have you tried with a core WordPress theme?) and the version of WordPress you are using.

  14. amesy
    Member
    Posted 11 months ago #

    i just tried it with the latest twentytwelve theme and it worked, so it seems its a problem specific to my theme - no idea what, but atleast it is not my server or plugin conflict and i can progress with debugging.

    i hadn't thought about switching themes so thanks for the advice :)

    i'll post back once i know what casued the issue.

  15. mattyrob
    Member
    Plugin Author

    Posted 11 months ago #

    @amesy,

    If your theme is a Premium theme (i.e. paid for) take this up with them. If it's a free theme try tracking down the author and if that fails you may need to change theme.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic