Support » Plugin: wpMandrill » Here's a bug fix for your wpMandrill for PHP 7

  • You are using a deprecated function and it looks like you’ve tried to prevent errors by redefining the function if it doesn’t exist – unfortunately you got the name of the function wrong in this section.

    If you look at line 545 in the mandrill.class.php file you’ll see a call to the function set_magic_quotes_runtime($value).

    In the previous few lines you’ve tried to redefine set_magic_quotes (i.e. you’re missing the _runtime suffix)

    Here’s the extra code to fix your problem:

    if ( !function_exists(‘set_magic_quotes_runtime’) ) {
    function set_magic_quotes_runtime($value) { return true;}
    }

    https://wordpress.org/plugins/wpmandrill/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Dhilditch,

    Where should this extra code go ? Just after the function in line 545 ?

    I keep getting this error in my debug.log, this is the same problem I guess ?

    PHP Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use

    __construct()

    instead.

    Thx ! Bjorn

    Thread Starter Dave Hilditch

    (@dhilditch)

    There’s a very similar 3 lines of code – I actually think they misspelled the function they are trying to emulate.

    You can paste the 3 lines above after the lines in the code which are something like this:

    if ( !function_exists('set_magic_quotes') ) {
    function set_magic_quotes($value) { return true;}
    }

    i.e. they run the same code for a different function called ‘set_magic_quotes’ and the function missing in PHP7 is set_magic_quotes_runtime. So after the 3 lines above, paste this:

    if ( !function_exists('set_magic_quotes_runtime') ) {
    function set_magic_quotes_runtime($value) { return true;}
    }

    It actually doesn’t matter quite so much where it goes, so long as it’s before the actual function call to set_magic_quotes_runtime.

    I have add the code, but this did not solve the error message for me.
    I found it was another plugin that caused this on my site. Mailchimp for WordPress.

    Thanks for your help dhilditch in any case 😉

    For anyone experiencing this issue that would just like to install a plugin and be done with it, I just created one that you can install to fix this problem. https://github.com/ericnicolaas/WPCharitable-Fix-wpMandrill

    Cheers,
    Eric

    Let’s see this fixed Mandrill, comon…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Here's a bug fix for your wpMandrill for PHP 7’ is closed to new replies.