wpml_wp_api = &$wpml_wp_api; $this->init_hooks(); } public function display_compatibility_issues() { $message = $this->get_message(); $this->render_message( $message ); } /** * @return string */ private function get_message() { $message = ''; if ( ! $this->wpml_wp_api->extension_loaded( 'libxml' ) ) { $message .= $this->missing_extension_message(); if ( $this->wpml_wp_api->version_compare_naked( $this->wpml_wp_api->phpversion(), '7.0.0', '>=' ) ) { $message .= $this->missing_extension_message_for_php7(); } $message .= $this->contact_the_admin(); return $message; } return $message; } private function init_hooks() { add_action( 'wpml_support_page_after', array( $this, 'display_compatibility_issues' ) ); } /** * @return string */ private function missing_extension_message() { return '
'; } /** * @return string */ private function missing_extension_message_for_php7() { return ' '; } /** * @return string */ private function contact_the_admin() { return '' . esc_html__( 'You may need to contact your server administrator or your hosting company to install this extension.', 'sitepress' ) . '
'; } /** * @param $message */ private function render_message( $message ) { if ( $message ) { $libxml_text = 'libxml'; $libxml_link = 'http://php.net/manual/en/book.libxml.php'; $libxml_php7_link = 'PHP 7: possible issues with simplexml'; echo ' '; } } }