false, 'blocking_mode' => 'enforce', 'banner_live' => false, 'adapter_version' => CONSIVA_CONSENT_VERSION, 'last_health_at' => null, 'current_scan_id' => null, ); /** * @return array */ public static function all() { $state = get_option( self::OPTION, array() ); return array_merge( self::DEFAULTS, is_array( $state ) ? $state : array() ); } /** * @param string $key Key. * @return mixed */ public static function get( $key ) { $state = self::all(); return isset( $state[ $key ] ) ? $state[ $key ] : null; } /** * @param array $values Values to merge. * @return void */ public static function update( array $values ) { update_option( self::OPTION, array_merge( self::all(), $values ), true ); } /** * @return void */ public static function clear() { delete_option( self::OPTION ); } }