}>
*/
private static function screens() {
$screens = array(
'site-replica' => array(
__( 'The dashboard shows this site\'s backups and connections at a glance.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'back-up-a-large-site' ), __( 'Back up a large site without filling its disk', 'accessnow-site-replica' ) ),
array( self::help_url( 'connect-two-sites' ), __( 'Connect two sites with a connection key', 'accessnow-site-replica' ) ),
),
),
'site-replica-pull' => array(
__( 'Copy another site into this one: add the site with its connection key, then pull a backup from it.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'connect-two-sites' ), __( 'Connect two sites with a connection key', 'accessnow-site-replica' ) ),
array( self::help_url( 'back-up-a-large-site' ), __( 'Back up a large site without filling its disk', 'accessnow-site-replica' ) ),
),
),
'site-replica-backups' => array(
__( 'Every backup stored on this site. Restoring shows you a plan first, and can be rolled back.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'restore-and-roll-back' ), __( 'Restore a backup, and roll it back', 'accessnow-site-replica' ) ),
array( self::help_url( 'reading-the-restore-plan' ), __( 'Reading the restore plan before you say go', 'accessnow-site-replica' ) ),
),
),
'site-replica-source' => array(
__( 'Let another site copy this one: turn the source on and give that site a connection key.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'connect-two-sites' ), __( 'Connect two sites with a connection key', 'accessnow-site-replica' ) ),
array( self::help_url( 'when-a-firewall-blocks-it' ), __( 'When your host\'s firewall blocks the requests', 'accessnow-site-replica' ) ),
),
),
'site-replica-logs' => array(
__( 'What each job did, step by step. The first place to look when something stops.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'when-a-firewall-blocks-it' ), __( 'When your host\'s firewall blocks the requests', 'accessnow-site-replica' ) ),
),
),
'site-replica-settings' => array(
__( 'Where backups are stored, how many are kept, and what is left out.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'what-the-plugin-writes' ), __( 'What the plugin writes, and where', 'accessnow-site-replica' ) ),
array( self::help_url( 'exclusions-and-retention' ), __( 'Leaving things out: exclusions and retention', 'accessnow-site-replica' ) ),
),
),
Cloud_Page::SLUG => array(
__( 'Scheduled backups to Google Drive or Amazon S3, uploading only what changed.', 'accessnow-site-replica' ),
array(
array( self::help_url( 'scheduled-cloud-backups' ), __( 'Scheduled backups to Google Drive or S3', 'accessnow-site-replica' ) ),
),
),
);
if ( defined( 'ACCESSNOW_REPLICA_PRO' ) && ACCESSNOW_REPLICA_PRO ) {
$screens['site-replica-pull'][1][] = array( self::help_url( 'put-a-redesign-live' ), __( 'Put a redesign live without losing new orders', 'accessnow-site-replica' ) );
$screens['site-replica-backups'][1][] = array( self::help_url( 'restore-only-some-of-it' ), __( 'Restore only some of it: files and tables', 'accessnow-site-replica' ) );
$screens['site-replica-settings'][1][] = array( self::help_url( 'backup-before-updates' ), __( 'A backup before every update', 'accessnow-site-replica' ) );
}
return $screens;
}
/**
* Action: current_screen. On the plugin's own screens only, a Help tab and the support sidebar.
*
* @param \WP_Screen $screen Current screen.
*/
public static function tabs( $screen ) {
$page = isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only picks which help text to show.
$map = self::screens();
if ( ! isset( $map[ $page ] ) || ! is_object( $screen ) || false === strpos( (string) $screen->id, $page ) ) {
return;
}
$content = '' . esc_html( $map[ $page ][0] ) . '
';
$screen->add_help_tab(
array(
'id' => 'accessnow-replica-help',
'title' => __( 'About this screen', 'accessnow-site-replica' ),
'content' => $content,
)
);
$sidebar = '' . esc_html__( 'More help', 'accessnow-site-replica' ) . '
';
$sidebar .= '' . esc_html__( 'Help articles', 'accessnow-site-replica' ) . '
';
$sidebar .= '' . esc_html__( 'Get support', 'accessnow-site-replica' ) . '
';
if ( '' !== ACCESSNOW_REPLICA_WPORG_SLUG ) {
$sidebar .= '' . esc_html__( 'WordPress.org listing', 'accessnow-site-replica' ) . '
';
}
$sidebar .= '' . esc_html__( 'About the plugin', 'accessnow-site-replica' ) . '
';
$screen->set_help_sidebar( $sidebar );
}
}