Title: Error when Activating Plugn
Last modified: March 18, 2021

---

# Error when Activating Plugn

 *  [dblinks](https://wordpress.org/support/users/dblinks/)
 * (@dblinks)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugn/)
 * In the dashboard when activating Post SMTP plugin (error goes away if I deactivate).
 * Notice: WP_Scripts::localize was called incorrectly. The $l10n parameter must
   be an array. To pass arbitrary data to scripts, use the wp_add_inline_script()
   function instead. Please see Debugging in WordPress for more information. (This
   message was added in version 5.7.0.) in /var/www/vhosts/newlife.missionhamilton.
   org/httpdocs/wp-includes/functions.php on line 5313
 * And the server log:
 * 62804#0: *197015 FastCGI sent in stderr: “PHP message: PHP Notice: WP_Scripts::
   localize was called **incorrectly**. The `$l10n` parameter must be an array. 
   To pass arbitrary data to scripts, use the `wp_add_inline_script()` function 
   instead. Please see [Debugging in WordPress](https://wordpress.org/support/article/debugging-in-wordpress/)
   for more information. (This message was added in version 5.7.0.) in /var/www/
   vhosts/newlife.missionhamilton.org/httpdocs/wp-includes/functions.php on line
   5313PHP message: PHP Notice: WP_Scripts::localize was called **incorrectly**.
   The `$l10n` parameter must be an array. To pass arbitrary data to scripts, use
   the `wp_add_inline_script()` function instead.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-when-activating-plugn%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Tim](https://wordpress.org/support/users/tneville/)
 * (@tneville)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugn/#post-14213707)
 * Hi [@dblinks](https://wordpress.org/support/users/dblinks/),
 * What PHP version is your hosting running?
 * Kind Regards,
    Tim
 *  [kenrichman](https://wordpress.org/support/users/kenrichman/)
 * (@kenrichman)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugn/#post-14235083)
 * It isn’t a PHP version issue it’s an issue with WordPress 5.7
 * Find:
    wp_localize_script( ‘handle’, ‘object_name’, ‘l10n_culprit_string’ );
 * Change to:
 * wp_localize_script( ‘handle’, ‘object_name’, array( ‘l10n_culprit_string’ ) );
    -  This reply was modified 5 years, 2 months ago by [kenrichman](https://wordpress.org/support/users/kenrichman/).
    -  This reply was modified 5 years, 2 months ago by [kenrichman](https://wordpress.org/support/users/kenrichman/).
 *  Thread Starter [dblinks](https://wordpress.org/support/users/dblinks/)
 * (@dblinks)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugn/#post-14240922)
 * Php 7.4.16
 * There are 3 posts now covering this, my bad. I found the solution by adding to
   the wp-config file using debug code:
 * define( ‘WP_DEBUG’, false ); // or true if you are ACTIVELY debugging
    define(‘
   WP_DEBUG_LOG’, true ); define( ‘WP_DEBUG_DISPLAY’, false );
 * This was brought up by the author (I think) in the other post. I’ve used WP for
   12 years never seen the LOG or DISPLAY values used. Pretty cool
 * thanks!
    stu
 *  [kenrichman](https://wordpress.org/support/users/kenrichman/)
 * (@kenrichman)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/error-when-activating-plugn/#post-14240965)
 * Stu, you didn’t find the solution, you found a way to hide the problem.
 *  [Tim](https://wordpress.org/support/users/tneville/)
 * (@tneville)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-when-activating-plugn/#post-14295568)
 * Escalating to the developer [@yehudah](https://wordpress.org/support/users/yehudah/)
   for comment.
 * Kind Regards,
    Tim

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error when Activating Plugn’ is closed to new replies.

 * ![](https://ps.w.org/post-smtp/assets/icon-128x128.gif?rev=3209655)
 * [Post SMTP – Complete Email Deliverability and SMTP Solution with Email Logs, Alerts, Backup SMTP & Mobile App](https://wordpress.org/plugins/post-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/post-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-smtp/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Tim](https://wordpress.org/support/users/tneville/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/error-when-activating-plugn/#post-14295568)
 * Status: not resolved