PluginProbe ʕ •ᴥ•ʔ
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress / 4.0.3
Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress v4.0.3
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 Membership 4 years ago AbstractSettingsPage.php 4 years ago AddNewForm.php 4 years ago AdminFooter.php 4 years ago ExtensionsSettingsPage.php 4 years ago FormList.php 4 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
190 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 if (ppressGET_var('page') == PPRESS_EXTENSIONS_SETTINGS_SLUG) {
27 $this->spInstance = Custom_Settings_Page_Api::instance([], EM::DB_OPTION_NAME);
28 }
29 });
30 }
31
32 public function default_header_menu()
33 {
34 return 'addons';
35 }
36
37 public function add_extension_tab($tabs)
38 {
39 $tabs['ppress_extensions'] = 'ProfilePress ' . __('Addons', 'wp-user-avatar');
40
41 return $tabs;
42 }
43
44 public function extension_view($tabs)
45 {
46 $this->admin_settings_page_callback();
47 }
48
49 public function admin_page_title()
50 {
51 return esc_html__('Addons', 'wp-user-avatar');
52 }
53
54 public function register_settings_page()
55 {
56 add_submenu_page(
57 PPRESS_DASHBOARD_SETTINGS_SLUG,
58 'ProfilePress ' . $this->admin_page_title(),
59 '<span style="color:#f18500">' . $this->admin_page_title() . '</span>',
60 'manage_options',
61 PPRESS_EXTENSIONS_SETTINGS_SLUG,
62 [$this, 'admin_page_callback']);
63 }
64
65 public function settings_page_function()
66 {
67 add_action('wp_cspa_main_content_area', array($this, 'admin_settings_page_callback'), 10, 2);
68 add_action('wp_cspa_form_tag', function () {
69 echo 'id="ppress-extension-manager-form"';
70 });
71
72 $this->spInstance->add_view_classes('ppress-extensions');
73 $this->spInstance->page_header($this->admin_page_title());
74 $this->register_core_settings($this->spInstance, true);
75 $this->spInstance->build(true);
76 }
77
78 public function admin_settings_page_callback()
79 {
80 ?>
81 <div class="ppress-extensions-items-wrap">
82 <?php if (EM::is_premium()) : ?>
83 <div class="ppress-extensions-header">
84 <div class="ppress-extensions-header-buttons">
85 <div class="button-content">
86 <button type="button" class="button-primary ppress-extensions-button" onclick="jQuery('.ppress-extension-manager-checkbox').prop('checked', true);jQuery('#ppress-extension-manager-form').submit();">
87 <?= esc_html__('Activate All', 'wp-user-avatar') ?>
88 </button>
89 <button type="button" class="button-secondary ppress-extensions-button" onclick="jQuery('.ppress-extension-manager-checkbox').prop('checked', false);jQuery('#ppress-extension-manager-form').submit();">
90 <?= esc_html__('Deactivate All', 'wp-user-avatar') ?>
91 </button>
92 </div>
93 </div>
94 </div>
95 <?php else : ?>
96 <div class="ppress-extensions-upsell-wrap">
97 <div class="notice-content">
98 <span>
99 <?= sprintf(
100 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'),
101 '<span class="ppress-extensions-upsell-highlight">', '</span>', '%'
102 ) ?>
103 </span>
104 <div class="ppress-extensions-upsell-button">
105 <a target="_blank" href="https://profilepress.com/pricing/?discount=10PPOFF&utm_source=liteplugin&utm_medium=extension-page&utm_campaign=notice&utm_content=upsell" class="button-primary">
106 <?= esc_html__('Upgrade Now', 'wp-user-avatar') ?>
107 </a>
108 </div>
109 </div>
110 </div>
111 <?php endif; ?>
112 <div class="ppress-extensions-items-row">
113
114 <?php foreach (EM::available_extensions() as $id => $extension) :
115 $name = sprintf('%s[%s]', EM::DB_OPTION_NAME, $id);
116 $extension_class = ppress_var(EM::class_map(), $id);
117 $upgrade_url = "https://profilepress.com/pricing/?utm_source=WordPress&utm_campaign=liteplugin&utm_medium=extension-upgrade&utm_content=$id";
118 if ( ! EM::is_premium()) {
119 $upgrade_url = add_query_arg('discount', '10PPOFF', $upgrade_url);
120 }
121
122 $upgrade_label = ! EM::is_premium() ? esc_html__('Upgrade to Premium', 'wp-user-avatar') : esc_html__('Upgrade Plan', 'wp-user-avatar');
123
124 ?>
125
126 <?php $dependency_available = isset($extension['is_available']) && true !== ($callable_result = call_user_func($extension['is_available'])) ? $callable_result : true; ?>
127 <div class="ppress-extension-item-wrap">
128 <div class="ppress-extension-item-card">
129 <div class="ppress-extension-card-body<?= EM::is_premium() && class_exists($extension_class) && $extension_class::$instance_flag && (true !== $dependency_available) ? ' ppress-unavailable' : '' ?>">
130 <div class="ppress-extension-card-header">
131 <?= ppress_var($extension, 'icon', '') ?>
132 <?= esc_html($extension['title']) ?>
133 </div>
134 <div class="ppress-extension-card-description">
135 <div><?= esc_html($extension['description']) ?></div>
136 <div class="ppress-extension-card-learn-more">
137 <a href="<?= esc_url($extension['url']) ?>" target="_blank"><?= esc_html__('Learn More', 'wp-user-avatar') ?></a>
138 <a href="<?= esc_url($extension['url']) ?>" target="_blank" class="no-underline"> </a>
139 </div>
140 </div>
141 </div>
142 <div class="ppress-extension-card-footer">
143
144 <?php if (EM::is_premium() && class_exists($extension_class) && $extension_class::$instance_flag) : ?>
145
146 <?php if (true !== $dependency_available) : ?>
147 <span class="ppress-extension-status">
148 <?= sprintf(esc_html__('Unavailable: %s', 'wp-user-avatar'), "<span>$callable_result</span>") ?>
149 </span>
150 <?php else : ?>
151 <div class="ppress-extension-card-install-activate">
152 <span class="ppress-extension-card-status">
153 <?= EM::is_enabled($id) ? esc_html__('Activated', 'wp-user-avatar') : esc_html__('Deactivated', 'wp-user-avatar') ?>
154 </span>
155 <label for="ppress-<?= $id ?>">
156 <input type="hidden" name="<?= $name ?>" value="false">
157 <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)) ?>>
158 <span class="ppress-extension-use-switch"></span>
159 </label>
160 </div>
161 <?php endif; ?>
162
163 <?php else : ?>
164 <div class="ppress-extensions-upgrade-cta">
165 <a class="button-primary ppress-extensions-button" href="<?= esc_url($upgrade_url) ?>" target="_blank">
166 <?= esc_html($upgrade_label) ?>
167 </a>
168 </div>
169 <?php endif; ?>
170 </div>
171 </div>
172 </div>
173 <?php endforeach; ?>
174 </div>
175 <input type="hidden" name="save_ppress_extension_manager" value="true">
176 </div>
177 <?php
178 }
179
180 public static function get_instance()
181 {
182 static $instance = null;
183
184 if (is_null($instance)) {
185 $instance = new self();
186 }
187
188 return $instance;
189 }
190 }