'statwrite' ), admin_url( 'admin.php' ) ); $writer = add_query_arg( array( 'page' => 'statwrite-writer' ), admin_url( 'admin.php' ) ); /* translators: %s: time difference, for example "5 minutes". */ $last_run_txt = $last_run > 0 ? sprintf( __( '%s ago', 'statwrite' ), human_time_diff( $last_run, time() ) ) : __( 'Not yet', 'statwrite' ); $next_txt = $next && $next > time() ? wp_date( 'Y/m/d H:i', $next ) : __( 'Waiting to run', 'statwrite' ); $dir_ok = is_dir( WPHS_Spool::dir() ) && wp_is_writable( WPHS_Spool::dir() ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Local template variable. $mode = WPHS_Settings::mode(); $cloud = WPHS_Cloud::status(); $cloud_notice = get_transient( 'wphs_cloud_notice' ); $token = (string) $settings['console_token']; $masked = '' !== $token ? substr( $token, 0, 9 ) . str_repeat( '•', 12 ) . substr( $token, -4 ) : ''; $ping_ok = '' !== $token && (int) get_option( 'wphs_cloud_ping_ok', 0 ) && (int) get_option( 'wphs_cloud_ping_at', 0 ) > 0; if ( $cloud_notice ) { delete_transient( 'wphs_cloud_notice' ); } /* translators: %s: time difference, for example "5 minutes". */ $cloud_last_success = $cloud['last_success'] > 0 ? sprintf( __( '%s ago', 'statwrite' ), human_time_diff( $cloud['last_success'], time() ) ) : '—'; /* translators: %s: time difference until the next attempt. */ $cloud_next_txt = $cloud['next_attempt'] > time() ? sprintf( __( 'in about %s', 'statwrite' ), human_time_diff( time(), $cloud['next_attempt'] ) ) : '—'; $cloud_cron_txt = $cloud['cron_next'] > time() ? wp_date( 'Y/m/d H:i', $cloud['cron_next'] ) : __( 'Waiting to run', 'statwrite' ); $day_label = static function ( $days ) { /* translators: %s: number of days. */ return sprintf( _n( '%s day', '%s days', $days, 'statwrite' ), number_format_i18n( $days ) ); }; $month_label = static function ( $months ) { /* translators: %s: number of months. */ return 0 === $months ? __( 'Keep forever', 'statwrite' ) : sprintf( _n( '%s month', '%s months', $months, 'statwrite' ), number_format_i18n( $months ) ); }; ?>