• Resolved sarahweb

    (@sarahweb)


    Since updating to 3.14.10 I am seeing masses of these PHP Warnings

    [21-Jul-2026 10:14:43 UTC] PHP Warning: Undefined array key “neutralize_shortcodes” in /xxx/wp-content/plugins/ninja-forms/includes/MergeTags/Other.php on line 95
    [21-Jul-2026 10:14:43 UTC] PHP Warning: Trying to access array offset on value of type null in /xxx/wp-content/plugins/ninja-forms/includes/MergeTags/Other.php on line 95

    Thank you

    Sarah

Viewing 3 replies - 1 through 3 (of 3 total)
  • Faisal Ahammad

    (@faisalahammad)

    Hi Sarah,

    I found the cause and a workaround for you.

    The warning is from a new security function added in 3.14.10. When you use PHP 8.0+, it triggers an error in the merge tags system.

    For now, here is a quick solution. Create a file named nf-fix-neutralize-shortcodes.php and upload it to /wp-content/mu-plugins/ folder. The warnings will stop right away.

    <?php
    /**
    * Plugin Name: Ninja Forms - Fix neutralize_shortcodes warning
    * Description: Fix PHP warning "Undefined array key neutralize_shortcodes" in Ninja Forms 3.14.10
    * Version: 1.0
    * Author: Faisal Ahammad
    */

    add_filter('ninja_forms_merge_tags_other', function($tags) {
    if (!isset($tags['neutralize_shortcodes'])) {
    $tags['neutralize_shortcodes'] = array(
    'id' => 'neutralize_shortcodes',
    'tag' => '{neutralize_shortcodes}',
    'callback' => 'neutralize_shortcodes',
    'value' => '',
    );
    }
    return $tags;
    });

    No activation needed from WordPress admin. Just put the file in the folder and it works.

    Let me know if you need help.

    Note for Ninja Forms developer team:

    The __call method in includes/MergeTags/Other.php line 95 does not check if the key exists before accessing it:

    return $this->merge_tags[$name]['value'];

    In PHP 8.0+, call_user_func from global scope with protected method callback (like map_deep($value, [$this, 'neutralize_shortcodes'])) triggers __call instead of a fatal error. Since neutralize_shortcodes is not a merge tag key, it throws the warning.

    Suggested fix: Add isset() guard:

    public function __call($name, $arguments)
    {
    if (isset($this->merge_tags[$name]['value'])) {
    return $this->merge_tags[$name]['value'];
    }
    return '';
    }

    Or change neutralize_shortcodes from protected to public. Same issue exists in Calcs.php:21 with calc_value.

    Best regards,
    Faisal (forum volunteer)

    Thread Starter sarahweb

    (@sarahweb)

    Thank you so much for taking the time – I will give that a go and hopefully NF will see this and make the required changes

    Plugin Support Mia

    (@xmiax)

    Hi

    Thanks for reaching out.

    As we mention at the pinned post in the top of the forum we offer support, free and paid alike, on our site. That is the fastest way to get help.

    Also please note that we do not support custom code. If you don’t let us know that you have implemented custom code when reaching out for support, your support ticket will take longer to resolve.

    Thanks

    Mia

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

You must be logged in to reply to this topic.