Skip to content

Optimize Restriction Checks #98

@danieliser

Description

@danieliser

Restructure the restriction checking process to be more performant, and allow optimizing for more complex setups.

  • Check user requirements before checking content match rules. If the user is logged in with correct role, this restriction doesn't apply anyways.
  • Checking user requirements & content matching should occur in same function/method. This simplifies all calls to check if something is restricted in a controlled an optimized way. Currently they are checked separately and each place they are checked is slightly different leading to non-uniformity and difficulty in reliability
  • Refactor get_applicable_restrictions to allow filtering based on certain performant filters such as login status, protection method or other segment-able settings.
  • Priority sort should come after filtering ^^, this way results are filtered & sorted on request. When hiding/filtering content, should only receive back matches that fit that.
  • Query rules should have a way to filter them for removing/including/only global main query rules. This allows excluding main query rules from non main query posts such as search results pages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions