Skip to main content

PHP Framework

Vasyl MartyniukAbout 1 min

Alpha 5

This is the documentation for the AAM 7.0.0-alpha.5 release. We are actively working on the documentation that may change before stable release announcement. Join our alpha team, and as a token of appreciation for helping improve AAM, you'll receive a complimentary premium add-on!

The Advanced Access Manager (AAM) plugin includes an embedded PHP framework to help accelerate your development process.

The AAM PHP framework is the result of years of experience in developing one of the leading WordPress plugins for user-role management. It emphasizes standardization, consistency, and adherence to best practices. Drawing from our support for thousands of WordPress projects of all sizes, the AAM PHP framework can save an average of 80 hours of senior engineering work. This translates into a significant productivity boost and a marked reduction in tech debt.

The framework is designed with a few key goals in mind:

  • Efficiently store access controls, preferences, and AAM configurations in persistent data storage.
  • Consider all known relationships between WordPress core resources to resolve any access control or preference ambiguities.
  • Provide clear decisions about whether a resource or action is permitted for any user, role, or visitor.
  • Simplify the programmatic management of roles and capabilities.

It’s important to note that the AAM PHP framework does not hook into WordPress core actions or filters to restrict access to limited resources. For instance, while the Advanced Access Manager plugin prevents users from accessing certain posts or URLs outside the framework, this is not managed by the PHP framework itself.

The AAM PHP framework is structured as follows:

  • Service: A programmatic facade for managing access controls on WordPress website resources. It abstracts complexity and covers most common use cases.

  • Access Level: An abstraction representing a role, user, visitor, or default level. AAM uses these four levels in a hierarchy to propagate access controls and preferences to the current user, whether authenticated or not.

  • Resource: Another abstraction representing a WordPress resource like post, URL or backend menu. Its main role is to store settings and collaborate with services to decide if given access level has certain permissions or not.

  • Preference: Represents a container of access level (e.g. role or user) preferences like login or 404 redirect.

  • Proxy: A layer that enriches and standardizes code readability and naming conventions. For instance, when requesting a role by its slug, you receive an AAM_Framework_Proxy_Role instead of a raw WP_Role object. Proxy objects can still access core WordPress object properties if needed.

In most cases, you’ll primarily work with framework services directly.