: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @author OnTheGo Systems
class WPML_Integrations {
const SCOPE_WP_CORE = 'wp-core';
private $components = array(
self::SCOPE_WP_CORE => array(
'name' => 'WordPress Block Editor',
'function' => 'parse_blocks',
'notices-display' => array(),
'page-builders' => array(
'name' => 'Visual Composer',
'constant' => 'WPB_VC_VERSION',
'notices-display' => array(
'wpml-translation-editor',
'constant' => 'ET_BUILDER_DIR',
'notices-display' => array(
'wpml-translation-editor',
'name' => 'Toolset Layouts',
'constant' => 'WPDDL_VERSION',
'notices-display' => array(
'wpml-translation-editor',
'constant' => 'X_VERSION',
'notices-display' => array(
'wpml-translation-editor',
'notices-display' => array(
'wpml-translation-editor',
'notices-display' => array(
'wpml-translation-editor',
'constant' => 'CT_VERSION',
'notices-display' => array(
'wpml-translation-editor',
'class' => 'WooCommerce',
'notices-display' => array(),
'name' => 'Gravity Forms',
'notices-display' => array(),
'notices-display' => array(
'wpml-translation-editor',
'name' => 'Beaver Builder Plugin',
'class' => 'FLBuilderLoader',
'notices-display' => array(
'wpml-translation-editor',
'elementor-plugin' => array(
'class' => '\Elementor\Plugin',
'notices-display' => array(
'wpml-translation-editor',
'wordpress-seo' => array(
'constant' => 'WPSEO_VERSION',
'notices-display' => array(),
private $items = array();
* WPML_Integrations constructor.
* @param WPML_WP_API $wpml_wp_api
function __construct( WPML_WP_API $wpml_wp_api ) {
$this->wpml_wp_api = $wpml_wp_api;
private function fetch_items() {
foreach ( $this->get_components() as $type => $components ) {
foreach ( (array) $components as $slug => $data ) {
if ( $this->component_has_constant( $data ) || $this->component_has_function( $data ) || $this->component_has_class( $data ) ) {
$this->items[ $slug ] = array( 'name' => $this->get_component_name( $data ) );
$this->items[ $slug ]['type'] = $type;
$this->items[ $slug ]['notices-display'] = isset( $data['notices-display'] ) ? $data['notices-display'] : array();
public function get_results() {
private function component_has_constant( array $data ) {
return array_key_exists( 'constant', $data ) && $data['constant'] && $this->wpml_wp_api->defined( $data['constant'] );
private function component_has_function( array $data ) {
return array_key_exists( 'function', $data ) && $data['function'] && function_exists( $data['function'] );
private function component_has_class( array $data ) {
return array_key_exists( 'class', $data ) && $data['class'] && class_exists( $data['class'] );
private function get_component_name( array $data ) {
private function get_components() {
return apply_filters( 'wpml_integrations_components', $this->components );