0, 'dismissible' => 1, 'trigger_target' => 1, 'content_toggle' => 1, 'motion_3d' => 1, 'media_scroller' => 1, 'mailchimp_tags' => 1, 'design_library' => 1, 'cloud_catalog' => 0, 'model_registry' => 0, 'builder_bridge' => 1, 'builder_drawer_fallback' => 0, 'admin_bar_auto_hide' => 0, 'admin_bar_links' => 1, 'current_user_shortcodes' => 1, 'duplicate_content' => 0, 'commerce_utilities' => 1, 'plus_checkout' => 1, 'plus_funnel' => 1, ); } /** Defaults from Lite plus any active add-on. */ public static function defaults() { $defaults = self::core_defaults(); /** * Filter the complete Divi Powers setting defaults. * * Pro uses this public seam to register its settings without duplicating * the Lite service container or owning a second settings option. * * @param array $defaults Setting defaults. */ $defaults = apply_filters( 'divi_powers_default_settings', $defaults ); return is_array( $defaults ) ? $defaults : self::core_defaults(); } /** Feature metadata shown in Feature Manager. */ public static function feature_definitions() { $features = array( 'cloud_catalog' => array( 'icon' => '☁', 'title' => __( 'Online Design Catalog', '5d-powers-for-divi' ), 'description' => __( 'Allow requests to DiviPowers.com for additional designs and catalog updates. Catalog and preview requests disclose your server or browser IP, plugin version, and standard HTTP metadata. Bundled designs work with this off. You can withdraw consent here at any time.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'model_registry' => array( 'icon' => '↻', 'title' => __( 'Online AI Model Catalog', '5d-powers-for-divi' ), 'description' => __( 'Allow requests to DiviPowers.com for approved model information. Requests disclose your server IP and standard HTTP metadata; they do not include your API key or prompts. Built-in models work with this off. You can withdraw consent here at any time.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'ai_connection' => array( 'icon' => '✦', 'title' => __( 'Visual Builder AI', '5d-powers-for-divi' ), 'description' => __( 'Optional legacy on-site Builder AI. Connect an external assistant from AI Connection for the current workflow.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'dismissible' => array( 'icon' => '×', 'title' => __( 'Dismissible Element', '5d-powers-for-divi' ), 'description' => __( 'Let visitors close any supported Divi element and remember their choice.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'trigger_target' => array( 'icon' => '↔', 'title' => __( 'Triggers & Targets', '5d-powers-for-divi' ), 'description' => __( 'Create click-, hover-, focus-, and event-driven reveals, tooltips, popovers, modals, drawers, bottom sheets, and connected interactions with native Divi elements.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'content_toggle' => array( 'icon' => '⇄', 'title' => __( 'Content Switcher & Scroll Navigation', '5d-powers-for-divi' ), 'description' => __( 'Build A/B toggles, coordinated content groups, active one-page navigation, deep links, remembered selections, and reading progress.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'motion_3d' => array( 'icon' => '◇', 'title' => __( '3D Motion', '5d-powers-for-divi' ), 'description' => __( 'Add responsive surface tilt, viewport-follow motion, glare, and layered depth to native Divi elements without an external animation library.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'media_scroller' => array( 'icon' => '∞', 'title' => __( 'Logo & Image Scroller', '5d-powers-for-divi' ), 'description' => __( 'Turn a native Divi Row or Section into an accessible, continuously scrolling logo, image, testimonial, or content strip.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'mailchimp_tags' => array( 'icon' => '🏷', 'title' => __( 'Mailchimp Tags', '5d-powers-for-divi' ), 'description' => __( 'Apply Mailchimp tags from Divi’s native Email Optin module and update existing contacts without changing their subscription status.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'design_library' => array( 'icon' => '◈', 'title' => __( 'Design Library', '5d-powers-for-divi' ), 'description' => __( 'Insert curated native Divi 5 sections, layouts, and prewired interaction patterns with coordinated Power IDs.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'builder_bridge' => array( 'icon' => '⚡', 'title' => __( 'Visual Builder Hub', '5d-powers-for-divi' ), 'description' => __( 'Build native Divi pages and sections from written prompts, follow the ChatGPT guide for mockups, and review how 5D Powers for Divi elements are connected.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'builder_drawer_fallback' => array( 'icon' => '↪', 'title' => __( 'Builder Drawer Compatibility Fallback', '5d-powers-for-divi' ), 'description' => __( 'Show the legacy floating launcher and right-side drawer only when Divi’s native left-toolbar workspace is unavailable. Leave this off unless a future Divi update breaks the native integration.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'admin_bar_auto_hide' => array( 'icon' => '↥', 'title' => __( 'Auto-hide Admin Bar', '5d-powers-for-divi' ), 'description' => __( 'Keep the front-end WordPress toolbar tucked away until it receives hover or keyboard focus.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'admin_bar_links' => array( 'icon' => '↗', 'title' => __( 'Admin Bar Quick Links', '5d-powers-for-divi' ), 'description' => __( 'Add a compact 5D Powers for Divi menu with capability-aware links for editing, Divi tools, content, media, and duplication.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'current_user_shortcodes' => array( 'icon' => '◉', 'title' => __( 'Current User Shortcodes', '5d-powers-for-divi' ), 'description' => __( 'Display the signed-in user’s name, username, email, ID, or avatar with one safe shortcode and legacy Divi Hacks aliases.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'duplicate_content' => array( 'icon' => '⧉', 'title' => __( 'Duplicate Content', '5d-powers-for-divi' ), 'description' => __( 'Add a protected Duplicate action to Posts, Pages, and editable public custom post types.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'commerce_utilities' => array( 'icon' => '⚙', 'title' => __( 'Commerce Utilities', '5d-powers-for-divi' ), 'description' => __( 'Auto-complete eligible virtual orders, create Buy Now links, control carts and quantities, configure accounts, and apply campaign coupons.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'plus_checkout' => array( 'icon' => '◇', 'title' => __( 'Free Checkout Layouts', '5d-powers-for-divi' ), 'description' => __( 'Choose a Classic Enhanced, Modern Two-Column, or Focused Single-Column WooCommerce checkout inside a normal Divi page.', '5d-powers-for-divi' ), 'edition' => 'lite', ), 'plus_funnel' => array( 'icon' => '⇢', 'title' => __( 'Basic Funnels', '5d-powers-for-divi' ), 'description' => __( 'Launch and customize unlimited basic native Divi funnels with a connected product, checkout, thank-you page, and basic activity reporting.', '5d-powers-for-divi' ), 'edition' => 'lite', ), ); $features = apply_filters( 'divi_powers_feature_definitions', $features ); return is_array( $features ) ? $features : array(); } /** Activation routine that preserves settings created by the all-in-one alpha. */ public static function activate() { $current = get_option( self::OPTION_KEY, array() ); $current = is_array( $current ) ? $current : array(); $normalized = self::normalize_settings( $current ); update_option( self::OPTION_KEY, wp_parse_args( $normalized, self::defaults() ) ); if ( class_exists( 'Divi_Powers_Onboarding' ) ) { Divi_Powers_Onboarding::activate(); } } /** Register Lite services. Pro registers its own services through its add-on. */ public function boot() { if ( $this->booted ) { return; } $this->booted = true; ( new Divi_Powers_Admin( $this ) )->register(); ( new Divi_Powers_OpenAI() )->register(); ( new Divi_Powers_Admin_Utilities( $this ) )->register(); ( new Divi_Powers_Site_Utilities( $this ) )->register(); ( new Divi_Powers_Onboarding( $this ) )->register(); ( new Divi_Powers_Support( $this ) )->register(); if ( $this->is_power_enabled( 'builder_bridge' ) ) { ( new Divi_Powers_Power_Map( $this ) )->register(); } ( new Divi_Powers_Design_Library( $this ) )->register(); ( new Divi_Powers_Divi_Integration( $this ) )->register(); $builder_bridge = new Divi_Powers_Builder_Bridge( $this ); $builder_bridge->register(); $this->layout_tools = new Divi_Powers_Layout_Tools( $this, $builder_bridge ); $this->layout_tools->register(); if ( $this->is_power_enabled( 'ai_connection' ) ) { ( new Divi_Powers_Builder_AI( $this, $builder_bridge, $this->layout_tools ) )->register(); } ( new Divi_Powers_Mailchimp_Tags( $this ) )->register(); ( new Divi_Powers_Funnel_Meta() )->register(); // Plus is now built into the free core. Keep the old add-on operational // during migration, and let Pro own all overlapping commerce runtime. if ( ! self::is_pro_active() && ! defined( 'DIVI_POWERS_PLUS_VERSION' ) ) { ( new Divi_Powers_Free_Commerce_Utilities( $this ) )->register(); ( new Divi_Powers_Free_Checkout( $this ) )->register(); ( new Divi_Powers_Free_Funnel( $this ) )->register(); } elseif ( defined( 'DIVI_POWERS_PLUS_VERSION' ) && ! self::is_pro_active() ) { add_action( 'admin_notices', array( $this, 'legacy_plus_notice' ) ); } add_filter( 'plugin_action_links_' . plugin_basename( DIVI_POWERS_FILE ), array( $this, 'plugin_action_links' ) ); do_action( 'divi_powers_lite_ready', $this ); } /** Return the local guarded layout service for compatible add-ons. */ public function layout_tools() { return $this->layout_tools; } /** Explain the one-time cleanup without automatically changing plugins. */ public function legacy_plus_notice() { if ( ! current_user_can( 'activate_plugins' ) ) { return; } ?>

settings(); if ( 'modal_drawer' === $power ) { $power = 'trigger_target'; } if ( 'content_switcher' === $power ) { $power = 'content_toggle'; } return ! empty( $settings[ $power ] ); } /** Return enabled Power slugs. */ public function enabled_powers() { $enabled = array(); foreach ( array_keys( self::defaults() ) as $power ) { if ( $this->is_power_enabled( $power ) ) { $enabled[] = $power; } } return $enabled; } /** Whether the retired Plus add-on is still active during migration. */ public static function is_plus_active() { return (bool) apply_filters( 'divi_powers_plus_active', defined( 'DIVI_POWERS_PLUS_VERSION' ) ); } /** Whether the Pro add-on is currently active and bootable. */ public static function is_pro_active() { return (bool) apply_filters( 'divi_powers_pro_active', defined( 'DIVI_POWERS_PRO_VERSION' ) ); } /** Human-readable edition name. */ public static function product_name() { return (string) apply_filters( 'divi_powers_product_name', self::is_pro_active() ? __( '5D Powers for Divi', '5d-powers-for-divi' ) : __( '5D Powers for Divi', '5d-powers-for-divi' ) ); } /** Version label shown in the shared admin UI. */ public static function version_label() { $label = self::is_pro_active() ? sprintf( 'Free %1$s · Pro %2$s', DIVI_POWERS_VERSION, defined( 'DIVI_POWERS_PRO_VERSION' ) ? DIVI_POWERS_PRO_VERSION : '' ) : ( self::is_plus_active() ? sprintf( 'Free %1$s · Plus %2$s', DIVI_POWERS_VERSION, defined( 'DIVI_POWERS_PLUS_VERSION' ) ? DIVI_POWERS_PLUS_VERSION : '' ) : sprintf( 'Free %s', DIVI_POWERS_VERSION ) ); return (string) apply_filters( 'divi_powers_version_label', $label ); } /** Add product shortcuts on the Plugins screen. */ public function plugin_action_links( $links ) { array_unshift( $links, sprintf( '%s', esc_url( admin_url( 'admin.php?page=divi-powers' ) ), esc_html__( 'Settings', '5d-powers-for-divi' ) ) ); $links[] = sprintf( '%s', esc_url( admin_url( 'admin.php?page=divi-powers-support' ) ), esc_html__( 'Help & Support', '5d-powers-for-divi' ) ); if ( ! self::is_pro_active() ) { $links[] = sprintf( '%s', esc_url( admin_url( 'admin.php?page=divi-powers-upgrade' ) ), esc_html__( 'Free Plus Upgrade', '5d-powers-for-divi' ) ); } return $links; } }