src/SimplePlugin.php
public function init_options() {
        if (!is_array($this->options)) {
            $this->options = array();
        }

        $options_id = $this->get_id('-options');
        $options = get_option($options_id);
        $need_update = false;

        if($options === false) {
            $need_update = true;
            $options = array();
        }

        foreach($this->options as $key => $value) {
            if(!array_key_exists($key, $options)) {
                $options[$key] = $value;
            }
        }

        if(!array_key_exists('latest_used_version', $options)) {
            $options['latest_used_version'] = $this->version;
            $need_update = true;
        }

        if($need_update === true) {
            update_option($options_id, $options);
        }

        return $options;
    }
public function init_options() {
        if (!is_array($this->options)) {
            $this->options = array();
        }

        $options_id = $this->get_id('-options');
        $options = get_option($options_id);
        $need_update = false;

        if($options === false) {
            $need_update = true;
            $options = array();
        }

        foreach($this->options as $key => $value) {
            if(!array_key_exists($key, $options)) {
                $options[$key] = $value;
            }
        }

        if(!array_key_exists('latest_used_version', $options)) {
            $options['latest_used_version'] = $this->version;
            $need_update = true;
        }

        if($need_update === true) {
            update_option($options_id, $options);
        }

        return $options;
    }
public function init_options ( ) { if ( ! is_array ( $ this -> options ) ) { $ this -> options = array ( ) ; } $ options_id = $ this -> get_id ( '-options' ) ; $ options = get_option ( $ options_id ) ; $ need_update = false ; if ( $ options === false ) { $ need_update = true ; $ options = array ( ) ; } foreach ( $ this -> options as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ options ) ) { $ options [ $ key ] = $ value ; } } if ( ! array_key_exists ( 'latest_used_version' , $ options ) ) { $ options [ 'latest_used_version' ] = $ this -> version ; $ need_update = true ; } if ( $ need_update === true ) { update_option ( $ options_id , $ options ) ; } return $ options ; }
Initialize plugin's options

@since 0.1.1
@return array
Initialize plugin s options