Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger: Add plan info to debug info #6171

Merged
merged 5 commits into from
Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions class.jetpack-debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ private static function is_jetpack_support_open() {
}
}

private static function what_jetpack_plan() {
$plan = Jetpack::get_active_plan();
$plan = ! empty( $plan['class'] ) ? $plan['class'] : 'undefined';
return 'JetpackPlan' . $plan;
}

static function seconds_to_time( $seconds ) {
$units = array(
"week" => 7*24*3600,
Expand Down Expand Up @@ -80,6 +86,7 @@ public static function jetpack_debug_display_handler() {
$debug_info .= "\r\n" . esc_html( "JETPACK__PLUGIN_DIR: " . JETPACK__PLUGIN_DIR );
$debug_info .= "\r\n" . esc_html( "SITE_URL: " . site_url() );
$debug_info .= "\r\n" . esc_html( "HOME_URL: " . home_url() );
$debug_info .= "\r\n" . esc_html( "PLAN: " . self::what_jetpack_plan() );

$debug_info .= "\r\n";
require_once JETPACK__PLUGIN_DIR . 'sync/class.jetpack-sync-modules.php';
Expand Down
6 changes: 5 additions & 1 deletion class.jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@ public static function get_active_plan() {
if ( ! $plan ) {
$plan = array(
'product_slug' => 'jetpack_free',
'supports' => array(),
'supports' => array(),
'class' => 'free',
);
}

Expand All @@ -1233,6 +1234,7 @@ public static function get_active_plan() {
$plan['supports'] = array(
'akismet',
);
$plan['class'] = 'personal';
}

// Define what paid modules are supported by premium plans
Expand All @@ -1248,6 +1250,7 @@ public static function get_active_plan() {
'vaultpress',
'wordads',
);
$plan['class'] = 'premium';
}

// Define what paid modules are supported by professional plans
Expand All @@ -1265,6 +1268,7 @@ public static function get_active_plan() {
'google-analytics',
'wordads',
);
$plan['class'] = 'business';
}

// Make sure we have an array here in the event database data is stale
Expand Down