PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.0.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.0.0
2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 All 61 releases
← All changes | includes/Admin/Integrations.php +329 -17 1.10.02.0.0 View file →
@@ -62,9 +62,8 @@
62 62 __( 'Integrations', 'subscription' ),
63 63 'manage_options',
64 64 'wp-subscription-integrations',
65 65 [ $this, 'render_integrations_page' ],
66 - 40
67 66 );
68 67 }
69 68
70 69 /**
@@ -100,8 +99,12 @@
100 99 'nonce' => wp_create_nonce( 'subscrpt_integration_install_nonce' ),
101 100 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
102 101 )
103 102 );
103 +
104 + // Browser-side filter rail. Enqueued on this hook, not in the render
105 + // callback, so it always loads.
106 + wp_enqueue_script( 'subscrpt-integrations-filter', SUBSCRPT_ASSETS . '/js/admin/integrations-filter.js', [], SUBSCRPT_VERSION, true );
104 107 }
105 108
106 109 /**
107 110 * Handle AJAX request for integrations.
@@ -205,12 +208,13 @@
205 208 * @return array
206 209 */
207 210 protected function get_integrations(): array {
208 211 $integrations = [
209 - [
212 + 'paypal' => [
210 213 'title' => 'PayPal',
211 - 'description' => 'Accept subscription payments via PayPal.',
212 - 'icon_url' => SUBSCRPT_ASSETS . '/images/paypal.svg',
214 + 'description' => 'Accept recurring subscription payments directly through PayPal.',
215 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/paypal.svg',
216 + 'type' => 'payment_gateway',
213 217 'is_installed' => 'on' === get_option( 'wp_subs_paypal_integration_enabled', 'off' ),
214 218 'is_active' => self::is_gateway_enabled( 'wp_subscription_paypal' ),
215 219 'supports_recurring' => true,
216 220 'actions' => [
@@ -234,12 +238,13 @@
234 238 // 'class' => 'button button-primary wp-subs-button-danger',
235 239 // ],
236 240 ],
237 241 ],
238 - [
242 + 'stripe' => [
239 243 'title' => 'Stripe',
240 244 'description' => 'Process subscription payments securely with Stripe.',
241 - 'icon_url' => 'https://ps.w.org/woocommerce-gateway-stripe/assets/icon-256x256.png',
245 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/stripe.png',
246 + 'type' => 'payment_gateway',
242 247 'is_installed' => class_exists( 'WC_Stripe' ),
243 248 'is_active' => self::is_gateway_enabled( 'stripe' ),
244 249 'supports_recurring' => true,
245 250 'actions' => [
@@ -256,12 +261,13 @@
256 261 'url' => admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe&panel=settings' ),
257 262 ],
258 263 ],
259 264 ],
260 - [
265 + 'paddle' => [
261 266 'title' => 'Paddle',
262 267 'description' => 'Process subscription payments securely with Paddle.',
263 - 'icon_url' => SUBSCRPT_ASSETS . '/images/paddle.svg',
268 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/paddle.svg',
269 + 'type' => 'payment_gateway',
264 270 'is_installed' => class_exists( 'SmartPayWoo\Gateways\Paddle\SmartPay_Paddle' ),
265 271 'is_active' => self::is_gateway_enabled( 'smartpay_paddle' ),
266 272 'supports_recurring' => true,
267 273 'actions' => [
@@ -290,10 +296,316 @@
290 296 'url' => 'https://wpsmartpay.com/paddle-for-woocommerce/',
291 297 ],
292 298 ],
293 299 ],
300 + 'mollie' => [
301 + 'title' => 'Mollie',
302 + 'description' => 'Pay for subscriptions with Mollie Payments for WooCommerce.',
303 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/mollie.png',
304 + 'type' => 'payment_gateway',
305 + 'is_pro' => true,
306 + 'is_installed' => class_exists( 'Mollie\WooCommerce\Activation\ActivationModule' ),
307 + 'is_active' => self::is_gateway_enabled( 'mollie_wc_gateway', true ),
308 + 'supports_recurring' => true,
309 + 'actions' => [
310 + [
311 + 'action' => 'install',
312 + 'label' => 'Install Now',
313 + 'type' => 'function',
314 + 'function' => "subscrptInstallPlugin(this, 'mollie-payments-for-woocommerce')",
315 + ],
316 + [
317 + 'action' => 'settings',
318 + 'label' => 'Settings',
319 + 'type' => 'link',
320 + 'url' => admin_url( 'admin.php?page=wc-settings&tab=mollie_settings' ),
321 + ],
322 + [
323 + 'label' => 'More Details',
324 + 'type' => 'external_link',
325 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-payment-with-mollie?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
326 + ],
327 + ],
328 + ],
329 + 'razorpay' => [
330 + 'title' => 'Razorpay',
331 + 'description' => 'Pay for subscriptions securely with Razorpay for WooCommerce.',
332 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/razorpay.png',
333 + 'type' => 'payment_gateway',
334 + 'is_pro' => true,
335 + 'is_beta' => true,
336 + 'is_installed' => class_exists( 'WC_Razorpay' ),
337 + 'is_active' => self::is_gateway_enabled( 'razorpay' ),
338 + 'supports_recurring' => true,
339 + 'actions' => [
340 + [
341 + 'action' => 'install',
342 + 'label' => 'Install Now',
343 + 'type' => 'function',
344 + 'function' => "subscrptInstallPlugin(this, 'woo-razorpay')",
345 + ],
346 + [
347 + 'action' => 'settings',
348 + 'label' => 'Settings',
349 + 'type' => 'link',
350 + 'url' => admin_url( 'admin.php?page=wc-settings&tab=checkout&section=razorpay' ),
351 + ],
352 + [
353 + 'label' => 'More Details',
354 + 'type' => 'external_link',
355 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-payment-with-razorpay?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
356 + ],
357 + ],
358 + ],
359 + 'xendit' => [
360 + 'title' => 'Xendit',
361 + 'description' => 'Pay for subscriptions securely with Xendit for WooCommerce.',
362 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/xendit.png',
363 + 'type' => 'payment_gateway',
364 + 'is_pro' => true,
365 + 'is_beta' => true,
366 + 'is_installed' => class_exists( 'WC_Xendit_CC' ),
367 + 'is_active' => self::is_gateway_enabled( 'xendit' ),
368 + 'supports_recurring' => true,
369 + 'actions' => [
370 + [
371 + 'action' => 'install',
372 + 'label' => 'Install Now',
373 + 'type' => 'function',
374 + 'function' => "subscrptInstallPlugin(this, 'woo-xendit-virtual-accounts')",
375 + ],
376 + [
377 + 'action' => 'settings',
378 + 'label' => 'Settings',
379 + 'type' => 'link',
380 + 'url' => admin_url( 'admin.php?page=wc-settings&tab=checkout&section=xendit_gateway' ),
381 + ],
382 + [
383 + 'label' => 'More Details',
384 + 'type' => 'external_link',
385 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-payment-with-xendit?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
386 + ],
387 + ],
388 + ],
294 389 ];
295 390
391 + // Third-party integrations (requires Pro plugin to function).
392 + $third_party = [
393 + // LMS.
394 + 'tutor_lms' => [
395 + 'title' => 'Tutor LMS',
396 + 'description' => 'Restrict course access based on subscription status. Enroll and unenroll students automatically.',
397 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/tutor-lms.jpeg',
398 + 'type' => 'third_party',
399 + 'is_pro' => true,
400 + 'category' => 'lms',
401 + 'is_installed' => is_plugin_active( 'tutor/tutor.php' ) && class_exists( 'TUTOR\Tutor' ),
402 + 'is_active' => is_plugin_active( 'tutor/tutor.php' ) && class_exists( 'TUTOR\Tutor' ),
403 + 'actions' => [
404 + [
405 + 'action' => 'install',
406 + 'label' => __( 'Install Now', 'subscription' ),
407 + 'type' => 'function',
408 + 'function' => "subscrptInstallPlugin(this, 'tutor')",
409 + ],
410 + [
411 + 'label' => __( 'Learn More', 'subscription' ),
412 + 'type' => 'external_link',
413 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-tutor-lms?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
414 + ],
415 + ],
416 + ],
417 + 'learnpress' => [
418 + 'title' => 'LearnPress',
419 + 'description' => 'Connect subscriptions with LearnPress courses. Enroll users automatically when subscriptions are active.',
420 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/learnpress.png',
421 + 'type' => 'third_party',
422 + 'is_pro' => true,
423 + 'category' => 'lms',
424 + 'is_installed' => is_plugin_active( 'learnpress/learnpress.php' ) && class_exists( 'LearnPress' ),
425 + 'is_active' => is_plugin_active( 'learnpress/learnpress.php' ) && class_exists( 'LearnPress' ),
426 + 'actions' => [
427 + [
428 + 'action' => 'install',
429 + 'label' => __( 'Install Now', 'subscription' ),
430 + 'type' => 'function',
431 + 'function' => "subscrptInstallPlugin(this, 'learnpress')",
432 + ],
433 + [
434 + 'label' => __( 'Learn More', 'subscription' ),
435 + 'type' => 'external_link',
436 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-learnpress-lms?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
437 + ],
438 + ],
439 + ],
440 + 'learndash' => [
441 + 'title' => 'LearnDash',
442 + 'description' => 'Sync subscription status with LearnDash group enrollment and course access.',
443 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/learndash.jpeg',
444 + 'type' => 'third_party',
445 + 'is_pro' => true,
446 + 'category' => 'lms',
447 + 'is_installed' => is_plugin_active( 'sfwd-lms/sfwd_lms.php' ) && class_exists( 'LearnDash\Core\App' ),
448 + 'is_active' => is_plugin_active( 'sfwd-lms/sfwd_lms.php' ) && class_exists( 'LearnDash\Core\App' ),
449 + 'actions' => [
450 + [
451 + 'action' => 'install',
452 + 'label' => __( 'Get LearnDash', 'subscription' ),
453 + 'type' => 'external_link',
454 + 'url' => 'https://www.learndash.com/',
455 + ],
456 + [
457 + 'label' => __( 'Learn More', 'subscription' ),
458 + 'type' => 'external_link',
459 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-learndash-lms?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
460 + ],
461 + ],
462 + ],
463 + // CRM.
464 + 'fluentcrm' => [
465 + 'title' => 'FluentCRM',
466 + 'description' => 'Trigger email sequences and manage contacts based on subscription events and status changes.',
467 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/fluentcrm.png',
468 + 'type' => 'third_party',
469 + 'is_pro' => true,
470 + 'category' => 'crm',
471 + 'is_installed' => class_exists( 'FluentCrm\App\Services\Funnel\BaseTrigger' ),
472 + 'is_active' => class_exists( 'FluentCrm\App\Services\Funnel\BaseTrigger' ),
473 + 'actions' => [
474 + [
475 + 'action' => 'install',
476 + 'label' => __( 'Install Now', 'subscription' ),
477 + 'type' => 'function',
478 + 'function' => "subscrptInstallPlugin(this, 'fluent-crm')",
479 + ],
480 + [
481 + 'label' => __( 'Learn More', 'subscription' ),
482 + 'type' => 'external_link',
483 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-fluent-crm?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
484 + ],
485 + ],
486 + ],
487 + // Automation.
488 + 'automatorwp' => [
489 + 'title' => 'AutomatorWP',
490 + 'description' => 'Build powerful automations triggered by subscription events without writing any code.',
491 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/automatorwp.png',
492 + 'type' => 'third_party',
493 + 'is_pro' => true,
494 + 'category' => 'automation',
495 + 'is_installed' => is_plugin_active( 'automatorwp/automatorwp.php' ) && class_exists( 'AutomatorWP' ),
496 + 'is_active' => is_plugin_active( 'automatorwp/automatorwp.php' ) && class_exists( 'AutomatorWP' ),
497 + 'actions' => [
498 + [
499 + 'action' => 'install',
500 + 'label' => __( 'Install Now', 'subscription' ),
501 + 'type' => 'function',
502 + 'function' => "subscrptInstallPlugin(this, 'automatorwp')",
503 + ],
504 + // [
505 + // 'label' => __( 'Learn More', 'subscription' ),
506 + // 'type' => 'external_link',
507 + // 'url' => 'https://docs.wpsubscription.co/en/',
508 + // ],
509 + ],
510 + ],
511 + 'wpfusion' => [
512 + 'title' => 'WP Fusion',
513 + 'description' => 'Sync subscription data with your CRM and marketing platforms through WP Fusion.',
514 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/wp-fusion.png',
515 + 'type' => 'third_party',
516 + 'is_pro' => true,
517 + 'category' => 'automation',
518 + 'is_installed' => class_exists( 'WPF_Integrations_Base' ),
519 + 'is_active' => class_exists( 'WPF_Integrations_Base' ),
520 + 'actions' => [
521 + [
522 + 'action' => 'install',
523 + 'label' => __( 'Get WP Fusion', 'subscription' ),
524 + 'type' => 'external_link',
525 + 'url' => 'https://wpfusion.com/',
526 + ],
527 + // [
528 + // 'label' => __( 'Learn More', 'subscription' ),
529 + // 'type' => 'external_link',
530 + // 'url' => 'https://docs.wpsubscription.co/en/',
531 + // ],
532 + ],
533 + ],
534 + // Email Marketing.
535 + 'mailpoet' => [
536 + 'title' => 'MailPoet',
537 + 'description' => 'Add subscribers to MailPoet lists and trigger email automations based on subscription lifecycle events.',
538 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/mailpoet.png',
539 + 'type' => 'third_party',
540 + 'is_pro' => true,
541 + 'category' => 'email',
542 + 'is_installed' => is_plugin_active( 'mailpoet/mailpoet.php' ) || is_plugin_active( 'mailpoet-premium/mailpoet-premium.php' ),
543 + 'is_active' => is_plugin_active( 'mailpoet/mailpoet.php' ) || is_plugin_active( 'mailpoet-premium/mailpoet-premium.php' ),
544 + 'actions' => [
545 + [
546 + 'action' => 'install',
547 + 'label' => __( 'Install Now', 'subscription' ),
548 + 'type' => 'function',
549 + 'function' => "subscrptInstallPlugin(this, 'mailpoet')",
550 + ],
551 + [
552 + 'label' => __( 'Learn More', 'subscription' ),
553 + 'type' => 'external_link',
554 + 'url' => 'https://docs.wpsubscription.co/en/wpsubscription-mailpoet?utm_source=plugin&utm_medium=admin&utm_campaign=docs',
555 + ],
556 + ],
557 + ],
558 + // License Management.
559 + 'wp_soft_lic' => [
560 + 'title' => 'WP Software License',
561 + 'description' => 'Issue and validate software licenses for subscription-based digital products.',
562 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/wp-software-license.png',
563 + 'type' => 'third_party',
564 + 'is_pro' => true,
565 + 'category' => 'license',
566 + 'is_installed' => is_plugin_active( 'software-license/software-license.php' ) && class_exists( 'WOO_SL' ),
567 + 'is_active' => is_plugin_active( 'software-license/software-license.php' ) && class_exists( 'WOO_SL' ),
568 + 'actions' => [
569 + [
570 + 'action' => 'install',
571 + 'label' => __( 'Get Plugin', 'subscription' ),
572 + 'type' => 'external_link',
573 + 'url' => 'https://wpsoftwarelicense.com/',
574 + ],
575 + // [
576 + // 'label' => __( 'Learn More', 'subscription' ),
577 + // 'type' => 'external_link',
578 + // 'url' => 'https://docs.wpsubscription.co/en/',
579 + // ],
580 + ],
581 + ],
582 + 'license_mgr' => [
583 + 'title' => 'License Manager for WooCommerce',
584 + 'description' => 'Generate and manage software license keys that are automatically tied to active subscriptions.',
585 + 'icon_url' => SUBSCRPT_ASSETS . '/images/integrations/license-manager.png',
586 + 'type' => 'third_party',
587 + 'is_pro' => true,
588 + 'category' => 'license',
589 + 'is_installed' => is_plugin_active( 'license-manager-for-woocommerce/license-manager-for-woocommerce.php' ) && class_exists( 'LicenseManagerForWooCommerce\Models\Resources\License' ),
590 + 'is_active' => is_plugin_active( 'license-manager-for-woocommerce/license-manager-for-woocommerce.php' ) && class_exists( 'LicenseManagerForWooCommerce\Models\Resources\License' ),
591 + 'actions' => [
592 + [
593 + 'action' => 'install',
594 + 'label' => __( 'Install Now', 'subscription' ),
595 + 'type' => 'function',
596 + 'function' => "subscrptInstallPlugin(this, 'license-manager-for-woocommerce')",
597 + ],
598 + // [
599 + // 'label' => __( 'Learn More', 'subscription' ),
600 + // 'type' => 'external_link',
601 + // 'url' => 'https://docs.wpsubscription.co/en/',
602 + // ],
603 + ],
604 + ],
605 + ];
606 + $integrations = array_merge( $integrations, $third_party );
607 +
296 608 // Add more integrations as needed.
297 609 $integrations = apply_filters( 'wpsubs_integrations', $integrations );
298 610
299 611 return $integrations;
@@ -310,9 +622,10 @@
310 622 foreach ( $integrations as $integration ) {
311 623 $is_installed = $integration['is_installed'] ?? false;
312 624 $is_active = $integration['is_active'] ?? false;
313 625
314 - $cleaned_actions = [];
626 + $cleaned_actions = [];
627 + $shown_install_url = null;
315 628
316 629 foreach ( $integration['actions'] as $integration_action ) {
317 630 $action_tag = $integration_action['action'] ?? null;
318 631
@@ -318,8 +631,9 @@
318 631
319 632 if ( 'install' === $action_tag ) {
320 633 if ( ! $is_installed ) {
321 634 $cleaned_actions[] = $integration_action;
635 + $shown_install_url = $integration_action['url'] ?? null;
322 636 }
323 637 continue;
324 638 }
325 639 if ( 'uninstall' === $action_tag ) {
@@ -340,9 +654,14 @@
340 654 }
341 655 continue;
342 656 }
343 657
344 - // Default.
658 + // Default. Skip a "More Details"-style link that just repeats the
659 + // install/"Get X" link already shown (e.g. Paddle), so the card
660 + // does not carry the same URL twice.
661 + if ( null !== $shown_install_url && ( $integration_action['url'] ?? null ) === $shown_install_url ) {
662 + continue;
663 + }
345 664 $cleaned_actions[] = $integration_action;
346 665 }
347 666
348 667 // Overwrite.
@@ -356,17 +675,10 @@
356 675 /**
357 676 * Render the Integrations admin page.
358 677 */
359 678 public function render_integrations_page() {
360 - if ( ! empty( $_GET['subscrpt_installed'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
361 - echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__( 'Plugin installed and activated successfully.', 'subscription' ) . '</p></div>';
362 - }
363 -
364 679 $integrations = $this->integrations;
365 680 $integrations = $this->filter_integration_actions( $integrations );
366 -
367 - // Integrations styles.
368 - // wp_enqueue_style( 'wp-subs-integration-settings', SUBSCRPT_ASSETS . '/css/integration_settings.css', [], SUBSCRPT_VERSION, 'all' );
369 681
370 682 $menu = new \SpringDevs\Subscription\Admin\Menu();
371 683 $menu->render_admin_header( __( 'Integrations', 'subscription' ) );
372 684 include 'views/integrations.php';