Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/popup-bu.../public/views
File: customEditor.php
<?php
[0] Fix | Delete
/* Exit if accessed directly */
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit;
[3] Fix | Delete
}
[4] Fix | Delete
use sgpb\AdminHelper;
[5] Fix | Delete
$popupId = !empty($_GET['post']) ? (int)sanitize_text_field($_GET['post']) : 0;
[6] Fix | Delete
$editorModeJs = htmlentities('text/javascript');
[7] Fix | Delete
$editorModeCss = htmlentities('text/css');
[8] Fix | Delete
[9] Fix | Delete
$defaultData = SGPBConfigDataHelper::defaultData();
[10] Fix | Delete
$jsDefaultData = $defaultData['customEditorContent']['js'];
[11] Fix | Delete
$cssDefaultData = $defaultData['customEditorContent']['css'];
[12] Fix | Delete
[13] Fix | Delete
$savedData = get_post_meta($popupId , 'sg_popup_scripts', true);
[14] Fix | Delete
?>
[15] Fix | Delete
[16] Fix | Delete
<div class="sgpb-wrapper sgpb-customJsOrCss">
[17] Fix | Delete
<p class="sgpb-customJsOrCss_text"><?php esc_html_e('This section is for adding custom codes (CSS or JS) for the popup, it requires some coding knowledge', 'popup-builder');?>.</p>
[18] Fix | Delete
<p class="sgpb-customJsOrCss_text"><?php esc_html_e('You may use your custom codes for extra actions connected to the popup opening (before, after, etc.) in the fields below', 'popup-builder');?>.</p>
[19] Fix | Delete
<!-- editor buttons -->
[20] Fix | Delete
<div class="sgpb-tabs sgpb-margin-y-30">
[21] Fix | Delete
<span class="sgpb-tab-link sgpb-tab-active sgpb-tab-1" onclick="SGPBBackend.prototype.changeTab(1)">JS</span>
[22] Fix | Delete
<span class="sgpb-tab-link sgpb-tab-2" onclick="SGPBBackend.prototype.changeTab(2)">CSS</span>
[23] Fix | Delete
</div>
[24] Fix | Delete
[25] Fix | Delete
<div class="sgpb-editor sgpb-tabs-content">
[26] Fix | Delete
<!-- JS editor content -->
[27] Fix | Delete
<div id="sgpb-editor-options-tab-content-wrapper-1" class="sgpb-editor-options-tab-content-wrapper sgpb-padding-right-40 sgpb-margin-y-20" style="display: block;">
[28] Fix | Delete
<?php
[29] Fix | Delete
foreach ($jsDefaultData['description'] as $text) { ?>
[30] Fix | Delete
<p><?php echo wp_kses($text, 'post'); ?></p>
[31] Fix | Delete
<?php }
[32] Fix | Delete
?>
[33] Fix | Delete
[34] Fix | Delete
<?php foreach ($jsDefaultData['helperText'] as $key => $value) {?>
[35] Fix | Delete
<div class="formItem">
[36] Fix | Delete
<span class="formItem__title"><?php echo wp_kses($value, 'post'); ?></span>
[37] Fix | Delete
<?php
[38] Fix | Delete
if (!empty($savedData['js']['sgpb-'.$key])) {
[39] Fix | Delete
if( AdminHelper::sgpbScanCustomJsStr( $savedData['js']['sgpb-'.$key] ) == true )
[40] Fix | Delete
{
[41] Fix | Delete
?>
[42] Fix | Delete
<span class="notice notice-warning">We have detected this snippet that is insecure and may compromise the security of your site. Please remove it and save your Popup data again.</span>
[43] Fix | Delete
<?php
[44] Fix | Delete
}
[45] Fix | Delete
}
[46] Fix | Delete
?>
[47] Fix | Delete
<textarea class="wp-editor-area formItem__textarea sgpb-margin-top-20"
[48] Fix | Delete
data-attr-event="<?php echo esc_attr($key);?>"
[49] Fix | Delete
placeholder=" #... type your code"
[50] Fix | Delete
mode="<?php echo esc_attr($editorModeJs); ?>"
[51] Fix | Delete
name="sgpb-<?php echo esc_attr($key); ?>"><?php
[52] Fix | Delete
if (!empty($savedData['js']['sgpb-'.$key])) {
[53] Fix | Delete
echo esc_html($savedData['js']['sgpb-'.$key]);
[54] Fix | Delete
}
[55] Fix | Delete
?>
[56] Fix | Delete
</textarea>
[57] Fix | Delete
<?php
[58] Fix | Delete
//Ted-fix : we stopped the render custom js code into front-end page to fix HACKER attack
[59] Fix | Delete
[60] Fix | Delete
/*
[61] Fix | Delete
if( AdminHelper::getOption('sgpb-disable-custom-js') )
[62] Fix | Delete
{
[63] Fix | Delete
?>
[64] Fix | Delete
<span class="notice notice-warning">We disabled this option for this version to remove hacker's attack code.</span>
[65] Fix | Delete
<textarea class="wp-editor-area formItem__textarea sgpb-margin-top-20"
[66] Fix | Delete
data-attr-event="<?php echo esc_attr($key);?>"
[67] Fix | Delete
placeholder=" #... type your code"
[68] Fix | Delete
mode="<?php echo esc_attr($editorModeJs); ?>"
[69] Fix | Delete
name="sgpb-<?php echo esc_attr($key); ?>" readonly><?php
[70] Fix | Delete
if (!empty($savedData['js']['sgpb-'.$key])) {
[71] Fix | Delete
echo esc_html($savedData['js']['sgpb-'.$key]);
[72] Fix | Delete
}
[73] Fix | Delete
?>
[74] Fix | Delete
</textarea>
[75] Fix | Delete
<?php
[76] Fix | Delete
}
[77] Fix | Delete
else
[78] Fix | Delete
{
[79] Fix | Delete
?>
[80] Fix | Delete
<textarea class="wp-editor-area formItem__textarea sgpb-margin-top-20"
[81] Fix | Delete
data-attr-event="<?php echo esc_attr($key);?>"
[82] Fix | Delete
placeholder=" #... type your code"
[83] Fix | Delete
mode="<?php echo esc_attr($editorModeJs); ?>"
[84] Fix | Delete
name="sgpb-<?php echo esc_attr($key); ?>"><?php
[85] Fix | Delete
if (!empty($savedData['js']['sgpb-'.$key])) {
[86] Fix | Delete
echo esc_html($savedData['js']['sgpb-'.$key]);
[87] Fix | Delete
}
[88] Fix | Delete
?>
[89] Fix | Delete
</textarea>
[90] Fix | Delete
<?php
[91] Fix | Delete
} */
[92] Fix | Delete
?>
[93] Fix | Delete
</div>
[94] Fix | Delete
<?php } ?>
[95] Fix | Delete
</div>
[96] Fix | Delete
[97] Fix | Delete
<!-- CSS editor content -->
[98] Fix | Delete
<div id="sgpb-editor-options-tab-content-wrapper-2" class="sgpb-editor-options-tab-content-wrapper sgpb-padding-right-40 sgpb-margin-y-20" style="display: none;">
[99] Fix | Delete
<?php
[100] Fix | Delete
foreach ($cssDefaultData['description'] as $text) { ?>
[101] Fix | Delete
<div><?php echo wp_kses($text, 'post'); ?></div>
[102] Fix | Delete
<?php } ?>
[103] Fix | Delete
[104] Fix | Delete
<?php foreach ($cssDefaultData['helperText'] as $key => $value) {?>
[105] Fix | Delete
<div class="formItem"><span class="formItem__title"><?php echo wp_kses($value, 'post'); ?></span></div>
[106] Fix | Delete
<?php } ?>
[107] Fix | Delete
[108] Fix | Delete
<textarea class="wp-editor-area editor-content sgpb-editor-content-css formItem__textarea sgpb-margin-top-20"
[109] Fix | Delete
placeholder=" #... type your code"
[110] Fix | Delete
mode="<?php echo esc_attr($editorModeCss); ?>"
[111] Fix | Delete
name="sgpb-css-editor"><?php
[112] Fix | Delete
if (isset($savedData['css'])) {
[113] Fix | Delete
echo esc_html($savedData['css']);
[114] Fix | Delete
}?></textarea>
[115] Fix | Delete
</div>
[116] Fix | Delete
</div>
[117] Fix | Delete
</div>
[118] Fix | Delete
[119] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function