$_amp_required_extension
";
} else {
foreach ( $_amp_required_constructs as $_amp_construct_type => $_amp_constructs ) {
switch ( $_amp_construct_type ) {
case 'functions':
foreach ( $_amp_constructs as $_amp_construct ) {
if ( ! function_exists( $_amp_construct ) ) {
$_amp_missing_functions[] = "$_amp_construct
";
}
}
break;
case 'classes':
foreach ( $_amp_constructs as $_amp_construct ) {
if ( ! class_exists( $_amp_construct ) ) {
$_amp_missing_classes[] = "$_amp_construct
";
}
}
break;
}
}
unset( $_amp_construct_type, $_amp_constructs );
}
}
if ( count( $_amp_missing_extensions ) > 0 ) {
$_amp_load_errors->add(
'missing_extension',
sprintf(
/* translators: %s is list of missing extensions */
_n(
'The following PHP extension is missing: %s. Please contact your host to finish installation.',
'The following PHP extensions are missing: %s. Please contact your host to finish installation.',
count( $_amp_missing_extensions ),
'amp'
),
implode( ', ', $_amp_missing_extensions )
)
);
}
if ( count( $_amp_missing_classes ) > 0 ) {
$_amp_load_errors->add(
'missing_class',
sprintf(
/* translators: %s is list of missing extensions */
_n(
'The following PHP class is missing: %s. Please contact your host to finish installation.',
'The following PHP classes are missing: %s. Please contact your host to finish installation.',
count( $_amp_missing_classes ),
'amp'
),
implode( ', ', $_amp_missing_classes )
)
);
}
if ( count( $_amp_missing_functions ) > 0 ) {
$_amp_load_errors->add(
'missing_class',
sprintf(
/* translators: %s is list of missing extensions */
_n(
'The following PHP function is missing: %s. Please contact your host to finish installation.',
'The following PHP functions are missing: %s. Please contact your host to finish installation.',
count( $_amp_missing_functions ),
'amp'
),
implode( ', ', $_amp_missing_functions )
)
);
}
unset( $_amp_required_extensions, $_amp_missing_extensions, $_amp_required_constructs, $_amp_missing_classes, $_amp_missing_functions, $_amp_required_extension, $_amp_construct_type, $_amp_construct, $_amp_constructs );
/**
* Displays an admin notice about why the plugin is unable to load.
*
* @since 1.1.2
* @internal
* @global WP_Error $_amp_load_errors
*/
function _amp_show_load_errors_admin_notice() {
global $_amp_load_errors;
?>
', '
' ), '`', $message );
$message = html_entity_decode( $message, ENT_QUOTES, 'UTF-8' );
if ( ! class_exists( 'WP_CLI' ) ) {
echo "$message\n"; // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
exit( 1 );
}
WP_CLI::warning( $message );
}
return;
}
/**
* Print admin notice if plugin installed with incorrect slug (which impacts WordPress's auto-update system).
*
* @since 1.0
* @internal
*/
function _amp_incorrect_plugin_slug_admin_notice() {
$actual_slug = basename( AMP__DIR__ );
?>
%1$s directory, but it needs to be placed in a directory named %2$s
. Please rename the directory. This is important for WordPress plugin auto-updates.', 'amp' ),
$actual_slug,
'amp'
)
);
?>