Title: Gravityforms Options Bug
Last modified: February 28, 2025

---

# Gravityforms Options Bug

 *  Resolved [Matt Neal](https://wordpress.org/support/users/mattfromrealcoder/)
 * (@mattfromrealcoder)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/gravityforms-options-bug/)
 * G’day! I noticed in one of my forms when submitting, I was getting a critical
   error due to this plugin. I dumped the contents of the `$options` variable `get_option('
   oopspamantispam_settings')`. This is what it returns:
 *     ```wp-block-code
        array:12 [▼  "oopspam_api_key_source" => "OOPSpamDashboard"  "oopspam_api_key" => "REDACTED"  "oopspam_spam_score_threshold" => "3"  "oopspam_spam_movedspam_to_folder" => "spam"  "oopspam_clear_spam_entries" => "monthly"  "oopspam_clear_ham_entries" => "monthly"  "oopspam_is_check_for_length" => "on"  "oopspam_is_gf_activated" => "1"  "oopspam_gf_spam_message" => "Unfortunately, it looks like your message was caught by our spam filter. Please email us at info@REDACTED.com.au directly."  "oopspam_gf_content_field" => "null"  "oopspam_gf_exclude_form" => ""  "oopspam_api_key_usage" => "18602/100000"]
       ```
   
 * This part here: **`"oopspam_gf_content_field" => "null"`** is the issue. It looks
   like it’s a string “null”, so the plugin sees this and in:
 *     ```wp-block-code
       plugins/oopspam-anti-spam/integration/GravityForms.php:112
       ```
   
 * There’s this:
 *     ```wp-block-code
           if (isset($options['oopspam_gf_content_field']) && $options['oopspam_gf_content_field']) {
       ```
   
 * So that means **`oopspam_gf_content_field`** is `_string_ 'null'`, it’s both 
   set AND is truthy.
 * That then means the proceeding code within the `if` statement will run, and there’s
   a `foreach` that tries to run on `$jsonData` which is `_string _'null'`. That’s
   when we get a fatal error because it’s trying to iterate over a string instead
   of an object/array 🙂

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

 *  Plugin Author [OOPSpam Team](https://wordpress.org/support/users/oopspam/)
 * (@oopspam)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/gravityforms-options-bug/#post-18335044)
 * Hi Matt,
 * Thanks for letting us know!
 * We are about to release a new update. I’ll make sure to include a fix for this
   as well.
 * Update: 
   We were able to replicate the issue and a fix will be available in the
   next release.
    - Mike
 *  -  This reply was modified 1 year, 3 months ago by [OOPSpam Team](https://wordpress.org/support/users/oopspam/).
    -  This reply was modified 1 year, 3 months ago by [OOPSpam Team](https://wordpress.org/support/users/oopspam/).
 *  Plugin Author [OOPSpam Team](https://wordpress.org/support/users/oopspam/)
 * (@oopspam)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/gravityforms-options-bug/#post-18335698)
 * We just updated the plugin with a fix.
 * Thanks again for letting us know!

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

The topic ‘Gravityforms Options Bug’ is closed to new replies.

 * ![](https://ps.w.org/oopspam-anti-spam/assets/icon-256x256.png?rev=2655369)
 * [OOPSpam Anti-Spam: Spam Protection for WordPress Forms & Comments (No CAPTCHA)](https://wordpress.org/plugins/oopspam-anti-spam/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/oopspam-anti-spam/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/oopspam-anti-spam/)
 * [Active Topics](https://wordpress.org/support/plugin/oopspam-anti-spam/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/oopspam-anti-spam/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/oopspam-anti-spam/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [OOPSpam Team](https://wordpress.org/support/users/oopspam/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/gravityforms-options-bug/#post-18335698)
 * Status: resolved