PluginProbe
Social Media Auto Poster – Schedule & Publish to Buffer / 6.2.1
Social Media Auto Poster – Schedule & Publish to Buffer v6.2.1
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.1, at lib/social/views/settings-auth.php

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