PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 6.0.2
Social Media Auto Poster – Schedule & Publish to Buffer v6.0.2
6.2.4 6.2.3 6.2.2 6.2.1 6.2.0 6.1.2 6.1.1 6.1.0 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 6.0.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 All 125 releases
wp-to-buffer / lib / views / settings-auth.php

settings-auth.php in Social Media Auto Poster – Schedule & Publish to Buffer 6.0.2, at lib/views/settings-auth.php

470 lines 17.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Outputs the Settings screen when the Plugin is authenticated with
4 * the third party API service.
5 *
6 * @package WP_To_Social_Pro
7 * @author WP Zinc
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 exit; // Exit if accessed directly.
12 }
13 ?>
14 <div class="postbox wpzinc-vertical-tabbed-ui">
15 <!-- Second level tabs -->
16 <ul class="wpzinc-nav-tabs wpzinc-js-tabs" data-panels-container="#settings-container" data-panel=".panel" data-active="wpzinc-nav-tab-vertical-active">
17 <li class="wpzinc-nav-tab lock">
18 <a href="#authentication" class="wpzinc-nav-tab-vertical-active" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/authentication-settings/">
19 <?php esc_html_e( 'Authentication', 'wp-to-buffer' ); ?>
20 </a>
21 </li>
22 <li class="wpzinc-nav-tab default">
23 <a href="#general-settings" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/general-settings/">
24 <?php esc_html_e( 'General Settings', 'wp-to-buffer' ); ?>
25 </a>
26 </li>
27 <li class="wpzinc-nav-tab image">
28 <a href="#image-settings" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/text-to-image-settings/">
29 <?php esc_html_e( 'Text to Image', 'wp-to-buffer' ); ?>
30 </a>
31 </li>
32 <li class="wpzinc-nav-tab file-text">
33 <a href="#log-settings" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/log-settings/">
34 <?php esc_html_e( 'Log Settings', 'wp-to-buffer' ); ?>
35 </a>
36 </li>
37 <li class="wpzinc-nav-tab arrow-right-circle">
38 <a href="#repost-settings" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/repost-settings/">
39 <?php esc_html_e( 'Repost Settings', 'wp-to-buffer' ); ?>
40 </a>
41 </li>
42 <?php
43 // Only display if we've auth'd and have profiles.
44 if ( $this->base->get_class( 'settings' )->account_connected() ) {
45 ?>
46 <li class="wpzinc-nav-tab users">
47 <a href="#user-access" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/user-access-settings/">
48 <?php esc_html_e( 'User Access', 'wp-to-buffer' ); ?>
49 </a>
50 </li>
51 <?php
52 }
53 ?>
54 <li class="wpzinc-nav-tab tag">
55 <a href="#custom-tags" data-documentation="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/custom-tags-settings/">
56 <?php esc_html_e( 'Custom Tags', 'wp-to-buffer' ); ?>
57 </a>
58 </li>
59 </ul>
60
61 <!-- Content -->
62 <div id="settings-container" class="wpzinc-nav-tabs-content">
63 <!-- Authentication -->
64 <div id="authentication" class="panel">
65 <div class="postbox">
66 <header>
67 <h3><?php esc_html_e( 'Connected Accounts', 'wp-to-buffer' ); ?></h3>
68
69 <p class="description">
70 <?php
71 echo esc_html(
72 sprintf(
73 /* translators: %1$s: Plugin Name, %2$s: Social Media Service Name (Buffer, Hootsuite) */
74 __( 'A list of %1$s accounts/organizations that are connected to %2$s.', 'wp-to-buffer' ),
75 $this->base->plugin->account,
76 $this->base->plugin->displayName
77 )
78 );
79 ?>
80 </p>
81 </header>
82
83 <?php
84 // List connected accounts.
85 foreach ( $this->base->get_class( 'settings' )->get_accounts() as $account_id => $account ) {
86 $reconnect_url = $this->base->get_class( 'api' )->get_oauth_url( $account_id );
87 $disconnect_url = add_query_arg(
88 array(
89 'page' => $this->base->plugin->name . '-settings',
90 $this->base->plugin->name . '-disconnect' => $account_id,
91 'nonce' => wp_create_nonce( $this->base->plugin->name . '-disconnect' ),
92 ),
93 admin_url( 'admin.php' )
94 );
95 ?>
96 <div class="wpzinc-option">
97 <div class="left">
98 <strong><?php echo esc_html( $account['name'] ); ?></strong>
99 </div>
100 <div class="right">
101 <a href="<?php echo esc_url( $reconnect_url ); ?>" class="button button-secondary">
102 <?php esc_html_e( 'Reconnect', 'wp-to-buffer' ); ?>
103 </a>
104 <a href="<?php echo esc_url( $disconnect_url ); ?>" class="button wpzinc-button-red">
105 <?php esc_html_e( 'Disconnect', 'wp-to-buffer' ); ?>
106 </a>
107 </div>
108 </div>
109 <?php
110 }
111 ?>
112 </div>
113 </div>
114
115 <!-- General Settings -->
116 <div id="general-settings" class="panel">
117 <div class="postbox">
118 <header>
119 <h3><?php esc_html_e( 'General Settings', 'wp-to-buffer' ); ?></h3>
120 <p class="description">
121 <?php esc_html_e( 'Provides options for logging, Post default level settings and whether to use WordPress Cron when publishing or updating Posts.', 'wp-to-buffer' ); ?>
122 </p>
123 </header>
124
125 <div class="wpzinc-option">
126 <div class="left">
127 <label for="test_mode"><?php esc_html_e( 'Enable Test Mode', 'wp-to-buffer' ); ?></label>
128 </div>
129 <div class="right">
130 <input type="checkbox" name="test_mode" id="test_mode" value="1" <?php checked( $this->get_setting( '', 'test_mode' ), 1 ); ?> />
131
132 <p class="description">
133 <?php
134 echo esc_html(
135 sprintf(
136 /* translators: Social Media Service Name (Buffer, Hootsuite) */
137 __( 'If enabled, status(es) are not sent to %s, but will appear in the Log, if logging is enabled. This is useful to test status text, conditions etc.', 'wp-to-buffer' ),
138 $this->base->plugin->account
139 )
140 );
141 ?>
142 </p>
143 </div>
144 </div>
145
146 <div class="wpzinc-option">
147 <div class="left">
148 <label for="force_trailing_forwardslash"><?php esc_html_e( 'Force Trailing Forwardslash?', 'wp-to-buffer' ); ?></label>
149 </div>
150 <div class="right">
151 <input type="checkbox" name="force_trailing_forwardslash" id="force_trailing_forwardslash" value="1" <?php checked( $this->get_setting( '', 'force_trailing_forwardslash' ), 1 ); ?> />
152
153 <p class="description">
154 <?php
155 esc_html_e( 'If enabled, any URLs in statuses will always end with a forwardslash. This might be required if the wrong image is shared with a status.', 'wp-to-buffer' );
156 ?>
157 <br />
158 <?php
159 printf(
160 '%1$s <a href="options-permalink.php">%2$s</a> %3$s',
161 esc_html__( 'It\'s better to ensure your', 'wp-to-buffer' ),
162 esc_html__( 'Permalink', 'wp-to-buffer' ),
163 esc_html__( 'settings end with a forwardslash, but this option is a useful fallback if changing Permalink structure isn\'t possible.', 'wp-to-buffer' )
164 );
165 ?>
166 </p>
167 </div>
168 </div>
169
170 <div class="wpzinc-option">
171 <div class="left">
172 <label for="proxy"><?php esc_html_e( 'Use Proxy?', 'wp-to-buffer' ); ?></label>
173 </div>
174 <div class="right">
175 <input type="checkbox" name="proxy" id="proxy" value="1" <?php checked( $this->get_setting( '', 'proxy' ), 1 ); ?> />
176
177 <p class="description">
178 <?php
179 echo esc_html(
180 sprintf(
181 /* translators: %1$s: Social Media Service Name (Buffer, Hootsuite), %2$s: Social Media Service Name (Buffer, Hootsuite) */
182 __( 'If enabled, statuses sent to %1$s are performed through our proxy. This is useful if your ISP or host\'s country prevents access to %1$s.', 'wp-to-buffer' ),
183 $this->base->plugin->account,
184 $this->base->plugin->account
185 )
186 );
187 ?>
188 <br />
189 <?php esc_html_e( 'You may still need to use a VPN for initial Authentication when setting up the Plugin for the first time.', 'wp-to-buffer' ); ?>
190 </p>
191 </div>
192 </div>
193 </div>
194 </div>
195
196 <!-- Image Settings -->
197 <div id="image-settings" class="panel">
198 <div class="postbox">
199 <header>
200 <h3><?php esc_html_e( 'Text to Image Settings', 'wp-to-buffer' ); ?></h3>
201 <p class="description">
202 <?php
203 esc_html_e(
204 'Provides options for automatically generating images from text, when a Status\' image option is set to Use Text to Image
205 and a status has Text to Image defined.',
206 'wp-to-buffer'
207 );
208 ?>
209 </p>
210 </header>
211
212 <div class="wpzinc-option highlight">
213 <div class="full">
214 <h4>
215 <?php
216 esc_html_e( 'Need to automatically generate images?', 'wp-to-buffer' );
217 ?>
218 </h4>
219
220 <p>
221 <?php
222 printf(
223 /* translators: Service name (Buffer, Hootsuite) */
224 esc_html__( '%s Pro provides options to generate images based on text, which are them submitted with your status message.', 'wp-to-buffer' ),
225 esc_html( $this->base->plugin->displayName )
226 );
227 ?>
228 </p>
229
230 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_inline_upgrade' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Upgrade', 'wp-to-buffer' ); ?></a>
231 </div>
232 </div>
233 </div>
234 </div>
235
236 <!-- Log Settings -->
237 <div id="log-settings" class="panel">
238 <div class="postbox">
239 <header>
240 <h3><?php esc_html_e( 'Log Settings', 'wp-to-buffer' ); ?></h3>
241 <p class="description">
242 <?php esc_html_e( 'Provides options to enable logging, display logs on Posts and how long to keep logs for.', 'wp-to-buffer' ); ?>
243 </p>
244 </header>
245
246 <div class="wpzinc-option">
247 <div class="left">
248 <label for="log_enabled"><?php esc_html_e( 'Enable Logging?', 'wp-to-buffer' ); ?></label>
249 </div>
250 <div class="right">
251 <input type="checkbox" name="log[enabled]" id="log_enabled" value="1" <?php checked( $this->get_setting( 'log', '[enabled]' ), 1 ); ?> data-conditional="enable_logging" />
252 <p class="description">
253 <?php
254 if ( $this->get_setting( 'log', '[enabled]' ) ) {
255 printf(
256 '%1$s <a href="%2$s">%3$s</a> %4$s',
257 esc_html__( 'If enabled, the', 'wp-to-buffer' ),
258 esc_html( admin_url( 'admin.php?page=' . $this->base->plugin->name . '-log' ) ),
259 esc_html__( 'Plugin Logs', 'wp-to-buffer' ),
260 esc_html(
261 sprintf(
262 /* translators: Social Media Service Name (Buffer, Hootsuite) */
263 __( 'will detail status(es) sent to %s, including any errors or reasons why no status(es) were sent.', 'wp-to-buffer' ),
264 $this->base->plugin->account
265 )
266 )
267 );
268 } else {
269 // Don't link "Plugin Log" text, as Logs are disabled so it won't show anything.
270 echo esc_html(
271 sprintf(
272 /* translators: %1$s: Social Media Service Name (Buffer, Hootsuite) */
273 __( 'If enabled, the Plugin Logs will detail status(es) sent to %1$s, including any errors or reasons why no status(es) were sent.', 'wp-to-buffer' ),
274 $this->base->plugin->account
275 )
276 );
277 }
278 ?>
279 </p>
280 </div>
281 </div>
282
283 <div id="enable_logging">
284 <div class="wpzinc-option">
285 <div class="left">
286 <label for="log_display_on_posts"><?php esc_html_e( 'Display on Posts?', 'wp-to-buffer' ); ?></label>
287 </div>
288 <div class="right">
289 <input type="checkbox" name="log[display_on_posts]" id="log_display_on_posts" value="1" <?php checked( $this->get_setting( 'log', '[display_on_posts]' ), 1 ); ?> />
290
291 <p class="description">
292 <?php
293 if ( $this->get_setting( 'log', '[enabled]' ) ) {
294 printf(
295 '%1$s <a href="%2$s">%3$s</a> %4$s',
296 esc_html__( 'If enabled, a Log will be displayed when editing a Post. Logs are always available through the', 'wp-to-buffer' ),
297 esc_html( admin_url( 'admin.php?page=' . $this->base->plugin->name . '-log' ) ),
298 esc_html__( 'Plugin Logs', 'wp-to-buffer' ),
299 esc_html__( 'screen', 'wp-to-buffer' )
300 );
301 } else {
302 // Don't link "Plugin Log" text, as Logs are disabled so it won't show anything.
303 esc_html_e( 'If enabled, a Log will be displayed when editing a Post. Logs are always available through the Plugin Logs screen.', 'wp-to-buffer' );
304 }
305 ?>
306 </p>
307 </div>
308 </div>
309
310 <div class="wpzinc-option">
311 <div class="left">
312 <label for="log_level"><?php esc_html_e( 'Log Level', 'wp-to-buffer' ); ?></label>
313 </div>
314 <div class="right">
315 <?php
316 $log_levels_settings = $this->get_setting(
317 'log',
318 'log_level',
319 array(
320 'success',
321 'test',
322 'pending',
323 'warning',
324 'error',
325 )
326 );
327
328 foreach ( $log_levels as $log_level => $label ) {
329 ?>
330 <label for="log_level_<?php echo esc_attr( $log_level ); ?>">
331 <input type="checkbox"
332 name="log[log_level][]"
333 id="log_level_<?php echo esc_attr( $log_level ); ?>"
334 value="<?php echo esc_attr( $log_level ); ?>"
335 <?php echo ( in_array( $log_level, $log_levels_settings, true ) || $log_level === 'error' ? ' checked' : '' ); ?>
336 <?php echo ( ( $log_level === 'error' ) ? ' disabled' : '' ); ?>
337 />
338
339 <?php echo esc_html( $label ); ?>
340 </label>
341 <br />
342 <?php
343 }
344 ?>
345
346 <p class="description">
347 <?php esc_html_e( 'Defines which log results to save to the Log database. Errors will always be logged.', 'wp-to-buffer' ); ?>
348 </p>
349 </div>
350 </div>
351
352 <div class="wpzinc-option">
353 <div class="left">
354 <label for="log_preserve_days"><?php esc_html_e( 'Preserve Logs', 'wp-to-buffer' ); ?></strong>
355 </div>
356 <div class="right">
357 <input type="number" name="log[preserve_days]" id="log_preserve_days" value="<?php echo esc_attr( $this->get_setting( 'log', '[preserve_days]' ) ); ?>" min="0" max="9999" step="1" />
358 <?php esc_html_e( 'days', 'wp-to-buffer' ); ?>
359
360 <p class="description">
361 <?php
362 esc_html_e( 'The number of days to preserve logs for. Zero means logs are kept indefinitely.', 'wp-to-buffer' );
363 ?>
364 </p>
365 </div>
366 </div>
367 </div>
368 </div>
369 </div>
370
371 <!-- Repost Settings -->
372 <div id="repost-settings" class="panel">
373 <div class="postbox">
374 <header>
375 <h3><?php esc_html_e( 'Repost Settings', 'wp-to-buffer' ); ?></h3>
376 <p class="description">
377 <?php esc_html_e( 'Provides options for when to run the WordPress Repost Cron Event on this WordPress installation.', 'wp-to-buffer' ); ?><br />
378 <?php
379 printf(
380 /* translators: Service (Buffer, Hootsuite) */
381 esc_html__( 'When Post(s) are scheduled on %s will depend on the Repost Status Settings.', 'wp-to-buffer' ),
382 esc_html( $this->base->plugin->displayName )
383 );
384 ?>
385 </p>
386 </header>
387
388 <div class="wpzinc-option highlight">
389 <div class="full">
390 <h4><?php esc_html_e( 'Revive Old Posts with Repost', 'wp-to-buffer' ); ?></h4>
391
392 <p>
393 <?php
394 printf(
395 /* translators: %1$s: Service (Buffer, Hootsuite), %2$s: Service (Buffer, Hootsuite) */
396 esc_html__( 'Automatically schedule old Posts to %1$s with %2$s Pro.', 'wp-to-buffer' ),
397 esc_html( $this->base->plugin->displayName ),
398 esc_html( $this->base->plugin->displayName )
399 );
400 ?>
401 </p>
402
403 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_inline_upgrade' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Upgrade', 'wp-to-buffer' ); ?></a>
404 </div>
405 </div>
406 </div>
407 </div>
408
409 <!-- User Access -->
410 <div id="user-access" class="panel">
411 <div class="postbox">
412 <header>
413 <h3><?php esc_html_e( 'User Access', 'wp-to-buffer' ); ?></h3>
414 <p class="description">
415 <?php esc_html_e( 'Optionally define which of your Post Types and connected social media account(s) should be available for configuration based on various WordPress User Roles.', 'wp-to-buffer' ); ?>
416 </p>
417 </header>
418
419 <div class="wpzinc-option highlight">
420 <div class="full">
421 <h4><?php esc_html_e( 'Limit Post Types and Social Profiles by WordPress User Role', 'wp-to-buffer' ); ?></h4>
422
423 <p>
424 <?php
425 printf(
426 /* translators: %1$s: Service (Buffer, Hootsuite) */
427 esc_html__( '%s Pro provides options to limit which Post Types to show in the Settings screens, as well as prevent access to specific social media profiles linked to your Buffer account, on a per-WordPress Role basis.', 'wp-to-buffer' ),
428 esc_html( $this->base->plugin->displayName )
429 );
430 ?>
431 </p>
432
433 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_inline_upgrade' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Upgrade', 'wp-to-buffer' ); ?></a>
434 </div>
435 </div>
436 </div>
437 </div>
438
439 <!-- Custom Tags -->
440 <div id="custom-tags" class="panel">
441 <div class="postbox">
442 <header>
443 <h3><?php esc_html_e( 'Custom Tags', 'wp-to-buffer' ); ?></h3>
444 <p class="description">
445 <?php esc_html_e( 'If your site uses Custom Fields, ACF or similar, you can specify additional tags to be added to the "Insert Tag" dropdown for each of your Post Types. These can then be used by Users, instead of having to remember the template tag text to use.', 'wp-to-buffer' ); ?>
446 </p>
447 </header>
448
449 <div class="wpzinc-option highlight">
450 <div class="full">
451 <h4><?php esc_html_e( 'Need to define your own Tags to use in status messages?', 'wp-to-buffer' ); ?></h4>
452
453 <p>
454 <?php
455 printf(
456 /* translators: %1$s: Service (Buffer, Hootsuite) */
457 esc_html__( '%s Pro provides options to define Custom Field / ACF Tags, which will then populate with Post data when used in status messages. Tags also appear in the Insert Tags dropdown.', 'wp-to-buffer' ),
458 esc_html( $this->base->plugin->displayName )
459 );
460 ?>
461 </p>
462
463 <a href="<?php echo esc_url( $this->base->dashboard->get_upgrade_url( 'settings_inline_upgrade' ) ); ?>" class="button button-primary" target="_blank"><?php esc_html_e( 'Upgrade', 'wp-to-buffer' ); ?></a>
464 </div>
465 </div>
466 </div>
467 </div>
468 </div>
469 </div>
470