PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
<?php class WPML_TM_Requirements { const INVALID_PHP_EXTENSIONS_OPTION = 'wpml-invalid-php-extensions'; private $missing; private $missing_one; public function __construct() { $this->missing = array(); $this->missing_one = false; add_action( 'admin_notices', array( $this, 'missing_plugins_warning' ) ); add_action( 'plugins_loaded', array( $this, 'plugins_loaded_action' ), 999999 ); add_action( 'wpml_loaded', array( $this, 'missing_php_extensions' ) ); } private function check_required_plugins() { $this->missing = array(); $this->missing_one = false; if ( ! defined( 'ICL_SITEPRESS_VERSION' ) || ICL_PLUGIN_INACTIVE || version_compare( ICL_SITEPRESS_VERSION, '2.0.5', '<' ) ) { $this->missing['WPML'] = array( 'url' => 'http://wpml.org', 'slug' => 'sitepress-multilingual-cms', ); $this->missing_one = true; } } public function plugins_loaded_action() { $this->check_required_plugins(); if ( ! $this->missing_one ) { do_action( 'wpml_tm_has_requirements' ); } } public function missing_php_extensions() { $extensions = $this->get_current_php_extensions(); if ( ! defined( 'ICL_HIDE_TRANSLATION_SERVICES' ) || ! ICL_HIDE_TRANSLATION_SERVICES ) { $wpml_wp_api_check = new WPML_WP_API(); if ( count( $extensions ) > 0 && $wpml_wp_api_check->is_tm_page() ) { $already_saved_invalid_extensions = get_option( self::INVALID_PHP_EXTENSIONS_OPTION ); if ( ! $already_saved_invalid_extensions || $already_saved_invalid_extensions !== $extensions ) { ICL_AdminNotifier::add_message( $this->build_invalid_php_extensions_message_args( $extensions ) ); update_option( self::INVALID_PHP_EXTENSIONS_OPTION, $extensions ); } } else { ICL_AdminNotifier::remove_message_group( 'wpml-tm-requirements' ); } } } private function build_invalid_php_extensions_message_args( array $extensions ) { $message = ''; $message .= '<p>'; $message .= __( 'WPML Translation Management requires the following PHP extensions and settings:', 'wpml-translation-management' ); $message .= '</p>'; $message .= '<ul>'; foreach ( $extensions as $id => $data ) { $message .= '<li>'; if ( 'setting' === $data['type'] ) { $message .= $data['type_description'] . ': <code>' . $id . '=' . $data['value'] . '</code>'; } if ( 'extension' === $data['type'] ) { $message .= $data['type_description'] . ': <strong>' . $id . '</strong>'; } $message .= '</li>'; } $message .= '</ul>'; return array( 'id' => 'wpml-tm-missing-extensions', 'group' => 'wpml-tm-requirements', 'msg' => $message, 'type' => 'error', 'admin_notice' => true, 'hide' => true, ); } private function get_current_php_extensions() { $extensions = array(); if ( ini_get( 'allow_url_fopen' ) !== '1' ) { $extensions['allow_url_fopen'] = array( 'type' => 'setting', 'type_description' => __( 'PHP Setting', 'wpml-translation-management' ), 'value' => '1', ); } if ( ! extension_loaded( 'openssl' ) ) { $extensions['openssl'] = array( 'type' => 'extension', 'type_description' => __( 'PHP Extension', 'wpml-translation-management' ), ); } return $extensions; } /** * Missing plugins warning. */ public function missing_plugins_warning() { if ( $this->missing ) { $missing = ''; $missing_slugs = array(); $counter = 0; foreach ( $this->missing as $title => $data ) { $url = $data['url']; $missing_slugs[] = 'wpml-missing-' . sanitize_title_with_dashes( $data['slug'] ); $counter ++; $sep = ', '; if ( count( $this->missing ) === $counter ) { $sep = ''; } elseif ( count( $this->missing ) - 1 === $counter ) { $sep = ' ' . __( 'and', 'wpml-translation-management' ) . ' '; } $missing .= '<a href="' . $url . '">' . $title . '</a>' . $sep; } $missing_slugs_classes = implode( ' ', $missing_slugs ); ?> <div class="message error wpml-admin-notice wpml-tm-inactive <?php echo $missing_slugs_classes; ?>"><p><?php printf( __( 'WPML Translation Management is enabled but not effective. It requires %s in order to work.', 'wpml-translation-management' ), $missing ); ?></p></div> <?php } } }
[+]
wpml-wp
[+]
ajax
[-] class-wpml-tm-translators-dropdown.php
[edit]
[+]
translation-priorities
[-] class-wpml-tm-promotions.php
[edit]
[+]
hooks
[+]
ICL-20-migration
[+]
templates
[+]
action-filter-loader
[-] class-wpml-translation-proxy-api.php
[edit]
[+]
wpml-st
[+]
utilities
[-] class-wpml-tm-translated-field.php
[edit]
[+]
requirements
[+]
sticky-posts
[-] class-wpml-tm-page.php
[edit]
[+]
icl
[+]
display-as-translated
[+]
custom-field-translation
[+]
language
[+]
ATE
[+]
shortcodes
[+]
translate_link_targets
[+]
core-abstract-classes
[+]
full-site-editing
[+]
settings
[-] class-wpml-file.php
[edit]
[+]
xliff
[+]
reset
[+]
REST-hooks
[+]
comments
[+]
plugins
[+]
templating
[+]
container
[+]
taxonomy
[+]
cookie
[-] class-wpml-tm-requirements.php
[edit]
[+]
translation-dashboard
[+]
helpers
[+]
translation-feedback
[+]
admin-language-switcher
[-] class-wpml-tm-troubleshooting-clear-ts.php
[edit]
[+]
jobs
[+]
compatibility
[+]
wp-core-hooks
[+]
post-edit-screen
[-] class-wpml-tm-troubleshooting-clear-ts-ui.php
[edit]
[+]
translation-jobs
[+]
logging
[+]
roles
[+]
media
[-] class-wpml-active-plugin-provider.php
[edit]
[+]
media-translation
[-] class-wpml-config-update.php
[edit]
[+]
seo
[+]
options
[+]
Installer
[-] class-wpml-tm-ajax-factory-2.php
[edit]
[+]
automatic-translation
[+]
troubleshoot
[+]
records
[-] class-wpml-translate-independently.php
[edit]
[+]
abstract
[-] class-wpml-tm-resources-factory.php
[edit]
[+]
post-types
[+]
wp-cli
[+]
translation-proxy
[-] class-wpml-tm-loader.php
[edit]
[-] class-wpml-config-update-integrator.php
[edit]
[-] class-wpml-theme-localization-type.php
[edit]
[+]
taxonomy-term-translation
[+]
setup
[+]
language-switcher
[+]
translation-mode
[+]
jobs-deadline
[+]
database-queries
[+]
utils
[+]
translation-basket
[-] ISitePress.php
[edit]
[-] class-wpml-current-screen.php
[edit]
[-] class-wpml-tm-ajax-factory.php
[edit]
[+]
admin-bar
[+]
canonicals
[+]
custom-xml-config
[-] class-wpml-db-chunk.php
[edit]
[+]
url-handling
[+]
admin-resources
[+]
theme-plugin-localization
[+]
ui-elements
[+]
languages
[+]
wizard
[-] LanguageNegotiation.php
[edit]
[-] class-wpml-browser-redirect.php
[edit]
[+]
menu
[-] class-wpml-mo-file-search.php
[edit]
[+]
query-filtering
[+]
translation-management
[+]
filters
[-] class-wpml-xmlrpc.php
[edit]
[-] class-wpml-site-id.php
[edit]
[+]
block-editor
[+]
icl-to-ate-migration
[+]
translations
[+]
user-language
[+]
..
[+]
menu-elements
[+]
translation-batch
[-] class-wpml-tm-api.php
[edit]
[-] class-wpml-translation-management.php
[edit]
[-] class-wpml-translation-job-factory.php
[edit]
[+]
xml-config
[+]
REST
[+]
editor
[+]
admin-menu
[+]
localization
[+]
tp-client
[+]
translation-roles
[-] Geolocalization.php
[edit]
[+]
wp
[+]
API
[+]
twig-extensions
[+]
troubleshooting
[+]
privacy
[+]
user
[-] class-wpml-tm-service-activation-ajax.php
[edit]
[+]
widgets
[+]
super-globals
[+]
emails
[+]
words-count
[+]
support
[+]
post-translation
[+]
browser-language-redirect
[+]
request-handling
[+]
notices
[+]
upgrade