> Service slug => names of the options that switch it on. */ public function inspect(): array { $found = array(); foreach ( self::CHECKS as list( $option, $path, $slug ) ) { if ( self::is_set( get_option( $option, null ), $path ) ) { $found[ $slug ][] = $option; } } return $found; } /** * Whether a value holds something at a path. * * @param mixed $value Option value. * @param array $path Keys to follow. */ private static function is_set( $value, array $path ): bool { foreach ( $path as $key ) { if ( ! is_array( $value ) || ! isset( $value[ $key ] ) ) { return false; } $value = $value[ $key ]; } if ( is_string( $value ) ) { $value = strtolower( trim( $value ) ); } return ! in_array( $value, array( '', '0', 'no', 'off', 'false', 0, false, null, array() ), true ); } }