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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i5h-3LL

HOME


5h-3LL 1.0
DIR: /srv/http/adent.cz/kvfinal.cz/wp-content/themes/Avada/includes
/srv/http/adent.cz/kvfinal.cz/wp-content/themes/Avada/includes/
Upload File:
Current File : /srv/http/adent.cz/kvfinal.cz/wp-content/themes/Avada/includes/class-avada-avadaredux-migration.php
<?php
/**
 * Handles migration from SMOF to Redux.
 *
 * @author     ThemeFusion
 * @copyright  (c) Copyright by ThemeFusion
 * @link       http://theme-fusion.com
 * @package    Avada
 * @subpackage Core
 * @since      4.0.0
 */

// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
	exit( 'Direct script access denied.' );
}

/**
 * Handle migration from SMOF to Redux.
 */
class Avada_AvadaRedux_Migration extends Avada_Migrate {

	/**
	 * Instance.
	 *
	 * @static
	 * @access public
	 * @var null|object
	 */
	public static $instance = null;


	/**
	 * The Theme Options db name.
	 *
	 * @since 5.1.0
	 * @access public
	 * @var string
	 */
	private $avada_option_name = '';

	/**
	 * Constructor.
	 *
	 * @access public
	 * @param string $avada_option_name The option-name.
	 */
	public function __construct( $avada_option_name ) {
		global $fusion_library;

		// Only run on the dashboard.
		if ( ! is_admin() ) {
			return;
		}
		// Set the version.
		$this->version = '400';
		$this->avada_option_name = $avada_option_name;

		// Set the language.
		if ( $_GET && isset( $_GET['lang'] ) ) {
			$this->lang = sanitize_text_field( wp_unslash( $_GET['lang'] ) );
		}
		if ( ! empty( $this->lang ) && ! Avada::$lang_applied ) {
			Fusion_Multilingual::set_active_language( $this->lang );
		}
		$default_old_options = get_option( 'Avada_options', array() );
		// For multilingual sites, set the language for the options.
		if ( ! in_array( $this->lang, array( '', 'en', 'all', null ) ) ) {
			$old_options = get_option( 'Avada_options_' . Fusion_Multilingual::get_active_language(), array() );
		} else {
			$old_options = $default_old_options;
		}
		$new_options = get_option( $this->avada_option_name, array() );

		// If clean install, set builder and encoding active.
		if ( empty( $old_options ) && empty( $new_options ) ) {
			update_option( 'avada_disable_builder', 1 );
			update_option( 'avada_disable_encoding', 1 );
		}

		// No need to proceed if there's no data at all to migrate.
		if ( empty( $default_old_options ) ) {
			return;
		}

		// Add migration steps for previous versions of Avada.
		parent::update_installation( true );

		// No need to proceed if the old options are empty.
		if ( empty( $old_options ) && ! Fusion_Multilingual::get_available_languages() ) {
			return;
		}
		// Redirect to the migration script if needed.
		$trigger_migration = false;
		if ( ! $_GET || ! isset( $_GET['avada_update'] ) || '1' != $_GET['avada_update'] ) {
			if ( ! empty( $old_options ) ) {
				if ( empty( $new_options ) ) {
					$trigger_migration = true;
				} else {
					// Get a record of already run migrations and determine if we should continue or not.
					$migration_run = get_option( 'avada_migrations', array() );
					if ( isset( $migration_run[ $this->version ] ) ) {
						if ( is_array( $migration_run[ $this->version ] ) ) {
							if ( isset( $migration_run[ $this->version ]['finished'] ) && true !== $migration_run[ $this->version ]['finished'] ) {
								$trigger_migration = true;
							}
							if ( isset( $migration_run[ $this->version ]['started'] ) && true !== $migration_run[ $this->version ]['started'] ) {
								$trigger_migration = true;
							}
						} else {
							$trigger_migration = true;
						}
					} else {
						$trigger_migration = true;
					}
				}
			}
		}

		if ( $trigger_migration ) {
			Avada_Upgrade::clear_twitter_widget_transients();
			wp_safe_redirect( trailingslashit( admin_url() ) . 'index.php?avada_update=1&ver=400&step=0&new=1' );
			exit;
		}

		// Define the migration steps.
		$this->steps = array(
			array(
				'callback'    => '__return_true',
				'description' => esc_html__( 'Preparing to run Upgrade', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'migrate_sliders' ),
				'description' => esc_html__( 'Slider controls', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'migrate_checkboxes' ),
				'description' => esc_html__( 'Checkbox & Switch controls', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'dimension' ),
				'description' => esc_html__( 'Dimension controls', 'Avada' ),
			),
			// Caution: social-icons migration is placed before the colors migrations.
			// We're doing this to avoid mis-sanitizations of multi-color entries.
			array(
				'callback'    => array( $this, 'social' ),
				'description' => esc_html__( 'Social Networks', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'color_alpha' ),
				'description' => esc_html__( 'HEX to RGBA colors conversion', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'color_hex' ),
				'description' => esc_html__( 'HEX colors', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'media_files' ),
				'description' => esc_html__( 'Media Files', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'spacing_1' ),
				'description' => esc_html__( 'Spacing Options', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'custom_fonts' ),
				'description' => esc_html__( 'Custom Fonts', 'Avada' ),
			),
			array(
				'callback'    => array( $this, 'typography_1' ),
				/* translators: %1$s, %2$s: Numbers. */
				'description' => sprintf( esc_html__( 'Typography Options (step %1$s of %2$s)', 'Avada' ), '1', '2' ),
			),
			array(
				'callback'    => array( $this, 'typography_2' ),
				/* translators: %1$s, %2$s: Numbers. */
				'description' => sprintf( esc_html__( 'Typography Options (step %1$s of %2$s)', 'Avada' ), '2', '2' ),
			),
			array(
				'callback'    => array( $this, 'other_options' ),
				'description' => esc_html__( 'Other Options', 'Avada' ),
			),
		);

		// Run the parent class constructor.
		parent::__construct();

		// Copy the old options to the new options for new migrations.
		if ( $_GET && isset( $_GET['new'] ) && 1 == $_GET['new'] ) {
			$migration_run = get_option( 'avada_migrations', array() );
			$migration_run[ $this->version ]['started']  = true;
			$migration_run[ $this->version ]['finished'] = false;
			if ( ! isset( $migration_run['copied'] ) ) {
				$migration_run['copied'] = false;
			}
			// Copy default options.
			$old_options = get_option( 'Avada_options', array() );
			if ( false == $migration_run['copied'] ) {
				update_option( $this->avada_option_name, $old_options );
			}
			// Check multilingual installations.
			if ( Fusion_Multilingual::get_available_languages() && false == $migration_run['copied'] ) {
				// Loop languages.
				foreach ( Fusion_Multilingual::get_available_languages() as $language ) {
					// Process secondary languages.
					// 'en' & 'all' have already been handled before we check for multilingual.
					if ( ! in_array( $language, array( '', 'en', 'all', null ) ) ) {
						// Get the old language options.
						$old_language_options = get_option( 'Avada_options_' . $language, array() );
						// If the old language options are empty, use the standard options instead.
						if ( empty( $old_language_options ) ) {
							$old_language_options = $old_options;
						}
						// Update the new language options with the old ones.
						update_option( $this->avada_option_name . '_' . $language, $old_language_options );
					}
				}
				$migration_run['copied'] = true;
			}
			update_option( 'avada_migrations', $migration_run );
		}

	}

	/**
	 * Convert checkbox values.
	 *
	 * @since 4.0.0
	 * @access public
	 */
	public function migrate_checkboxes() {
		$options = get_option( $this->avada_option_name, array() );

		// Logic switch options, from disable to enable.
		$zero_options = array(
			'blog_pn_nav',
			'post_meta_author',
			'post_meta_date',
			'post_meta_cats',
			'post_meta_comments',
			'post_meta_read',
			'post_meta_tags',
			'portfolio_pn_nav',
			'portfolio_disable_first_featured_image',
			'status_lightbox',
			'status_lightbox_single',
			'mobile_slidingbar_widgets',
			'map_pin',
			'map_scrollwheel',
			'map_scale',
			'map_zoomcontrol',
			'search_excerpt',
			'search_featured_images',
			'disable_excerpts',
			'featured_images_pages',
			'link_image_rollover',
			'zoom_image_rollover',
			'title_image_rollover',
			'cats_image_rollover',
			'icon_circle_image_rollover',
			'smooth_scrolling',
			'disable_code_block_encoding',
			'disable_megamenu',
			'avada_rev_styles',
			'avada_styles_dropdowns',
			'use_animate_css',
			'disable_mobile_animate_css',
			'disable_mobile_image_hovers',
			'status_yt',
			'status_vimeo',
			'status_gmap',
			'status_totop',
			'status_totop_mobile',
			'status_fusion_slider',
			'status_eslider',
			'status_fontawesome',
			'status_opengraph',
			'disable_date_rich_snippet_pages',
			'woocommerce_avada_ordering',
			'woocommerce_disable_crossfade_effect',
			'disable_woo_gallery',
		);

		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) && isset( $field['id'] ) && in_array( $field['type'], array( 'checkbox', 'switch', 'toggle' ) ) ) {
				$initial_value = $options[ $field['id'] ];
				if ( isset( $options[ $field['id'] ] ) ) {
					$value = $options[ $field['id'] ];
				} else {
					$value = $field['default'];
				}

				$value = ( 'yes' == strtolower( $value ) ) ? '1' : $value;
				$value = ( 'no' == strtolower( $value ) ) ? '0' : $value;

				// Take care of options in the $zero_options array.
				if ( in_array( $field['id'], $zero_options ) ) {
					$value = ( $value || '1' == $value ) ? '0' : '1';
				}
				$value = (int) $value;
				$options[ $field['id'] ] = ( $value ) ? '1' : '0';
				Avada_Migrate::generate_debug_log( array( $field['id'], $field['id'], $initial_value, $options[ $field['id'] ] ) );
			}
		}

		// Do disable_builder separately since it no longer exists in get_option_fields.
		$options['disable_builder'] = ( $options['disable_builder'] || '1' == $options['disable_builder'] ) ? '0' : '1';

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Returns an array of spacing elements to convert.
	 *
	 * @since 4.0.0
	 * @access public
	 */
	public function spacing_1() {
		$spacing_options = array(
			'logo_margin' => array(
				'top'    => 'margin_logo_top',
				'bottom' => 'margin_logo_bottom',
				'left'   => 'margin_logo_left',
				'right'  => 'margin_logo_right',
				'units'  => 'px',
			),
			'header_padding' => array(
				'top'    => 'margin_header_top',
				'bottom' => 'margin_header_bottom',
				'left'   => 'padding_header_left',
				'right'  => 'padding_header_right',
				'units'  => 'px',
			),
			'main_padding' => array(
				'top'    => 'main_top_padding',
				'bottom' => 'main_bottom_padding',
				'units'  => 'px',
			),
			'footer_area_padding' => array(
				'top'    => 'footer_area_top_padding',
				'bottom' => 'footer_area_bottom_padding',
				'left'   => 'footer_area_left_padding',
				'right'  => 'footer_area_right_padding',
				'units'  => 'px',
			),
			'copyright_padding' => array(
				'top'    => 'copyright_top_padding',
				'bottom' => 'copyright_bottom_padding',
				'units'  => 'px',
			),
			'col_margin' => array(
				'top'    => 'col_top_margin',
				'bottom' => 'col_bottom_margin',
				'units'  => 'px',
			),
			'tagline_margin' => array(
				'top'    => 'tagline_margin_top',
				'bottom' => 'tagline_margin_bottom',
				'units'  => 'px',
			),
			'title_margin' => array(
				'top'    => 'title_top_margin',
				'bottom' => 'title_bottom_margin',
				'units'  => 'px',
			),
			'content_box_margin' => array(
				'top'    => 'content_box_margin_top',
				'bottom' => 'content_box_margin_bottom',
				'units'  => 'px',
			),
		);
		$this->spacing_options( $spacing_options );
	}

	/**
	 * Returns an array of typography elements to convert.
	 *
	 * @since 4.0.0
	 * @access public
	 */
	public function typography_1() {
		$typography_options = array(
			'body_typography' => array(
				'font-family'    => array(
					'google'     => 'google_body',
					'standard'   => 'standard_body',
					'custom'     => false,
				),
				'font-size'      => 'body_font_size',
				'line-height'    => 'body_font_lh',
				'font-weight'    => 'font_weight_body',
				'color'          => 'body_text_color',
			),
			'nav_typography' => array(
				'font-family'    => array(
					'google'     => 'google_nav',
					'standard'   => 'standard_nav',
					'custom'     => true,
				),
				'font-weight'    => 'font_weight_menu',
				'letter-spacing' => 'menu_font_ls',
			),
			'h1_typography' => array(
				'font-family'    => array(
					'google'     => 'google_headings',
					'standard'   => 'standard_headings',
					'custom'     => true,
				),
				'font-size'      => 'h1_font_size',
				'line-height'    => 'h1_font_lh',
				'font-weight'    => 'font_weight_headings',
				'letter-spacing' => 'h1_font_ls',
				'color'          => 'h1_color',
				'margin-top'     => 'h1_top_margin',
				'margin-bottom'  => 'h1_bottom_margin',
				'margin-units'   => 'em',

			),
			'h2_typography' => array(
				'font-family'    => array(
					'google'     => 'google_headings',
					'standard'   => 'standard_headings',
					'custom'     => true,
				),
				'font-size'      => 'h2_font_size',
				'line-height'    => 'h2_font_lh',
				'font-weight'    => 'font_weight_headings',
				'letter-spacing' => 'h2_font_ls',
				'color'          => 'h2_color',
				'margin-top'     => 'h2_top_margin',
				'margin-bottom'  => 'h2_bottom_margin',
				'margin-units'   => 'em',
			),
			'h3_typography' => array(
				'font-family'    => array(
					'google'     => 'google_headings',
					'standard'   => 'standard_headings',
					'custom'     => true,
				),
				'font-size'      => 'h3_font_size',
				'line-height'    => 'h3_font_lh',
				'font-weight'    => 'font_weight_headings',
				'letter-spacing' => 'h3_font_ls',
				'color'          => 'h3_color',
				'margin-top'     => 'h3_top_margin',
				'margin-bottom'  => 'h3_bottom_margin',
				'margin-units'   => 'em',
			),
		);
		$this->migrate_typography_fields( $typography_options );
	}

	/**
	 * Returns an array of typography elements to convert.
	 *
	 * @since 4.0.0
	 * @access public
	 */
	public function typography_2() {
		$typography_options = array(
			'h4_typography' => array(
				'font-family'    => array(
					'google'     => 'google_headings',
					'standard'   => 'standard_headings',
					'custom'     => true,
				),
				'font-size'      => 'h4_font_size',
				'line-height'    => 'h4_font_lh',
				'font-weight'    => 'font_weight_headings',
				'letter-spacing' => 'h4_font_ls',
				'color'          => 'h4_color',
				'margin-top'     => 'h4_top_margin',
				'margin-bottom'  => 'h4_bottom_margin',
				'margin-units'   => 'em',
			),
			'h5_typography' => array(
				'font-family'    => array(
					'google'     => 'google_headings',
					'standard'   => 'standard_headings',
					'custom'     => true,
				),
				'font-size'      => 'h5_font_size',
				'line-height'    => 'h5_font_lh',
				'font-weight'    => 'font_weight_headings',
				'letter-spacing' => 'h5_font_ls',
				'color'          => 'h5_color',
				'margin-top'     => 'h5_top_margin',
				'margin-bottom'  => 'h5_bottom_margin',
				'margin-units'   => 'em',
			),
			'h6_typography' => array(
				'font-family'    => array(
					'google'     => 'google_headings',
					'standard'   => 'standard_headings',
					'custom'     => true,
				),
				'font-size'      => 'h6_font_size',
				'line-height'    => 'h6_font_lh',
				'font-weight'    => 'font_weight_headings',
				'letter-spacing' => 'h6_font_ls',
				'color'          => 'h6_color',
				'margin-top'     => 'h6_top_margin',
				'margin-bottom'  => 'h6_bottom_margin',
				'margin-units'   => 'em',
			),
			'button_typography' => array(
				'font-family'    => array(
					'google'     => 'google_button',
					'standard'   => 'standard_button',
					'custom'     => false,
				),
				'font-weight'    => 'font_weight_button',
				'letter-spacing' => 'button_font_ls',
			),
			'footer_headings_typography' => array(
				'font-family'    => array(
					'google'     => 'google_footer_headings',
					'standard'   => 'standard_footer_headings',
					'custom'     => false,
				),
				'font-size'      => 'footw_font_size',
				'font-weight'    => 'font_weight_footer_headings',
				'color'          => 'footer_headings_color',
			),
		);
		$this->migrate_typography_fields( $typography_options );
	}

	/**
	 * Migrate sliders.
	 */
	public function migrate_sliders() {
		$options = get_option( $this->avada_option_name, array() );
		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) && isset( $field['id'] ) && 'slider' == $field['type'] ) {
				$initial_value = ( isset( $options[ $field['id'] ] ) ) ? $options[ $field['id'] ] : 'UNDEFINED';

				$min  = ( isset( $field['choices'] ) && isset( $field['choices']['min'] ) ) ? intval( $field['choices']['min'] ) : 0;
				$max  = ( isset( $field['choices'] ) && isset( $field['choices']['max'] ) ) ? intval( $field['choices']['max'] ) : 100;
				$step = ( isset( $field['choices'] ) && isset( $field['choices']['step'] ) ) ? $field['choices']['step'] : 1;

				if ( isset( $options[ $field['id'] ] ) && '' != $options[ $field['id'] ] ) {
					$value = $options[ $field['id'] ];
					/**
					 * If the value does not exist, SMOF saves it as 0.
					 * We have to check if the value is empty or zero.
					 * If it is, then compare to the min value.
					 * If 0 is smaller than the min value, then set to default.
					 *
					 * The exception to the above rule is the search_results_per_page setting.
					 * If that setting is < 1, then we need to set it to the max value.
					 */
					if ( 'search_results_per_page' == $field['id'] && 1 > $value ) {
						$value = $max;
					}
					if ( ( '' == $value || 0 == $value ) && 0 < $min ) {
						if ( isset( $field['default'] ) ) {
							$value = $field['default'];
						}
					} else {
						// Limit lower & max values.
						$value = max( $min, min( $max, $options[ $field['id'] ] ) );
					}
					// Round using the step.
					if ( 1 == $step ) {
						$value = intval( $value );
					} elseif ( 1 < $step ) {
						$value = $min + ( round( ( $value - $min ) / $step ) * $step );
					} else {
						$value = $step * round( ( $value / $step ), 2 );
					}
					$options[ $field['id'] ] = $value;
				} else {
					if ( isset( $field['default'] ) ) {
						$options[ $field['id'] ] = Fusion_Sanitize::number( $field['default'] );
					}
				} // End if().
				Avada_Migrate::generate_debug_log( array( $field['id'], $field['id'], $initial_value, $options[ $field['id'] ] ) );
			} // End if().
		} // End foreach().

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Add the 'px' suffix to integers if needed.
	 */
	public function dimension() {
		$options = get_option( $this->avada_option_name, array() );
		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) && 'dimension' == $field['type'] ) {
				$initial_value = ( isset( $options[ $field['id'] ] ) ) ? $options[ $field['id'] ] : 'UNDEFINED';
				/**
				 * Convert previously integer options to strings
				 * by appending 'px' and sanitizing them.
				 * Please note that some settings use % and not px.
				 */
				if ( ! isset( $options[ $field['id'] ] ) ) {
					if ( isset( $field['default'] ) ) {
						$options[ $field['id'] ] = Fusion_Sanitize::size( $field['default'] );
					}
				}
				/**
				 * Check if the value is set to 'round'.
				 * If yes, then convert to 50%.
				 */
				$value = trim( $options[ $field['id'] ] );
				if ( 'round' == $value ) {
					$value = '50%';
				}
				$options[ $field['id'] ] = Fusion_Sanitize::size( $options[ $field['id'] ] );
				if ( empty( $options[ $field['id'] ] ) || is_null( $options[ $field['id'] ] ) ) {
					if ( isset( $field['default'] ) ) {
						$options[ $field['id'] ] = Fusion_Sanitize::size( $field['default'] );
					}
				}

				$numeric_value = Fusion_Sanitize::number( $options[ $field['id'] ] );
				if ( $numeric_value == $options[ $field['id'] ] ) {
					$percent_settings = array(
						'sidebar_width',
						'sidebar_2_1_width',
						'sidebar_2_2_width',
						'ec_sidebar_width',
						'ec_sidebar_2_1_width',
						'ec_sidebar_2_2_width',
					);
					if ( in_array( $field['id'], $percent_settings ) ) {
						$options[ $field['id'] ] = $numeric_value . '%';
					} else {
						$options[ $field['id'] ] = intval( $options[ $field['id'] ] ) . 'px';
					}
				}
				Avada_Migrate::generate_debug_log( array( $field['id'], $field['id'], $initial_value, $options[ $field['id'] ] ) );
			} // End if().
		} // End foreach().

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Color-alpha options.
	 */
	public function color_alpha() {
		$options = get_option( $this->avada_option_name, array() );
		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			/**
			 * Make sure color-alpha fields are properly formatted.
			 */
			if ( isset( $options[ $field['id'] ] ) && isset( $field['type'] ) && 'color-alpha' == $field['type'] ) {
				$initial_value = ( isset( $options[ $field['id'] ] ) ) ? $options[ $field['id'] ] : 'UNDEFINED';
				if ( ! isset( $options[ $field['id'] ] ) ) {
					$value = $field['default'];
				} elseif ( empty( $options[ $field['id'] ] ) ) {
					$to_transparent = array(
						'button_gradient_top_color',
						'button_gradient_bottom_color',
						'button_gradient_top_color_hover',
						'button_gradient_bottom_color_hover',
					);
					$value = $field['default'];
					if ( in_array( $field['id'], $to_transparent ) ) {
						$value = 'rgba(255,255,255,0)';
					}
				} else {
					$value = $options[ $field['id'] ];
				}
				// Hack for fields that used to inherit their value from the primary color.
				if ( in_array(
					$field['id'], array(
						'content_box_hover_animation_accent_color',
						'map_overlay_color',
					)
				) && '' == $value ) {
					$value = $options['primary_color'];
				}
				if ( is_array( $value ) ) {
					if ( isset( $value['rgba'] ) ) {
						$value = $value['rgba'];
					} elseif ( isset( $value['color'] ) ) {
						if ( '' == $value['color'] || 'transparent' == $value['color'] ) {
							$value = 'rgba(255,255,255,0)';
						} else {
							$opacity = 1;
							if ( isset( $value['opacity'] ) ) {
								$opacity = Fusion_Sanitize::number( $value['opacity'] );
							} elseif ( isset( $value['alpha'] ) ) {
								$opacity = Fusion_Sanitize::number( $value['alpha'] );
							}
							$color_obj = Fusion_Color::new_color( $value['color'] );
							$color_obj->alpha = $opacity;
							$value = ( 1 > $opacity ) ? $color_obj->to_css( 'rgba' ) : $value['color'];
						}
					}
				} elseif ( 'transparent' == $value || '' == $value ) {
					$value = 'rgba(255,255,255,0)';
				}
				// Make sure value is properly sanitized and then set it.
				$options[ $field['id'] ] = Fusion_Sanitize::color( $value );
				Avada_Migrate::generate_debug_log( array( $field['id'], $field['id'], $initial_value, $options[ $field['id'] ] ) );
			} // End if().
		} // End foreach().

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * HEX sanitization.
	 */
	public function color_hex() {
		$options = get_option( $this->avada_option_name, array() );
		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) ) {
				/**
				 * Make sure color fields are properly formatted.
				 */
				if ( 'color' == $field['type'] ) {
					$initial_value = ( isset( $options[ $field['id'] ] ) ) ? $options[ $field['id'] ] : 'UNDEFINED';
					if ( isset( $options[ $field['id'] ] ) ) {
						if ( ! empty( $options[ $field['id'] ] ) ) {
							$value = $options[ $field['id'] ];
							if ( is_string( $options[ $field['id'] ] ) ) {
								$value = trim( $options[ $field['id'] ] );
							}
						} else {
							$value = $field['default'];
						}
						if ( is_array( $value ) ) {
							if ( isset( $value['color'] ) ) {
								$value['color'] = ( 'transparent' == $value['color'] ) ? '#ffffff' : $value['color'];
								$options[ $field['id'] ] = Fusion_Color::new_color( $value['color'] )->to_css( 'hex' );
							}
						} else {
							$value = ( 'transparent' == $value ) ? '#ffffff' : $value;
							if ( false !== strpos( 'rgba', $value ) ) {
								$value = Fusion_Color::new_color( $value )->to_css( 'hex' );
							}
							$options[ $field['id'] ] = Fusion_Color::new_color( $value )->to_css( 'hex' );
						}
					} elseif ( isset( $field['default'] ) ) {
						$options[ $field['id'] ] = Fusion_Color::new_color( $field['default'] )->to_css( 'hex' );
					}
					Avada_Migrate::generate_debug_log( array( $field['id'], $field['id'], $initial_value, $options[ $field['id'] ] ) );
				}
			}
		}

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Media files migration.
	 */
	public function media_files() {
		$options = get_option( $this->avada_option_name, array() );
		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) ) {
				/**
				 * Make sure media fields are properly formatted.
				 */
				if ( 'media' == $field['type'] ) {
					$initial_value = ( isset( $options[ $field['id'] ] ) ) ? $options[ $field['id'] ] : 'UNDEFINED';
					if ( isset( $options[ $field['id'] ] ) ) {
						if ( ! empty( $options[ $field['id'] ] ) ) {
							$options[ $field['id'] ] = $this->single_media_file( $field );
						}
					}
					Avada_Migrate::generate_debug_log( array( $field['id'], $field['id'], $initial_value, $options[ $field['id'] ] ) );
				}
			}
		}

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );

	}

	/**
	 * A single media file.
	 *
	 * @since 4.0.0
	 * @param array $field The field array.
	 * @return array
	 */
	public function single_media_file( $field ) {
		global $wpdb;
		$options = get_option( $this->avada_option_name, array() );

		// Try to get the image from the media library.
		$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s;", $options[ $field['id'] ] ) );
		// Attachment was not found in the media library.
		// We'll have to create it ourselves.
		if ( empty( $attachment ) ) {
			// Include required files to help us import the image to the media library.
			require_once wp_normalize_path( ABSPATH . 'wp-admin/includes/media.php' );
			require_once wp_normalize_path( ABSPATH . 'wp-admin/includes/file.php' );
			require_once wp_normalize_path( ABSPATH . 'wp-admin/includes/image.php' );
			// Upload image to the media library.
			if ( is_string( $options[ $field['id'] ] ) ) {
				$new_image  = media_sideload_image( $options[ $field['id'] ], 0, '', 'src' );
				// Check that media_sideload_image did not return a WP_Error object.
				if ( ! is_wp_error( $new_image ) ) {
					$attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s;", $new_image ) );
				}
			}
		}

		$new_media = array(
			'url' => $options[ $field['id'] ],
		);

		if ( is_array( $attachment ) && isset( $attachment[0] ) ) {
			$attachment_id   = $attachment[0];
			$attachment_url  = wp_get_attachment_url( $attachment_id );
			$attachment_meta = wp_get_attachment_metadata( $attachment[0] );

			if ( ! isset( $attachment_meta['width'] ) || isset( $attachment['height'] ) ) {
				$file_path = get_attached_file( $attachment_id );
				wp_generate_attachment_metadata( $attachment_id, $file_path );
			}

			$new_media = array(
				'url' => $attachment_url,
			);
			if ( isset( $attachment_meta['width'] ) ) {
				$new_media['width'] = $attachment_meta['width'];
			}
			if ( isset( $attachment_meta['height'] ) ) {
				$new_media['height'] = $attachment_meta['height'];
			}
		}

		// Return the modified option.
		return $new_media;

	}

	/**
	 * Spacing options.
	 *
	 * @since 4.0.0
	 * @access public
	 * @param array $spacing_options The spacing options to convert.
	 * @return void
	 */
	public function spacing_options( $spacing_options = array() ) {
		$options = get_option( $this->avada_option_name, array() );
		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) ) {
				/**
				 * Convert spacing options.
				 */
				if ( isset( $field['id'] ) && array_key_exists( $field['id'], $spacing_options ) ) {
					if ( ! isset( $options[ $field['id'] ] ) ) {
						if ( isset( $field['default'] ) ) {
							$options[ $field['id'] ] = $field['default'];
						} else {
							$options[ $field['id'] ] = array();
						}
					}
					foreach ( $spacing_options[ $field['id'] ] as $direction => $old_setting ) {
						$initial_value = 'UNDEFINED';
						if ( isset( $options[ $spacing_options[ $field['id'] ][ $direction ] ] ) ) {
							// Get the previous value.
							$options[ $field['id'] ][ $direction ] = $options[ $spacing_options[ $field['id'] ][ $direction ] ];
							$initial_value = $options[ $field['id'] ][ $direction ];
							// Figure out the units we'll be using.
							$units = ( isset( $spacing_options[ $field['id'] ]['units'] ) ) ? $spacing_options[ $field['id'] ]['units'] : 'px';
							// If numeric value is the same as the whole value, then we don't have units and we'll need to add them.
							if ( Fusion_Sanitize::number( $options[ $field['id'] ][ $direction ] ) == $options[ $field['id'] ][ $direction ] ) {
								// Make sure value is not empty.
								if ( '' == trim( $options[ $field['id'] ][ $direction ] ) ) {
									$options[ $field['id'] ][ $direction ] = $field['default'][ $direction ];
								}
								// Format the value: numeric + units.
								$options[ $field['id'] ][ $direction ] = Fusion_Sanitize::number( $options[ $field['id'] ][ $direction ] ) . $units;
							}
						}
						if ( 'units' != $direction ) {
							Avada_Migrate::generate_debug_log( array( $old_setting, $field['id'] . '[' . $direction . ']', $initial_value, $options[ $field['id'] ][ $direction ] ) );
						}
					}
				}
			} // End if().
		} // End foreach().

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Migrate typography fields.
	 *
	 * @since 4.0.0
	 * @access public
	 * @param array $typography_options The typography options array.
	 * @return void
	 */
	public function migrate_typography_fields( $typography_options ) {
		global $wpdb;
		$options = get_option( $this->avada_option_name, array() );

		$is_custom_font = false;
		if ( isset( $options['custom_fonts'] ) ) {
			if ( isset( $options['custom_fonts']['woff'] ) && ! empty( $options['custom_fonts']['woff'] ) ) {
				if ( isset( $options['custom_fonts']['woff'][0] ) && isset( $options['custom_fonts']['woff'][0]['id'] ) ) {
					$is_custom_font = true;
					$woff_path = get_attached_file( $options['custom_fonts']['woff'][0]['id'] );
					$custom_font_name = str_replace( '.woff', '', basename( $woff_path ) );
					$custom_font_name = str_replace( ' ', '-', $custom_font_name );
				}
			}
		}

		// Get subsets from gfont_settings.
		$subset = false;
		if ( isset( $options['gfont_settings'] ) && ! empty( $options['gfont_settings'] ) ) {
			if ( false !== strpos( $options['gfont_settings'], 'subset' ) ) {
				$gfont_settings = wp_parse_args( $options['gfont_settings'], array() );
			} else {
				$all_subsets = Fusion_Data::font_subsets();
				$gfont_settings = array();
				foreach ( $all_subsets as $available_subset ) {
					if ( false !== strpos( $options['gfont_settings'], $available_subset ) ) {
						$gfont_settings['subset'][] = $available_subset;
					}
				}
			}
			if ( isset( $gfont_settings['subset'] ) && ! empty( $gfont_settings['subset'] ) ) {
				if ( is_array( $gfont_settings['subset'] ) ) {
					$subsets = $gfont_settings['subset'];
				} else {
					if ( false !== strpos( $gfont_settings['subset'], ',' ) ) {
						$subsets = explode( ',', $gfont_settings['subset'] );
					} else {
						$all_subsets = Fusion_Data::font_subsets();
						$subsets = array();
						foreach ( $all_subsets as $available_subset ) {
							if ( false !== strpos( $options['gfont_settings'], $available_subset ) ) {
								$subsets[] = $available_subset;
							}
						}
					}
				}

				if ( 1 < count( $subsets ) ) {
					$subset = ( 'latin' == $subsets[0] ) ? $subsets[1] : $subsets[0];
				} else {
					$subset = $subsets[0];
				}
			} else {
				$subset = ( isset( $gfont_settings['subset'] ) ) ? $gfont_settings['subset'] : false;
			}
		} // End if().
		$subset = ( 'latin' == $subset ) ? false : $subset;

		$this->fields = Avada_Options::get_option_fields();

		foreach ( $this->fields as $field ) {
			if ( isset( $field['type'] ) ) {
				/**
				 * Convert typography fields.
				 */
				if ( isset( $field['id'] ) && array_key_exists( $field['id'], $typography_options ) ) {
					$options[ $field['id'] ] = array();

					/**
					 * Font-family.
					 */
					if ( isset( $typography_options[ $field['id'] ]['font-family'] ) ) {
						if ( is_array( $typography_options[ $field['id'] ]['font-family'] ) ) {
							// Standard fonts.
							if ( isset( $typography_options[ $field['id'] ]['font-family']['standard'] ) && isset( $options[ $typography_options[ $field['id'] ]['font-family']['standard'] ] ) ) {
								if ( ! in_array( $options[ $typography_options[ $field['id'] ]['font-family']['standard'] ], array( '', 'None', 'none', 'Select Font' ) ) ) {
									$options[ $field['id'] ]['font-family'] = $options[ $typography_options[ $field['id'] ]['font-family']['standard'] ];
								} elseif ( 'body_typography' != $field['id'] && isset( $options['body_typography']['font-backup'] ) ) {
									$options[ $field['id'] ]['font-backup'] = $options['body_typography']['font-backup'];
								}
							}
							// Google fonts.
							if ( isset( $typography_options[ $field['id'] ]['font-family']['google'] ) && isset( $options[ $typography_options[ $field['id'] ]['font-family']['google'] ] ) && ! in_array( $options[ $typography_options[ $field['id'] ]['font-family']['google'] ], array( '', 'None', 'none' ) ) ) {
								$options[ $field['id'] ]['font-family'] = $options[ $typography_options[ $field['id'] ]['font-family']['google'] ];
								$options[ $field['id'] ]['google'] = 'true';
								// Use standard font as backup font.
								if ( isset( $typography_options[ $field['id'] ]['font-family']['standard'] ) && isset( $options[ $typography_options[ $field['id'] ]['font-family']['standard'] ] ) ) {
									if ( ! in_array( $options[ $typography_options[ $field['id'] ]['font-family']['standard'] ], array( '', 'None', 'none', 'Select Font' ) ) ) {
										$options[ $field['id'] ]['font-backup'] = $options[ $typography_options[ $field['id'] ]['font-family']['standard'] ];
									} else {
										$options[ $field['id'] ]['font-backup'] = 'Arial, Helvetica, sans-serif';
									}
								}
							}
							// Handle custom-fonts.
							if ( isset( $custom_font_name ) && isset( $typography_options[ $field['id'] ]['font-family']['custom'] ) && true === $typography_options[ $field['id'] ]['font-family']['custom'] && $is_custom_font ) {
								$options[ $field['id'] ]['font-family'] = $custom_font_name;
							}
						} else {
							$options[ $field['id'] ]['font-family'] = $options[ $typography_options[ $field['id'] ]['font-family'] ];
						}
					}
					/**
					 * Font-size.
					 */
					if ( isset( $typography_options[ $field['id'] ]['font-size'] ) ) {
						if ( isset( $options[ $typography_options[ $field['id'] ]['font-size'] ] ) && ! isset( $options[ $field['id'] ]['font-size'] ) ) {
							$options[ $field['id'] ]['font-size'] = $options[ $typography_options[ $field['id'] ]['font-size'] ] . 'px';
						}
					}
					/**
					 * Line-height.
					 */
					if ( isset( $typography_options[ $field['id'] ]['line-height'] ) && isset( $options[ $typography_options[ $field['id'] ]['line-height'] ] ) ) {
						$font_size   = intval( $options[ $field['id'] ]['font-size'] );
						$line_height = intval( $options[ $typography_options[ $field['id'] ]['line-height'] ] );
						if ( 4 < $line_height ) {
							$options[ $field['id'] ]['line-height'] = round( ( $line_height / $font_size ), 2 );
						}
					}
					/**
					 * Font-weight.
					 */
					if ( isset( $typography_options[ $field['id'] ]['font-weight'] ) ) {
						if ( isset( $options[ $typography_options[ $field['id'] ]['font-weight'] ] ) ) {
							$options[ $field['id'] ]['font-weight'] = (int) $options[ $typography_options[ $field['id'] ]['font-weight'] ];
						}
					}
					/**
					 * Letter-spacing.
					 */
					if ( isset( $typography_options[ $field['id'] ]['letter-spacing'] ) ) {
						if ( isset( $options[ $typography_options[ $field['id'] ]['letter-spacing'] ] ) ) {
							$options[ $field['id'] ]['letter-spacing'] = intval( $options[ $typography_options[ $field['id'] ]['letter-spacing'] ] ) . 'px';
						}
					}
					/**
					 * Color.
					 */
					if ( isset( $typography_options[ $field['id'] ]['color'] ) ) {
						if ( isset( $options[ $typography_options[ $field['id'] ]['color'] ] ) ) {
							$options[ $field['id'] ]['color'] = $options[ $typography_options[ $field['id'] ]['color'] ];
						}
					}
					/**
					 * Margin-top.
					 */
					if ( isset( $typography_options[ $field['id'] ]['margin-top'] ) ) {
						if ( isset( $options[ $typography_options[ $field['id'] ]['margin-top'] ] ) ) {
							// Get the previous value.
							$options[ $field['id'] ]['margin-top'] = $options[ $typography_options[ $field['id'] ]['margin-top'] ];
							// Figure out the units we'll be using.
							$units = ( isset( $typography_options[ $field['id'] ]['margin-units'] ) ) ? $typography_options[ $field['id'] ]['margin-units'] : 'em';
							// If numeric value is the same as the whole value, then we don't have units and we'll need to add them.
							if ( Fusion_Sanitize::number( $options[ $field['id'] ]['margin-top'] ) == $options[ $field['id'] ]['margin-top'] ) {
								// Format the value: numeric + units.
								$options[ $field['id'] ]['margin-top'] = $options[ $field['id'] ]['margin-top'] . $units;
							}
						}
					}

					/**
					 * Margin-bottom.
					 */
					if ( isset( $typography_options[ $field['id'] ]['margin-bottom'] ) ) {
						if ( isset( $options[ $typography_options[ $field['id'] ]['margin-bottom'] ] ) ) {
							// Get the previous value.
							$options[ $field['id'] ]['margin-bottom'] = $options[ $typography_options[ $field['id'] ]['margin-bottom'] ];
							// Figure out the units we'll be using.
							$units = ( isset( $typography_options[ $field['id'] ]['margin-units'] ) ) ? $typography_options[ $field['id'] ]['margin-units'] : 'em';
							// If numeric value is the same as the whole value, then we don't have units and we'll need to add them.
							if ( Fusion_Sanitize::number( $options[ $field['id'] ]['margin-bottom'] ) == $options[ $field['id'] ]['margin-bottom'] ) {
								// Format the value: numeric + units.
								$options[ $field['id'] ]['margin-bottom'] = $options[ $field['id'] ]['margin-bottom'] . $units;
							}
						}
					}

					/**
					 * Add fallbacks to default values.
					 */
					if ( isset( $all_new_fields[ $field['id'] ]['default']['font-family'] ) && ! isset( $options[ $field['id'] ]['font-family'] ) ) {
						$options[ $field['id'] ]['font-family'] = $all_new_fields[ $field['id'] ]['default']['font-family'];
					}
					if ( isset( $all_new_fields[ $field['id'] ]['default']['font-size'] ) && ! isset( $options[ $field['id'] ]['font-size'] ) ) {
						$options[ $field['id'] ]['font-size'] = $all_new_fields[ $field['id'] ]['default']['font-size'];
					}
					if ( isset( $all_new_fields[ $field['id'] ]['default']['line-height'] ) && ! isset( $options[ $field['id'] ]['line-height'] ) ) {
						$options[ $field['id'] ]['line-height'] = $all_new_fields[ $field['id'] ]['default']['line-height'];
					}
					if ( isset( $all_new_fields[ $field['id'] ]['default']['font-weight'] ) && ! isset( $options[ $field['id'] ]['font-weight'] ) ) {
						$options[ $field['id'] ]['font-weight'] = $all_new_fields[ $field['id'] ]['default']['font-weight'];
					}
					if ( isset( $all_new_fields[ $field['id'] ]['default']['letter-spacing'] ) && ! isset( $options[ $field['id'] ]['letter-spacing'] ) ) {
						$options[ $field['id'] ]['letter-spacing'] = $all_new_fields[ $field['id'] ]['default']['letter-spacing'];
					}
					if ( isset( $all_new_fields[ $field['id'] ]['default']['color'] ) && ! isset( $options[ $field['id'] ]['color'] ) ) {
						$options[ $field['id'] ]['color'] = $all_new_fields[ $field['id'] ]['default']['color'];
					}

					// Add subsets.
					if ( $subset ) {
						$options[ $field['id'] ]['subsets'] = $subset;
					}
				} // End if().
			} // End if().
		} // End foreach().

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Custom fonts.
	 */
	public function custom_fonts() {
		global $wpdb;
		$options = get_option( $this->avada_option_name, array() );
		$is_custom_font = (
			(
				( isset( $options['custom_font_woff']['url'] ) && $options['custom_font_woff']['url'] ) &&
				( isset( $options['custom_font_ttf']['url'] ) && $options['custom_font_ttf']['url'] ) &&
				( isset( $options['custom_font_svg']['url'] ) && $options['custom_font_svg']['url'] ) &&
				( isset( $options['custom_font_eot']['url'] ) && $options['custom_font_eot'] )
			) || (
				( isset( $options['custom_font_woff'] ) && $options['custom_font_woff'] ) &&
				( isset( $options['custom_font_ttf'] ) && $options['custom_font_ttf'] ) &&
				( isset( $options['custom_font_svg'] ) && $options['custom_font_svg'] ) &&
				( isset( $options['custom_font_eot'] ) && $options['custom_font_eot'] )
			)
		);
		// Convert custom fonts.
		if ( ! $is_custom_font ) {
			return;
		}
		// Get the files.
		$custom_font_woff = ( is_array( $options['custom_font_woff'] ) && isset( $options['custom_font_woff']['url'] ) ) ? $options['custom_font_woff']['url'] : $options['custom_font_woff'];
		$custom_font_ttf  = ( is_array( $options['custom_font_ttf'] ) && isset( $options['custom_font_ttf']['url'] ) ) ? $options['custom_font_ttf']['url'] : $options['custom_font_ttf'];
		$custom_font_svg  = ( is_array( $options['custom_font_svg'] ) && isset( $options['custom_font_svg']['url'] ) ) ? $options['custom_font_svg']['url'] : $options['custom_font_svg'];
		$custom_font_eot  = ( is_array( $options['custom_font_eot'] ) && isset( $options['custom_font_eot']['url'] ) ) ? $options['custom_font_eot']['url'] : $options['custom_font_eot'];
		// Get the attachment IDs.
		$attachment_woff = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s;", $custom_font_woff ) );
		$attachment_ttf  = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s;", $custom_font_ttf ) );
		$attachment_svg  = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s;", $custom_font_svg ) );
		$attachment_eot  = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid=%s;", $custom_font_eot ) );
		// Get the font name from the filename.
		$custom_font_name = 'custom-font';
		if ( is_array( $attachment_woff ) && isset( $attachment_woff[0] ) ) {
			$woff_path = get_attached_file( $attachment_woff[0] );
			$custom_font_name = str_replace( '.woff', '', basename( $woff_path ) );
			$custom_font_name = str_replace( ' ', '-', $custom_font_name );
		}

		if (
			( ! is_array( $attachment_woff ) || ! isset( $attachment_woff[0] ) ) ||
			( ! is_array( $attachment_ttf ) || ! isset( $attachment_ttf[0] ) ) ||
			( ! is_array( $attachment_svg ) || ! isset( $attachment_svg[0] ) ) ||
			( ! is_array( $attachment_eot ) || ! isset( $attachment_eot[0] ) )
		) {
			return;
		}

		$options['custom_fonts'] = array(
			'avadaredux_repeater_data' => array(
				array(
					'title' => '',
				),
			),
			'name' => array(
				$custom_font_name,
			),
			'woff' => array(
				array(
					'url'       => $custom_font_woff,
					'id'        => $attachment_woff[0],
					'height'    => '',
					'width'     => '',
					'thumbnail' => trailingslashit( includes_url() ) . 'images/media/default.png',
				),
			),
			'ttf' => array(
				array(
					'url'       => $custom_font_ttf,
					'id'        => $attachment_ttf[0],
					'height'    => '',
					'width'     => '',
					'thumbnail' => trailingslashit( includes_url() ) . 'images/media/default.png',
				),
			),
			'svg' => array(
				array(
					'url' => $custom_font_svg,
					'id'  => $attachment_svg[0],
					'height'    => '',
					'width'     => '',
					'thumbnail' => trailingslashit( includes_url() ) . 'images/media/default.png',
				),
			),
			'eot' => array(
				array(
					'url'       => $custom_font_eot,
					'id'        => $attachment_eot[0],
					'height'    => '',
					'width'     => '',
					'thumbnail' => trailingslashit( includes_url() ) . 'images/media/default.png',
				),
			),
		);

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Social networks.
	 */
	public function social() {
		$options = get_option( $this->avada_option_name, array() );
		/**
		 * Convert social-sorter control to the new format.
		 * We used to have multiple separate settings, all saved as strings.
		 * We'll be converting this to a single setting, but an array.
		 */
		$new_social = array();
		if ( isset( $options['social_sorter'] ) ) {
			/**
			 * Setting is saved as a comma-separated string with all values included.
			 */
			$values = explode( ',', $options['social_sorter'] );
			/**
			 * Get colors and determine if we want to use a different color for each social network.
			 * We'll be doing this for the following settings:
			 * footer_social_links_icon_color
			 * footer_social_links_box_color
			 * header_social_links_icon_color
			 * header_social_links_box_color
			 *
			 * The goal is to determin if we should turn on the brand-colors options.
			 */
			$footer_social_links_icon_color = isset( $options['footer_social_links_icon_color'] ) ? $options['footer_social_links_icon_color'] : '';
			$footer_social_links_box_color  = isset( $options['footer_social_links_box_color'] ) ? $options['footer_social_links_box_color'] : '';
			$header_social_links_icon_color = isset( $options['header_social_links_icon_color'] ) ? $options['header_social_links_icon_color'] : '';
			$header_social_links_box_color  = isset( $options['header_social_links_box_color'] ) ? $options['header_social_links_box_color'] : '';

			$use_brand_colors_on_footer = false;
			$use_brand_colors_on_footer = ( false !== strpos( $footer_social_links_icon_color, '|' ) ) ? true : $use_brand_colors_on_footer;
			$use_brand_colors_on_footer = ( false !== strpos( $footer_social_links_box_color, '|' ) ) ? true : $use_brand_colors_on_footer;

			$use_brand_colors_on_header = false;
			$use_brand_colors_on_header = ( false !== strpos( $header_social_links_icon_color, '|' ) ) ? true : $use_brand_colors_on_header;
			$use_brand_colors_on_header = ( false !== strpos( $header_social_links_box_color, '|' ) ) ? true : $use_brand_colors_on_header;

			$options['footer_social_links_color_type'] = ( $use_brand_colors_on_footer ) ? 'brand' : 'custom';
			$options['header_social_links_color_type'] = ( $use_brand_colors_on_header ) ? 'brand' : 'custom';

			$active_icons = array();
			// Find active acons and their colors.
			foreach ( $values as $key => $row ) {
				// Check if there's a setting with that name.
				if ( isset( $options[ $row ] ) ) {
					if ( isset( $options[ $options[ $row ] ] ) && ! empty( $options[ $options[ $row ] ] ) ) {
						$active_icons[] = $row;
					}
				}
			}

			$new_social['avadaredux_repeater_data'] = array();
			foreach ( $active_icons as $active_icon ) {
				$new_social['avadaredux_repeater_data'][] = array(
					'title' => '',
				);
			}
			// Process each row in the array separately.
			foreach ( $values as $key => $row ) {
				// Check if there's a setting with that name.
				if ( isset( $options[ $row ] ) ) {
					if ( false !== array_search( $row, $active_icons ) ) {
						$active_icon_key = array_search( $row, $active_icons );
					}
					// Check if a URL is defined for this social network.
					if ( isset( $active_icon_key ) && isset( $options[ $options[ $row ] ] ) && ! empty( $options[ $options[ $row ] ] ) ) {
						$new_social['icon'][ $active_icon_key ] = str_replace( array( 'google', 'googleplus' ), 'gplus', str_replace( '_link', '', $options[ $row ] ) );
						$new_social['url'][ $active_icon_key ]  = $options[ $options[ $row ] ];
					}
				}
			}
			/**
			 * Take care of custom Icon.
			 */
			if ( isset( $options['custom_icon_image'] ) && ! empty( $options['custom_icon_image'] ) ) {
				// Get the key for the custom icon by counting other icons.
				$custom_icon_key = count( $new_social['icon'] );
				// Set the 'avadaredux_repeater_data' for this icon.
				$new_social['avadaredux_repeater_data'][ $custom_icon_key ] = array(
					'title' => '',
				);
				// Set the icon type to custom.
				$new_social['icon'][ $custom_icon_key ] = 'custom';
				// Set the icon name.
				$new_social['custom_title'][ $custom_icon_key ] = isset( $options['custom_icon_name'] ) ? $options['custom_icon_name'] : '';
				// Set the URL.
				$new_social['url'][ $custom_icon_key ] = ( isset( $options['custom_icon_link'] ) ) ? $options['custom_icon_link'] : '';
				// Make sure color values are not unset.
				$new_social['header_box_color'][ $custom_icon_key ]  = '';
				$new_social['footer_box_color'][ $custom_icon_key ]  = '';
				// Get the image.
				// If we're using a retina image then use that instead,
				// and set the retina checkbox to 1.
				if ( isset( $options['custom_icon_image_retina'] ) && ! empty( $options['custom_icon_image_retina'] ) ) {
					$new_social['custom_source'][ $custom_icon_key ] = $this->single_media_file(
						array(
							'id' => 'custom_icon_image_retina',
						)
					);
				} else {
					$new_social['custom_source'][ $custom_icon_key ] = $this->single_media_file(
						array(
							'id' => 'custom_icon_image',
						)
					);
				}
			}
		} // End if().
		$options['social_media_icons'] = $new_social;

		/**
		 * Decide if we want to use brand colors or custom colors.
		 */
		$options['sharing_social_links_color_type'] = 'custom';
		if ( isset( $options['sharing_social_links_icon_color'] ) && false !== strpos( $options['sharing_social_links_icon_color'], '|' ) ) {
			$options['sharing_social_links_color_type'] = 'brand';
		}
		if ( isset( $options['sharing_social_links_box_color'] ) && false !== strpos( $options['sharing_social_links_box_color'], '|' ) ) {
			$options['sharing_social_links_color_type'] = 'brand';
		}

		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Various other options that don't fit anywhere else.
	 */
	public function other_options() {
		$options = get_option( $this->avada_option_name, array() );

		// Convert the "round" option to "50%".
		$round_options = array(
			'content_box_icon_circle_radius',
			'content_box_icon_circle_radius',
			'social_links_boxed_radius',
			'header_social_links_boxed_radius',
			'footer_social_links_boxed_radius',
			'sharing_social_links_boxed_radius',
			'imageframe_border_radius',
			'person_border_radius',
			'flip_boxes_border_radius',
		);
		foreach ( $round_options as $round_option ) {
			if ( isset( $options[ $round_option ] ) ) {
				$initial_value = ( isset( $options[ $round_option ] ) ) ? $options[ $round_option ] : 'UNDEFINED';
				if ( 'round' == strtolower( trim( $options[ $round_option ] ) ) ) {
					$options[ $round_option ] = '50%';
				}
				Avada_Migrate::generate_debug_log( array( $round_option, $round_option, $initial_value, $options[ $round_option ] ) );
			}
		}

		$dimensions_fields = array(
			'slider_nav_box_dimensions' => array(
				'width'  => 'slider_nav_box_width',
				'height' => 'slider_nav_box_height',
			),
			'tfes_dimensions' => array(
				'width'  => 'tfes_slider_width',
				'height' => 'tfes_slider_height',
			),
			'gmap_dimensions' => array(
				'width'  => 'gmap_width',
				'height' => 'gmap_height',
			),
			'lightbox_video_dimensions' => array(
				'width'  => 'lightbox_video_width',
				'height' => 'lightbox_video_height',
			),
		);

		$this->fields = Avada_Options::get_option_fields();

		foreach ( $dimensions_fields as $dimensions_field => $args ) {
			$initial_value_width  = 'UNDEFINED';
			$initial_value_height = 'UNDEFINED';
			$width = ( isset( $this->fields[ $dimensions_field ]['default']['width'] ) ) ? $this->fields[ $dimensions_field ]['default']['width'] : '';
			if ( isset( $options[ $args['width'] ] ) ) {
				$width = $options[ $args['width'] ];
				$initial_value_width = $width;
			}
			$height = ( isset( $this->fields[ $dimensions_field ]['default']['height'] ) ) ? $this->fields[ $dimensions_field ]['default']['height'] : '';
			if ( isset( $options[ $args['height'] ] ) ) {
				$height = $options[ $args['height'] ];
				$initial_value_height = $height;
			}
			$options[ $dimensions_field ] = array(
				'width'  => Fusion_Sanitize::size( $width ),
				'height' => Fusion_Sanitize::size( $height ),
			);
			Avada_Migrate::generate_debug_log( array( $args['width'], $dimensions_field . '[width]', $initial_value_width, $options[ $dimensions_field ]['width'] ) );
			Avada_Migrate::generate_debug_log( array( $args['height'], $dimensions_field . '[height]', $initial_value_height, $options[ $dimensions_field ]['height'] ) );
		}

		$capitalization_check_fields = array(
			'excerpt_base',
			'sidenav_behavior',
		);
		foreach ( $capitalization_check_fields as $capitalization_check_field ) {
			if ( isset( $options[ $capitalization_check_field ] ) ) {
				$initial_value = $options[ $capitalization_check_field ];
				$options[ $capitalization_check_field ] = ucfirst( $options[ $capitalization_check_field ] );
				Avada_Migrate::generate_debug_log( array( $capitalization_check_field, $capitalization_check_field, $initial_value, $options[ $capitalization_check_field ] ) );
			}
		}

		// SMOF default value is "show".
		if ( isset( $options['faq_filters'] ) && 'show' == $options['faq_filters'] ) {
			$options['faq_filters'] = 'yes';
		}

		if ( isset( $options['load_more_posts_button_bg_color'] ) ) {
			$options['blog_load_more_posts_button_bg_color'] = $options['load_more_posts_button_bg_color'];
			$options['portfolio_load_more_posts_button_bg_color'] = $options['load_more_posts_button_bg_color'];
		}

		if ( isset( $options['pagination_box_padding'] ) && ! is_array( $options['pagination_box_padding'] ) ) {
			$options['pagination_box_padding'] = trim( $options['pagination_box_padding'] );
			if ( strpos( $options['pagination_box_padding'], ' ' ) ) {
				$values = explode( ' ', $options['pagination_box_padding'] );
				$options['pagination_box_padding'] = array(
					'height' => $values[0],
					'width'  => $values[1],
				);
			} else {
				$value = $options['pagination_box_padding'];
				$options['pagination_box_padding'] = array(
					'width'  => $value,
					'height' => $value,
				);
			}
		}
		// Update the options with our modifications.
		update_option( $this->avada_option_name, $options );
	}

	/**
	 * Runs when all steps have been completed.
	 */
	public function finished() {

		// Make sure initial values are set without need to save.
		$options = get_option( $this->avada_option_name, array() );

		// Disable builder needs switched here because logic switch wont trigger earlier due option being removed.
		update_option( 'avada_disable_builder', $options['disable_builder'] );
		update_option( 'avada_disable_encoding', $options['disable_code_block_encoding'] );

		// Reset the css.
		update_option( 'fusion_dynamic_css_posts', array() );

		// Update the 'avada_migrations' option.
		$migration_run = get_option( 'avada_migrations', array() );
		$migration_run[ $this->version ]['finished'] = true;
		unset( $migration_run['copied'] );
		update_option( 'avada_migrations', $migration_run );

	}
}