Made with by the WP Subscription Team
Support  /  Docs
'wp-subscription', 'label' => __('Subscriptions', 'wp_subscription'), 'url' => admin_url('admin.php?page=wp-subscription'), ], [ 'slug' => 'wp-subscription-stats', 'label' => __('Reports', 'wp_subscription'), 'url' => admin_url('admin.php?page=wp-subscription-stats'), ], [ 'slug' => 'wp-subscription-settings', 'label' => __('Settings', 'wp_subscription'), 'url' => admin_url('admin.php?page=wp-subscription-settings'), ], [ 'slug' => 'wp-subscription-support', 'label' => __('Support', 'wp_subscription'), 'url' => admin_url('admin.php?page=wp-subscription-support'), ], ]; // Allow pro plugin to inject menu items $menu_items = apply_filters('wp_subscription_admin_header_menu_items', $menu_items, $current); ?>
render_admin_header(); // Handle filters $status = isset($_GET['subscrpt_status']) ? sanitize_text_field($_GET['subscrpt_status']) : ''; $search = isset($_GET['s']) ? sanitize_text_field($_GET['s']) : ''; $date_filter = isset($_GET['date_filter']) ? sanitize_text_field($_GET['date_filter']) : ''; $per_page = isset($_GET['per_page']) ? max(1, intval($_GET['per_page'])) : 20; $paged = isset($_GET['paged']) ? max(1, intval($_GET['paged'])) : 1; // Handle duplicate action if (isset($_GET['action']) && $_GET['action'] === 'duplicate' && !empty($_GET['sub_id'])) { $sub_id = intval($_GET['sub_id']); $post = get_post($sub_id); if ($post && $post->post_type === 'subscrpt_order') { $new_post = [ 'post_title' => $post->post_title . ' (Copy)', 'post_content' => $post->post_content, 'post_status' => 'draft', 'post_type' => 'subscrpt_order', ]; $new_id = wp_insert_post($new_post); if ($new_id) { $meta = get_post_meta($sub_id); foreach ($meta as $key => $values) { foreach ($values as $value) { add_post_meta($new_id, $key, maybe_unserialize($value)); } } } } wp_safe_redirect(admin_url('admin.php?page=wp-subscription')); exit; } $args = [ 'post_type' => 'subscrpt_order', 'post_status' => 'any', 'posts_per_page' => $per_page, 'paged' => $paged, 'orderby' => 'date', 'order' => 'DESC', ]; if ($status) { $args['post_status'] = $status; } // Search only by subscription ID if ($search !== '') { if (is_numeric($search)) { $args['p'] = intval($search); } else { // If not numeric, return no results $args['post__in'] = array(0); } } // Dynamic date filter (YYYY-MM) if ($date_filter && preg_match('/^\d{4}-\d{2}$/', $date_filter)) { $year = substr($date_filter, 0, 4); $month = substr($date_filter, 5, 2); $args['date_query'][] = [ 'year' => intval($year), 'month' => intval($month), ]; } $query = new \WP_Query($args); $subscriptions = $query->posts; $total = $query->found_posts; $max_num_pages = $query->max_num_pages; // Get all possible statuses for filter dropdown $all_statuses = get_post_stati(['show_in_admin_all_list' => true], 'objects'); include dirname(__FILE__) . '/views/subscription-list.php'; ?>
Made with by the WP Subscription Team
Support  /  Docs
render_admin_header(); // if ( ! class_exists('Sdevs_Wc_Subscription_Pro') ){ // $this->render_admin_footer(); // return; // } if ( ! class_exists('Sdevs_Wc_Subscription_Pro') ) { ?>
Unlock advanced features, priority support,
and more subscription control and reporting.
UPGRADE TO PRO
render_admin_footer(); return; } global $wpdb; $months = []; $now = current_time('timestamp'); for ($i = 11; $i >= 0; $i--) { $month = strtotime("-{$i} month", $now); $key = date('Y-m', $month); $months[$key] = [ 'label' => date('M Y', $month), 'total' => 0, 'active' => 0, 'cancelled' => 0, 'revenue' => 0.0, ]; } $start = strtotime('-11 months', $now); $start = strtotime(date('Y-m-01 00:00:00', $start)); $end = strtotime(date('Y-m-t 23:59:59', $now)); $subs = $wpdb->get_results($wpdb->prepare( "SELECT ID, post_status, post_date_gmt FROM {$wpdb->posts} WHERE post_type='subscrpt_order' AND post_status != 'trash' AND post_date_gmt >= %s AND post_date_gmt <= %s", gmdate('Y-m-d H:i:s', $start), gmdate('Y-m-d H:i:s', $end) )); // dd($subs); foreach ($subs as $sub) { $month = date('Y-m', strtotime($sub->post_date_gmt)); if (!isset($months[$month])) continue; $months[$month]['total']++; if ($sub->post_status === 'active') $months[$month]['active']++; if ($sub->post_status === 'cancelled') $months[$month]['cancelled']++; // Revenue: get price meta $price = get_post_meta($sub->ID, '_subscrpt_price', true); $months[$month]['revenue'] += floatval($price); } // Next month projection: current active * avg revenue per active $active_now = $months[array_key_last($months)]['active']; $revenue_now = $months[array_key_last($months)]['revenue']; $avg_per_active = $active_now ? ($revenue_now / $active_now) : 0; $projection = round($active_now * $avg_per_active, 2); // Previous month $month_keys = array_keys($months); $prev_month_key = $month_keys[count($month_keys)-2] ?? null; $prev_month_label = $prev_month_key ? $months[$prev_month_key]['label'] : ''; $prev_month_revenue = $prev_month_key ? $months[$prev_month_key]['revenue'] : 0; // Next month name $next_month_label = date('M Y', strtotime('+1 month', $now)); ?>

Monthly Subscription Report

Subscriptions This Month
Active Subscriptions
Cancelled This Month
$
Revenue This Month
$
Previous Month ()
$
Next Month Projection ()
render_admin_footer(); ?> render_admin_header(); ?>
Made with by the WP Subscription Team
Support  /  Docs
render_admin_header(); ?>
Unlock advanced features, priority support,
and more subscription control and reporting.
UPGRADE TO PRO

Product Overview

WP Subscription helps you manage WooCommerce subscriptions with ease. Enjoy a modern admin UI, powerful filters, detailed history, and seamless customer management. Designed for speed, clarity, and growth.

  • Modern, compact admin interface
  • Advanced filtering & search
  • Subscription history & activities
  • Easy migration from other plugins
  • Pro: Analytics, automation, integrations, and more!
Watch: Quick Product Tour
WP Subscription PRO Features

Documentation

Read our comprehensive docs for setup, migration, and advanced usage.

View Docs

Facing An Issue?

If you have a problem, open a support ticket or check our FAQ.

Get Support

Request a Feature

Have an idea? Request a feature or vote on others.

Request Feature

Show Your Love

Enjoying WP Subscription? Leave us a review or share your experience!

Leave a Review
Made with by the WP Subscription Team
Support  /  Docs