PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.2.6
Gallery : FooGallery v3.2.6
3.3.2 3.3.3 3.3.0 3.1.31 3.1.32 3.1.34 3.1.36 3.2.0 3.2.6 trunk 1.10.3 2.0.24 2.1.34 2.2.44 2.3.3 2.4.32 3.0.6 3.1.11 3.1.12 3.1.13 3.1.20 3.1.25 3.1.26 3.1.26.1 3.1.26.2
foogallery / freemius / templates / pricing.php
foogallery / freemius / templates Last commit date
account 4 weeks ago checkout 4 weeks ago connect 4 weeks ago debug 4 weeks ago forms 4 weeks ago js 4 weeks ago partials 4 weeks ago plugin-info 4 weeks ago account.php 4 weeks ago add-ons.php 4 weeks ago add-trial-to-pricing.php 4 weeks ago admin-notice.php 4 weeks ago ajax-loader.php 4 weeks ago api-connectivity-message-js.php 4 weeks ago auto-installation.php 4 weeks ago checkout.php 4 weeks ago clone-resolution-js.php 4 weeks ago connect.php 4 weeks ago contact.php 4 weeks ago debug.php 4 weeks ago email.php 4 weeks ago gdpr-optin-js.php 4 weeks ago index.php 4 weeks ago plugin-icon.php 4 weeks ago pricing.php 4 weeks ago secure-https-header.php 4 weeks ago sticky-admin-notice-js.php 4 weeks ago tabs-capture-js.php 4 weeks ago tabs.php 4 weeks ago
pricing.php
113 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.0.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 wp_enqueue_script( 'jquery' );
14 fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
15 fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
16 fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
17
18 /**
19 * @var array $VARS
20 * @var Freemius $fs
21 */
22 $fs = freemius( $VARS['id'] );
23 $slug = $fs->get_slug();
24 $timestamp = time();
25
26 $context_params = array(
27 'plugin_id' => $fs->get_id(),
28 'plugin_public_key' => $fs->get_public_key(),
29 'plugin_version' => $fs->get_plugin_version(),
30 );
31
32 $bundle_id = $fs->get_bundle_id();
33 if ( ! is_null( $bundle_id ) ) {
34 $context_params['bundle_id'] = $bundle_id;
35 }
36
37 // Get site context secure params.
38 if ( $fs->is_registered() ) {
39 $context_params = array_merge( $context_params, FS_Security::instance()->get_context_params(
40 $fs->get_site(),
41 $timestamp,
42 'upgrade'
43 ) );
44 } else {
45 $context_params['home_url'] = home_url();
46 }
47
48 if ( $fs->is_payments_sandbox() ) // Append plugin secure token for sandbox mode authentication.)
49 {
50 $context_params['sandbox'] = FS_Security::instance()->get_secure_token(
51 $fs->get_plugin(),
52 $timestamp,
53 'checkout'
54 );
55 }
56
57 $query_params = array_merge( $context_params, $_GET, array(
58 'next' => $fs->_get_sync_license_url( false, false ),
59 'plugin_version' => $fs->get_plugin_version(),
60 // Billing cycle.
61 'billing_cycle' => fs_request_get( 'billing_cycle', WP_FS__PERIOD_ANNUALLY ),
62 'is_network_admin' => fs_is_network_admin() ? 'true' : 'false',
63 'currency' => $fs->apply_filters( 'default_currency', 'usd' ),
64 'discounts_model' => $fs->apply_filters( 'pricing/discounts_model', 'absolute' ),
65 ) );
66
67 $pricing_js_url = fs_asset_url( $fs->get_pricing_js_path() );
68
69 wp_enqueue_script( 'freemius-pricing', $pricing_js_url );
70
71 $pricing_css_path = $fs->apply_filters( 'pricing/css_path', null );
72 if ( is_string( $pricing_css_path ) ) {
73 wp_enqueue_style( 'freemius-pricing', fs_asset_url( $pricing_css_path ) );
74 }
75
76 $has_tabs = $fs->_add_tabs_before_content();
77
78 if ( $has_tabs ) {
79 $query_params['tabs'] = 'true';
80 }
81 ?>
82 <div id="fs_pricing" class="wrap fs-section fs-full-size-wrapper">
83 <div id="fs_pricing_wrapper" data-public-url="<?php echo trailingslashit( dirname( $pricing_js_url ) ) ?>"></div>
84 <?php
85 $pricing_config = array_merge( array(
86 'contact_url' => $fs->contact_url(),
87 'is_production' => ( defined( 'WP_FS__IS_PRODUCTION_MODE' ) ? WP_FS__IS_PRODUCTION_MODE : null ),
88 'menu_slug' => $fs->get_menu_slug(),
89 'mode' => 'dashboard',
90 'fs_wp_endpoint_url' => WP_FS__ADDRESS,
91 'request_handler_url' => admin_url(
92 'admin-ajax.php?' . http_build_query( array(
93 'module_id' => $fs->get_id(),
94 'action' => $fs->get_ajax_action( 'pricing_ajax_action' ),
95 'security' => $fs->get_ajax_security( 'pricing_ajax_action' )
96 ) )
97 ),
98 'selector' => '#fs_pricing_wrapper',
99 'unique_affix' => $fs->get_unique_affix(),
100 'show_annual_in_monthly' => $fs->apply_filters( 'pricing/show_annual_in_monthly', true ),
101 'license' => $fs->has_active_valid_license() ? $fs->_get_license() : null,
102 'plugin_icon' => $fs->get_local_icon_url(),
103 'disable_single_package' => $fs->apply_filters( 'pricing/disable_single_package', false ),
104 ), $query_params );
105
106 wp_add_inline_script( 'freemius-pricing', 'Freemius.pricing.new( ' . json_encode( $pricing_config ) . ' )' );
107 ?>
108 </div>
109 <?php
110 if ( $has_tabs ) {
111 $fs->_add_tabs_after_content();
112 }
113