OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
*/
/*
 * @todo Filter input, escape output, stop using $_POST directly
 *
 * @todo add button to submit schema
 *
 * Do we need to custom build a schema based on custom post types, etc?
 *
 */
//get the plugin settings
$s4wp_settings = s4wp_get_option('plugin_s4wp_settings');
#set defaults if not initialized
if ($s4wp_settings['s4wp_solr_initialized'] != 1) {
    $options = s4wp_initalize_options();
    $options['s4wp_index_all_sites'] = 0;
    //update existing settings from multiple option record to a single array
    //if old options exist, update to new system
    // Pretty sure we don't need any of this. Seems left over from an older version. - Cal
    $delete_option_function = 'delete_option';
    if (is_multisite()) {
        $indexall = get_site_option('s4wp_index_all_sites');
        $delete_option_function = 'delete_site_option';
    }
    //find each of the old options function
    //update our new array and delete the record.
    foreach ($options as $key => $value) {
        if ($existing = get_option($key)) {
            $options[$key] = $existing;
            $indexall = FALSE;
function s4wp_activate()
{
    // Check to see if we have  environment variables. If not, bail. If so, create the initial options.
    if ($errMessage = s4wp_sanity_check()) {
        wp_die($errMessage);
    }
    $schemaSubmit = s4wp_submit_schema();
    if (strpos($schemaSubmit, 'Error')) {
        wp_die('Submitting the schema failed with the message ' . $errorMessage);
    }
    $options = s4wp_initalize_options();
    s4wp_update_option($options);
    return;
}