code: protected function isOptional($action)
      {
          $id = $this->getActionId($action);
          foreach ($this->optional as $pattern) {
              if (StringHelper::matchWildcard($pattern, $id)) {
                  return true;
              }
          }
  
          return false;
      }
docs: Checks, whether authentication is optional for the given action.
  
  @param Action $action action to be checked.
  @return bool whether authentication is optional or not.
  @see optional
  @since 2.0.7