/**
  * Sets the default values for new forms. Since it uses some WordPress functions that are not available at the time of instantiation, it has to be called in add_actions and upgrade_forms functions.
  **/
 private function set_defaults()
 {
     $this->post_types = get_post_types(array('show_ui' => true), 'names', 'and');
     $this->defaults = array();
     $this->defaults['fields'] = $this->generate_default_form_fields();
     $this->defaults['custom_field'] = array('type' => 'custom_field', 'enabled' => true, 'required' => true, 'width' => '', 'strip_tags' => 'unsafe', 'nofollow' => false, 'element' => 'input', 'choices' => '', 'fallback_value' => '', 'prefix_text' => '');
     $this->defaults['settings'] = array('no_restrictions' => wpfepp_prepare_default_role_settings(), 'instantly_publish' => wpfepp_prepare_default_role_settings(), 'width' => '', 'redirect_url' => '', 'button_color' => 'blue', 'enable_drafts' => true, 'user_emails' => true, 'admin_emails' => true, 'copyscape_enabled' => false, 'captcha_enabled' => false);
     $this->defaults['emails'] = array('user_email_subject' => __("Thank you for your contribution", 'wpfepp-plugin'), 'user_email_content' => sprintf(__("Hi %s,\n\nThank you for submitting the article '%s' at our website %s. It has been added to the queue and will be published shortly.\n\nRegards,\n%s\n%s", 'wpfepp-plugin'), "%%AUTHOR_NAME%%", "%%POST_TITLE%%", "%%SITE_NAME%%", "%%ADMIN_NAME%%", "%%SITE_URL%%"), 'admin_email_subject' => sprintf(__("A new article has been submitted on your website %s", 'wpfepp-plugin'), "%%SITE_NAME%%"), 'admin_email_content' => sprintf(__("Hi %s,\n\nA new article has been added to your website. You can view and edit all your articles here:\n\n%s\n\nRegards,\nYour web server", 'wpfepp-plugin'), "%%ADMIN_NAME%%", "%%EDIT_LINK%%"));
 }
 /**
  * Adds settings that are not currently in the database. Used when the plugin is updated.
  *
  **/
 public function update_settings()
 {
     $current_media_settings = get_option('wpfepp_media_settings', array());
     $default_media_settings = array('max_upload_size' => 500, 'own_media_only' => '1', 'allowed_media_types' => array('image' => '1', 'video' => '0', 'text' => '0', 'audio' => '0', 'office' => '0', 'open_office' => '0', 'wordperfect' => '0', 'iwork' => '0', 'misc' => '0'), 'exempt_roles' => wpfepp_prepare_default_role_settings(), 'force_allow_uploads' => '0');
     $final_media_settings = wpfepp_update_array($current_media_settings, $default_media_settings);
     update_option('wpfepp_media_settings', $final_media_settings);
     $current_post_list_settings = get_option('wpfepp_post_list_settings', array());
     $default_post_list_settings = array('post_list_page_len' => '10', 'post_list_cols' => array('link' => '1', 'edit' => '1', 'delete' => '1'), 'post_list_tabs' => array('live' => '1', 'pending' => '1', 'draft' => '1'));
     $final_post_list_settings = wpfepp_update_array($current_post_list_settings, $default_post_list_settings);
     update_option('wpfepp_post_list_settings', $final_post_list_settings);
     $current_data_settings = get_option('wpfepp_data_settings', array());
     $default_data_settings = array('delete_on_uninstall' => '0');
     $final_data_settings = wpfepp_update_array($current_data_settings, $default_data_settings);
     update_option('wpfepp_data_settings', $final_data_settings);
     $current_errors = get_option('wpfepp_errors', array());
     $default_errors = array('form' => __("There are errors in your submission. Please try again.", 'wpfepp-plugin'), 'required' => __("This field is required.", 'wpfepp-plugin'), 'min_words' => __("Please enter atleast {0} words.", 'wpfepp-plugin'), 'max_words' => __("You can't enter more than {0} words.", 'wpfepp-plugin'), 'max_links' => __("You can't enter more than {0} links.", 'wpfepp-plugin'), 'min_segments' => __("Please enter atleast {0}.", 'wpfepp-plugin'), 'max_segments' => __("You can't enter more than {0}.", 'wpfepp-plugin'), 'invalid_email' => __("Please enter a valid email address.", 'wpfepp-plugin'), 'invalid_url' => __("Please enter a valid URL.", 'wpfepp-plugin'), 'copyscape' => __("The content you have entered is not original.", 'wpfepp-plugin'));
     $final_errors = wpfepp_update_array($current_errors, $default_errors);
     update_option('wpfepp_errors', $final_errors);
     $current_email_settings = get_option('wpfepp_email_settings', array());
     $default_email_settings = array('sender_address' => "", 'sender_name' => "", 'email_format' => 'plain');
     $final_email_settings = wpfepp_update_array($current_email_settings, $default_email_settings);
     update_option('wpfepp_email_settings', $final_email_settings);
     $current_copyscape_settings = get_option('wpfepp_copyscape_settings', array());
     $default_copyscape_settings = array('username' => "", 'api_key' => "", 'block' => false, 'column_types' => wpfepp_get_post_type_settings());
     $final_copyscape_settings = wpfepp_update_array($current_copyscape_settings, $default_copyscape_settings);
     update_option('wpfepp_copyscape_settings', $final_copyscape_settings);
     $current_recaptcha_settings = get_option('wpfepp_recaptcha_settings', array());
     $default_recaptcha_settings = array('site_key' => "", 'secret' => "", 'theme' => 'light');
     $final_recaptcha_settings = wpfepp_update_array($current_recaptcha_settings, $default_recaptcha_settings);
     update_option('wpfepp_recaptcha_settings', $final_recaptcha_settings);
 }