setup(); } return $instance; } /** * Placeholder */ public function __construct() {} /** * Setup actions and filters for all things settings */ public function setup() { $current_version = get_option( 'aws_plugin_ver' ); $reindex_version = get_option( 'aws_reindex_version' ); if ( ! ( $reindex_version ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_no_index' ) ); } if ( $reindex_version && version_compare( $reindex_version, '1.16', '<' ) ) { add_action( 'admin_notices', array( $this, 'admin_notice_reindex' ) ); } if ( $current_version ) { if ( version_compare( $current_version, '1.16', '<' ) ) { $settings = get_option( 'aws_settings' ); if ( $settings ) { if ( ! isset( $settings['outofstock'] ) ) { $settings['outofstock'] = 'false'; update_option( 'aws_settings', $settings ); } } } if ( version_compare( $current_version, '1.17', '<' ) ) { $settings = get_option( 'aws_settings' ); if ( $settings ) { if ( ! isset( $settings['use_analytics'] ) ) { $settings['use_analytics'] = 'false'; update_option( 'aws_settings', $settings ); } } } if ( version_compare( $current_version, '1.21', '<' ) ) { $settings = get_option( 'aws_settings' ); if ( $settings ) { if ( ! isset( $settings['show_page'] ) ) { $settings['show_page'] = 'false'; update_option( 'aws_settings', $settings ); } } } } update_option( 'aws_plugin_ver', AWS_VERSION ); } /** * Admin notice for table first reindex */ public function admin_notice_no_index() { ?>

'.esc_html__( 'Reindex Table', 'aws' ).'' ); ?>

'.esc_html__( 'Reindex Table', 'aws' ).'' ); ?>