' . __( 'Connect your AffKeeper account to see clicks and stock alerts here.', 'affkeeper' ) . '
' ),
esc_url( admin_url( 'admin.php?page=' . AffKeeper_Settings::MENU_SLUG ) )
);
return;
}
$summary = AffKeeper_API::summary();
if ( is_wp_error( $summary ) ) {
echo '' . esc_html( $summary->get_error_message() ) . '
';
return;
}
$clicks = isset( $summary['clicks'] ) ? (int) $summary['clicks'] : 0;
$links = isset( $summary['links'] ) ? (int) $summary['links'] : 0;
$unbuyable = isset( $summary['unbuyable'] ) ? (int) $summary['unbuyable'] : 0;
$low = isset( $summary['low_stock'] ) ? (int) $summary['low_stock'] : 0;
$broken = isset( $summary['broken'] ) ? (int) $summary['broken'] : 0;
echo '';
echo '
' . esc_html( number_format_i18n( $clicks ) ) . '' . esc_html__( 'Clicks (30d)', 'affkeeper' ) . '
';
echo '
' . esc_html( number_format_i18n( $links ) ) . '' . esc_html__( 'Links', 'affkeeper' ) . '
';
echo '
';
echo '';
if ( $unbuyable > 0 ) {
echo '- ' . esc_html( sprintf(
/* translators: %d: number of links. */
_n( '%d link points to an unavailable product', '%d links point to unavailable products', $unbuyable, 'affkeeper' ),
$unbuyable
) ) . '
';
} else {
echo '- ' . esc_html__( 'All products are buyable', 'affkeeper' ) . '
';
}
if ( $low > 0 ) {
echo '- ' . esc_html( sprintf(
/* translators: %d: number of links. */
_n( '%d running low on stock', '%d running low on stock', $low, 'affkeeper' ),
$low
) ) . '
';
}
if ( $broken > 0 ) {
echo '- ' . esc_html( sprintf(
/* translators: %d: number of links. */
_n( '%d redirect link is broken', '%d redirect links are broken', $broken, 'affkeeper' ),
$broken
) ) . '
';
}
echo '
';
echo '' . esc_html__( 'View all links →', 'affkeeper' ) . '
';
}
}