get_slug(); $timestamp = time(); $context_params = array( 'plugin_id' => $fs->get_id(), 'public_key' => $fs->get_public_key(), 'plugin_version' => $fs->get_plugin_version(), 'mode' => 'dashboard', 'trial' => fs_request_get_bool( 'trial' ), 'is_ms' => ( fs_is_network_admin() && $fs->is_network_active() ), ); $plan_id = fs_request_get( 'plan_id' ); if ( FS_Plugin_Plan::is_valid_id( $plan_id ) ) { $context_params['plan_id'] = $plan_id; } $licenses = fs_request_get( 'licenses' ); if ( $licenses === strval( intval( $licenses ) ) && $licenses > 0 ) { $context_params['licenses'] = $licenses; } $plugin_id = fs_request_get( 'plugin_id' ); if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) { $plugin_id = $fs->get_id(); } if ( $plugin_id == $fs->get_id() ) { $is_premium = $fs->is_premium(); $bundle_id = $fs->get_bundle_id(); if ( ! is_null( $bundle_id ) ) { $context_params['bundle_id'] = $bundle_id; } } else { // Identify the module code version of the checkout context module. if ( $fs->is_addon_activated( $plugin_id ) ) { $fs_addon = Freemius::get_instance_by_id( $plugin_id ); $is_premium = $fs_addon->is_premium(); } else { // If add-on isn't activated assume the premium version isn't installed. $is_premium = false; } } // Get site context secure params. if ( $fs->is_registered() ) { $site = $fs->get_site(); if ( $plugin_id != $fs->get_id() ) { if ( $fs->is_addon_activated( $plugin_id ) ) { $fs_addon = Freemius::get_instance_by_id( $plugin_id ); $addon_site = $fs_addon->get_site(); if ( is_object( $addon_site ) ) { $site = $addon_site; } } } $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params( $site, $timestamp, 'checkout' ) ); } else { $current_user = Freemius::_get_current_wp_user(); // Add site and user info to the request, this information // is NOT being stored unless the user complete the purchase // and agrees to the TOS. $context_params = array_merge( $context_params, array( 'user_firstname' => $current_user->user_firstname, 'user_lastname' => $current_user->user_lastname, 'user_email' => $current_user->user_email, 'home_url' => home_url(), ) ); $fs_user = Freemius::_get_user_by_email( $current_user->user_email ); if ( is_object( $fs_user ) && $fs_user->is_verified() ) { $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params( $fs_user, $timestamp, 'checkout' ) ); } } if ( $fs->is_payments_sandbox() ) { // Append plugin secure token for sandbox mode authentication. $context_params['sandbox'] = FS_Security::instance()->get_secure_token( $fs->get_plugin(), $timestamp, 'checkout' ); /** * @since 1.1.7.3 Add security timestamp for sandbox even for anonymous user. */ if ( empty( $context_params['s_ctx_ts'] ) ) { $context_params['s_ctx_ts'] = $timestamp; } } $return_url = $fs->_get_sync_license_url( $plugin_id ); $can_user_install = ( ( $fs->is_plugin() && current_user_can( 'install_plugins' ) ) || ( $fs->is_theme() && current_user_can( 'install_themes' ) ) ); $query_params = array_merge( $context_params, $_GET, array( // Current plugin version. 'plugin_version' => $fs->get_plugin_version(), 'sdk_version' => WP_FS__SDK_VERSION, 'is_premium' => $is_premium ? 'true' : 'false', 'can_install' => $can_user_install ? 'true' : 'false', 'return_url' => $return_url, ) ); $xdebug_session = fs_request_get( 'XDEBUG_SESSION' ); if ( false !== $xdebug_session ) { $query_params['XDEBUG_SESSION'] = $xdebug_session; } $view_params = array( 'id' => $VARS['id'], 'page' => strtolower( $fs->get_text_inline( 'Checkout', 'checkout' ) ) . ' ' . $fs->get_text_inline( 'PCI compliant', 'pci-compliant' ), ); fs_require_once_template('secure-https-header.php', $view_params); ?>