src/class-upgrader.php
protected function upgrade_options() {
		// Pre-0.4.0 options array to 0.5.0+ individual option entries.
		$old_options = (array) $this->options->get_store()->get( 'settings', [] );

		if ( isset( $old_options['email_address'] ) ) {
			$sanitized = sanitize_email( $old_options['email_address'] );

			if ( $sanitized ) {
				$this->options->get_store()->set( 'email_address', $old_options['email_address'] );
			}
		}

		if ( isset( $old_options['html_email'] ) && $old_options['html_email'] ) {
			$this->options->get_store()->set( 'email_type', 'html' );
		}

		if (
			isset( $old_options['ignored_plugins'] )
			&& is_array( $old_options['ignored_plugins'] )
		) {
			$ignored_plugins = $this->prepare_ignored_plugins( $old_options['ignored_plugins'] );

			if ( ! empty( $ignored_plugins ) ) {
				$this->options->get_store()->set( 'ignored_plugins', $ignored_plugins );
			}
		}

		if (
			isset( $old_options['ignored_themes'] )
			&& is_array( $old_options['ignored_themes'] )
		) {
			$ignored_themes = $this->prepare_ignored_themes( $old_options['ignored_themes'] );

			if ( ! empty( $ignored_themes ) ) {
				$this->options->get_store()->set( 'ignored_themes', $ignored_themes );
			}
		}

		// These options don't technically get set because they are the same as the
		// defaults we have defined in the options manager class...
		$this->options->get_store()->set( 'email_enabled', 'yes' );
		$this->options->get_store()->set( 'last_scan_hash', '' );
		$this->options->get_store()->set( 'should_nag', 'yes' );
		$this->options->get_store()->set( 'slack_enabled', 'no' );
		$this->options->get_store()->set( 'slack_url', '' );

		$this->options->get_store()->delete( 'settings' );
	}
protected function upgrade_options() {
		// Pre-0.4.0 options array to 0.5.0+ individual option entries.
		$old_options = (array) $this->options->get_store()->get( 'settings', [] );

		if ( isset( $old_options['email_address'] ) ) {
			$sanitized = sanitize_email( $old_options['email_address'] );

			if ( $sanitized ) {
				$this->options->get_store()->set( 'email_address', $old_options['email_address'] );
			}
		}

		if ( isset( $old_options['html_email'] ) && $old_options['html_email'] ) {
			$this->options->get_store()->set( 'email_type', 'html' );
		}

		if (
			isset( $old_options['ignored_plugins'] )
			&& is_array( $old_options['ignored_plugins'] )
		) {
			$ignored_plugins = $this->prepare_ignored_plugins( $old_options['ignored_plugins'] );

			if ( ! empty( $ignored_plugins ) ) {
				$this->options->get_store()->set( 'ignored_plugins', $ignored_plugins );
			}
		}

		if (
			isset( $old_options['ignored_themes'] )
			&& is_array( $old_options['ignored_themes'] )
		) {
			$ignored_themes = $this->prepare_ignored_themes( $old_options['ignored_themes'] );

			if ( ! empty( $ignored_themes ) ) {
				$this->options->get_store()->set( 'ignored_themes', $ignored_themes );
			}
		}

		// These options don't technically get set because they are the same as the
		// defaults we have defined in the options manager class...
		$this->options->get_store()->set( 'email_enabled', 'yes' );
		$this->options->get_store()->set( 'last_scan_hash', '' );
		$this->options->get_store()->set( 'should_nag', 'yes' );
		$this->options->get_store()->set( 'slack_enabled', 'no' );
		$this->options->get_store()->set( 'slack_url', '' );

		$this->options->get_store()->delete( 'settings' );
	}
protected function upgrade_options ( ) { // Pre-0.4.0 options array to 0.5.0+ individual option entries. $ old_options = ( array ) $ this -> options -> get_store ( ) -> get ( 'settings' , [ ] ) ; if ( isset ( $ old_options [ 'email_address' ] ) ) { $ sanitized = sanitize_email ( $ old_options [ 'email_address' ] ) ; if ( $ sanitized ) { $ this -> options -> get_store ( ) -> set ( 'email_address' , $ old_options [ 'email_address' ] ) ; } } if ( isset ( $ old_options [ 'html_email' ] ) && $ old_options [ 'html_email' ] ) { $ this -> options -> get_store ( ) -> set ( 'email_type' , 'html' ) ; } if ( isset ( $ old_options [ 'ignored_plugins' ] ) && is_array ( $ old_options [ 'ignored_plugins' ] ) ) { $ ignored_plugins = $ this -> prepare_ignored_plugins ( $ old_options [ 'ignored_plugins' ] ) ; if ( ! empty ( $ ignored_plugins ) ) { $ this -> options -> get_store ( ) -> set ( 'ignored_plugins' , $ ignored_plugins ) ; } } if ( isset ( $ old_options [ 'ignored_themes' ] ) && is_array ( $ old_options [ 'ignored_themes' ] ) ) { $ ignored_themes = $ this -> prepare_ignored_themes ( $ old_options [ 'ignored_themes' ] ) ; if ( ! empty ( $ ignored_themes ) ) { $ this -> options -> get_store ( ) -> set ( 'ignored_themes' , $ ignored_themes ) ; } } // These options don't technically get set because they are the same as the // defaults we have defined in the options manager class... $ this -> options -> get_store ( ) -> set ( 'email_enabled' , 'yes' ) ; $ this -> options -> get_store ( ) -> set ( 'last_scan_hash' , '' ) ; $ this -> options -> get_store ( ) -> set ( 'should_nag' , 'yes' ) ; $ this -> options -> get_store ( ) -> set ( 'slack_enabled' , 'no' ) ; $ this -> options -> get_store ( ) -> set ( 'slack_url' , '' ) ; $ this -> options -> get_store ( ) -> delete ( 'settings' ) ; }
Upgrade to latest options implementation.

@return void
Upgrade to latest options implementation .