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