get_option / wp_localize_script Not Working in OOP Plug In

The second parameter for register_setting() is the database option name which you would use with get_option() just as you’ve done successfully with the title_char_count_settings option: register_setting( 'pluginPage', 'title_char_count_settings' ) and get_option( 'title_char_count_settings' );.

So I’m guessing that you either:

  1. Made a typo in the register_setting() call in your ebay_keyword_suggest_settings_init() function:

    // You used this:
    register_setting( 'pluginPage', 'pluginPage', array($this, 'ebay_keyword_suggest_settings'));
    
    // But perhaps you meant this? (Note the option name - the second parameter)
    register_setting( 'pluginPage', 'ebay_keyword_suggest_settings', array($this, 'ebay_keyword_suggest_settings'));
    
  2. Or you made a typo in your get_option() call in your enqueue_localize() function, where you should have used get_option( 'pluginPage' ). But it’s unlikely that you would use pluginPage as the name for that option? 🙂