Skip to content

Commit 4c3af7d

Browse files
authored
Now the wizard uses a custom header and the content has been changed (#274)
* Now the wizard uses a custom header and the content has been changed * Fix simple liniting issues * Fix simple liniting issues * Fix simple liniting issues
1 parent c3f821c commit 4c3af7d

10 files changed

Lines changed: 114 additions & 34 deletions

File tree

assets/css/src/admin/_wizard.scss

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ body.iawmlf-onboarding-active #wpbody-content {
1313
}
1414
}
1515

16+
.iawmlf-wizard__header {
17+
width: 400px;
18+
margin-left: auto;
19+
margin-right: auto;
20+
display: flex;
21+
gap: 20px;
22+
align-items: center;
23+
padding: 10px;
24+
margin-bottom: 10px;
25+
img {
26+
width: 100px;
27+
}
28+
}
29+
1630
#iawmlf_wizard {
1731
padding: 20px 30px;
1832
background: white;
@@ -69,7 +83,7 @@ body.iawmlf-onboarding-active #wpbody-content {
6983
display: flex;
7084
width: 100%;
7185
align-items: center;
72-
justify-content: space-between;
86+
flex-direction: column;
7387
}
7488

7589
.iawmlf-wizard__footer__progress {
@@ -82,6 +96,14 @@ body.iawmlf-onboarding-active #wpbody-content {
8296
@media (max-width: 499px) {
8397
display: none;
8498
}
99+
padding-bottom: 12px;
100+
}
101+
102+
.iawmlf-wizard__footer__actions {
103+
display: flex;
104+
align-items: center;
105+
justify-content: space-between;
106+
width: 100%;
85107
}
86108

87109
.iawmlf-wizard__footer__progress__bar {
@@ -91,6 +113,10 @@ body.iawmlf-onboarding-active #wpbody-content {
91113
display: inline;
92114
text-align: center;
93115
position: relative;
116+
p {
117+
margin-top: 0;
118+
margin-bottom: 0;
119+
}
94120
.iawmlf-wizard__footer__progress__bar__inner {
95121
background-color: #2271b1;
96122
height: 5px;

assets/images/icon.svg

Lines changed: 10 additions & 0 deletions
Loading

languages/internet-archive-wayback-machine-link-fixer.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ msgstr ""
783783
#. translators: 1: number of broken links being redirected, 2: number of broken links not being redirected.
784784
#: templates/admin/dashboard/page.php:51
785785
#, php-format
786-
msgid "%1$s being redirected, %2$s inedible for redirect"
786+
msgid "%1$s being redirected, %2$s ineligible for redirect"
787787
msgstr ""
788788

789789
#: templates/admin/dashboard/page.php:58

src/Dashboard/Setup_Wizard.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,17 @@ private function handle_step_3(): void {
404404
public function render_page(): void {
405405

406406
echo '<div class="wrap">';
407-
echo '<h1>';
408-
esc_html_e( 'Wayback Link Fixer - Setup Wizard', 'internet-archive-wayback-machine-link-fixer' );
409-
echo '</h1>';
407+
408+
echo '<div class="iawmlf-wizard__header">';
409+
printf(
410+
'<img src="%1$s" alt="%2$s" class="iawmlf-wizard__title__logo" /> ',
411+
esc_url( IAWMLF_URL . 'assets/images/icon.svg' ),
412+
'Internet Archive Logo'
413+
);
414+
echo '<h1 class="iawmlf-wizard__title">';
415+
esc_html_e( 'Internet Archive Wayback Machine Link Fixer Setup', 'internet-archive-wayback-machine-link-fixer' );
416+
echo '</h1>';
417+
echo '</div>';
410418

411419
$step_data = $this->get_step_data();
412420

templates/admin/dashboard/page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
$iawmlf_tooltip_checks_in_progress = __( 'The plugin is still working through checking the status of these links and whether archived snapshots are available.', 'internet-archive-wayback-machine-link-fixer' );
5050
$iawmlf_tooltip_broken_links = sprintf(
5151
// translators: 1: number of broken links being redirected, 2: number of broken links not being redirected.
52-
__( '%1$s being redirected, %2$s inedible for redirect', 'internet-archive-wayback-machine-link-fixer' ),
52+
__( '%1$s being redirected, %2$s ineligible for redirect', 'internet-archive-wayback-machine-link-fixer' ),
5353
$iawmlf_broken_redirected,
5454
$iawmlf_broken_not_redirected
5555
);

templates/admin/wizard/complete.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
printf(
2828
// translators: %s is a link to the plugin settings page.
2929
esc_html__( 'Setup is now complete! You can edit these settings at any time from the %s page.', 'internet-archive-wayback-machine-link-fixer' ),
30-
'<a href="' . esc_url( Settings_Page::get_page_url() ) . '">' . esc_html__( 'Wayback Link Fixer Settings', 'internet-archive-wayback-machine-link-fixer' ) . '</a>'
30+
'<a href="' . esc_url( Settings_Page::get_page_url() ) . '">' . esc_html__( 'Advanced Settings page', 'internet-archive-wayback-machine-link-fixer' ) . '</a>'
3131
);
3232
?>
3333
</p>

templates/admin/wizard/footer.php

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,30 @@
2424
);
2525
$iawmlf_progress_pc = ( $step_data['progress']['current'] / $step_data['progress']['total'] ) * 100;
2626
$iawmlf_rerun_wizard = isset( $_GET['rerun-wizard'] ) && '1' === sanitize_text_field( $_GET['rerun-wizard'] ); // phpcs:ignore
27+
28+
// Based on the current step, set the button labels.
29+
switch ( $step_data['step'] ) {
30+
case 'step-1':
31+
$iawmlf_next_label = esc_html__( 'Next Step: Configure the Link Fixer', 'internet-archive-wayback-machine-link-fixer' );
32+
$iawmlf_previous_label = '';
33+
break;
34+
case 'step-2':
35+
$iawmlf_next_label = esc_html__( 'Next Step: Configure the Auto Archiver', 'internet-archive-wayback-machine-link-fixer' );
36+
$iawmlf_previous_label = esc_html__( 'Previous Step: About', 'internet-archive-wayback-machine-link-fixer' );
37+
break;
38+
case 'step-3':
39+
$iawmlf_next_label = esc_html__( 'Finish Setup', 'internet-archive-wayback-machine-link-fixer' );
40+
$iawmlf_previous_label = esc_html__( 'Previous Step: Configure the Link Fixer', 'internet-archive-wayback-machine-link-fixer' );
41+
break;
42+
case 'complete':
43+
$iawmlf_next_label = '';
44+
$iawmlf_previous_label = esc_html__( 'Previous Step: Configure the Auto Archiver', 'internet-archive-wayback-machine-link-fixer' );
45+
break;
46+
}
2747
?>
2848
</div> <!-- END Wizard content -->
2949

3050
<div id="iawmlf-wizard__footer">
31-
<div class="iawmlf-wizard__footer__previous">
32-
<?php if ( 'step-1' === $step_data['step'] ) : ?>
33-
<button class="button button-primary" type="button" name="" disabled <?php echo esc_attr( $iawmlf_previous_state ); ?>><?php esc_html_e( 'Previous Step', 'internet-archive-wayback-machine-link-fixer' ); ?></button>
34-
<?php elseif ( 'complete' !== $step_data['step'] || $iawmlf_rerun_wizard ) : ?>
35-
<button class="button button-primary" type="submit" name="iawmlf-previous-step" <?php echo esc_attr( $iawmlf_previous_state ); ?>><?php esc_html_e( 'Previous Step', 'internet-archive-wayback-machine-link-fixer' ); ?></button>
36-
<?php endif; ?>
37-
</div>
3851
<div class="iawmlf-wizard__footer__progress">
3952
<?php if ( 'complete' !== $step_data['step'] ) : ?>
4053
<div class="iawmlf-wizard__footer__progress__bar">
@@ -43,11 +56,24 @@
4356
</div>
4457
<?php endif; ?>
4558
</div>
46-
<div class="iawmlf-wizard__footer__next">
59+
60+
<div class="iawmlf-wizard__footer__actions">
61+
<div class="iawmlf-wizard__footer__previous">
62+
<?php if ( 'step-1' === $step_data['step'] ) : ?>
63+
<span></span>
64+
<?php elseif ( 'complete' !== $step_data['step'] || $iawmlf_rerun_wizard ) : ?>
65+
<button class="button button-primary" type="submit" name="iawmlf-previous-step" <?php echo esc_attr( $iawmlf_previous_state ); ?>><?php echo esc_html( $iawmlf_previous_label ); ?></button>
66+
<?php endif; ?>
67+
</div>
68+
<div class="iawmlf-wizard__footer__next">
4769
<?php if ( 'complete' !== $step_data['step'] ) : ?>
4870
<button class="button button-primary" type="submit" name="next-step" <?php echo esc_attr( $iawmlf_next_state ); ?>><?php echo esc_html( $iawmlf_next_label ); ?></button>
4971
<?php endif; ?>
5072
</div>
73+
</div>
74+
75+
76+
5177
</div>
5278
</form> <!-- END Wizard form -->
5379
</div> <!-- END Wizard container -->

templates/admin/wizard/step-1.php

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,33 @@
1818

1919
<?php echo wp_kses( $header, \Internet_Archive\Wayback_Machine_Link_Fixer\Util\Esc::wizard_allowed_tags() ); ?>
2020

21-
<div class="iawmlf-wizard__content__header">
22-
<h2><?php esc_html_e( '??Step 1: Configure the Wayback Machine API', 'internet-archive-wayback-machine-link-fixer' ); ?></h2>
23-
</div>
24-
2521
<div class="iawmlf-wizard__content__intro">
26-
<p><?php esc_html_e( '??To archive more than 4000 links from your site to the Wayback Machine per day, you\'ll need a free archive.org account. Once you have your account, enter the API Access Key and Secret Key below. (Optional)', 'internet-archive-wayback-machine-link-fixer' ); ?>
27-
<br /><a href="https://archive.org/account/s3.php" target="_blank"><?php esc_html_e( 'Get your API keys here.', 'internet-archive-wayback-machine-link-fixer' ); ?></a></p>
22+
<p><?php esc_html_e( 'Thanks for installing the Internet Archive Wayback Machine Link Fixer!', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
23+
<p>
24+
<?php
25+
printf(
26+
/* translators: %s: Wayback Machine link */
27+
esc_html__( 'This plugin scans your posts for links, checks whether or not they work, and if they don\'t work it automatically redirects them to an archived snapshot on the %s. Here\'s what you need to know:', 'internet-archive-wayback-machine-link-fixer' ),
28+
'<a href="https://wayback.archive.org" target="_blank">' . esc_html__( 'Wayback Machine', 'internet-archive-wayback-machine-link-fixer' ) . '</a>'
29+
);
30+
?>
31+
</p>
32+
33+
<ul>
34+
<li>
35+
<h3><?php esc_html_e( 'Checking links takes time.', 'internet-archive-wayback-machine-link-fixer' ); ?></h3>
36+
<p><?php esc_html_e( 'It takes some time to check your links. We process them in small batches over time so we don\'t slow down your site. After you set it up, check back in a couple days on the progress. We keep the dashboard updated with how many posts have been scanned and how many links have been checked.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
37+
</li>
38+
<li>
39+
<h3><?php esc_html_e( 'Broken links redirect to the Wayback Machine after 3 checks.', 'internet-archive-wayback-machine-link-fixer' ); ?></h3>
40+
<p><?php esc_html_e( 'We want to make sure the link is actually broken and not just an intermittent issue, so we check it 3 times, at least 3 days apart. We keep checking it, so if it comes back online we\'ll stop redirecting it.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
41+
</li>
42+
<li>
43+
<h3><?php esc_html_e( 'Set it and forget it.', 'internet-archive-wayback-machine-link-fixer' ); ?></h3>
44+
<p><?php esc_html_e( 'Once you set up this plugin, it continues to run and check your links in the background, no action required from you.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
45+
</li>
46+
</ul>
2847
</div>
2948

3049

31-
3250
<?php echo wp_kses( $footer, \Internet_Archive\Wayback_Machine_Link_Fixer\Util\Esc::wizard_allowed_tags() ); ?>

templates/admin/wizard/step-2.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,16 @@
2020

2121
<?php echo wp_kses( $header, \Internet_Archive\Wayback_Machine_Link_Fixer\Util\Esc::wizard_allowed_tags() ); ?>
2222
<input type="hidden" name="iawmlf_wizard_activate_link_fixer" value="<?php echo Settings::is_link_processing_enabled( true ) ? '1' : '0'; ?>" />
23-
<div class="iawmlf-wizard__content__header">
24-
<h2><?php esc_html_e( 'Step 2: Configure the Link Fixer', 'internet-archive-wayback-machine-link-fixer' ); ?></h2>
25-
</div>
2623

2724
<div class="iawmlf-wizard__content__intro">
28-
<p><?php esc_html_e( '?? You can set the Link Fixer to work only with specific post types and apply it to existing posts.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
25+
<p><?php esc_html_e( 'We\'ll scan your site\'s content for links and redirect the broken ones to snapshots on the Wayback Machine of what those links used to show.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
2926
</div>
3027

3128

3229
<div class="iawmlf-wizard__content__field" >
3330
<label for="iawmlf_wizard_post_types">
34-
<?php esc_html_e( 'Post Types', 'internet-archive-wayback-machine-link-fixer' ); ?>
31+
<?php esc_html_e( 'Automatically fix broken links in:', 'internet-archive-wayback-machine-link-fixer' ); ?>
3532
</label>
36-
<p class="description"><?php esc_html_e( '?? Select the post types you want to enable the link fixer for.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
3733
<div class="iawmlf-wizard__content__inner-field checkboxes">
3834
<?php foreach ( $post_types as $iawmlf_pt_slug => $iawmlf_pt_name ) : ?>
3935
<div class="inner-spaced-between__list">

templates/admin/wizard/step-3.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,16 @@
1919

2020
<?php echo wp_kses( $header, \Internet_Archive\Wayback_Machine_Link_Fixer\Util\Esc::wizard_allowed_tags() ); ?>
2121

22-
<div class="iawmlf-wizard__content__header">
23-
<h2><?php esc_html_e( 'Step 3: Configure the Auto Archiver', 'internet-archive-wayback-machine-link-fixer' ); ?></h2>
24-
</div>
2522
<input type="hidden" name="iawmlf_wizard_activate_auto_archiver" value="<?php echo esc_attr( Settings::add_own_links( true ) ? '1' : '0' ); ?>" />
2623

2724
<div class="iawmlf-wizard__content__intro">
28-
<p><?php esc_html_e( 'Easily preserve your website’s content by enabling automatic archiving with the Internet Archive, setting up regular archiving, and choosing which post types to include.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
25+
<p><?php esc_html_e( 'In addition to fixing broken links, this plugin can preserve your content on the Wayback Machine in case your site goes offline. New posts will be preserved when published, and we\'ll schedule regular snapshots so your content stays preserved over time.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
2926
</div>
3027

3128
<div class="iawmlf-wizard__content__field" >
3229
<label for="iawmlf_wizard_post_types">
33-
<?php esc_html_e( 'Post Types', 'internet-archive-wayback-machine-link-fixer' ); ?>
30+
<?php esc_html_e( 'Automatically preserve:', 'internet-archive-wayback-machine-link-fixer' ); ?>
3431
</label>
35-
<p class="description"><?php esc_html_e( 'Select which post types should be archived on the Wayback Machine.', 'internet-archive-wayback-machine-link-fixer' ); ?></p>
3632
<div class="iawmlf-wizard__content__inner-field checkboxes">
3733
<?php foreach ( $post_types as $iawmlf_pt_slug => $iawmlf_pt_name ) : ?>
3834
<div class="inner-spaced-between__list">

0 commit comments

Comments
 (0)