get_app_setting( 'license_key' );
if ( empty( $license_key ) ) {
$activate_url = admin_url( 'admin.php?page=gravityflow_settings' );
/* Translators: the placeholders are link tags pointing to the Gravity Flow settings page */
$license_message = sprintf( esc_html__( 'Please %1$sactivate%2$s your license to access this page.', 'gravityflow' ), "", '' );
} else {
$response = gravity_flow()->perform_edd_license_request( 'check_license', $license_key );
if ( is_wp_error( $response ) ) {
$license_message = esc_html__( 'A valid license key is required to access support but there was a problem validating your license key. Please log in to GravityFlow.io and open a support ticket.', 'gravityflow' );
} else {
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
$valid = null;
if ( empty( $license_data ) || $license_data->license == 'invalid' ) {
$license_message = esc_html__( 'Invalid license key. A valid license key is required to access support. Please check the status of your license key in your account area on GravityFlow.io.', 'gravityflow' );
}
}
}
if ( ! empty( $license_message ) ) {
GFCommon::add_message( $license_message, true );
?>
array(
'input_1' => rgpost( 'gravityflow_name' ),
'input_2' => rgpost( 'gravityflow_email' ),
'input_4' => rgpost( 'gravityflow_subject' ),
'input_3' => rgpost( 'gravityflow_description' ),
'input_5' => $system_info,
),
);
$body_json = json_encode( $body );
$options = array(
'method' => 'POST',
'timeout' => 30,
'redirection' => 5,
'blocking' => true,
'sslverify' => false,
'headers' => array(),
'body' => $body_json,
'cookies' => array(),
);
$raw_response = wp_remote_post( 'https://gravityflow.io/gravityformsapi/forms/3/submissions/', $options );
if ( is_wp_error( $raw_response ) ) {
$message = '' . esc_html__( 'There was a problem submitting your request. Please open a support ticket on GravityFlow.io', 'gravityflow' ) . '
';
}
$response_json = wp_remote_retrieve_body( $raw_response );
$response = json_decode( $response_json, true );
if ( rgar( $response, 'status' ) == '200' ) {
$message = '' . esc_html__( 'Thank you! We\'ll be in touch soon.', 'gravityflow' ) . '
';
}
}
$user = wp_get_current_user();
?>
is_gravityforms_supported( '2.2' ) ) {
require_once( GFCommon::get_base_path() . '/includes/system-status/class-gf-system-report.php' );
$sections = GF_System_Report::get_system_report();
$system_report_text = GF_System_Report::get_system_report_text( $sections );
return $system_report_text;
}
if ( ! function_exists( 'get_plugins' ) ) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
$plugin_list = get_plugins();
$site_url = get_bloginfo( 'url' );
$plugins = array();
$active_plugins = get_option( 'active_plugins' );
foreach ( $plugin_list as $key => $plugin ) {
$is_active = in_array( $key, $active_plugins );
if ( $is_active ) {
$name = substr( $key, 0, strpos( $key, '/' ) );
$plugins[] = $name . 'v' . $plugin['Version'];
}
}
$plugins = join( ', ', $plugins );
// Get theme info.
$theme = wp_get_theme();
$theme_name = $theme->get( 'Name' );
$theme_uri = $theme->get( 'ThemeURI' );
$theme_version = $theme->get( 'Version' );
$theme_author = $theme->get( 'Author' );
$theme_author_uri = $theme->get( 'AuthorURI' );
$form_counts = GFFormsModel::get_form_count();
$active_count = $form_counts['active'];
$inactive_count = $form_counts['inactive'];
$fc = abs( $active_count ) + abs( $inactive_count );
$entry_count = GFFormsModel::get_lead_count_all_forms( 'active' );
$im = is_multisite() ? 'yes' : 'no';
global $wpdb;
$info = array(
'site: ' . $site_url,
'GF version' . GFCommon::$version,
'Gravity Flow version' . gravity_flow()->_version,
'WordPress version: ' . get_bloginfo( 'version' ),
'php version' . phpversion(),
'mysql version: ' . $wpdb->db_version(),
'theme name:' . $theme_name,
'theme url' . $theme_uri,
'theme version:' . $theme_version,
'theme author: ' . $theme_author,
'theme author URL:' . $theme_author_uri,
'is multisite' . $im,
'form count: ' . $fc,
'entry count: ' . $entry_count,
'plugins: ' . $plugins,
);
return join( PHP_EOL, $info );
}
/**
* Get the default value for the email field.
*
* @return string
*/
public static function get_email() {
$license_data = gravity_flow()->check_license();
$email = rgobj( $license_data, 'customer_email' );
if ( empty( $email ) ) {
$email = get_option( 'admin_email' );
}
return $email;
}
}