Skip to content

Commit

Permalink
Merge pull request #442 from ConvertKit/replace-mb-convert-encoding
Browse files Browse the repository at this point in the history
Replace `mb_convert_encoding()` for PHP 8.2 compatibility
  • Loading branch information
n7studios authored Feb 22, 2023
2 parents 049c460 + 3cba712 commit a9238b6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 50 deletions.
48 changes: 0 additions & 48 deletions admin/class-convertkit-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ public function display_settings_page() {
<h1><?php esc_html_e( 'ConvertKit', 'convertkit' ); ?></h1>
</header>

<?php
$this->maybe_display_notices();
?>

<div class="wrap">
<?php
if ( count( $this->sections ) > 1 ) {
Expand Down Expand Up @@ -188,50 +184,6 @@ private function get_active_section() {

}

/**
* Display notice(s) immediately after the settings screen header.
*
* @since 1.9.6
*/
private function maybe_display_notices() {

$notices = array();

// Check the mbstring extension is loaded.
if ( ! extension_loaded( 'mbstring' ) ) {
$notices[] = array(
'type' => 'warning',
'message' => sprintf(
/* translators: link to php.net manual */
__( 'Notice: Your server does not support the %s function - this is required for better character encoding. Please contact your webhost to have it installed.', 'convertkit' ),
'<a href="https://php.net/manual/en/mbstring.installation.php">mbstring</a>'
),
);
}

// Bail if no notices exist.
if ( ! count( $notices ) ) {
return;
}
?>
<div class="notices">
<?php
// Output inline notices.
foreach ( $notices as $notice ) {
?>
<div class="inline notice notice-<?php echo esc_attr( $notice['type'] ); ?>">
<p>
<?php echo esc_attr( $notice['message'] ); ?>
</p>
</div>
<?php
}
?>
</div>
<?php

}

/**
* Define links to display below the Plugin Name on the WP_List_Table at in the Plugins screen.
*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "project",
"license": "GPLv3",
"require": {
"convertkit/convertkit-wordpress-libraries": "1.3.2"
"convertkit/convertkit-wordpress-libraries": "1.3.3"
},
"require-dev": {
"lucatume/wp-browser": "^3.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ modules:
window_size: 1920x1080
capabilities:
chromeOptions:
args: ["--headless=new", "--disable-gpu"]
args: ["--headless", "--disable-gpu"]
prefs:
download.default_directory: '%WP_ROOT_FOLDER%'
6 changes: 6 additions & 0 deletions tests/acceptance/forms/PageFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public function testAddNewPageUsingDefaultLegacyForm(AcceptanceTester $I)

// Confirm that the ConvertKit Default Legacy Form displays.
$I->seeInSource('<form id="ck_subscribe_form" class="ck_subscribe_form" action="https://api.convertkit.com/landing_pages/' . $_ENV['CONVERTKIT_API_LEGACY_FORM_ID'] . '/subscribe" data-remote="true">');

// Confirm that the Legacy Form title's character encoding is correct.
$I->seeInSource('Vantar þinn ungling sjálfstraust í stærðfræði?');
}

/**
Expand Down Expand Up @@ -248,6 +251,9 @@ public function testAddNewPageUsingDefinedLegacyForm(AcceptanceTester $I)

// Confirm that the ConvertKit Legacy Form displays.
$I->seeInSource('<form id="ck_subscribe_form" class="ck_subscribe_form" action="https://api.convertkit.com/landing_pages/' . $_ENV['CONVERTKIT_API_LEGACY_FORM_ID'] . '/subscribe" data-remote="true">');

// Confirm that the Legacy Form title's character encoding is correct.
$I->seeInSource('Vantar þinn ungling sjálfstraust í stærðfræði?');
}

/**
Expand Down

0 comments on commit a9238b6

Please sign in to comment.