';
}
/** The way through setup as four steps, with the next thing to do under it. */
private static function steps( $connected, $has_service, $events_on, $sent_today, $links ) {
$steps = array(
array( __( 'Connect your store', 'winnyplus' ), __( 'Pair this site with your WinnyPlus account.', 'winnyplus' ), $connected ),
array( __( 'Choose your services', 'winnyplus' ), __( 'Subscribe to what your business needs.', 'winnyplus' ), $has_service ),
array( __( 'Decide what is sent', 'winnyplus' ), __( 'Orders, customers, carts and products, as your services need them.', 'winnyplus' ), $events_on > 0 ),
array( __( 'Follow it from the dashboard', 'winnyplus' ), __( 'Orders, carts and numbers, in one place.', 'winnyplus' ), $sent_today > 0 ),
);
$current = count( $steps );
foreach ( $steps as $i => $step ) {
if ( ! $step[2] ) {
$current = $i;
break;
}
}
?>
$step ) : ?>
-
%s %s', esc_url( $next[1] ), esc_html( $next[0] ), WinnyPlus_Connect_Icons::markup( 'arrow' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- markup() is already filtered with wp_kses
}
}
/** One service: where the brand stands with it, what it uses from the store, its numbers, and the next thing to do. */
private static function service_card( array $service ) {
$state = isset( $service['state'] ) ? $service['state'] : 'available';
$chips = array(
'active' => array( __( 'Active', 'winnyplus' ), __( 'Open', 'winnyplus' ) ),
'paused' => array( __( 'Cancelled', 'winnyplus' ), __( 'Renew subscription', 'winnyplus' ) ),
'available' => array( __( 'Not subscribed', 'winnyplus' ), __( 'Activate', 'winnyplus' ) ),
);
$chip = isset( $chips[ $state ] ) ? $chips[ $state ] : $chips['available'];
$color = ! empty( $service['color'] ) && preg_match( '/^#[0-9a-fA-F]{3,8}$/', $service['color'] ) ? $service['color'] : '#00A859';
$feeds = ! empty( $service['feeds'] ) && is_array( $service['feeds'] ) ? $service['feeds'] : array();
$stats = ! empty( $service['stats'] ) && is_array( $service['stats'] ) ? $service['stats'] : array();
?>
' . WinnyPlus_Connect_Icons::markup( 'alert' ) . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- markup() is already filtered with wp_kses
echo '
' . esc_html( $read['stale'] ? __( 'Showing the last view we saved', 'winnyplus' ) : __( 'WinnyPlus could not be reached', 'winnyplus' ) ) . ' ';
echo esc_html( $read['error'] ) . ' ';
printf( '
%s', esc_url( wp_nonce_url( admin_url( 'admin.php?page=winnyplus&winnyplus_connect_refresh=1' ), 'winnyplus_connect_refresh_overview' ) ), esc_html__( 'Try again', 'winnyplus' ) );
echo '
';
}
if ( $connected ) {
?>