|
32 | 32 | $email_error_enabled = isset( $settings['logs'], $settings['logs']['send_email_report'] ) ? $settings['logs']['send_email_report'] : 0; |
33 | 33 | $email_error_address_placeholder = ( ! empty( $email_error_address ) ) ? $email_error_address : get_option( 'admin_email' ); |
34 | 34 |
|
35 | | - $custom_schedules = array(); |
36 | | - if ( isset( $settings['custom_schedules'] ) && is_array( $settings['custom_schedules'] ) ) { |
37 | | - $custom_schedules = $settings['custom_schedules']; |
38 | | - } |
39 | | - |
40 | 35 | if ( 'logs' === $active_tab ) { |
41 | 36 | $logs_type = isset( $_REQUEST['logs_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['logs_type'] ) ) : null;// phpcs:ignore WordPress.Security.NonceVerification |
42 | 37 | $logs = Feedzy_Rss_Feeds_Log::get_instance()->get_recent_logs( 50, $logs_type ); |
@@ -110,6 +105,9 @@ class="<?php echo 'logs' === $active_tab ? esc_attr( 'active' ) : ''; ?>" |
110 | 105 | class="<?php echo 'schedules' === $active_tab ? esc_attr( 'active' ) : ''; ?>" |
111 | 106 | > |
112 | 107 | <?php esc_html_e( 'Schedules', 'feedzy-rss-feeds' ); ?> |
| 108 | + <?php if ( ! feedzy_is_pro() ) : ?> |
| 109 | + <span class="pro-label">PRO</span> |
| 110 | + <?php endif; ?> |
113 | 111 | </a> |
114 | 112 | </li> |
115 | 113 | <?php |
@@ -505,115 +503,7 @@ class="form-control" |
505 | 503 | $show_button = false; |
506 | 504 | break; |
507 | 505 | case 'schedules': |
508 | | - ?> |
509 | | - <div class="fz-form-wrap"> |
510 | | - <div class="form-block"> |
511 | | - <div class="fz-form-group"> |
512 | | - <h4 class="h4"> |
513 | | - <?php esc_html_e( 'Add Cron Schedule', 'feedzy-rss-feeds' ); ?> |
514 | | - </h4> |
515 | | - <div class="fz-condition-control" style="padding-bottom: 0;"> |
516 | | - <div class="fz-form-row" style="margin: 0; gap: 1rem; align-items: flex-end;"> |
517 | | - <div class="fz-form-group"> |
518 | | - <label class="form-label" for="fz-schedule-interval"> |
519 | | - <?php esc_html_e( 'Interval (seconds)', 'feedzy-rss-feeds' ); ?> |
520 | | - </label> |
521 | | - <input |
522 | | - type="number" |
523 | | - class="form-control" |
524 | | - id="fz-schedule-interval" |
525 | | - placeholder="3600" |
526 | | - required |
527 | | - min="<?php echo esc_attr( defined( 'WP_CRON_LOCK_TIMEOUT' ) ? WP_CRON_LOCK_TIMEOUT : 60 ); ?>" |
528 | | - /> |
529 | | - </div> |
530 | | - |
531 | | - <div class="fz-form-group"> |
532 | | - <label class="form-label" for="fz-schedule-display"> |
533 | | - <?php esc_html_e( 'Display Name', 'feedzy-rss-feeds' ); ?> |
534 | | - </label> |
535 | | - <input required type="text" class="form-control" id="fz-schedule-display" placeholder="Once Hourly" /> |
536 | | - </div> |
537 | | - |
538 | | - <div class="fz-form-group"> |
539 | | - <label class="form-label" for="fz-schedule-name"> |
540 | | - <?php esc_html_e( 'Internal Name', 'feedzy-rss-feeds' ); ?> |
541 | | - </label> |
542 | | - <input required type="text" class="form-control" id="fz-schedule-name" placeholder="hourly" /> |
543 | | - </div> |
544 | | - <div class="fz-form-group"> |
545 | | - <button class="btn btn-primary" id="fz-add-schedule"> |
546 | | - <?php esc_html_e( 'Add Cron Schedule', 'feedzy-rss-feeds' ); ?> |
547 | | - </button> |
548 | | - </div> |
549 | | - </div> |
550 | | - </div> |
551 | | - </div> |
552 | | - </div> |
553 | | - |
554 | | - <div class="form-block"> |
555 | | - <div class="fz-schedule-counter"> |
556 | | - <?php |
557 | | - $schedule_count = count( $custom_schedules ); |
558 | | - |
559 | | - // translators: %s is the number of custom schedules. |
560 | | - echo esc_html( sprintf( __( '%s items', 'feedzy-rss-feeds' ), $schedule_count ) ); |
561 | | - ?> |
562 | | - </div> |
563 | | - |
564 | | - <table class="fz-schedules-table widefat striped"> |
565 | | - <thead> |
566 | | - <tr> |
567 | | - <th><?php esc_html_e( 'Internal Name', 'feedzy-rss-feeds' ); ?></th> |
568 | | - <th><?php esc_html_e( 'Interval', 'feedzy-rss-feeds' ); ?></th> |
569 | | - <th><?php esc_html_e( 'Display Name', 'feedzy-rss-feeds' ); ?></th> |
570 | | - <th><?php esc_html_e( 'Actions', 'feedzy-rss-feeds' ); ?></th> |
571 | | - </tr> |
572 | | - </thead> |
573 | | - <tbody> |
574 | | - <?php |
575 | | - foreach ( $custom_schedules as $slug => $schedule ) : |
576 | | - $interval_seconds = $schedule['interval']; |
577 | | - $interval_display = $interval_seconds . ' (' . human_time_diff( 0, $interval_seconds ) . ')'; |
578 | | - ?> |
579 | | - <tr> |
580 | | - <td class="fz-schedule-attributes"> |
581 | | - <strong><?php echo esc_html( $slug ); ?></strong> |
582 | | - </td> |
583 | | - |
584 | | - <td class="fz-schedule-attributes"> |
585 | | - <?php echo esc_html( $interval_display ); ?> |
586 | | - </td> |
587 | | - |
588 | | - <td class="fz-schedule-attributes"> |
589 | | - <?php echo esc_html( $schedule['display'] ); ?> |
590 | | - </td> |
591 | | - |
592 | | - <td class="fz-schedule-attributes"> |
593 | | - <button type="button" class="btn btn-outline-primary fz-delete-schedule fz-is-destructive" data-schedule="<?php echo esc_attr( $slug ); ?>"> |
594 | | - <?php esc_html_e( 'Delete', 'feedzy-rss-feeds' ); ?> |
595 | | - </button> |
596 | | - </td> |
597 | | - |
598 | | - <input |
599 | | - type="hidden" |
600 | | - value="<?php echo esc_attr( $schedule['interval'] ); ?>" |
601 | | - name="fz-custom-schedule-interval[<?php echo esc_attr( $slug ); ?>][interval]" |
602 | | - > |
603 | | - |
604 | | - <input |
605 | | - type="hidden" |
606 | | - value="<?php echo esc_attr( $schedule['display'] ); ?>" |
607 | | - name="fz-custom-schedule-interval[<?php echo esc_attr( $slug ); ?>][display]" |
608 | | - > |
609 | | - </tr> |
610 | | - <?php endforeach; ?> |
611 | | - </tbody> |
612 | | - </table> |
613 | | - </div> |
614 | | - |
615 | | - </div> |
616 | | - <?php |
| 506 | + load_template( FEEDZY_ABSPATH . '/includes/layouts/feedzy-schedules.php' ); |
617 | 507 | break; |
618 | 508 | default: |
619 | 509 | $fields = apply_filters( 'feedzy_display_tab_settings', array(), $active_tab ); |
|
0 commit comments