• Resolved wpwench

    (@wpwench)


    Hi, I’ve just installed the latest version of the plugin and receive a fatal error on trying to integrate this with sendinblue.

    Warning: json_decode() expects parameter 1 to be string, array given in /wp-content/plugins/mailoptin/src/connections/SendinblueConnect/Connect.php on line 166

    Fatal error: Uncaught Error: Unsupported operand types in /wp-content/plugins/mailoptin/src/connections/SendinblueConnect/ConnectSettingsPage.php:72
    Stack trace:
    #0 /wp-includes/class-wp-hook.php(287): MailOptin\SendinblueConnect\ConnectSettingsPage->connection_settings(Array)
    #1 /wp-includes/plugin.php(206): WP_Hook->apply_filters(Array, Array)
    #2 /wp-content/plugins/mailoptin/src/core/src/Admin/SettingsPage/Connections.php(160): apply_filters(‘mailoptin_conne…’, Array)
    #3 /wp-includes/class-wp-hook.php(287): MailOptin\Core\Admin\SettingsPage\Connections->settings_admin_page_callback(”)
    #4 /wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #5 /wp-includes/plugin.php(478): WP_Hook->d in /wp-content/plugins/mailoptin/src/connections/SendinblueConnect/ConnectSettingsPage.php on line 72

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wpwench

    (@wpwench)

    Just to add, wp version is 5.5, PHP version is 7.3.23, and there are only 3-4 plugins activated on this site.

    $double_optin_templates = ['' => esc_html__('Select...', 'mailoptin')] + Connect::get_instance()->get_double_optin_template();

    Looks like an error in the code where using addition (+) on an array which I confirmed by removing the array & testing with
    esc_html__('Select...', 'mailoptin') + Connect::get_instance()->get_double_optin_template();
    But of course, this brings up a Warning: A non-numeric value encountered.

    Looks like it’s connected though, because this code only runs if (true == $connected) but still surely needs to be looked at. Can’t access the page with fatal error.

    • This reply was modified 4 years, 4 months ago by wpwench.
    • This reply was modified 4 years, 4 months ago by wpwench.

    Hello, we sincerely apologize for this error you are getting.

    Can you make a little change to the plugin from the plugin editor in your dashboard?

    If you can, kindly follow these steps:

    1. Go to the plugin editor and select MailOptin.
    2. Under the plugin files section, Open this folder path: src/connections/SendinblueConnect/
    3. And click on Connect.php under the SendinblueConnect folder.
    4. Locate line 155, where you see this $double_optin_templates = [];
    5. From that line 155, replace the code from line 155 till 166 with this particular code:

    $double_optin_templates = [];
    
    if (isset($response['body']->templates) && ! empty($response['body']->templates)) {
    
       foreach ($response['body']->templates as $template) {
          $double_optin_templates[$template->id] = $template->name;
       }
    }
                
    return $double_optin_templates;

    6. Then click on the Update File Button below to effect changes. This would clear up the error.

    But if you can’t make the changes yourself, please send us a developer login to our support email ([email protected]) to assist. We would love to help.

    Let me know if this works.

    Plugin Author Collins Agbonghama

    (@collizo4sky)

    Issue resolved in the latest update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal Error Connecting with Sendinblue’ is closed to new replies.