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
subscription / includes / Admin.php

Admin.php in Subscriptions for WooCommerce with Stripe Recurring Payments 2.0.0, at includes/Admin.php

78 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SpringDevs\Subscription;
4
5 use SpringDevs\Subscription\Admin\Dashboard;
6 use SpringDevs\Subscription\Admin\Integrations;
7 use SpringDevs\Subscription\Admin\Required;
8 use SpringDevs\Subscription\Admin\Links;
9 use SpringDevs\Subscription\Admin\CancellationFlow;
10 use SpringDevs\Subscription\Admin\Menu;
11 use SpringDevs\Subscription\Admin\Order as AdminOrder;
12 use SpringDevs\Subscription\Admin\Plans;
13 use SpringDevs\Subscription\Admin\Product;
14 use SpringDevs\Subscription\Admin\ProSettingsFields;
15 use SpringDevs\Subscription\Admin\Settings;
16 use SpringDevs\Subscription\Admin\Subscriptions;
17 use SpringDevs\Subscription\Illuminate\Comments;
18
19 /**
20 * The admin class
21 */
22 class Admin {
23
24 /**
25 * Initialize the class
26 */
27 public function __construct() {
28 $this->dispatch_actions();
29 if ( ! function_exists( 'is_plugin_active' ) ) {
30 include_once ABSPATH . 'wp-admin/includes/plugin.php';
31 }
32 // Only show required plugins notice if Pro is NOT active
33 if ( ! is_plugin_active( 'subscription-pro/subscription-pro.php' ) ) {
34 if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
35 // Show required notice only, do not load other admin content
36 new Required();
37 return;
38 } else {
39 new Required();
40 }
41 }
42 // Only load admin content if WooCommerce is active
43 if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
44 new Menu();
45 new Dashboard();
46 new Plans();
47 new CancellationFlow();
48 new Product\Plans();
49 new Integrations();
50 new Product();
51 new Subscriptions();
52 new AdminOrder();
53 new Comments();
54 new Settings();
55 new ProSettingsFields();
56 new Links();
57 }
58 }
59
60 /**
61 * Dispatch and bind actions
62 *
63 * @return void
64 */
65 public function dispatch_actions() {
66 add_action( 'save_post_product', array( $this, 'flush_gsc_cache' ) );
67 }
68
69 /**
70 * Bust the GSC product-exists cache when any product is saved.
71 *
72 * @return void
73 */
74 public function flush_gsc_cache() {
75 delete_transient( 'subscrpt_has_enabled_product' );
76 }
77 }
78