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 / AbstractSettingsPage.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
AbstractSettingsPage.php
176 lines
1 <?php
2
3 namespace ProfilePress\Core\Admin\SettingsPages;
4
5 use ProfilePress\Core\Classes\ExtensionManager;
6 use ProfilePress\Custom_Settings_Page_Api;
7
8 if ( ! defined('ABSPATH')) {
9 exit;
10 }
11
12 abstract class AbstractSettingsPage
13 {
14 protected $option_name;
15
16 public function init_menu()
17 {
18 add_action('admin_menu', array($this, 'register_core_menu'));
19 }
20
21 private function getMenuIcon()
22 {
23 return 'data:image/svg+xml;base64,' . base64_encode('<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" width="150" height="150" viewBox="0 0 11.71 11.71" shape-rendering="geometricPrecision" image-rendering="optimizeQuality" fill-rule="evenodd" xmlns:v="https://vecta.io/nano"><path d="M5.85.2c3.13 0 5.66 2.53 5.66 5.65 0 3.13-2.53 5.66-5.66 5.66C2.73 11.51.2 8.98.2 5.85A5.65 5.65 0 0 1 5.85.2zM3.17 5.66l2.98-2.98c.24-.24.62-.24.86 0L8.53 4.2c.24.24.24.63 0 .87L6.12 7.48l.53.54a.64.64 0 0 1 0 .92l-.07.07a.64.64 0 0 1-.92 0l-.54-.53L3.44 6.8l-.27-.28c-.24-.23-.24-.62 0-.86zm3.21-1.22L4.93 5.89c-.12.11-.12.29 0 .4.11.11.28.11.39 0l1.46-1.45c.11-.11.11-.29 0-.4h0c-.11-.11-.29-.11-.4 0zM4.93 6.29h0z" fill="#a6aaad"/></svg>');
24 }
25
26 public function register_core_menu()
27 {
28 add_menu_page(
29 esc_html__('ProfilePress - WordPress User Registration & Profile Plugin', 'wp-user-avatar'),
30 'ProfilePress',
31 'manage_options',
32 PPRESS_SETTINGS_SLUG,
33 '',
34 $this->getMenuIcon(),
35 '80.0015'
36 );
37 }
38
39 /**
40 * Register core settings.
41 *
42 * @param Custom_Settings_Page_Api $instance
43 * @param bool $remove_sidebar
44 */
45 public function register_core_settings(Custom_Settings_Page_Api $instance, $remove_sidebar = false)
46 {
47 if ( ! $remove_sidebar) {
48 $instance->sidebar($this->sidebar_args());
49 }
50 }
51
52 public function settings_tab_args()
53 {
54 $tabs = apply_filters('ppress_settings_page_tabs', [
55 20 => ['url' => PPRESS_SETTINGS_SETTING_PAGE, 'label' => esc_html__('General', 'wp-user-avatar')],
56 40 => ['url' => add_query_arg('view', 'email', PPRESS_SETTINGS_SETTING_PAGE), 'label' => esc_html__('Emails', 'wp-user-avatar')],
57 60 => ['url' => add_query_arg('view', 'tools', PPRESS_SETTINGS_SETTING_PAGE), 'label' => esc_html__('Tools', 'wp-user-avatar')],
58 ]);
59
60 if ( ! ExtensionManager::is_premium()) {
61 $tabs[999] = ['url' => PPRESS_EXTENSIONS_SETTINGS_PAGE, 'label' => esc_html__('Premium Addons', 'wp-user-avatar')];
62 }
63
64 ksort($tabs);
65
66 return $tabs;
67 }
68
69 public function sidebar_args()
70 {
71 $sidebar_args = [
72 [
73 'section_title' => esc_html__('Help / Support', 'wp-user-avatar'),
74 'content' => $this->sidebar_support_docs(),
75 ],
76 [
77 'section_title' => esc_html__('Check out MailOptin', 'wp-user-avatar'),
78 'content' => $this->mailoptin_ad_block(),
79 ]
80 ];
81
82 return $sidebar_args;
83 }
84
85 public function sidebar_support_docs()
86 {
87 $content = '<p>';
88 $content .= sprintf(
89 esc_html__('Visit the %s for guidance.', 'wp-user-avatar'),
90 '<strong><a href="https://profilepress.net/docs/" target="_blank">' . esc_html__('Documentation', 'wp-user-avatar') . '</a></strong>'
91 );
92
93 $content .= '</p>';
94
95 $content .= '<p>';
96 $content .= sprintf(
97 esc_html__('For support, %sreach out to us%s.', 'wp-user-avatar'),
98 '<strong><a href="https://profilepress.net/support/" target="_blank">', '</a></strong>'
99 );
100 $content .= '</p>';
101
102 return $content;
103 }
104
105 public function mailoptin_ad_block()
106 {
107 $content = '<p>';
108 $content .= sprintf(
109 esc_html__('Use the coupon code %s10PERCENTOFF%s to save %s off MailOptin.', 'wp-user-avatar'),
110 '<code>', '</code>', '10%'
111 );
112
113 $content .= '</p>';
114
115 $content .= '<a href="https://mailoptin.io/?utm_source=wp_dashboard&utm_medium=profilepress-admin-sidebar&utm_campaign=mailoptin" target="_blank"><img style="width: 100%" src="' . PPRESS_ASSETS_URL . '/images/admin/mo-pro-upgrade.jpg"></a>';
116
117 return $content;
118 }
119
120 protected function placeholder_tags_table($placeholders)
121 {
122 ?>
123 <div class="pp-placeholder-tags">
124 <table class="widefat striped">
125 <tbody>
126 <tr>
127 <th colspan="2"><?= esc_html__('Available placeholders for subject and message body', 'wp-user-avatar'); ?></th>
128 </tr>
129 <?php foreach ($placeholders as $tag => $description) : ?>
130 <tr>
131 <td><?= $tag ?></td>
132 <td><?= $description ?></td>
133 </tr>
134 <?php endforeach; ?>
135 </tbody>
136 </table>
137 </div>
138 <?php
139 }
140
141 protected function page_dropdown($id, $appends = [], $args = [])
142 {
143 $html = wp_dropdown_pages(
144 array_replace(
145 [
146 'name' => PPRESS_SETTINGS_DB_OPTION_NAME . "[$id]",
147 'show_option_none' => esc_html__('Select...', 'wp-user-avatar'),
148 'selected' => ppress_get_setting($id, ''),
149 'echo' => false
150 ],
151 $args
152 )
153 );
154
155 if ( ! empty($appends)) {
156 $addition = '';
157 foreach ($appends as $append) {
158 $key = $append['key'];
159 $label = $append['label'];
160 $addition .= "<option value=\"$key\"" . selected(ppress_get_setting($id), $key, false) . '>' . $label . '</option>';
161 }
162
163 $html = ppress_append_option_to_select($addition, $html);
164 }
165
166 return $html;
167 }
168
169 protected function custom_text_input($id, $placeholder = '')
170 {
171 $placeholder = ! empty($placeholder) ? $placeholder : esc_html__('Custom URL Here', 'wp-user-avatar');
172 $value = ppress_get_setting($id, '');
173
174 return "<input placeholder=\"$placeholder\" name=\"" . PPRESS_SETTINGS_DB_OPTION_NAME . "[$id]\" type=\"text\" class=\"regular-text code\" value=\"$value\">";
175 }
176 }