Skip to content

Architecture

The addon follows the WordPress Plugin Boilerplate structure: a bootstrap file, a core class that wires hooks through a loader, and separate admin and public controllers. There is no custom namespace; classes use the Reign_Wcvendors_Addon_* and Reign_WCVendors_* prefixes, and helper functions are procedural.

  • reign-wcvendors-addon.php defines constants, registers activation and deactivation hooks, and includes the EDD license file.
  • On plugins_loaded, the plugin boots only when class_exists( 'WC_Vendors' ) is true.
  • On admin_init, two guards run: one deactivates the addon and shows a notice if WC Vendors is not active, another deactivates it if the active theme is not Reign.

Reign_Wcvendors_Addon (in includes/class-reign-wcvendors-addon.php) loads dependencies, sets the locale, and defines admin and public hooks through a loader object (Reign_Wcvendors_Addon_Loader). The loader collects actions, filters, and shortcodes and registers them on run(). The shortcode registration path exists in the loader but the addon registers no shortcodes.

Text domain reign-wc-vendor-addon is loaded on init (not plugins_loaded) to avoid the WordPress 6.7+ “translation loaded too early” notice.

File Responsibility
admin/class-reign-wcvendors-addon-admin.php Theme options tab, settings save, widget and sidebar registration, hiding WC Vendors default header settings.
admin/class-reign-wcvendors-customizer-setting.php Customizer panel, sections, and fields (Reign Customizer framework).
public/class-reign-wcvendors-addon-public.php Store header rendering, default-header removal, favorites (price button, AJAX, profile tab), asset loading.
includes/reign_wc_vendors_core_functions.php Shared helper functions for store data, template location, and the free-version sales count.
includes/class-reign-wcvendors-social-helper.php Single detection point for BuddyPress, BuddyBoss, and PeepSo, and for activity and profile availability.
public/buddypress/ BuddyPress/BuddyBoss profile tabs and activity.
public/peepso/ PeepSo profile segments and activity.

The BuddyPress files load only when class_exists( 'BuddyPress' ), and the PeepSo file loads only when class_exists( 'PeepSo' ). Detection is centralized in Reign_WCVendors_Social_Helper.

The addon stores no custom tables and no custom post types. Its own data is user and post meta:

  • rwcv_my_fav_products (user meta): a customer’s favorite product IDs.
  • rwcv_fav_product_by_user (post meta): user IDs who favorited a product.

Vendor store data (name, description, icon, banner, phone, address, social, opening hours, verified and trusted flags) is read from the WC Vendors store meta keys, not written by this addon.

Surface Count
REST endpoints 0
Shortcodes registered 0
AJAX actions 1 (rwcv_mark_product_fav, logged-in only)
Blocks 0
Custom post types / taxonomies 0
Custom tables 0
Cron events 0
WP-CLI commands 0
Widgets 3
Widget areas 1
Overridden templates 1