PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.5
YayMail – WooCommerce Email Customizer v4.4.5
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
yaymail / vendor-prefixed / views / license-card.php

license-card.php in YayMail – WooCommerce Email Customizer 4.4.5, at vendor-prefixed/views/license-card.php

134 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMailScoped;
4
5 /**
6 * License "active" card — shows current license state with update/deactivate buttons.
7 *
8 * De-branded port from YayMail Pro information-card.php.
9 * Expects in scope: $license (License), $_plugin ['slug', 'name'].
10 *
11 * @package YayCommerce\AdminShell\Views
12 */
13 \defined('ABSPATH') || exit;
14 $plugin_slug = $_plugin['slug'];
15 $plugin_name = $_plugin['name'];
16 $license_info = $license->get_license_info();
17 $expires = $license_info['expires'] ?? 'Not updated';
18 $is_expired = $license->is_expired();
19 $is_addon = \false !== \strpos($plugin_slug, 'addon');
20 ?>
21 <div class="yaycommerce-license-card" id="<?php
22 echo \esc_attr("{$plugin_slug}_license_card");
23 ?>" style="<?php
24 echo \esc_attr($is_addon ? 'order: 999;' : '');
25 ?>">
26 <div class="yaycommerce-license-card-header">
27 <div class="yaycommerce-license-card-title-wrapper">
28 <h3 class="yaycommerce-license-card-title yaycommerce-license-card-header-item">
29 <?php
30 echo \esc_html($plugin_name);
31 ?>
32 <span class="yaycommerce-license-badge <?php
33 echo \esc_attr($is_expired ? 'error' : 'success');
34 ?>">
35 <?php
36 echo \esc_html($is_expired ? \__('Expired', 'yaycommerce') : \__('Active', 'yaycommerce'));
37 ?>
38 </span>
39 </h3>
40 </div>
41 </div>
42 <div class="yaycommerce-license-card-body">
43 <label for="<?php
44 echo \esc_attr("{$plugin_slug}_license_input");
45 ?>"><?php
46 \esc_html_e('Your license key:', 'yaycommerce');
47 ?></label>
48 <div class="yaycommerce-license-input-row">
49 <input type="text" id="<?php
50 echo \esc_attr("{$plugin_slug}_license_input");
51 ?>" disabled value="<?php
52 echo \esc_attr($license->format_license_key());
53 ?>">
54 <button class="yaycommerce-license-button yaycommerce-update-license" data-plugin="<?php
55 echo \esc_attr($plugin_slug);
56 ?>">
57 <span><?php
58 \esc_html_e('Update', 'yaycommerce');
59 ?></span>
60 <span class="activate-loading sync-loading" style="display:none;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.66 10.37a.62.62 0 00.07-.19l.75-4a1 1 0 00-2-.36l-.37 2a9.22 9.22 0 00-16.58.84 1 1 0 00.55 1.3 1 1 0 001.31-.55A7.08 7.08 0 0112.07 5a7.17 7.17 0 016.24 3.58l-1.65-.27a1 1 0 10-.32 2l4.25.71h.16a.93.93 0 00.34-.06.33.33 0 00.1-.06.78.78 0 00.2-.11l.08-.1a1.07 1.07 0 00.14-.16.58.58 0 00.05-.16zM19.88 14.07a1 1 0 00-1.31.56A7.08 7.08 0 0111.93 19a7.17 7.17 0 01-6.24-3.58l1.65.27h.16a1 1 0 00.16-2L3.41 13a.91.91 0 00-.33 0H3a1.15 1.15 0 00-.32.14 1 1 0 00-.18.18l-.09.1a.84.84 0 00-.07.19.44.44 0 00-.07.17l-.75 4a1 1 0 00.8 1.22h.18a1 1 0 001-.82l.37-2a9.22 9.22 0 0016.58-.83 1 1 0 00-.57-1.28z"></path></svg></span>
61 </button>
62 <button class="yaycommerce-license-button yaycommerce-remove-license" data-plugin="<?php
63 echo \esc_attr($plugin_slug);
64 ?>">
65 <span><?php
66 \esc_html_e('Deactivate', 'yaycommerce');
67 ?></span>
68 <span class="activate-loading sync-loading" style="display:none;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.66 10.37a.62.62 0 00.07-.19l.75-4a1 1 0 00-2-.36l-.37 2a9.22 9.22 0 00-16.58.84 1 1 0 00.55 1.3 1 1 0 001.31-.55A7.08 7.08 0 0112.07 5a7.17 7.17 0 016.24 3.58l-1.65-.27a1 1 0 10-.32 2l4.25.71h.16a.93.93 0 00.34-.06.33.33 0 00.1-.06.78.78 0 00.2-.11l.08-.1a1.07 1.07 0 00.14-.16.58.58 0 00.05-.16zM19.88 14.07a1 1 0 00-1.31.56A7.08 7.08 0 0111.93 19a7.17 7.17 0 01-6.24-3.58l1.65.27h.16a1 1 0 00.16-2L3.41 13a.91.91 0 00-.33 0H3a1.15 1.15 0 00-.32.14 1 1 0 00-.18.18l-.09.1a.84.84 0 00-.07.19.44.44 0 00-.07.17l-.75 4a1 1 0 00.8 1.22h.18a1 1 0 001-.82l.37-2a9.22 9.22 0 0016.58-.83 1 1 0 00-.57-1.28z"></path></svg></span>
69 </button>
70 </div>
71 <div class="<?php
72 echo \esc_attr($plugin_slug);
73 ?>-license-message yaycommerce-license-message"></div>
74 <div><?php
75 \esc_html_e('Expiration Date:', 'yaycommerce');
76 ?>
77 <?php
78 if ('lifetime' === $expires) {
79 echo '<strong>' . \esc_html__('Lifetime', 'yaycommerce') . '</strong>';
80 } elseif ('Not updated' === $expires) {
81 echo '<strong>' . \esc_html__('Not updated', 'yaycommerce') . '</strong>';
82 } else {
83 $time_in_tz = \strtotime($expires);
84 echo '<strong>' . \esc_html(\gmdate('F j, Y', $time_in_tz)) . '</strong>';
85 }
86 if ($is_expired) {
87 echo '<strong class="yaycommerce-license-expired-text"> (' . \esc_html__('Expired', 'yaycommerce') . ')</strong>';
88 }
89 ?>
90 </div>
91 </div>
92 <div class="yaycommerce-license-card-footer">
93 <?php
94 if ($is_expired) {
95 ?>
96 <div>
97 <strong class="yaycommerce-license-expired-text">
98 <?php
99 \esc_html_e('Your license is expired!', 'yaycommerce');
100 ?>
101 <a href="<?php
102 echo \esc_url($license->get_renewal_url());
103 ?>" class="yaycommerce-license-expired-text" target="_blank">
104 <?php
105 \esc_html_e('Renew Now!', 'yaycommerce');
106 ?>
107 </a>
108 </strong>
109 </div>
110 <?php
111 }
112 ?>
113 <?php
114 if (isset($license_info['license_limit']) && 0 !== (int) $license_info['license_limit']) {
115 ?>
116 <div>
117 <?php
118 \esc_html_e('Need more licenses?', 'yaycommerce');
119 ?>
120 <a class="yaycommerce-license-buy-now" href="<?php
121 echo \esc_url($license->get_upgrade_url());
122 ?>" target="_blank">
123 <?php
124 \esc_html_e('Upgrade to unlimited', 'yaycommerce');
125 ?>
126 </a>
127 </div>
128 <?php
129 }
130 ?>
131 </div>
132 </div>
133 <?php
134