The plugin ships two native Divi 5 modules: Affiliate Registration and Affiliate Dashboard. They are Divi 5 modules proper — registered directly against Divi’s own ModuleRegistration class, styled through its options, and visible in the builder like anything else, not an iframe or a shortcode dressed up to look like a module.
How they detect Divi 5#
Each module checks for the presence of ET\Builder\Packages\ModuleLibrary\ModuleRegistration — a class that only exists once Divi 5’s builder framework has loaded — before registering anything. On a site without Divi, or on Divi 4, that class is simply absent, the check fails, and the module registration is skipped entirely: no error, no broken menu item, nothing half-built in the builder. The plugin doesn’t need to know your Divi version in advance; it asks Divi’s own framework whether the API it needs exists, and defers to the shortcodes when the answer is no.
What they are for#
They exist so that a Divi site can lay out the registration form and the portal with the builder’s own spacing, typography and colour controls rather than fighting a shortcode inside a text module.
Registration module#
Renders the affiliate application form. Field labels, the button, the success and error states and the logged-in fallback are all builder-styled. Server-side, its render callback mounts the exact same React application the [squad_affiliate_apply] shortcode mounts — there’s no separate implementation to drift out of sync, no second copy of the validation or the submit handler. An application submitted through the module goes through the identical code path an application submitted through the shortcode does.
Dashboard module#
Renders the affiliate portal — the same mount point the [squad_affiliate_dashboard] shortcode uses. The tabs, tables and stat cards inherit the builder’s type and colour settings. Logged-out visitors get the login prompt, styled to match, rather than an empty or broken module.
Divi is optional#
The plugin works on any theme. Without Divi the two modules are simply absent from the builder — there’s no attempt to register a module Divi can’t load — and the [squad_affiliate_apply] (aliased from the older [squad_affiliate_register]) and [squad_affiliate_dashboard] shortcodes do the same job everywhere, including inside Divi, if you’d rather not use the modules even when they’re available.
Divi 4#
The modules target Divi 5’s module API specifically and do not register on Divi 4 — the class they check for doesn’t exist there. Use the shortcodes on a Divi 4 site instead; the programme itself is entirely unaffected either way, because both modules are a presentation layer sitting on top of the same registration and dashboard code the shortcodes call into, not a different feature set.
How registration actually happens#
The plugin hooks Divi’s own divi_module_library_modules_dependency_tree action rather than checking for Divi at plugin load time. That’s a real difference: the hook fires only when Divi 5’s module system is actually building its dependency tree, so the two modules simply add themselves to that tree when it exists and never run at all when it doesn’t — there’s no separate “is Divi active” check happening earlier that could disagree with what Divi itself is doing. A second hook, fired only inside Divi’s own Visual Builder and gated behind et_builder_d5_enabled(), registers the small JavaScript bundle the builder needs to render the modules’ settings panels live in the editor — that bundle is never enqueued on the front end or in a Visual Builder session running Divi 4, so there’s no unused script sitting on every page load of a site that isn’t using either module.
What’s in the visual-builder bundle#
The registered script package declares its dependencies against Divi’s own module library and hook system (divi-module-library, divi-vendor-wp-hooks), and its version is read from a build manifest generated at compile time rather than hardcoded — so a cache-busting version change happens automatically whenever the bundle itself changes, without a version number needing to be bumped by hand in the PHP that registers it.