get( 'overrides' ); $out = array(); foreach ( isset( $scan['items'] ) ? (array) $scan['items'] : array() as $id => $it ) { $cat = isset( $over[ $id ] ) ? $over[ $id ] : ( isset( $it['default'] ) ? $it['default'] : '' ); if ( 'marketing' === $cat || in_array( (string) $id, self::RECORDERS, true ) ) { $out[] = isset( $it['label'] ) ? (string) $it['label'] : (string) $id; } } return array_values( array_unique( $out ) ); } /** * Store whether the site qualifies (after each scan or setting change). * * @param Settings $settings Settings. */ public static function refresh( Settings $settings ) { $ok = self::blockers( $settings ) ? 0 : 1; if ( (int) get_option( self::FLAG, 0 ) !== $ok ) { update_option( self::FLAG, $ok, true ); } } /** * Whether US visitors skip the banner on this request. * * @param Settings $settings Settings. * @return bool */ public static function active( Settings $settings ) { return 'us_optout' === $settings->get( 'banner_mode' ) && 1 === (int) get_option( self::FLAG, 0 ); } }