Skip to content

Commit

Permalink
Add theme header comparison check to compatibility logic (#76)
Browse files Browse the repository at this point in the history
* Add theme header comparison check to compatibility logic

* Fix a typo

* Improve user feedback during theme compatibility checks

* Slight reword as proposed
  • Loading branch information
mattyrob authored Aug 17, 2021
1 parent 450ec86 commit 914d8b2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion lib/admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,35 @@ function classicpress_check_can_migrate() {
echo "<tr>\n<td>$icon_preflight_fail</td>\n<td>\n";
printf( __(
/* translators: active theme name */
'It looks like you are using the <strong>%1$s</strong> theme. Unfortuantely it is incompatible with ClassicPress.',
'It looks like you are using the <strong>%1$s</strong> theme. Unfortunately it is incompatible with ClassicPress.',
'switch-to-classicpress'
), $theme->name );
echo "<br>\n";
_e(
'Consider switching to a different theme, perhaps an older core theme, and try again.',
'switch-to-classicpress'
);
} elseif ( empty ( $theme->get( 'RequiresWP' ) ) ) {
$preflight_checks['theme'] = true;
echo "<tr>\n<td>$icon_preflight_warn</td>\n<td>\n";
printf( __(
/* translators: active theme name */
'It looks like you are using the <strong>%1$s</strong> theme. We cannot be sure it is compatible with ClassicPress because it is not declaring a minimum required version of WordPress.',
'switch-to-classicpress'
), $theme->name );
} elseif ( version_compare( $theme->get( 'RequiresWP' ), '5.0' ) >= 0 ) {
$preflight_checks['theme'] = false;
echo "<tr>\n<td>$icon_preflight_fail</td>\n<td>\n";
printf( __(
/* translators: active theme name */
'It looks like you are using the <strong>%1$s</strong> theme. Unfortunately it seems it requires WordPress %2$s or above and it may therefore be incompatible with ClassicPress.',
'switch-to-classicpress'
), $theme->name, $theme->get( 'RequiresWP' ) );
echo "<br>\n";
_e(
'Consider switching to a different theme, perhaps an older core theme, and try again.',
'switch-to-classicpress'
);
} else {
$preflight_checks['theme'] = true;
echo "<tr>\n<td>$icon_preflight_warn</td>\n<td>\n";
Expand Down

0 comments on commit 914d8b2

Please sign in to comment.