PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 3.2.2
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v3.2.2
4.17.2 4.17.1 4.17.0 4.16.19 4.16.18 4.16.17 4.16.16 trunk 1.0 1.0.1 1.0.2 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5a 1.1.6 1.1.7 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.7 1.7.1 1.7.2 1.8 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.1.9 2.2.10 2.2.11 2.2.12 2.2.13 2.2.14 2.2.15 2.2.16 2.2.2 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 3.0 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10.0 4.10.1 4.10.2 4.10.3 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.13.3 4.13.4 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.15.0 4.15.1 4.15.10 4.15.11 4.15.12 4.15.13 4.15.14 4.15.15 4.15.16 4.15.17 4.15.18 4.15.19 4.15.2 4.15.20 4.15.20.1 4.15.21 4.15.22 4.15.23 4.15.24 4.15.25 4.15.3 4.15.4 4.15.5 4.15.6 4.15.7 4.15.8 4.15.9 4.16.0 4.16.1 4.16.10 4.16.11 4.16.12 4.16.13 4.16.14 4.16.15 4.16.2 4.16.3 4.16.4 4.16.5 4.16.6 4.16.7 4.16.8 4.16.9 4.2.0 4.3.0 4.3.1 4.3.2 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.7.0 4.8.0 4.9.0
wp-user-avatar / src / Admin / SettingsPages / ExtensionsSettingsPage.php
wp-user-avatar / src / Admin / SettingsPages Last commit date
DragDropBuilder 4 years ago EmailSettings 4 years ago AbstractSettingsPage.php 4 years ago AddNewForm.php 4 years ago AdminFooter.php 5 years ago ExtensionsSettingsPage.php 4 years ago FormList.php 5 years ago Forms.php 4 years ago GeneralSettings.php 4 years ago IDUserColumn.php 5 years ago MailOptin.php 4 years ago MemberDirectories.php 4 years ago MembersDirectoryList.php 5 years ago ToolsSettingsPage.php 4 years ago index.php 5 years ago
ExtensionsSettingsPage.php
188 lines
1 <?php
2
3 namespace ProfilePress\Core\Admin\SettingsPages;
4
5 use ProfilePress\Core\Classes\ExtensionManager;
6 use ProfilePress\Core\Classes\ExtensionManager as EM;
7 use ProfilePress\Custom_Settings_Page_Api;
8
9 class ExtensionsSettingsPage extends AbstractSettingsPage
10 {
11 protected $spInstance;
12
13 public function __construct()
14 {
15 add_action('ppress_admin_hooks', function () {
16 add_action('ppress_register_menu_page', [$this, 'register_settings_page']);
17 add_action('ppress_admin_settings_page_addons', [$this, 'settings_page_function']);
18 });
19
20 if ( ! ExtensionManager::is_premium()) {
21 add_filter('install_plugins_tabs', [$this, 'add_extension_tab']);
22 add_action('install_plugins_ppress_extensions', [$this, 'extension_view']);
23 }
24
25 add_action('admin_init', function () {
26 $this->spInstance = Custom_Settings_Page_Api::instance([], EM::DB_OPTION_NAME);
27 });
28 }
29
30 public function default_header_menu()
31 {
32 return 'addons';
33 }
34
35 public function add_extension_tab($tabs)
36 {
37 $tabs['ppress_extensions'] = 'ProfilePress ' . __('Addons', 'wp-user-avatar');
38
39 return $tabs;
40 }
41
42 public function extension_view($tabs)
43 {
44 $this->admin_settings_page_callback();
45 }
46
47 public function admin_page_title()
48 {
49 return esc_html__('Addons', 'wp-user-avatar');
50 }
51
52 public function register_settings_page()
53 {
54 add_submenu_page(
55 PPRESS_SETTINGS_SLUG,
56 $this->admin_page_title() . ' - ProfilePress',
57 '<span style="color:#f18500">' . $this->admin_page_title() . '</span>',
58 'manage_options',
59 PPRESS_EXTENSIONS_SETTINGS_SLUG,
60 [$this, 'admin_page_callback']);
61 }
62
63 public function settings_page_function()
64 {
65 add_action('wp_cspa_main_content_area', array($this, 'admin_settings_page_callback'), 10, 2);
66 add_action('wp_cspa_form_tag', function () {
67 echo 'id="ppress-extension-manager-form"';
68 });
69
70 $this->spInstance->add_view_classes('ppress-extensions');
71 $this->spInstance->page_header($this->admin_page_title());
72 $this->register_core_settings($this->spInstance, true);
73 $this->spInstance->build(true);
74 }
75
76 public function admin_settings_page_callback()
77 {
78 ?>
79 <div class="ppress-extensions-items-wrap">
80 <?php if (EM::is_premium()) : ?>
81 <div class="ppress-extensions-header">
82 <div class="ppress-extensions-header-buttons">
83 <div class="button-content">
84 <button type="button" class="button-primary ppress-extensions-button" onclick="jQuery('.ppress-extension-manager-checkbox').prop('checked', true);jQuery('#ppress-extension-manager-form').submit();">
85 <?= esc_html__('Activate All', 'wp-user-avatar') ?>
86 </button>
87 <button type="button" class="button-secondary ppress-extensions-button" onclick="jQuery('.ppress-extension-manager-checkbox').prop('checked', false);jQuery('#ppress-extension-manager-form').submit();">
88 <?= esc_html__('Deactivate All', 'wp-user-avatar') ?>
89 </button>
90 </div>
91 </div>
92 </div>
93 <?php else : ?>
94 <div class="ppress-extensions-upsell-wrap">
95 <div class="notice-content">
96 <span>
97 <?= sprintf(
98 esc_html__('Upgrade to Premium to unlock extensions and other great features. As a valued ProfilePress Lite user, you will %1$sreceive 10%3$s off%2$s your purchase, automatically applied at checkout!', 'wp-user-avatar'),
99 '<span class="ppress-extensions-upsell-highlight">', '</span>', '%'
100 ) ?>
101 </span>
102 <div class="ppress-extensions-upsell-button">
103 <a target="_blank" href="https://profilepress.net/pricing/?discount=10PPOFF&utm_source=liteplugin&utm_medium=extension-page&utm_campaign=notice&utm_content=upsell" class="button-primary">
104 <?= esc_html__('Upgrade Now', 'wp-user-avatar') ?>
105 </a>
106 </div>
107 </div>
108 </div>
109 <?php endif; ?>
110 <div class="ppress-extensions-items-row">
111
112 <?php foreach (EM::available_extensions() as $id => $extension) :
113 $name = sprintf('%s[%s]', EM::DB_OPTION_NAME, $id);
114 $extension_class = ppress_var(EM::class_map(), $id);
115 $upgrade_url = "https://profilepress.net/pricing/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=extension-upgrade&utm_content=$id";
116 if ( ! EM::is_premium()) {
117 $upgrade_url = add_query_arg('discount', '10PPOFF', $upgrade_url);
118 }
119
120 $upgrade_label = ! EM::is_premium() ? esc_html__('Upgrade to Premium', 'wp-user-avatar') : esc_html__('Upgrade Plan', 'wp-user-avatar');
121
122 ?>
123
124 <?php $dependency_available = isset($extension['is_available']) && true !== ($callable_result = call_user_func($extension['is_available'])) ? $callable_result : true; ?>
125 <div class="ppress-extension-item-wrap">
126 <div class="ppress-extension-item-card">
127 <div class="ppress-extension-card-body<?= EM::is_premium() && $extension_class::$instance_flag && (true !== $dependency_available) ? ' ppress-unavailable' : '' ?>">
128 <div class="ppress-extension-card-header">
129 <?= ppress_var($extension, 'icon', '') ?>
130 <?= esc_html($extension['title']) ?>
131 </div>
132 <div class="ppress-extension-card-description">
133 <div><?= esc_html($extension['description']) ?></div>
134 <div class="ppress-extension-card-learn-more">
135 <a href="<?= esc_url($extension['url']) ?>" target="_blank"><?= esc_html__('Learn More', 'wp-user-avatar') ?></a>
136 <a href="<?= esc_url($extension['url']) ?>" target="_blank" class="no-underline"> </a>
137 </div>
138 </div>
139 </div>
140 <div class="ppress-extension-card-footer">
141
142 <?php if (EM::is_premium() && $extension_class::$instance_flag) : ?>
143
144 <?php if (true !== $dependency_available) : ?>
145 <span class="ppress-extension-status">
146 <?= sprintf(esc_html__('Unavailable: %s', 'wp-user-avatar'), "<span>$callable_result</span>") ?>
147 </span>
148 <?php else : ?>
149 <div class="ppress-extension-card-install-activate">
150 <span class="ppress-extension-card-status">
151 <?= EM::is_enabled($id) ? esc_html__('Activated', 'wp-user-avatar') : esc_html__('Deactivated', 'wp-user-avatar') ?>
152 </span>
153 <label for="ppress-<?= $id ?>">
154 <input type="hidden" name="<?= $name ?>" value="false">
155 <input class="ppress-extension-manager-checkbox" type="checkbox" name="<?= $name ?>" id="ppress-<?= $id ?>" value="true" onchange="jQuery('#ppress-extension-manager-form').submit();" <?php checked(EM::is_enabled($id)) ?>>
156 <span class="ppress-extension-use-switch"></span>
157 </label>
158 </div>
159 <?php endif; ?>
160
161 <?php else : ?>
162 <div class="ppress-extensions-upgrade-cta">
163 <a class="button-primary ppress-extensions-button" href="<?= esc_url($upgrade_url) ?>" target="_blank">
164 <?= esc_html($upgrade_label) ?>
165 </a>
166 </div>
167 <?php endif; ?>
168 </div>
169 </div>
170 </div>
171 <?php endforeach; ?>
172 </div>
173 <input type="hidden" name="save_ppress_extension_manager" value="true">
174 </div>
175 <?php
176 }
177
178 public static function get_instance()
179 {
180 static $instance = null;
181
182 if (is_null($instance)) {
183 $instance = new self();
184 }
185
186 return $instance;
187 }
188 }