diff --git a/includes/Framework/Plugin/Dependencies.php b/includes/Framework/Plugin/Dependencies.php index 2af86fe0d..b7c9394ae 100644 --- a/includes/Framework/Plugin/Dependencies.php +++ b/includes/Framework/Plugin/Dependencies.php @@ -1,5 +1,4 @@ array(), - 'php_functions' => array(), - 'php_settings' => array(), - ) ); + $dependencies = wp_parse_args( + $args, + array( + 'php_extensions' => array(), + 'php_functions' => array(), + 'php_settings' => array(), + ) + ); $default_settings = array( 'suhosin.post.max_array_index_length' => 256, 'suhosin.post.max_totalname_length' => 65535, @@ -166,21 +168,21 @@ public function add_php_settings_notices() { if ( count( $bad_settings ) > 0 ) { $message = sprintf( /* translators: Placeholders: %s - plugin name */ - __( '%s may behave unexpectedly because the following PHP configuration settings are required:' ), + __( '%s may behave unexpectedly because the following PHP configuration settings are required:', 'facebook-for-woocommerce' ), '' . esc_html( $this->get_plugin()->get_plugin_name() ) . '' ); $message .= '
' . $setting . ' = ' . $values['expected'] . '';
- if ( ! empty( $values['type'] ) && 'min' === $values['type'] ) {
- $setting_message = sprintf(
- /* translators: Placeholders: %s - a PHP setting value */
- __( '%s or higher', 'facebook-for-woocommerce' ),
- $setting_message
- );
- }
- $message .= '' . $setting . ' = ' . $values['expected'] . '';
+ if ( ! empty( $values['type'] ) && 'min' === $values['type'] ) {
+ $setting_message = sprintf(
+ /* translators: Placeholders: %s - a PHP setting value */
+ __( '%s or higher', 'facebook-for-woocommerce' ),
+ $setting_message
+ );
}
+ $message .= ''; $message .= sprintf( /* translators: Placeholders: %1$s - , %2$s - */ - __( 'Hey there! We\'ve noticed that your server is running %1$san outdated version of PHP%2$s, which is the programming language that WooCommerce and its extensions are built on. + __( + 'Hey there! We\'ve noticed that your server is running %1$san outdated version of PHP%2$s, which is the programming language that WooCommerce and its extensions are built on. The PHP version that is currently used for your site is no longer maintained, nor %1$sreceives security updates%2$s; newer versions are faster and more secure. As a result, %3$s no longer supports this version and you should upgrade PHP as soon as possible. - Your hosting provider can do this for you. %4$sHere are some resources to help you upgrade%5$s and to explain PHP versions further.', 'facebook-for-woocommerce' ), - '', '', + Your hosting provider can do this for you. %4$sHere are some resources to help you upgrade%5$s and to explain PHP versions further.', + 'facebook-for-woocommerce' + ), + '', + '', esc_html( $this->get_plugin()->get_plugin_name() ), - '', '' + '', + '' ); $message .= '
'; $this->add_admin_notice( 'sv-wc-deprecated-php-version', $message, 'error' ); @@ -225,9 +232,13 @@ protected function add_deprecated_notices() { */ protected function add_admin_notice( $id, $message, $type = 'info' ) { $notice_class = 'notice-' . $type; - $this->get_plugin()->get_admin_notice_handler()->add_admin_notice( $message, $id, array( - 'notice_class' => $notice_class, - ) ); + $this->get_plugin()->get_admin_notice_handler()->add_admin_notice( + $message, + $id, + array( + 'notice_class' => $notice_class, + ) + ); } @@ -248,15 +259,18 @@ public function get_active_scripts_optimization_plugins() { * * @param array $plugins an array of file identifiers (keys) and plugin names (values) */ - $plugins = (array) apply_filters( 'wc_' . $this->get_plugin()->get_id() . '_scripts_optimization_plugins', [ - 'async-javascript.php' => 'Async JavaScript', - 'autoptimize.php' => 'Autoptimize', - 'wp-hummingbird.php' => 'Hummingbird', - 'sg-optimizer.php' => 'SG Optimizer', - 'w3-total-cache.php' => 'W3 Total Cache', - 'wpFastestCache.php' => 'WP Fastest Cache', - 'wp-rocket.php' => 'WP Rocket', - ] ); + $plugins = (array) apply_filters( + 'wc_' . $this->get_plugin()->get_id() . '_scripts_optimization_plugins', + [ + 'async-javascript.php' => 'Async JavaScript', + 'autoptimize.php' => 'Autoptimize', + 'wp-hummingbird.php' => 'Hummingbird', + 'sg-optimizer.php' => 'SG Optimizer', + 'w3-total-cache.php' => 'W3 Total Cache', + 'wpFastestCache.php' => 'WP Fastest Cache', + 'wp-rocket.php' => 'WP Rocket', + ] + ); $active_plugins = []; foreach ( $plugins as $filename => $plugin_name ) { if ( $this->get_plugin()->is_plugin_active( $filename ) ) {