function json_decode($content, $assoc = false)
 {
     require_once wpgmappity_plugin_path() . 'classes/JSON.phps';
     if ($assoc) {
         $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
     } else {
         $json = new Services_JSON();
     }
     return $json->decode($content);
 }
function wpgmappity_db_version()
{
    $db_version = get_option('wpgmappity_db_version');
    $current_db_version = WPGMAPPITY_PLUGIN_CURRENT_DB;
    $is_wedged = get_option('wpgmappity_db_wedge');
    // Fix the DB's that have gotten stuck with the bad version
    // temp hack until the next db upgrade
    if (isset($db_version) && $db_version == $current_db_version && $is_wedged === false) {
        global $wpdb;
        $marker_table_name = $wpdb->prefix . "wpgmappity_markers";
        if ($wpdb->get_var("show columns from {$marker_table_name} like 'marker_image'") == false) {
            require_once wpgmappity_plugin_path() . 'wpgmappity-db-upgrade.php';
            wpgmappity_upgrade_db_from_3();
        }
        add_option("wpgmappity_db_wedge", '1');
    }
    if (isset($db_version) && $db_version != $current_db_version) {
        require_once wpgmappity_plugin_path() . 'wpgmappity-db-upgrade.php';
        switch ($db_version) {
            case '0.1':
                wpgmappity_upgrade_db_from_1();
                update_option("wpgmappity_db_version", $current_db_version);
                break;
            case '0.3':
                wpgmappity_upgrade_db_from_3();
                update_option("wpgmappity_db_version", $current_db_version);
                break;
            case '0.5':
                wpgmappity_upgrade_db_from_5();
                update_option("wpgmappity_db_version", $current_db_version);
                break;
        }
    }
}