MPSS Core Plugin
Platform Registration
The platform registration system is a key feature of the MPSS core plugin, allowing seamless integration of various e-commerce platforms. This modular approach enables easy expansion of MPSS capabilities without modifying the core code.
How Platform Registration Works
Registration Hook: MPSS provides a WordPress filter hook
mpss_add_platform
that sub-plugins use to register themselves.Sub-plugin Implementation: Each sub-plugin implements a registration function that hooks into
mpss_add_platform
.Dynamic Discovery: The MPSS core automatically discovers and loads registered platforms during runtime.
Registration Process
Sub-plugin registers itself
When MPSS initializes, it calls the mpss_add_platform filter for each known platform name.
MPSS stores the registered class name and uses it for subsequent operations.
Benefits of This Approach
- Modularity: New platforms can be added without changing the MPSS core.
- Flexibility: Platforms can be easily enabled or disabled.
- Maintainability: Each platform's code is separate, making updates easier.
- Performance: Only active platforms are loaded and processed.