| @@ -1,13 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace SpringDevs\Subscription; |
| 4 | 4 | |
| 5 | +use SpringDevs\Subscription\Admin\Dashboard; | |
| 6 | +use SpringDevs\Subscription\Admin\Integrations; | |
| 5 | 7 | use SpringDevs\Subscription\Admin\Required; |
| 6 | 8 | use SpringDevs\Subscription\Admin\Links; |
| 9 | +use SpringDevs\Subscription\Admin\CancellationFlow; | |
| 7 | 10 | use SpringDevs\Subscription\Admin\Menu; |
| 8 | 11 | use SpringDevs\Subscription\Admin\Order as AdminOrder; |
| 12 | +use SpringDevs\Subscription\Admin\Plans; | |
| 9 | 13 | use SpringDevs\Subscription\Admin\Product; |
| 14 | +use SpringDevs\Subscription\Admin\ProSettingsFields; | |
| 10 | 15 | use SpringDevs\Subscription\Admin\Settings; |
| 11 | 16 | use SpringDevs\Subscription\Admin\Subscriptions; |
| 12 | 17 | use SpringDevs\Subscription\Illuminate\Comments; |
| 13 | 18 | |
| @@ -36,13 +41,19 @@ | ||
| 36 | 41 | } |
| 37 | 42 | // Only load admin content if WooCommerce is active |
| 38 | 43 | if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { |
| 39 | 44 | new Menu(); |
| 45 | + new Dashboard(); | |
| 46 | + new Plans(); | |
| 47 | + new CancellationFlow(); | |
| 48 | + new Product\Plans(); | |
| 49 | + new Integrations(); | |
| 40 | 50 | new Product(); |
| 41 | 51 | new Subscriptions(); |
| 42 | 52 | new AdminOrder(); |
| 43 | 53 | new Comments(); |
| 44 | 54 | new Settings(); |
| 55 | + new ProSettingsFields(); | |
| 45 | 56 | new Links(); |
| 46 | 57 | } |
| 47 | 58 | } |
| 48 | 59 | |
| @@ -51,6 +62,16 @@ | ||
| 51 | 62 | * |
| 52 | 63 | * @return void |
| 53 | 64 | */ |
| 54 | 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' ); | |
| 55 | 76 | } |
| 56 | 77 | } |