: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if ( ! wp_doing_ajax() ) {
if ( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
if ( ! isset( $_POST['action'] ) || 'et_pb_get_backbone_templates' !== $_POST['action'] ) {
if ( ! current_user_can( 'edit_posts' ) ) {
if ( ! function_exists( 'et_pb_attempt_memory_limit_increase' ) ) :
function et_pb_attempt_memory_limit_increase() {
if ( ! isset( $_POST['et_admin_load_nonce'] ) || ! wp_verify_nonce( $_POST['et_admin_load_nonce'], 'et_admin_load_nonce' ) ) {
if ( ! current_user_can( 'manage_options' ) ) {
if ( et_increase_memory_limit() ) {
et_update_option( 'set_memory_limit', '1' );
die( wp_json_encode( array(
die( wp_json_encode( array(
add_action( 'wp_ajax_et_pb_increase_memory_limit', 'et_pb_attempt_memory_limit_increase' );
if ( ! function_exists( 'et_reset_memory_limit_increase' ) ) :
function et_reset_memory_limit_increase() {
if ( ! isset( $_POST['et_builder_reset_memory_limit_nonce'] ) || ! wp_verify_nonce( $_POST['et_builder_reset_memory_limit_nonce'], 'et_builder_reset_memory_limit_nonce' ) ) {
if ( ! current_user_can( 'manage_options' ) ) {
if ( et_get_option( 'set_memory_limit' ) ) {
et_delete_option( 'set_memory_limit' );
add_action( 'wp_ajax_et_reset_memory_limit_increase', 'et_reset_memory_limit_increase' );
if ( ! function_exists( 'et_builder_get_core_modal_template' ) ) :
function et_builder_get_core_modal_template() {
'<div class="et-core-modal-overlay et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
if ( ! function_exists( 'et_builder_get_core_modal_buttons_template' ) ) :
function et_builder_get_core_modal_buttons_template() {
'<div class="et_pb_prompt_buttons">
<span class="spinner"></span>
if ( ! function_exists( 'et_builder_get_cache_notification_modal' ) ) :
function et_builder_get_cache_notification_modal() {
$cache_plugin_message = '';
if ( false !== ( $cache_plugin = et_pb_detect_cache_plugins() ) ) {
$cache_plugin_message = sprintf(
esc_html__( 'You are using the %1$s plugin. We recommend clearing the plugin cache after updating your theme.', 'et_builder' ),
esc_html( $cache_plugin['name'] )
$cache_plugin_message = '<p>' . $cache_plugin_message . '</p>';
$cache_plugin_message .= sprintf(
'<a href="%1$s" class="et_builder_modal_action_button" target="_blank">%2$s</a>',
esc_url( admin_url( $cache_plugin['page'] ) ),
esc_html__( 'Clear Plugin Cache', 'et_builder' )
$browser_cache_message = '<p>' . esc_html__( 'Builder files may also be cached in your browser. Please clear your browser cache.', 'et_builder' ) . '</p>';
$browser_cache_message .= sprintf(
'<a href="http://www.refreshyourcache.com/en/home/" class="et_builder_modal_action_button" target="_blank">%1$s</a>',
esc_html__( 'Clear Browser Cache', 'et_builder' )
'<div class="et_pb_modal_overlay et_modal_on_top et_pb_failure_notification_modal et_pb_new_template_modal">
<div class="et_pb_prompt_modal">
<div class="et_pb_prompt_modal_inside">
<a href="#"" class="et_pb_prompt_dont_proceed et-pb-modal-close"></a>
<div class="et_pb_prompt_buttons">
<span class="spinner"></span>
<a href="#" class="et_pb_reload_builder button-primary et_pb_prompt_proceed">%3$s</a>
esc_html__( 'Builder Cache Warning', 'et_builder' ),
esc_html__( 'The Divi Builder has been updated, however your browser is loading an old cached version of the builder. Loading old files can cause the builder to malfunction.', 'et_builder' ),
esc_html__( 'Reload The Builder', 'et_builder' ),
et_core_esc_previously( $cache_plugin_message ),
et_core_esc_previously( $browser_cache_message ),
esc_html__( 'If you have cleared your plugin cache and browser cache, but still get this warning, then your files may be cached at the DNS or Server level. Contact your host or CDN for assistance.', 'et_builder' )
if ( ! function_exists( 'et_builder_get_failure_notification_modal' ) ) :
function et_builder_get_failure_notification_modal() {
$warnings = et_builder_get_warnings();
if ( false === $warnings ) {
foreach( $warnings as $warning ) {
'<p><strong>%1$s. </strong>%2$s</p>',
et_core_esc_previously( $warning )
'<div class="et-core-modal-overlay et-builder-timeout et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
<p><strong>%4$s</strong></p>
<div class="et_pb_prompt_buttons">
<span class="spinner"></span>
<a href="#" class="et-core-modal-action">%3$s</a>
esc_html__( 'Divi Builder Timeout', 'et_builder' ),
et_core_esc_previously( $messages ),
esc_html__( 'Reload The Builder', 'et_builder' ),
esc_html__( 'Oops, it looks like the Divi Builder failed to load. Performing the following actions may help solve the problem.', 'et_builder' )
if ( ! function_exists( 'et_builder_get_no_builder_notification_modal' ) ) :
function et_builder_get_no_builder_notification_modal() {
'<div class="et-core-modal-overlay et-builder-timeout et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
<p><strong>%2$s</strong></p>
esc_html__( 'Incompatible Post Type', 'et_builder' ),
esc_html__( 'This post does not show the standard WordPress content area. Unfortunately, that means the Divi Builder cannot be used on this post.', 'et_builder' )
if ( ! function_exists( 'et_builder_get_no_browser_notification_modal' ) ) :
function et_builder_get_no_browser_notification_modal() {
'<div class="et-core-modal-overlay et-builder-timeout et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
<p><strong>%2$s</strong></p>
esc_html__( 'Your Browser Is Not Supported', 'et_builder' ),
esc_html__( 'The Divi Builder does not support the browser you are using. Your browser is no longer being developed, so it is time to switch to something new! The Divi Builder works best in the most recent versions of Chrome, Firefox, Safari, Opera and Edge.', 'et_builder' )
if ( ! function_exists( 'et_builder_get_exit_notification_modal' ) ) :
function et_builder_get_exit_notification_modal() {
'<div class="et-core-modal-overlay et-core-modal-two-buttons et-builder-exit-modal et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
<div class="et_pb_prompt_buttons">
<span class="spinner"></span>
<a href="#" class="et-core-modal-action et-core-modal-action-secondary">%3$s</a>
<a href="#" class="et-core-modal-action">%4$s</a>
esc_html__( 'You Have Unsaved Changes', 'et_builder' ),
et_get_safe_localization( __( 'Your page contains changes that have not been saved. If you close the builder without saving, these changes will be lost. If you would like to leave the builder and save all changes, please select <strong>Save & Exit</strong>. If you would like to discard all recent changes, choose <strong>Discard & Exit</strong>.', 'et_builder' ) ),
esc_html__( 'Discard & Exit', 'et_builder' ),
esc_html__( 'Save & Exit', 'et_builder' )
if ( ! function_exists( 'et_builder_get_browser_autosave_notification_modal' ) ) :
function et_builder_get_browser_autosave_notification_modal() {
'<div class="et-core-modal-overlay et-core-modal-two-buttons et-builder-autosave-modal et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
<div class="et_pb_prompt_buttons">
<span class="spinner"></span>
<a href="#" class="et-core-modal-action et-core-modal-action-dont-restore et-core-modal-action-secondary">%3$s</a>
<a href="#" class="et-core-modal-action et-core-modal-action-restore">%4$s</a>
esc_html__( 'A Browser Backup Exists', 'et_builder' ),
et_get_safe_localization( __( 'A browser backup exists for this post that is newer than the version you are currently viewing. This backup was captured during your previous editing session, but you never saved it. Would you like to restore this backup and continue editing where you left off?', 'et_builder' ) ),
esc_html__( "Don't Restore", 'et_builder' ), // left button
esc_html__( 'Restore', 'et_builder' ) // right button
if ( ! function_exists( 'et_builder_get_server_autosave_notification_modal' ) ) :
function et_builder_get_server_autosave_notification_modal() {
'<div class="et-core-modal-overlay et-core-modal-two-buttons et-builder-autosave-modal et-core-active">
<div class="et-core-modal">
<div class="et-core-modal-header">
<h3 class="et-core-modal-title">%1$s</h3>
<a href="#" class="et-core-modal-close" data-et-core-modal="close"></a>
<div class="et-core-modal-content">
<div class="et_pb_prompt_buttons">
<span class="spinner"></span>
<a href="#" class="et-core-modal-action et-core-modal-action-dont-restore et-core-modal-action-secondary">%3$s</a>
<a href="#" class="et-core-modal-action et-core-modal-action-restore">%4$s</a>
esc_html__( 'An Autosave Exists', 'et_builder' ),
et_get_safe_localization( __( 'A recent autosave exists for this post that is newer than the version you are currently viewing. This autosave was captured during your previous editing session, but you never saved it. Would you like to restore this autosave and continue editing where you left off?', 'et_builder' ) ),
esc_html__( "Don't Restore", 'et_builder' ), // left button
esc_html__( 'Restore', 'et_builder' ) // right button
if ( ! function_exists( 'et_builder_get_unsaved_notification_texts' ) ) :
function et_builder_get_unsaved_notification_texts() {
'<p>%1$s</p><p>%2$s</p><p>%3$s</p>',
et_get_safe_localization( __( 'An error has occurred while saving your page. Various problems can cause a save to fail, such as a lack of server resources, firewall blockages, plugin conflicts or server misconfiguration. You can try saving again by clicking Try Again, or you can download a backup of your unsaved page by clicking Download Backup. Backups can be restored using the portability system while next editing your page.', 'et_builder' ) ),
et_get_safe_localization( __( 'Contacting your host and asking them to increase the following PHP variables may help: memory_limit, max_execution_time, upload_max_filesize, post_max_size, max_input_time, max_input_vars. In addition, auditing your firewall error log (such as ModSecurity) may reveal false positives that are preventing saves from completing.', 'et_builder' ) ),
et_get_safe_localization( __( 'Lastly, it is recommended that you temporarily disable all WordPress plugins and browser extensions and try to save again to determine if something is causing a conflict.', 'et_builder' ) )
'header' => esc_html__( 'Your Save Has Failed', 'et_builder' ),
'secondary' => sprintf( '<a href="#" class="et-core-modal-action et-core-modal-action-secondary">%1$s</a>', esc_html__( 'Try Again', 'et_builder' ) ),
'primary' => sprintf( '<a href="#" class="et-core-modal-action et-core-modal-action-primary">%1$s</a>', esc_html__( 'Download Backup', 'et_builder' ) ),
'classes' => 'et-builder-unsaved-modal',
if ( ! function_exists( 'et_builder_get_global_presets_save_failure_texts' ) ) :
function et_builder_get_global_presets_save_failure_texts() {
<a class="et-builder-global-presets-save-failure-download" style="display: none"></a>',
et_get_safe_localization( __( 'An error has occurred while saving the Global Presets settings. Various problems can cause a save to fail, such as a lack of server resources, firewall blockages or plugin conflicts or server misconfiguration. You can try saving again by clicking Try Again, or you can download a backup of your unsaved defaults by clicking Download Backup. A backup can be helpful when contacting our Support Team.', 'et_builder' ) )
'header' => esc_html__( 'Save of Global Presets Has Failed', 'et_builder' ),
'secondary' => sprintf('<a href="#" class="et-core-modal-action et-core-modal-action-secondary">%1$s</a>', esc_html__( 'Try Again', 'et_builder' ) ),
'primary' => sprintf('<a href="#" class="et-core-modal-action et-core-modal-action-primary">%1$s</a>', esc_html__( 'Download Backup', 'et_builder' ) ),
'classes' => 'et-builder-global-presets-save-failure-modal',
if ( ! function_exists( 'et_builder_get_global_presets_save_forbidden_texts' ) ) :
function et_builder_get_global_presets_save_forbidden_texts() {
et_get_safe_localization( __( 'You do not have sufficient permissions to edit Divi Presets.', 'et_builder' ) )
'header' => esc_html__( 'Save of Global Presets Has Failed', 'et_builder' ),
'primary' => sprintf('<a href="#" class="et-core-modal-action et-core-modal-action-primary">%1$s</a>', esc_html__( 'Ok', 'et_builder' ) ),
'classes' => 'et-builder-global-presets-save-forbidden-modal',
if ( ! function_exists( 'et_builder_get_global_presets_load_failure_texts' ) ) :
function et_builder_get_global_presets_load_failure_texts() {
et_get_safe_localization( __( 'An error has occurred while loading the Global History States. Various problems can cause a save to fail, such as a lack of server resources, firewall blockages or plugin conflicts or server misconfiguration. You can try loading again by clicking Try Again.', 'et_builder' ) )
'header' => esc_html__( 'Load of Global Presets Has Failed', 'et_builder' ),
'primary' => sprintf( '<a href="#" class="et-core-modal-action et-core-modal-action-primary">%1$s</a>', esc_html__( 'Try Again', 'et_builder' ) )
'classes' => 'et-builder-global-presets-load-failure-modal',
if ( ! function_exists( 'et_builder_page_creation_modal' ) ) :
function et_builder_page_creation_modal() {
return '<div class="et-pb-page-creation-card <%= option.className %>" data-action="<%= id %>">
<div class="et-pb-page-creation-content">
<img src="<%= option.images_uri %>/<%= option.imgSrc %>" data-src="<%= option.images_uri %>/<%= option.imgSrc %>" data-hover="<%= option.images_uri %>/<%= option.imgHover %>" alt="<%= option.titleText %>" />
<div class="et-pb-page-creation-text">
<h3><%= option.titleText %></h3>
<p><%= option.descriptionText %></p>
<a href="#" class="et-pb-page-creation-link"><%= option.buttonText %></a>
if ( ! function_exists( 'et_builder_get_disabled_link_modal' ) ) :
function et_builder_disabled_link_modal() {
'<div class="et_pb_modal_overlay link-disabled">
<div class="et_pb_prompt_modal">
<div class="et_pb_prompt_buttons">
<a href="#" class="et_pb_prompt_proceed">%3$s</a>
</div><!-- .et_pb_prompt_modal -->
</div><!-- .et_pb_modal_overlay -->',
esc_html__( 'Link Disabled', 'et_builder' ),
esc_html__( 'During preview, link to different page is disabled', 'et_builder' ),
esc_html__( 'Close', 'et_builder' )
if ( ! function_exists( 'et_builder_get_warnings' ) ) :
function et_builder_get_warnings() {
if ( ! current_user_can( 'manage_options' ) ) {
if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
'%1$s. <a href="https://codex.wordpress.org/Debugging_in_WordPress" class="et_builder_modal_action_button" target="_blank">%2$s</a>',
esc_html__( 'You have WP_DEBUG enabled. Please disable this setting in wp-config.php', 'et_builder' ),
esc_html__( 'Disable Debug Mode', 'et_builder' )
$third_party_plugins_active = false;
$excluded_plugins = array(
'wordpress-importer/wordpress-importer.php',
'divi-builder/divi-builder.php',
'elegant-themes-updater/elegant-themes-updater.php',
'et-security-patcher/et-security-patcher.php',
$active_plugins = get_option( 'active_plugins' );
if ( is_array( $active_plugins ) && ! empty( $active_plugins ) ) {
foreach ( $active_plugins as $plugin ) {
if ( in_array( $plugin, $excluded_plugins ) ) {
$third_party_plugins_active = true;