PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.3.2
StreamCast – bring live radio to your site with a sleek player v2.3.2
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
streamcast / freemius / templates / checkout / redirect.php

redirect.php in StreamCast – bring live radio to your site with a sleek player 2.3.2, at freemius/templates/checkout/redirect.php

103 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2024, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 2.9.0
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * @var array $VARS
15 * @var Freemius $fs
16 */
17 $fs = freemius( $VARS['id'] );
18 $fs_checkout = FS_Checkout_Manager::instance();
19
20 $plugin_id = fs_request_get( 'plugin_id' );
21 if ( ! FS_Plugin::is_valid_id( $plugin_id ) ) {
22 $plugin_id = $fs->get_id();
23 }
24
25 $plan_id = fs_request_get( 'plan_id' );
26 $licenses = fs_request_get( 'licenses' );
27
28 $query_params = $fs_checkout->get_query_params(
29 $fs,
30 $plugin_id,
31 $plan_id,
32 $licenses
33 );
34
35 // The return URL is a special page which will process the result.
36 $return_url = $fs_checkout->get_checkout_redirect_return_url( $fs );
37 $query_params['return_url'] = $return_url;
38
39 // Add the cancel URL to the same pricing page the request originated from.
40 $query_params['cancel_url'] = $fs->pricing_url(
41 fs_request_get( 'billing_cycle', 'annual' ),
42 fs_request_get_bool( 'trial' )
43 );
44
45 if ( has_site_icon() ) {
46 $query_params['cancel_icon'] = get_site_icon_url();
47 }
48
49 // If the user didn't connect his account with Freemius,
50 // once he accepts the Terms of Service and Privacy Policy,
51 // and then click the purchase button, the context information
52 // of the user will be shared with Freemius in order to complete the
53 // purchase workflow and activate the license for the right user.
54 $install_data = array_merge(
55 $fs->get_opt_in_params(),
56 array(
57 'activation_url' => fs_nonce_url(
58 $fs->_get_admin_page_url(
59 '',
60 array(
61 'fs_action' => $fs->get_unique_affix() . '_activate_new',
62 'plugin_id' => $plugin_id,
63 )
64 ),
65 $fs->get_unique_affix() . '_activate_new'
66 ),
67 )
68 );
69 $query_params['install_data'] = json_encode( $install_data );
70
71 $query_params['_fs_dashboard_independent'] = true;
72
73 $redirect_url = $fs_checkout->get_full_checkout_url( $query_params );
74
75 if ( ! fs_redirect( $redirect_url ) ) {
76 // The Header was sent, so the server redirect failed. Rely on JS instead.
77 ?>
78 <div class="fs-checkout-process-redirect">
79 <div class="fs-checkout-process-redirect__loader">
80 <?php fs_include_template( 'ajax-loader.php' ); ?>
81 </div>
82
83 <div class="fs-checkout-process-redirect__content">
84 <p>
85 <?php echo wp_kses(
86 sprintf(
87 fs_text_inline( 'Redirecting, please <a href="%1$s">click here</a> if you\'re stuck...' ),
88 esc_url( $redirect_url )
89 ),
90 array( 'a' => array( 'href' => true ) )
91 ); ?>
92 </p>
93 </div>
94 </div>
95 <script type="text/javascript">
96 jQuery( document ).ready( function ( $ ) {
97 $( '.fs-checkout-process-redirect .fs-ajax-loader' ).show();
98 window.location.href = <?php echo wp_json_encode($redirect_url ); ?>;
99 });
100 </script>
101 <?php
102 }
103