Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for required iconv extension #1727

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion amp.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function _amp_print_php_version_admin_notice() {
function _amp_print_php_dom_document_notice() {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'The AMP plugin requires DOM extension in PHP. Please contact your host to install DOM extension.', 'amp' ); ?></p>
<p><?php esc_html_e( 'The AMP plugin requires DOM extension in PHP. Please contact your host to install this extension.', 'amp' ); ?></p>
</div>
<?php
}
Expand All @@ -47,6 +47,23 @@ function _amp_print_php_dom_document_notice() {
return;
}

/**
* Print admin notice regarding DOM extension is not installed.
*
* @since 1.0.1
*/
function _amp_print_php_missing_iconv_notice() {
?>
<div class="notice notice-error">
<p><?php esc_html_e( 'The AMP plugin requires iconv extension in PHP. Please contact your host to install this extension.', 'amp' ); ?></p>
</div>
<?php
}
if ( ! function_exists( 'iconv' ) ) {
add_action( 'admin_notices', '_amp_print_php_missing_iconv_notice' );
return;
}

/**
* Print admin notice when composer install has not been performed.
*
Expand Down