';
}
public static function test_alert() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You are not allowed to do this.', 'nodebook' ), 403 );
}
check_admin_referer( 'nodebook_test_alert' );
$ok = Nodebook_Setup::send_test();
Nodebook_Admin::redirect( Nodebook_Admin::url( 'nodebook-settings' ) . '#nb-status', $ok ? 'mailok' : 'mailfail' );
}
public static function test_weekly() {
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You are not allowed to do this.', 'nodebook' ), 403 );
}
check_admin_referer( 'nodebook_test_weekly' );
$ok = Nodebook_Weekly::send( true );
Nodebook_Admin::redirect( Nodebook_Admin::url( 'nodebook-settings' ) . '#nb-signals', $ok ? 'weeklyok' : 'mailfail' );
}
private static function name( $key, $multi = false ) {
return Nodebook_Settings::OPTION . '[' . $key . ']' . ( $multi ? '[]' : '' );
}
/** "Node on your phone": the app's address, connect a phone (code + QR), connected phones. */
private static function phone_row() {
$owner = Nodebook_Node::owner();
$me = get_current_user_id() === $owner;
echo '
' . esc_html__( 'Today, people waiting, tasks and contacts in your pocket, with one-tap call and WhatsApp. Press “Connect a phone” and scan the code with your phone’s camera. The app has a private address that is not linked anywhere: anyone else who finds it sees “page not found”.', 'nodebook' ) . '
';
if ( $me ) {
echo '
' . esc_html__( 'Scan with your phone’s camera, then add it to your home screen. Asked for a code in the app? Type:', 'nodebook' ) . '
' . esc_html__( 'The code works once, for 10 minutes.', 'nodebook' ) . '
' . esc_html__( 'Can’t scan? Send this link to your phone and open it there:', 'nodebook' ) . '
';
} else {
echo '
' . esc_html(
sprintf(
/* translators: %s: name */
__( 'Only %s, who Node works for, can connect a phone.', 'nodebook' ),
Nodebook_Node::user_first( $owner )
)
) . '