• Hi,

    On the index page we are getting this warning (in french):

    Notice: La fonction WP_Scripts::localize a été appelée de fa?on incorrecte. Le paramètre $l10n doit être un tableau. Pour transmettre des données arbitraires aux scripts, utilisez plut?t la fonction wp_add_inline_script(). Veuillez lire Débogage dans WordPress (en) pour plus d’informations. (Ce message a été ajouté à la version 5.7.0.) in /data/html/wp-includes/functions.php on line 6085

    The bugfix is to replace in class-media-deduper.php, this:

    wp_localize_script( 'media-deduper-js', 'mdd_indexer_stop_nonce', wp_create_nonce( 'mdd_index_stop' ) );

    by this:

    wp_localize_script( 'media-deduper-js', 'mdd_indexer_stop_nonce', array( 'value' => wp_create_nonce( 'mdd_index_stop' ) ) );

    And in media-deduper.js use “mdd_indexer_stop_nonce.value” instead of “mdd_indexer_stop_nonce”.

    Can you include this in your next release?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter inovagora

    (@inovagora)

    (a Notice bugfix indeed, not a Warning one)

    • This reply was modified 1 month, 3 weeks ago by inovagora.
    Plugin Author cornershop

    (@cornershop)

    Thanks for reporting these warnings! We’ll fix this in the next release. We’ll probably switch to using wp_add_inline_script() instead of wp_localize_script() too, since that’s considered best practice now.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.