[ 'lastActiveVersion' => [ 'type' => 'string', 'default' => '0.0' ] ] // phpcs:enable WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound ]; /** * The Construct method. * * @since 1.0.6 * * @param string $optionsName An array of options. */ public function __construct( $optionsName = 'aioseo_index_now_options_internal' ) { $this->optionsName = $optionsName; $this->init(); add_action( 'shutdown', [ $this, 'save' ] ); } /** * Initializes the options. * * @since 1.0.6 * * @return void */ protected function init() { // Options from the DB. $dbOptions = json_decode( get_option( $this->optionsName ), true ); if ( empty( $dbOptions ) ) { $dbOptions = []; } // Refactor options. $this->defaultsMerged = array_replace_recursive( $this->defaults, $this->defaultsMerged ); $options = array_replace_recursive( $this->defaultsMerged, $this->addValueToValuesArray( $this->defaultsMerged, $dbOptions ) ); aioseo()->core->optionsCache->setOptions( $this->optionsName, apply_filters( 'aioseo_get_index_now_options_internal', $options ) ); } }