PluginProbe ʕ •ᴥ•ʔ
Rich Showcase for Google Reviews / 3.1
Rich Showcase for Google Reviews v3.1
6.9.8 6.9.7 6.9.6 trunk 1.4 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.5 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.7 1.6.8 1.6.9 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8 1.8.1 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.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.4 2.4.1 2.4.2 2.5 2.5.1 2.6 2.6.1 2.6.2 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.6.1 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.8.1 4.8.2 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.7.1 5.8 5.9 5.9.1 5.9.2 5.9.3 5.9.7 6.0 6.1 6.2 6.3 6.4 6.4.1 6.5 6.6 6.6.1 6.6.2 6.7 6.8 6.8.1 6.8.2 6.9 6.9.1 6.9.2 6.9.3 6.9.4 6.9.4.1 6.9.4.2 6.9.4.3 6.9.4.4 6.9.5
widget-google-reviews / includes / class-plugin-settings.php
widget-google-reviews / includes Last commit date
admin 2 years ago core 2 years ago class-activator.php 3 years ago class-assets.php 2 years ago class-builder-page.php 3 years ago class-deactivator.php 3 years ago class-debug-info.php 2 years ago class-feed-ajax.php 2 years ago class-feed-block.php 2 years ago class-feed-deserializer.php 2 years ago class-feed-old.php 4 years ago class-feed-page.php 3 years ago class-feed-serializer.php 3 years ago class-feed-shortcode.php 3 years ago class-feed-widget.php 4 years ago class-plugin-overview-ajax.php 3 years ago class-plugin-overview.php 3 years ago class-plugin-settings.php 2 years ago class-plugin-support.php 3 years ago class-plugin.php 2 years ago class-post-types.php 3 years ago class-reviews-cron.php 2 years ago class-settings-save.php 3 years ago class-view.php 2 years ago index.php 4 years ago page-setting-fig.php 3 years ago page-setting-support.php 4 years ago
class-plugin-settings.php
172 lines
1 <?php
2
3 namespace WP_Rplg_Google_Reviews\Includes;
4
5 class Plugin_Settings {
6
7 private $debug_info;
8
9 public function __construct(Debug_Info $debug_info) {
10 $this->debug_info = $debug_info;
11 }
12
13 public function register() {
14 add_action('grw_admin_page_grw-settings', array($this, 'init'));
15 add_action('grw_admin_page_grw-settings', array($this, 'render'));
16 }
17
18 public function init() {
19
20 }
21
22 public function render() {
23
24 $tab = isset($_GET['grw_tab']) && strlen($_GET['grw_tab']) > 0 ? sanitize_text_field(wp_unslash($_GET['grw_tab'])) : 'active';
25
26 $grw_enabled = get_option('grw_active') == '1';
27 $grw_demand_assets = get_option('grw_demand_assets');
28 $grw_minified_assets = get_option('grw_minified_assets');
29 $grw_google_api_key = get_option('grw_google_api_key');
30 $grw_activation_time = get_option('grw_activation_time');
31 $grw_debug_mode = get_option('grw_debug_mode') == '1';
32
33 $grw_revupd_cron = get_option('grw_revupd_cron') == '1';
34 ?>
35
36 <div class="grw-page-title">
37 Settings
38 </div>
39
40 <?php do_action('grw_admin_notices'); ?>
41
42 <div class="grw-settings-workspace">
43
44 <div data-nav-tabs="">
45
46 <div class="nav-tab-wrapper">
47 <a href="#grw-general" class="nav-tab<?php if ($tab == 'active') { ?> nav-tab-active<?php } ?>">General</a>
48 <a href="#grw-google" class="nav-tab<?php if ($tab == 'google') { ?> nav-tab-active<?php } ?>">Google</a>
49 <a href="#grw-advance" class="nav-tab<?php if ($tab == 'advance') { ?> nav-tab-active<?php } ?>">Advance</a>
50 </div>
51
52 <div id="grw-general" class="tab-content" style="display:<?php echo $tab == 'active' ? 'block' : 'none'?>;">
53 <h3>General Settings</h3>
54 <form method="post" action="<?php echo esc_url(admin_url('admin-post.php?action=grw_settings_save&grw_tab=active&active=' . (string)((int)($grw_enabled != true)))); ?>">
55 <div class="grw-field">
56 <div class="grw-field-label">
57 <label>Google Reviews plugin is currently <b><?php echo $grw_enabled ? 'enabled' : 'disabled' ?></b></label>
58 </div>
59 <div class="wp-review-field-option">
60 <?php wp_nonce_field('grw-wpnonce_active', 'grw-form_nonce_active'); ?>
61 <input type="submit" name="active" class="button" value="<?php echo $grw_enabled ? 'Disable' : 'Enable'; ?>" />
62 </div>
63 </div>
64 </form>
65 </div>
66
67 <div id="grw-google" class="tab-content" style="display:<?php echo $tab == 'google' ? 'block' : 'none'?>;">
68 <h3>Google</h3>
69 <form method="post" action="<?php echo esc_url(admin_url('admin-post.php?action=grw_settings_save&grw_tab=google')); ?>">
70 <?php wp_nonce_field('grw-wpnonce_save', 'grw-form_nonce_save'); ?>
71 <div class="grw-field">
72 <div class="grw-field-label">
73 <label>Google Places API key</label>
74 </div>
75 <div class="wp-review-field-option">
76 <input type="text" id="grw_google_api_key" name="grw_google_api_key" class="regular-text" value="<?php echo esc_attr($grw_google_api_key); ?>">
77 <?php if (!$grw_google_api_key && time() - $grw_activation_time > 60 * 60 * 48) { ?>
78 <div class="grw-warn">Your Google API key is not set for this reason, reviews are not automatically updated daily.<br>Please create your own Google API key and save here.</div>
79 <?php } ?>
80 <p>API key is mandatory to make the reviews automatically updated.</p>
81 <p>If you do not know how to create it, please read: <a href="<?php echo admin_url('admin.php?page=grw-support&grw_tab=fig'); ?>" target="_blank">Full Installation Guide</a></p>
82 <div style="padding-top:15px">
83 <input type="submit" value="Save" name="save" class="button" />
84 </div>
85 </div>
86 </div>
87 </form>
88 </div>
89
90 <div id="grw-advance" class="tab-content" style="display:<?php echo $tab == 'advance' ? 'block' : 'none'?>;">
91 <h3>Advance</h3>
92 <form method="post" action="<?php echo esc_url(admin_url('admin-post.php?action=grw_settings_save&grw_tab=advance')); ?>">
93
94 <div class="grw-field">
95 <div class="grw-field-label">
96 <label>Reviews update daily schedule is <b><?php echo $grw_revupd_cron ? 'enabled' : 'disabled' ?></b></label>
97 </div>
98 <div class="wp-review-field-option">
99 <?php wp_nonce_field('grw-wpnonce_revupd_cron', 'grw-form_nonce_revupd_cron'); ?>
100 <input type="submit" value="<?php echo $grw_revupd_cron ? 'Disable' : 'Enable'; ?>" name="revupd_cron" class="button" />
101 </div>
102 </div>
103
104 <div class="grw-field">
105 <div class="grw-field-label">
106 <label>Re-create the database tables of the plugin (service option)</label>
107 </div>
108 <div class="wp-review-field-option">
109 <?php wp_nonce_field('grw-wpnonce_create_db', 'grw-form_nonce_create_db'); ?>
110 <input type="submit" value="Re-create Database" name="create_db" onclick="return confirm('Are you sure you want to re-create database tables?')" class="button" />
111 </div>
112 </div>
113 <div class="grw-field">
114 <div class="grw-field-label">
115 <label><b>Please be careful</b>: this removes all settings, reviews, feeds and install the plugin from scratch</label>
116 </div>
117 <div class="wp-review-field-option">
118 <?php wp_nonce_field('grw-wpnonce_create_db', 'grw-form_nonce_create_db'); ?>
119 <input type="submit" value="Install from scratch" name="install" onclick="return confirm('It will delete all current feeds, are you sure you want to install from scratch the plugin?')" class="button" />
120 <p><label><input type="checkbox" id="install_multisite" name="install_multisite"> For all sites (WP Multisite)</label></p>
121 </div>
122 </div>
123 <div class="grw-field">
124 <div class="grw-field-label">
125 <label><b>Please be careful</b>: this removes all plugin-specific settings, reviews and feeds</label>
126 </div>
127 <div class="wp-review-field-option">
128 <?php wp_nonce_field('grw-wpnonce_reset_all', 'grw-form_nonce_reset_all'); ?>
129 <input type="submit" value="Delete All Data" name="reset_all" onclick="return confirm('Are you sure you want to reset all plugin data including feeds?')" class="button" />
130 <p><label><input type="checkbox" id="reset_all_multisite" name="reset_all_multisite"> For all sites (WP Multisite)</label></p>
131 </div>
132 </div>
133 <div id="debug_info" class="grw-field">
134 <div class="grw-field-label">
135 <label>Debug information</label>
136 </div>
137 <div class="wp-review-field-option">
138 <input type="button" value="Copy Debug Information" name="reset_all" onclick="window.grw_debug_info.select();document.execCommand('copy');window.grw_debug_msg.innerHTML='Debug Information copied, please paste it to your email to support';" class="button" />
139 <textarea id="grw_debug_info" style="display:block;width:30em;height:250px;margin-top:10px" onclick="window.grw_debug_info.select();document.execCommand('copy');window.grw_debug_msg.innerHTML='Debug Information copied, please paste it to your email to support';" readonly><?php $this->debug_info->render(); ?></textarea>
140 <p id="grw_debug_msg"></p>
141 </div>
142 </div>
143 <div class="grw-field" style="display:none">
144 <div class="grw-field-label">
145 <label>Debug mode is currently <b><?php echo $grw_debug_mode ? 'enabled' : 'disabled' ?></b></label>
146 </div>
147 <div class="wp-review-field-option">
148 <?php wp_nonce_field('grw-wpnonce_debug_mode', 'grw-form_nonce_debug_mode'); ?>
149 <input type="submit" name="debug_mode" class="button" value="<?php echo $grw_debug_mode ? 'Disable' : 'Enable'; ?>" />
150 </div>
151 </div>
152 <div class="grw-field">
153 <div class="grw-field-label">
154 <label>Execute db update manually</label>
155 </div>
156 <div class="wp-review-field-option">
157 <?php wp_nonce_field('grw-wpnonce_update_db', 'grw-form_nonce_update_db'); ?>
158 <input type="submit" name="update_db" class="button" />
159 <input type="text" name="update_db_ver" style="width:94px;height:22px" placeholder="version" />
160 </div>
161 </div>
162 </form>
163 </div>
164
165 </div>
166
167 </div>
168 <?php
169 }
170
171 }
172