esc_url_raw( rest_url( 'backupino/v1/' ) ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'isRtl' => is_rtl(), 'strings' => array( 'creating' => __( 'Starting…', 'backupino' ), 'running' => __( 'Working…', 'backupino' ), 'failed' => __( 'The job failed.', 'backupino' ), 'confirm' => __( 'Delete this package permanently?', 'backupino' ), 'saved' => __( 'Settings saved.', 'backupino' ), 'copied' => __( 'Link copied to the clipboard.', 'backupino' ), 'notified' => __( 'Test message sent.', 'backupino' ), 'jobDetails' => __( 'Backup Job', 'backupino' ), 'cancelConfirm' => __( 'Cancel the current backup job?', 'backupino' ), 'cancelled' => __( 'Backup cancelled.', 'backupino' ), ), ) ); } /** * Render the dashboard. * * @return void */ public function render_dashboard(): void { if ( ! Capabilities::user_can_manage() ) { wp_die( esc_html__( 'You are not allowed to manage backups.', 'backupino' ) ); } Views::render( 'dashboard' ); } /** * Render the settings screen. * * @return void */ public function render_settings(): void { if ( ! Capabilities::user_can_manage() ) { wp_die( esc_html__( 'You are not allowed to manage backups.', 'backupino' ) ); } Views::render( 'settings' ); } /** * Add a settings link on the plugins screen. * * @param string[] $links Existing links. * @return string[] */ public function action_links( array $links ): array { $settings_url = admin_url( 'admin.php?page=' . self::SLUG . '-settings' ); $new_links = array( sprintf( '%s', esc_url( $settings_url ), esc_html__( 'Settings', 'backupino' ) ), ); return array_merge( $new_links, $links ); } /** * Display migration/restoration success notice if flag is set. * * @return void */ public function migration_notice(): void { if ( ! Capabilities::user_can_manage() ) { return; } if ( '1' !== (string) get_option( 'backupino_migration_notice', '0' ) ) { return; } delete_option( 'backupino_migration_notice' ); ?>