PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.6
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.6
1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 All 211 releases
charitable / includes / admin / views / settings / licenses.php

licenses.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.6, at includes/admin/views/settings/licenses.php

125 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Display the table of products requiring licenses.
4 *
5 * @author David Bisset
6 * @package Charitable/Admin View/Settings
7 * @copyright Copyright (c) 2022, WP Charitable LLC
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.0.0
10 * @version 1.0.0
11 */
12
13 $helper = charitable_get_helper( 'licenses' );
14 $products = $helper->get_products();
15
16 if ( empty( $products ) ) :
17 return;
18 endif;
19
20 $slug = Charitable_Addons_Directory::get_current_plan_slug();
21 $is_legacy = Charitable_Addons_Directory::is_current_plan_legacy();
22
23 if ( false !== $slug && strtolower( $slug ) !== 'lite' && ! $is_legacy ) {
24
25 // there is a valid legacy license present
26
27 $new_tab_notification =
28 '<p>' .
29 sprintf(
30 wp_kses(
31 /* translators: %s - charitable.com upgrade URL. */
32 __( 'You already have a non-legacy license activate on this install, which you can deactivate <a href="%s">in the "General" tab</a>.', 'charitable' ),
33 [
34 'a' => [
35 'href' => [],
36 'class' => [],
37 'target' => [],
38 'rel' => [],
39 ],
40 'br' => [],
41 'strong' => [],
42 ]
43 ),
44 esc_url( admin_url( 'admin.php?page=charitable-settings&tab=general' ) )
45 ) .
46 '</p>';
47
48 ?>
49
50 <div class="charitable-settings-notice license-notice" style="margin-bottom: 20px;">
51 <p><?php _e( 'This area is reserved for older (legacy) license keys.', 'charitable' ); ?></p>
52 <p><?php echo $new_tab_notification; ?></p>
53 </div>
54
55 <?php
56
57 } else {
58
59 $new_tab_notification =
60 '<p>' .
61 sprintf(
62 wp_kses(
63 /* translators: %s - charitable.com upgrade URL. */
64 __( 'If you have purchased your license key recently, please enter your Chariable license key <a href="%s">in the "General" tab</a>.', 'charitable' ),
65 [
66 'a' => [
67 'href' => [],
68 'class' => [],
69 'target' => [],
70 'rel' => [],
71 ],
72 'br' => [],
73 'strong' => [],
74 ]
75 ),
76 esc_url( admin_url( 'admin.php?page=charitable-settings&tab=general' ) )
77 ) .
78 '</p>';
79
80 ?>
81 <div class="charitable-settings-notice license-notice" style="margin-bottom: 20px;">
82 <p><?php _e( 'This area is reserved for older (legacy) license keys.', 'charitable' ); ?></p>
83 <p><?php echo $new_tab_notification; ?></p>
84 <p><?php _e( 'By adding your license keys, you agree for your website to send requests to wpcharitable.com to check license details and provide automatic plugin updates. Your license(s) can be disconnected at any time.', 'charitable' ); ?></p>
85 </div>
86 <?php
87 foreach ( $products as $key => $product ) :
88
89 $license = $helper->get_license_details( $key );
90
91 if ( is_array( $license ) ) {
92 $is_active = $license['valid'];
93 $license_key = $license['license'];
94 } else {
95 $is_active = false;
96 $license_key = $license;
97 }
98
99 ?>
100 <div class="charitable-settings-object charitable-licensed-product cf">
101 <h4><?php echo $product['name']; ?></h4>
102 <input type="text" name="charitable_settings[legacy_licenses][<?php echo $key; ?>]" id="charitable_settings_licenses_<?php echo $key; ?>" class="charitable-settings-field" placeholder="<?php _e( 'Add your license key', 'charitable' ); ?>" value="<?php echo $license_key; ?>" />
103 <?php if ( $license ) : ?>
104 <div class="license-meta">
105 <?php if ( $is_active ) : ?>
106 <a href="<?php echo $helper->get_license_deactivation_url( $key ); ?>" class="button-secondary license-deactivation"><?php _e( 'Deactivate License', 'charitable' ); ?></a>
107 <?php if ( 'lifetime' == $license['expiration_date'] ) : ?>
108 <span class="license-expiration-date"><?php _e( 'Lifetime license', 'charitable' ); ?></span>
109 <?php else : ?>
110 <span class="license-expiration-date"><?php printf( '%s %s.', __( 'Expiring in', 'charitable' ), human_time_diff( strtotime( $license['expiration_date'] ), time() ) ); ?></span>
111 <?php endif ?>
112 <?php elseif ( is_array( $license ) ) : ?>
113 <span class="license-invalid"><?php _e( 'This license is not valid', 'charitable' ); ?></span>
114 <?php else : ?>
115 <span class="license-invalid"><?php _e( 'We could not validate this license', 'charitable' ); ?></span>
116 <?php endif ?>
117 </div>
118 <?php endif ?>
119 </div>
120
121 <?php
122 endforeach;
123
124 }
125