array( 'name' => 'WooCommerce', 'category' => 'Commerce', 'description' => 'Customers, orders, payments and abandoned carts from WooCommerce, with recovery emails.', 'requires_name' => 'WooCommerce', 'requires_file' => 'woocommerce/woocommerce.php', 'plugin_file' => 'acquisitionsuite-woocommerce/acquisitionsuite-woocommerce.php', 'docs_url' => $docs . 'woocommerce-add-on/' ),
'edd' => array( 'name' => 'Easy Digital Downloads', 'category' => 'Commerce', 'description' => 'Customers and purchases from Easy Digital Downloads, including refunds and abandoned orders.', 'requires_name' => 'Easy Digital Downloads', 'requires_file' => 'easy-digital-downloads/easy-digital-downloads.php', 'plugin_file' => 'acquisitionsuite-edd/acquisitionsuite-edd.php', 'docs_url' => $docs . 'easy-digital-downloads-add-on/' ),
'onepagesale' => array( 'name' => 'OnePage Sale', 'category' => 'Commerce', 'description' => 'Orders, payments, deliveries and reviews from OnePage Sale Engine, including Pay on Delivery.', 'requires_name' => 'OnePage Sale Engine', 'requires_file' => 'onepage-sale-engine/onepage-sale-engine.php', 'plugin_file' => 'acquisitionsuite-onepagesale/acquisitionsuite-onepagesale.php', 'docs_url' => $docs . 'onepage-sale-add-on/' ),
'wpforms' => array( 'name' => 'WPForms', 'category' => 'Forms', 'description' => 'Everyone who fills in a WPForms form becomes a lead.', 'requires_name' => 'WPForms', 'requires_file' => 'wpforms-lite/wpforms.php', 'plugin_file' => 'acquisitionsuite-wpforms/acquisitionsuite-wpforms.php', 'docs_url' => $docs . 'form-plugin-add-ons/' ),
'fluentform' => array( 'name' => 'Fluent Forms', 'category' => 'Forms', 'description' => 'Everyone who fills in a Fluent Forms form becomes a lead.', 'requires_name' => 'Fluent Forms', 'requires_file' => 'fluentform/fluentform.php', 'plugin_file' => 'acquisitionsuite-fluentform/acquisitionsuite-fluentform.php', 'docs_url' => $docs . 'form-plugin-add-ons/' ),
'formidable' => array( 'name' => 'Formidable', 'category' => 'Forms', 'description' => 'Everyone who fills in a Formidable form becomes a lead.', 'requires_name' => 'Formidable Forms', 'requires_file' => 'formidable/formidable.php', 'plugin_file' => 'acquisitionsuite-formidable/acquisitionsuite-formidable.php', 'docs_url' => $docs . 'form-plugin-add-ons/' ),
'cf7' => array( 'name' => 'Contact Form 7', 'category' => 'Forms', 'description' => 'Everyone who fills in a Contact Form 7 form becomes a lead.', 'requires_name' => 'Contact Form 7', 'requires_file' => 'contact-form-7/wp-contact-form-7.php', 'plugin_file' => 'acquisitionsuite-cf7/acquisitionsuite-cf7.php', 'docs_url' => $docs . 'form-plugin-add-ons/' ),
'whatsapp' => array( 'name' => 'WhatsApp', 'category' => 'Messaging', 'description' => 'Message your leads on WhatsApp from automation rules with approved templates, and hear back when they reply.', 'requires_name' => '', 'requires_file' => '', 'plugin_file' => 'acquisitionsuite-whatsapp/acquisitionsuite-whatsapp.php', 'docs_url' => $docs . 'whatsapp-add-on/' ),
'sms' => array( 'name' => 'SMS', 'category' => 'Messaging', 'description' => 'Text your leads from automation rules with Twilio, Termii, Africa\'s Talking or Vonage, with STOP handling and quiet hours.', 'requires_name' => '', 'requires_file' => '', 'plugin_file' => 'acquisitionsuite-sms/acquisitionsuite-sms.php', 'docs_url' => $docs . 'sms-add-on/' ),
);
}
/** What the page shows. A site or another plugin can adjust it with the filter. */
public static function catalog() {
return (array) apply_filters( 'acquis_addons_page_catalog', self::bundled() );
}
// ── Page ───────────────────────────────────────────────────────────────
public static function render() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'Insufficient permissions.', 'acquisitionsuite' ), 403 );
}
// Pro draws the whole page for a licensed site.
$renderer = apply_filters( 'acquis_addons_page_renderer', null );
if ( 'pro' === self::state() && is_callable( $renderer ) ) {
call_user_func( $renderer );
return;
}
self::render_directory( self::state() );
}
private static function category_icon( $category ) {
$map = array( 'commerce' => 'dashicons-cart', 'forms' => 'dashicons-feedback', 'messaging' => 'dashicons-format-chat' );
return $map[ strtolower( (string) $category ) ] ?? 'dashicons-admin-plugins';
}
private static function plugin_active( $file ) {
return '' !== $file && is_plugin_active( $file );
}
private static function card( $slug, array $a, $state, $detected ) {
$installed = isset( get_plugins()[ $a['plugin_file'] ] );
$has_req = '' !== $a['requires_name'];
$req_on = $has_req && self::plugin_active( $a['requires_file'] );
?>