PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 6.2.5
Social Media Auto Poster – Schedule & Publish to Buffer v6.2.5
6.2.5 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 All 126 releases
wp-to-buffer / lib / social / views / settings-auth.php

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

529 lines 19.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 WPZinc\Social
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: Social Media Scheduler Name, %2$s: Plugin Name */
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 <br />
81 <?php
82 echo esc_html__( 'Missing profiles? Click the Refresh Profiles button to update your profiles list.', 'wp-to-buffer' );
83 ?>
84 <br />
85 <?php
86 echo esc_html(
87 sprintf(
88 /* translators: %s: Social Media Scheduler Name */
89 __( 'Issues with your connection to %s? You\'ll see a Reconnect button below, which you can click.', 'wp-to-buffer' ),
90 $this->base->plugin->account
91 )
92 );
93 ?>
94 </p>
95 </header>
96
97 <?php
98 // List connected accounts.
99 foreach ( $this->base->get_class( 'settings' )->get_accounts() as $account_id => $account ) {
100 $reconnect_url = $this->base->get_class( 'api' )->get_oauth_url( $account_id );
101 $refresh_profiles_url = add_query_arg(
102 array(
103 'page' => $this->base->plugin->name . '-settings',
104 $this->base->plugin->name . '-refresh-profiles' => $account_id,
105 'nonce' => wp_create_nonce( $this->base->plugin->name . '-refresh-profiles' ),
106 ),
107 admin_url( 'admin.php' )
108 );
109 $disconnect_url = add_query_arg(
110 array(
111 'page' => $this->base->plugin->name . '-settings',
112 $this->base->plugin->name . '-disconnect' => $account_id,
113 'nonce' => wp_create_nonce( $this->base->plugin->name . '-disconnect' ),
114 ),
115 admin_url( 'admin.php' )
116 );
117 ?>
118 <div class="wpzinc-option">
119 <div class="left">
120 <strong><?php echo esc_html( $account['name'] ); ?></strong>
121 </div>
122 <div class="right">
123 <a href="<?php echo esc_url( $refresh_profiles_url ); ?>" class="button button-secondary">
124 <?php esc_html_e( 'Refresh Profiles', 'wp-to-buffer' ); ?>
125 </a>
126 <?php
127 // Only show Reconnect if the token expired.
128 if ( time() > $account['token_expires'] ) {
129 ?>
130 <a href="<?php echo esc_url( $reconnect_url ); ?>" class="button button-secondary">
131 <?php esc_html_e( 'Reconnect', 'wp-to-buffer' ); ?>
132 </a>
133 <?php
134 }
135 ?>
136 <a href="<?php echo esc_url( $disconnect_url ); ?>" class="button wpzinc-button-red">
137 <?php esc_html_e( 'Disconnect', 'wp-to-buffer' ); ?>
138 </a>
139 </div>
140 </div>
141 <?php
142 }
143 ?>
144
145 <div class="wpzinc-option highlight">
146 <div class="full">
147 <h4>
148 <?php
149 printf(
150 /* translators: Service name (Buffer, Hootsuite) */
151 esc_html__( 'Need to connect multiple %s accounts?', 'wp-to-buffer' ),
152 esc_html( $this->base->plugin->account )
153 );
154 ?>
155 </h4>
156
157 <p>
158 <?php
159 printf(
160 /* translators: Service name (Buffer, Hootsuite) */
161 esc_html__( '%1$s Pro allows you to connect multiple %2$s accounts to a single WordPress installation.', 'wp-to-buffer' ),
162 esc_html( $this->base->plugin->displayName ),
163 esc_html( $this->base->plugin->account )
164 );
165 ?>
166 </p>
167
168 <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>
169 </div>
170 </div>
171 </div>
172 </div>
173
174 <!-- General Settings -->
175 <div id="general-settings" class="panel">
176 <div class="postbox">
177 <header>
178 <h3><?php esc_html_e( 'General Settings', 'wp-to-buffer' ); ?></h3>
179 <p class="description">
180 <?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' ); ?>
181 </p>
182 </header>
183
184 <div class="wpzinc-option">
185 <div class="left">
186 <label for="test_mode"><?php esc_html_e( 'Enable Test Mode', 'wp-to-buffer' ); ?></label>
187 </div>
188 <div class="right">
189 <input type="checkbox" name="test_mode" id="test_mode" value="1" <?php checked( $this->get_setting( '', 'test_mode' ), 1 ); ?> />
190
191 <p class="description">
192 <?php
193 echo esc_html(
194 sprintf(
195 /* translators: Social Media Service Name (Buffer, Hootsuite) */
196 __( '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' ),
197 $this->base->plugin->account
198 )
199 );
200 ?>
201 </p>
202 </div>
203 </div>
204
205 <div class="wpzinc-option">
206 <div class="left">
207 <label for="force_trailing_forwardslash"><?php esc_html_e( 'Force Trailing Forwardslash?', 'wp-to-buffer' ); ?></label>
208 </div>
209 <div class="right">
210 <input type="checkbox" name="force_trailing_forwardslash" id="force_trailing_forwardslash" value="1" <?php checked( $this->get_setting( '', 'force_trailing_forwardslash' ), 1 ); ?> />
211
212 <p class="description">
213 <?php
214 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' );
215 ?>
216 <br />
217 <?php
218 printf(
219 '%1$s <a href="options-permalink.php">%2$s</a> %3$s',
220 esc_html__( 'It\'s better to ensure your', 'wp-to-buffer' ),
221 esc_html__( 'Permalink', 'wp-to-buffer' ),
222 esc_html__( 'settings end with a forwardslash, but this option is a useful fallback if changing Permalink structure isn\'t possible.', 'wp-to-buffer' )
223 );
224 ?>
225 </p>
226 </div>
227 </div>
228
229 <div class="wpzinc-option">
230 <div class="left">
231 <label for="proxy"><?php esc_html_e( 'Use Proxy?', 'wp-to-buffer' ); ?></label>
232 </div>
233 <div class="right">
234 <input type="checkbox" name="proxy" id="proxy" value="1" <?php checked( $this->get_setting( '', 'proxy' ), 1 ); ?> />
235
236 <p class="description">
237 <?php
238 echo esc_html(
239 sprintf(
240 /* translators: %1$s: Social Media Service Name (Buffer, Hootsuite), %2$s: Social Media Service Name (Buffer, Hootsuite) */
241 __( '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' ),
242 $this->base->plugin->account,
243 $this->base->plugin->account
244 )
245 );
246 ?>
247 <br />
248 <?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' ); ?>
249 </p>
250 </div>
251 </div>
252 </div>
253 </div>
254
255 <!-- Image Settings -->
256 <div id="image-settings" class="panel">
257 <div class="postbox">
258 <header>
259 <h3><?php esc_html_e( 'Text to Image Settings', 'wp-to-buffer' ); ?></h3>
260 <p class="description">
261 <?php
262 esc_html_e(
263 'Provides options for automatically generating images from text, when a Status\' image option is set to Use Text to Image
264 and a status has Text to Image defined.',
265 'wp-to-buffer'
266 );
267 ?>
268 </p>
269 </header>
270
271 <div class="wpzinc-option highlight">
272 <div class="full">
273 <h4>
274 <?php
275 esc_html_e( 'Need to automatically generate images?', 'wp-to-buffer' );
276 ?>
277 </h4>
278
279 <p>
280 <?php
281 printf(
282 /* translators: Service name (Buffer, Hootsuite) */
283 esc_html__( '%s Pro provides options to generate images based on text, which are them submitted with your status message.', 'wp-to-buffer' ),
284 esc_html( $this->base->plugin->displayName )
285 );
286 ?>
287 </p>
288
289 <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>
290 </div>
291 </div>
292 </div>
293 </div>
294
295 <!-- Log Settings -->
296 <div id="log-settings" class="panel">
297 <div class="postbox">
298 <header>
299 <h3><?php esc_html_e( 'Log Settings', 'wp-to-buffer' ); ?></h3>
300 <p class="description">
301 <?php esc_html_e( 'Provides options to enable logging, display logs on Posts and how long to keep logs for.', 'wp-to-buffer' ); ?>
302 </p>
303 </header>
304
305 <div class="wpzinc-option">
306 <div class="left">
307 <label for="log_enabled"><?php esc_html_e( 'Enable Logging?', 'wp-to-buffer' ); ?></label>
308 </div>
309 <div class="right">
310 <input type="checkbox" name="log[enabled]" id="log_enabled" value="1" <?php checked( $this->get_setting( 'log', '[enabled]' ), 1 ); ?> data-conditional="enable_logging" />
311 <p class="description">
312 <?php
313 if ( $this->get_setting( 'log', '[enabled]' ) ) {
314 printf(
315 '%1$s <a href="%2$s">%3$s</a> %4$s',
316 esc_html__( 'If enabled, the', 'wp-to-buffer' ),
317 esc_html( admin_url( 'admin.php?page=' . $this->base->plugin->name . '-log' ) ),
318 esc_html__( 'Plugin Logs', 'wp-to-buffer' ),
319 esc_html(
320 sprintf(
321 /* translators: Social Media Service Name (Buffer, Hootsuite) */
322 __( 'will detail status(es) sent to %s, including any errors or reasons why no status(es) were sent.', 'wp-to-buffer' ),
323 $this->base->plugin->account
324 )
325 )
326 );
327 } else {
328 // Don't link "Plugin Log" text, as Logs are disabled so it won't show anything.
329 echo esc_html(
330 sprintf(
331 /* translators: %1$s: Social Media Service Name (Buffer, Hootsuite) */
332 __( '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' ),
333 $this->base->plugin->account
334 )
335 );
336 }
337 ?>
338 </p>
339 </div>
340 </div>
341
342 <div id="enable_logging">
343 <div class="wpzinc-option">
344 <div class="left">
345 <label for="log_display_on_posts"><?php esc_html_e( 'Display on Posts?', 'wp-to-buffer' ); ?></label>
346 </div>
347 <div class="right">
348 <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 ); ?> />
349
350 <p class="description">
351 <?php
352 if ( $this->get_setting( 'log', '[enabled]' ) ) {
353 printf(
354 '%1$s <a href="%2$s">%3$s</a> %4$s',
355 esc_html__( 'If enabled, a Log will be displayed when editing a Post. Logs are always available through the', 'wp-to-buffer' ),
356 esc_html( admin_url( 'admin.php?page=' . $this->base->plugin->name . '-log' ) ),
357 esc_html__( 'Plugin Logs', 'wp-to-buffer' ),
358 esc_html__( 'screen', 'wp-to-buffer' )
359 );
360 } else {
361 // Don't link "Plugin Log" text, as Logs are disabled so it won't show anything.
362 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' );
363 }
364 ?>
365 </p>
366 </div>
367 </div>
368
369 <div class="wpzinc-option">
370 <div class="left">
371 <label for="log_level"><?php esc_html_e( 'Log Level', 'wp-to-buffer' ); ?></label>
372 </div>
373 <div class="right">
374 <?php
375 $log_levels_settings = $this->get_setting(
376 'log',
377 'log_level',
378 array(
379 'success',
380 'test',
381 'pending',
382 'warning',
383 'error',
384 )
385 );
386
387 foreach ( $log_levels as $log_level => $label ) {
388 ?>
389 <label for="log_level_<?php echo esc_attr( $log_level ); ?>">
390 <input type="checkbox"
391 name="log[log_level][]"
392 id="log_level_<?php echo esc_attr( $log_level ); ?>"
393 value="<?php echo esc_attr( $log_level ); ?>"
394 <?php echo ( in_array( $log_level, $log_levels_settings, true ) || $log_level === 'error' ? ' checked' : '' ); ?>
395 <?php echo ( ( $log_level === 'error' ) ? ' disabled' : '' ); ?>
396 />
397
398 <?php echo esc_html( $label ); ?>
399 </label>
400 <br />
401 <?php
402 }
403 ?>
404
405 <p class="description">
406 <?php esc_html_e( 'Defines which log results to save to the Log database. Errors will always be logged.', 'wp-to-buffer' ); ?>
407 </p>
408 </div>
409 </div>
410
411 <div class="wpzinc-option">
412 <div class="left">
413 <label for="log_preserve_days"><?php esc_html_e( 'Preserve Logs', 'wp-to-buffer' ); ?></strong>
414 </div>
415 <div class="right">
416 <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" />
417 <?php esc_html_e( 'days', 'wp-to-buffer' ); ?>
418
419 <p class="description">
420 <?php
421 esc_html_e( 'The number of days to preserve logs for. Zero means logs are kept indefinitely.', 'wp-to-buffer' );
422 ?>
423 </p>
424 </div>
425 </div>
426 </div>
427 </div>
428 </div>
429
430 <!-- Repost Settings -->
431 <div id="repost-settings" class="panel">
432 <div class="postbox">
433 <header>
434 <h3><?php esc_html_e( 'Repost Settings', 'wp-to-buffer' ); ?></h3>
435 <p class="description">
436 <?php esc_html_e( 'Provides options for when to run the WordPress Repost Cron Event on this WordPress installation.', 'wp-to-buffer' ); ?><br />
437 <?php
438 printf(
439 /* translators: Service (Buffer, Hootsuite) */
440 esc_html__( 'When Post(s) are scheduled on %s will depend on the Repost Status Settings.', 'wp-to-buffer' ),
441 esc_html( $this->base->plugin->displayName )
442 );
443 ?>
444 </p>
445 </header>
446
447 <div class="wpzinc-option highlight">
448 <div class="full">
449 <h4><?php esc_html_e( 'Revive Old Posts with Repost', 'wp-to-buffer' ); ?></h4>
450
451 <p>
452 <?php
453 printf(
454 /* translators: %1$s: Service (Buffer, Hootsuite), %2$s: Service (Buffer, Hootsuite) */
455 esc_html__( 'Automatically schedule old Posts to %1$s with %2$s Pro.', 'wp-to-buffer' ),
456 esc_html( $this->base->plugin->displayName ),
457 esc_html( $this->base->plugin->displayName )
458 );
459 ?>
460 </p>
461
462 <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>
463 </div>
464 </div>
465 </div>
466 </div>
467
468 <!-- User Access -->
469 <div id="user-access" class="panel">
470 <div class="postbox">
471 <header>
472 <h3><?php esc_html_e( 'User Access', 'wp-to-buffer' ); ?></h3>
473 <p class="description">
474 <?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' ); ?>
475 </p>
476 </header>
477
478 <div class="wpzinc-option highlight">
479 <div class="full">
480 <h4><?php esc_html_e( 'Limit Post Types and Social Profiles by WordPress User Role', 'wp-to-buffer' ); ?></h4>
481
482 <p>
483 <?php
484 printf(
485 /* translators: %1$s: Service (Buffer, Hootsuite) */
486 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' ),
487 esc_html( $this->base->plugin->displayName )
488 );
489 ?>
490 </p>
491
492 <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>
493 </div>
494 </div>
495 </div>
496 </div>
497
498 <!-- Custom Tags -->
499 <div id="custom-tags" class="panel">
500 <div class="postbox">
501 <header>
502 <h3><?php esc_html_e( 'Custom Tags', 'wp-to-buffer' ); ?></h3>
503 <p class="description">
504 <?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' ); ?>
505 </p>
506 </header>
507
508 <div class="wpzinc-option highlight">
509 <div class="full">
510 <h4><?php esc_html_e( 'Need to define your own Tags to use in status messages?', 'wp-to-buffer' ); ?></h4>
511
512 <p>
513 <?php
514 printf(
515 /* translators: %1$s: Service (Buffer, Hootsuite) */
516 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' ),
517 esc_html( $this->base->plugin->displayName )
518 );
519 ?>
520 </p>
521
522 <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>
523 </div>
524 </div>
525 </div>
526 </div>
527 </div>
528 </div>
529