PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.9
Code Manager v1.0.9
1.0.48 1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / freemius / templates / plugin-info / features.php
code-manager / freemius / templates / plugin-info Last commit date
description.php 4 years ago features.php 4 years ago index.php 4 years ago screenshots.php 4 years ago
features.php
114 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.6
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * @var array $VARS
15 *
16 * @var FS_Plugin $plugin
17 */
18 $plugin = $VARS['plugin'];
19
20 $plans = $VARS['plans'];
21
22 $features_plan_map = array();
23 foreach ( $plans as $plan ) {
24 if (!empty($plan->features) && is_array($plan->features)) {
25 foreach ( $plan->features as $feature ) {
26 if ( ! isset( $features_plan_map[ $feature->id ] ) ) {
27 $features_plan_map[ $feature->id ] = array( 'feature' => $feature, 'plans' => array() );
28 }
29
30 $features_plan_map[ $feature->id ]['plans'][ $plan->id ] = $feature;
31 }
32 }
33
34 // Add support as a feature.
35 if ( ! empty( $plan->support_email ) ||
36 ! empty( $plan->support_skype ) ||
37 ! empty( $plan->support_phone ) ||
38 true === $plan->is_success_manager
39 ) {
40 if ( ! isset( $features_plan_map['support'] ) ) {
41 $support_feature = new stdClass();
42 $support_feature->id = 'support';
43 $support_feature->title = fs_text_inline( 'Support', $plugin->slug );
44 $features_plan_map[ $support_feature->id ] = array( 'feature' => $support_feature, 'plans' => array() );
45 } else {
46 $support_feature = $features_plan_map['support'];
47 }
48
49 $features_plan_map[ $support_feature->id ]['plans'][ $plan->id ] = $support_feature;
50 }
51 }
52
53 // Add updates as a feature for all plans.
54 $updates_feature = new stdClass();
55 $updates_feature->id = 'updates';
56 $updates_feature->title = fs_text_inline( 'Unlimited Updates', 'unlimited-updates', $plugin->slug );
57 $features_plan_map[ $updates_feature->id ] = array( 'feature' => $updates_feature, 'plans' => array() );
58 foreach ( $plans as $plan ) {
59 $features_plan_map[ $updates_feature->id ]['plans'][ $plan->id ] = $updates_feature;
60 }
61 ?>
62 <div class="fs-features">
63 <table>
64 <thead>
65 <tr>
66 <th></th>
67 <?php foreach ( $plans as $plan ) : ?>
68 <th>
69 <?php echo $plan->title ?>
70 <span class="fs-price"><?php
71 if ( empty( $plan->pricing ) ) {
72 fs_esc_html_echo_inline( 'Free', 'free', $plugin->slug );
73 } else {
74 foreach ( $plan->pricing as $pricing ) {
75 /**
76 * @var FS_Pricing $pricing
77 */
78 if ( 1 == $pricing->licenses ) {
79 if ( $pricing->has_annual() ) {
80 echo "\${$pricing->annual_price} / " . fs_esc_html_x_inline( 'year', 'as annual period', 'year', $plugin->slug );
81 } else if ( $pricing->has_monthly() ) {
82 echo "\${$pricing->monthly_price} / " . fs_esc_html_x_inline( 'mo', 'as monthly period', 'mo', $plugin->slug );
83 } else {
84 echo "\${$pricing->lifetime_price}";
85 }
86 }
87 }
88 }
89 ?></span>
90 </th>
91 <?php endforeach ?>
92 </tr>
93 </thead>
94 <tbody>
95 <?php $odd = true;
96 foreach ( $features_plan_map as $feature_id => $data ) : ?>
97 <tr class="fs-<?php echo $odd ? 'odd' : 'even' ?>">
98 <td><?php echo esc_html( ucfirst( $data['feature']->title ) ) ?></td>
99 <?php foreach ( $plans as $plan ) : ?>
100 <td>
101 <?php if ( isset( $data['plans'][ $plan->id ] ) ) : ?>
102 <?php if ( ! empty( $data['plans'][ $plan->id ]->value ) ) : ?>
103 <b><?php echo esc_html( $data['plans'][ $plan->id ]->value ) ?></b>
104 <?php else : ?>
105 <i class="dashicons dashicons-yes"></i>
106 <?php endif ?>
107 <?php endif ?>
108 </td>
109 <?php endforeach ?>
110 </tr>
111 <?php $odd = ! $odd; endforeach ?>
112 </tbody>
113 </table>
114 </div>