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