id, array( 'plugins', 'toplevel_page_' . Admin::SLUG ), true ) ) {
return;
}
$skip = wp_nonce_url( admin_url( 'admin-post.php?action=ariconsent_setup_skip' ), 'ariconsent_setup_skip' );
?>
__( 'Contrast %s:1 – easy to read.', 'ariconsent' ),
/* translators: %s: contrast ratio, e.g. 3.2 */
'contrastLow' => __( 'Contrast %s:1 – too low, whether the text is white or dark. Choose a darker or lighter colour (at least 4.5:1).', 'ariconsent' ),
'darkText' => \AriConsent\Banner::DARK_TEXT,
)
);
}
/**
* Renders the current step.
*/
public static function render() {
if ( ! current_user_can( Plugin::capability() ) ) {
wp_die( esc_html__( 'You do not have permission to do this.', 'ariconsent' ), 403 );
}
$step = self::step();
$titles = array(
1 => __( 'What your site uses', 'ariconsent' ),
2 => __( 'How the banner looks', 'ariconsent' ),
3 => __( 'Privacy policy and Google', 'ariconsent' ),
4 => __( 'Done', 'ariconsent' ),
);
if ( 4 === $step ) {
update_option( self::DONE_OPT, true, false );
}
?>
$title ) : ?>
>
' . esc_html__( 'Scan finished. The list below includes what was found on your home page.', 'ariconsent' ) . '
';
} elseif ( 'scan_failed' === $notice ) {
echo '' . esc_html__( 'The scan could not load your site. Check that the site is reachable from the server.', 'ariconsent' ) . '
';
}
switch ( $step ) {
case 2:
self::step_look();
break;
case 3:
self::step_policy();
break;
case 4:
self::step_done();
break;
default:
self::step_services();
}
?>
';
settings_fields( 'ariconsent' );
// A second referer field wins over the one settings_fields() printed, so saving moves on.
echo ' ';
}
/**
* Back link and continue button.
*
* @param int $step Current step.
* @param string $label Button label.
*/
private static function form_close( $step, $label ) {
echo '';
if ( $step > 1 ) {
echo '' . esc_html__( 'Back', 'ariconsent' ) . ' ';
}
submit_button( $label, 'primary', 'submit', false );
echo '
';
}
/**
* Step 1: what was found and where it came from.
*/
private static function step_services() {
$categories = Services::categories();
$by_plugin = Integrations::detected();
$scanned = (array) get_option( Admin::DETECTED_OPT, array() );
$seen = (array) get_option( 'ariconsent_seen', array() );
$scan_time = (int) get_option( Health::SCAN_TIME_OPT, 0 );
$listed = Services::listed();
?>
add( 'ariconsent', ARICONSENT_URL . 'assets/css/banner.css', array(), ARICONSENT_VERSION );
$styles->add_inline_style( 'ariconsent', Banner::inline_css() );
$styles->add( 'ariconsent-preview', false, array( 'ariconsent' ), ARICONSENT_VERSION );
$styles->add_inline_style( 'ariconsent-preview', $page_css );
ob_start();
$styles->do_items( array( 'ariconsent-preview' ) );
$head = (string) ob_get_clean();
$page = '
'
. str_repeat( '
', 8 )
. '
';
return ' '
. ' ' . $head
. '' . $page . $markup . '';
}
/**
* Step 3: privacy policy page, Google Consent Mode and the consent log.
*/
private static function step_policy() {
$s = Settings::get();
$name = Settings::OPTION;
self::form_open( 4 );
?>