Skip to content

Commit ebd37db

Browse files
committed
Added extra column of data to say how often links are checked
1 parent 9746bd7 commit ebd37db

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/Dashboard/Dashboard_Notifications.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ public function render_widget(): void {
8989
'wlf_auto_archiver_enabled' => Settings::add_own_links(),
9090
'wlf_scan_existing_enabled' => Settings::should_scan_existing_posts(),
9191
'wlf_link_processing_enabled' => Settings::is_link_processing_enabled(),
92+
'wlf_link_check_duration' => Settings::get_link_check_duration(),
93+
'wlf_failed_check_count' => Settings::get_failed_count(),
9294
)
9395
);
9496
}

templates/admin/dashboard/widget.php

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* @param bool $wlf_auto_archiver_enabled Whether auto archiver is enabled.
1414
* @param bool $wlf_scan_existing_enabled Whether scanning existing posts is enabled.
1515
* @param bool $wlf_link_processing_enabled Whether link processing is enabled.
16+
* @param int $wlf_link_check_duration Number of days between link checks.
17+
* @param int $wlf_failed_check_count Number of failed checks before marking as broken.
1618
*/
1719

1820
defined( 'ABSPATH' ) || exit;
@@ -78,7 +80,7 @@
7880
</span>
7981
<div class="wlf_dashboard-features-content">
8082
<span class="wlf_dashboard-features-label"><?php esc_html_e( 'Link Processing', 'wpcomsp_wayback_link_fixer' ); ?></span>
81-
<div class="wlf_dashboard-features-description"><?php esc_html_e( 'Create snapshots of external links in your content', 'wpcomsp_wayback_link_fixer' ); ?></div>
83+
<div class="wlf_dashboard-features-description"><?php esc_html_e( 'Create snapshots of external links when posts are created or updated', 'wpcomsp_wayback_link_fixer' ); ?></div>
8284
</div>
8385
</div>
8486
<div class="wlf_dashboard-features-item">
@@ -99,6 +101,35 @@
99101
<div class="wlf_dashboard-features-description"><?php esc_html_e( 'Process links in previously published content', 'wpcomsp_wayback_link_fixer' ); ?></div>
100102
</div>
101103
</div>
104+
<div class="wlf_dashboard-features-item">
105+
<span class="wlf_dashboard-features-status <?php echo esc_attr( $wlf_link_processing_enabled ? 'enabled' : 'disabled' ); ?>">
106+
<span class="dashicons dashicons-clock"></span>
107+
</span>
108+
<div class="wlf_dashboard-features-content">
109+
<span class="wlf_dashboard-features-label"><?php esc_html_e( 'Link Checking', 'wpcomsp_wayback_link_fixer' ); ?></span>
110+
<div class="wlf_dashboard-features-description">
111+
<?php if ( $wlf_link_processing_enabled ) : ?>
112+
<?php
113+
printf(
114+
/* translators: 1: number of days between checks, 2: number of failed checks before marking as broken */
115+
esc_html__( 'Links are checked every %1$d days and marked as broken after %2$d consecutive failures', 'wpcomsp_wayback_link_fixer' ),
116+
absint( $wlf_link_check_duration ),
117+
absint( $wlf_failed_check_count )
118+
);
119+
?>
120+
<?php else : ?>
121+
<?php
122+
printf(
123+
/* translators: 1: opening link tag, 2: closing link tag */
124+
esc_html__( 'Links are not being checked. %1$sEnable Link Processing%2$s to turn this back on.', 'wpcomsp_wayback_link_fixer' ),
125+
'<a href="' . esc_url( $wlf_link_to_settings ) . '">',
126+
'</a>'
127+
);
128+
?>
129+
<?php endif; ?>
130+
</div>
131+
</div>
132+
</div>
102133
</div>
103134
</div>
104135

0 commit comments

Comments
 (0)