get_slug(); $timestamp = time(); $context_params = array( 'plugin_id' => $fs->get_id(), 'plugin_public_key' => $fs->get_public_key(), 'plugin_version' => $fs->get_plugin_version(), ); // Get site context secure params. if ( $fs->is_registered() ) { $site = $fs->get_site(); $plugin_id = fs_request_get( 'plugin_id', $fs->get_id() ); if ($plugin_id != $fs->get_id()) { if ( $fs->is_addon_activated( $plugin_id ) ) { $fs_addon = Freemius::get_instance_by_id( $plugin_id ); $site = $fs_addon->get_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, // 'user_nickname' => $current_user->user_nicename, // 'plugin_slug' => $slug, // 'site_url' => get_site_url(), // 'site_name' => get_bloginfo( 'name' ), // 'platform_version' => get_bloginfo( 'version' ), // 'language' => get_bloginfo( 'language' ), // 'charset' => get_bloginfo( 'charset' ), // 'account_url' => fs_nonce_url( $fs->_get_admin_page_url( // 'account', // array( 'fs_action' => 'sync_user' ) // ), 'sync_user' ), ) ); $fs_user = Freemius::_get_user_by_email( $current_user->user_email ); if ( is_object( $fs_user ) ) { $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( isset( $_GET['plugin_id'] ) ? $_GET['plugin_id'] : $fs->get_id() ); $query_params = array_merge( $context_params, $_GET, array( // Current plugin version. 'plugin_version' => $fs->get_plugin_version(), 'sdk_version' => WP_FS__SDK_VERSION, 'return_url' => $return_url, // Admin CSS URL for style/design competability. // 'wp_admin_css' => get_bloginfo('wpurl') . "/wp-admin/load-styles.php?c=1&load=buttons,wp-admin,dashicons", ) ); ?>
'checkout', 'module_id' => $fs->get_id(), 'module_slug' => $slug, 'module_version' => $fs->get_plugin_version(), ); fs_require_template( 'powered-by.php', $params ); ?>