PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 1.7.1
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v1.7.1
4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / freemius / templates / add-ons.php
embedpress / freemius / templates Last commit date
debug 9 years ago forms 9 years ago plugin-info 9 years ago account.php 9 years ago add-ons.php 9 years ago add-trial-to-pricing.php 9 years ago admin-notice.php 9 years ago all-admin-notice.php 9 years ago billing.php 9 years ago checkout-legacy.php 9 years ago checkout.php 9 years ago connect.php 9 years ago contact.php 9 years ago debug.php 9 years ago email.php 9 years ago firewall-issues-js.php 9 years ago index.php 9 years ago plugin-icon.php 9 years ago powered-by.php 9 years ago pricing.php 9 years ago sticky-admin-notice-js.php 9 years ago
add-ons.php
165 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6 * @since 1.0.3
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * @var array $VARS
15 */
16 $slug = $VARS['slug'];
17 /**
18 * @var Freemius
19 */
20 $fs = freemius( $slug );
21
22 $open_addon_slug = fs_request_get( 'slug' );
23
24 $open_addon = false;
25
26 /**
27 * @var FS_Plugin[]
28 */
29 $addons = $fs->get_addons();
30
31 $has_addons = ( is_array( $addons ) && 0 < count( $addons ) );
32 ?>
33 <div id="fs_addons" class="wrap">
34 <h2><?php printf( __fs( 'add-ons-for-x', $slug ), $fs->get_plugin_name() ) ?></h2>
35
36 <div id="poststuff">
37 <?php if ( ! $has_addons ) : ?>
38 <h3><?php printf(
39 '%s... %s',
40 __fs( 'oops', $slug ),
41 __fs( 'add-ons-missing', $slug )
42 ) ?></h3>
43 <?php endif ?>
44 <ul class="fs-cards-list">
45 <?php if ( $has_addons ) : ?>
46 <?php foreach ( $addons as $addon ) : ?>
47 <?php
48 $open_addon = ( $open_addon || ( $open_addon_slug === $addon->slug ) );
49
50 $price = 0;
51 $plan = null;
52 $plans_result = $fs->get_api_site_or_plugin_scope()->get( "/addons/{$addon->id}/plans.json" );
53 if ( ! isset( $plans_result->error ) ) {
54 $plans = $plans_result->plans;
55 if ( is_array( $plans ) && 0 < count( $plans ) ) {
56 $plan = new FS_Plugin_Plan( $plans[0] );
57 $pricing_result = $fs->get_api_site_or_plugin_scope()->get( "/addons/{$addon->id}/plans/{$plan->id}/pricing.json" );
58 if ( ! isset( $pricing_result->error ) ) {
59 // Update plan's pricing.
60 $plan->pricing = $pricing_result->pricing;
61
62 if ( is_array( $plan->pricing ) && 0 < count( $plan->pricing ) ) {
63 $min_price = 999999;
64 foreach ( $plan->pricing as $pricing ) {
65 if ( ! is_null( $pricing->annual_price ) && $pricing->annual_price > 0 ) {
66 $min_price = min( $min_price, $pricing->annual_price );
67 } else if ( ! is_null( $pricing->monthly_price ) && $pricing->monthly_price > 0 ) {
68 $min_price = min( $min_price, 12 * $pricing->monthly_price );
69 }
70 }
71
72 if ( $min_price < 999999 ) {
73 $price = $min_price;
74 }
75 }
76 }
77 }
78 }
79 ?>
80 <li class="fs-card fs-addon" data-slug="<?php echo $addon->slug ?>">
81 <?php
82 echo sprintf( '<a href="%s" class="thickbox fs-overlay" aria-label="%s" data-title="%s"></a>',
83 esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&parent_plugin_id=' . $fs->get_id() . '&plugin=' . $addon->slug .
84 '&TB_iframe=true&width=600&height=550' ) ),
85 esc_attr( sprintf( __fs( 'more-information-about-x', $slug ), $addon->title ) ),
86 esc_attr( $addon->title )
87 );
88 ?>
89 <?php
90 if ( is_null( $addon->info ) ) {
91 $addon->info = new stdClass();
92 }
93 if ( ! isset( $addon->info->card_banner_url ) ) {
94 $addon->info->card_banner_url = '//dashboard.freemius.com/assets/img/marketing/blueprint-300x100.jpg';
95 }
96 if ( ! isset( $addon->info->short_description ) ) {
97 $addon->info->short_description = 'What\'s the one thing your add-on does really, really well?';
98 }
99 ?>
100 <div class="fs-inner">
101 <ul>
102 <li class="fs-card-banner"
103 style="background-image: url('<?php echo $addon->info->card_banner_url ?>');"></li>
104 <!-- <li class="fs-tag"></li>-->
105 <li class="fs-title"><?php echo $addon->title ?></li>
106 <li class="fs-offer">
107 <span
108 class="fs-price"><?php echo ( 0 == $price ) ? __fs( 'free', $slug ) : ('$' . number_format( $price, 2 ) . ($plan->has_trial() ? ' - ' . __fs('trial', $slug) : '')) ?></span>
109 </li>
110 <li class="fs-description"><?php echo ! empty( $addon->info->short_description ) ? $addon->info->short_description : 'SHORT DESCRIPTION' ?></li>
111 <li class="fs-cta"><a class="button"><?php _efs( 'view-details', $slug ) ?></a></li>
112 </ul>
113 </div>
114 </li>
115 <?php endforeach ?>
116 <?php endif ?>
117 </ul>
118 </div>
119 </div>
120 <script type="text/javascript">
121 (function ($) {
122 <?php if ( $open_addon ) : ?>
123
124 var interval = setInterval(function () {
125 // Open add-on information page.
126 <?php
127 /**
128 * @author Vova Feldman
129 *
130 * This code does NOT expose an XSS vulnerability because:
131 * 1. This page only renders for admins, so if an attacker manage to get
132 * admin access, they can do more harm.
133 * 2. This code won't be rendered unless $open_addon_slug matches any of
134 * the plugin's add-ons slugs.
135 */
136 ?>
137 $('.fs-card[data-slug=<?php echo $open_addon_slug ?>] a').click();
138 if ($('#TB_iframeContent').length > 0) {
139 clearInterval(interval);
140 interval = null;
141 }
142 }, 200);
143
144 <?php else : ?>
145
146
147 $('.fs-card.fs-addon')
148 .mouseover(function () {
149 $(this).find('.fs-cta .button').addClass('button-primary');
150 }).mouseout(function () {
151 $(this).find('.fs-cta .button').removeClass('button-primary');
152 });
153
154 <?php endif ?>
155 })(jQuery);
156 </script>
157 <?php
158 $params = array(
159 'page' => 'addons',
160 'module_id' => $fs->get_id(),
161 'module_slug' => $slug,
162 'module_version' => $fs->get_plugin_version(),
163 );
164 fs_require_template( 'powered-by.php', $params );
165 ?>