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/wp-conte.../plugins/poptin
File: class-affiliate.php
<?php
[0] Fix | Delete
if (!defined('ABSPATH')) {
[1] Fix | Delete
exit;
[2] Fix | Delete
}
[3] Fix | Delete
class Poptin_affiliate_program {
[4] Fix | Delete
[5] Fix | Delete
public $plugin_name = "Poptin";
[6] Fix | Delete
[7] Fix | Delete
public $plugin_slug = "poptin";
[8] Fix | Delete
[9] Fix | Delete
public function __construct() {
[10] Fix | Delete
add_action("wp_ajax_".$this->plugin_slug."_affiliate_program", array($this, "affiliate_program"));
[11] Fix | Delete
[12] Fix | Delete
add_action('admin_notices', array($this, 'admin_notices'));
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
public function affiliate_program() {
[16] Fix | Delete
if(current_user_can('manage_options')) {
[17] Fix | Delete
$nonce = filter_input(INPUT_POST, 'nonce');
[18] Fix | Delete
$days = filter_input(INPUT_POST, 'days');
[19] Fix | Delete
if (!empty($nonce) && wp_verify_nonce($nonce, $this->plugin_slug . "_affiliate_program")) {
[20] Fix | Delete
if ($days == -1) {
[21] Fix | Delete
add_option($this->plugin_slug . "_hide_affiliate_box", "1");
[22] Fix | Delete
} else {
[23] Fix | Delete
$date = date("Y-m-d", strtotime("+" . $days . " days"));
[24] Fix | Delete
update_option($this->plugin_slug . "_show_affiliate_box_after", $date);
[25] Fix | Delete
}
[26] Fix | Delete
}
[27] Fix | Delete
die;
[28] Fix | Delete
}
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
public function admin_notices() {
[32] Fix | Delete
if(current_user_can('manage_options')) {
[33] Fix | Delete
$is_hidden = get_option($this->plugin_slug."_hide_affiliate_box");
[34] Fix | Delete
if($is_hidden !== false) {
[35] Fix | Delete
return;
[36] Fix | Delete
}
[37] Fix | Delete
$date_to_show = get_option($this->plugin_slug."_show_affiliate_box_after");
[38] Fix | Delete
if($date_to_show === false || empty($date_to_show)) {
[39] Fix | Delete
$date = date("Y-m-d", strtotime("+5 days"));
[40] Fix | Delete
update_option($this->plugin_slug."_show_affiliate_box_after", $date);
[41] Fix | Delete
return;
[42] Fix | Delete
}
[43] Fix | Delete
$current_date = date("Y-m-d");
[44] Fix | Delete
if($current_date < $date_to_show) {
[45] Fix | Delete
return;
[46] Fix | Delete
}
[47] Fix | Delete
?>
[48] Fix | Delete
<style>
[49] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate p a {
[50] Fix | Delete
display: inline-block;
[51] Fix | Delete
float: right;
[52] Fix | Delete
text-decoration: none;
[53] Fix | Delete
color: #999999;
[54] Fix | Delete
position: absolute;
[55] Fix | Delete
right: 12px;
[56] Fix | Delete
top: 12px;
[57] Fix | Delete
}
[58] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate p a:hover, .<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate p a:focus {
[59] Fix | Delete
color: #333333;
[60] Fix | Delete
}
[61] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate .button span {
[62] Fix | Delete
display: inline-block;
[63] Fix | Delete
line-height: 27px;
[64] Fix | Delete
font-size: 16px;
[65] Fix | Delete
}
[66] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate {
[67] Fix | Delete
padding: 1px 100px 12px 12px;
[68] Fix | Delete
margin: 15px 15px 2px;
[69] Fix | Delete
position: relative;
[70] Fix | Delete
}
[71] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup {
[72] Fix | Delete
position: fixed;
[73] Fix | Delete
width: 100%;
[74] Fix | Delete
height: 100%;
[75] Fix | Delete
z-index: 10001;
[76] Fix | Delete
background: rgba(0,0,0,0.65);
[77] Fix | Delete
top: 0;
[78] Fix | Delete
left: 0;
[79] Fix | Delete
display: none;
[80] Fix | Delete
}
[81] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup-content {
[82] Fix | Delete
background: #ffffff;
[83] Fix | Delete
padding: 20px;
[84] Fix | Delete
position: absolute;
[85] Fix | Delete
max-width: 450px;
[86] Fix | Delete
width: 100%;
[87] Fix | Delete
margin: 0 auto;
[88] Fix | Delete
top: 45%;
[89] Fix | Delete
left: 0;
[90] Fix | Delete
right: 0;
[91] Fix | Delete
-webkit-border-radius: 5px;
[92] Fix | Delete
-moz-border-radius: 5px;
[93] Fix | Delete
border-radius: 5px;: ;
[94] Fix | Delete
}
[95] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-title {
[96] Fix | Delete
padding: 0 0 10px 0;
[97] Fix | Delete
font-weight: bold;
[98] Fix | Delete
}
[99] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-options a {
[100] Fix | Delete
display: block;
[101] Fix | Delete
margin: 5px 0 5px 0;
[102] Fix | Delete
color: #333;
[103] Fix | Delete
text-decoration: none;
[104] Fix | Delete
}
[105] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-options a.dismiss {
[106] Fix | Delete
color: #999;
[107] Fix | Delete
}
[108] Fix | Delete
.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-options a:hover, .affiliate-options a:focus {
[109] Fix | Delete
color: #0073aa;
[110] Fix | Delete
}
[111] Fix | Delete
button.<?php echo esc_attr($this->plugin_slug) ?>-close-affiliate-popup {
[112] Fix | Delete
position: absolute;
[113] Fix | Delete
top: 5px;
[114] Fix | Delete
right: 0;
[115] Fix | Delete
border: none;
[116] Fix | Delete
background: transparent;
[117] Fix | Delete
cursor: pointer;
[118] Fix | Delete
}
[119] Fix | Delete
a.button.button-primary.<?php echo esc_attr($this->plugin_slug) ?>-affiliate-btn {
[120] Fix | Delete
font-size: 14px;
[121] Fix | Delete
background: #F51366;
[122] Fix | Delete
color: #fff;
[123] Fix | Delete
border: solid 1px #F51366;
[124] Fix | Delete
border-radius: 3px;
[125] Fix | Delete
line-height: 24px;
[126] Fix | Delete
-webkit-box-shadow: 0 3px 5px -3px #333333;
[127] Fix | Delete
-moz-box-shadow: 0 3px 5px -3px #333333;
[128] Fix | Delete
box-shadow: 0 3px 5px -3px #333333;
[129] Fix | Delete
text-shadow: none;
[130] Fix | Delete
}
[131] Fix | Delete
</style>
[132] Fix | Delete
<div class="notice admin-poptin-box notice-info <?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate <?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate">
[133] Fix | Delete
<p>Hi there, you've been using <?php echo esc_attr($this->plugin_name) ?> for a while now. Do you know that <b><?php echo esc_attr($this->plugin_name) ?></b> has an affiliate program? Join now and get <b>25% lifetime commission</b> <a href="javascript:" class="dismiss-btn"><span class="dashicons dashicons-no-alt"></span> Dismiss</a></p>
[134] Fix | Delete
<div class="clear clearfix"></div>
[135] Fix | Delete
<a class="button button-primary <?php echo esc_attr($this->plugin_slug) ?>-affiliate-btn" target="_blank" href="https://www.poptin.com/affiliate/?utm_source=wordpressplugin&domain=<?php echo esc_url($_SERVER['HTTP_HOST']) ?>">Tell me more <span class="dashicons dashicons-arrow-right-alt"></span></a>
[136] Fix | Delete
</div>
[137] Fix | Delete
<div class="<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup">
[138] Fix | Delete
<div class="<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup-content">
[139] Fix | Delete
<button class="<?php echo esc_attr($this->plugin_slug) ?>-close-affiliate-popup"><span class="dashicons dashicons-no-alt"></span></button>
[140] Fix | Delete
<div class="<?php echo esc_attr($this->plugin_slug) ?>-affiliate-title">Would you like us to remind you about this later?</div>
[141] Fix | Delete
<div class="<?php echo esc_attr($this->plugin_slug) ?>-affiliate-options">
[142] Fix | Delete
<a href="javascript:" data-days="3">Remind me in 3 days</a>
[143] Fix | Delete
<a href="javascript:" data-days="10">Remind me in 10 days</a>
[144] Fix | Delete
<a href="javascript:" data-days="-1" class="dismiss">Don't remind me about this</a>
[145] Fix | Delete
</div>
[146] Fix | Delete
</div>
[147] Fix | Delete
</div>
[148] Fix | Delete
<script>
[149] Fix | Delete
jQuery(document).ready(function(){
[150] Fix | Delete
jQuery(document).on("click", ".<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate p a.dismiss-btn", function(){
[151] Fix | Delete
jQuery(".<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup").show();
[152] Fix | Delete
});
[153] Fix | Delete
jQuery(document).on("click", ".<?php echo esc_attr($this->plugin_slug) ?>-close-affiliate-popup", function(){
[154] Fix | Delete
jQuery(".<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup").hide();
[155] Fix | Delete
});
[156] Fix | Delete
jQuery(document).on("click", ".<?php echo esc_attr($this->plugin_slug) ?>-affiliate-options a", function(){
[157] Fix | Delete
var dataDays = jQuery(this).attr("data-days");
[158] Fix | Delete
jQuery(".<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup").hide();
[159] Fix | Delete
jQuery(".<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate").hide();
[160] Fix | Delete
jQuery.ajax({
[161] Fix | Delete
url: "<?php echo admin_url("admin-ajax.php") ?>",
[162] Fix | Delete
data: "action=<?php echo esc_attr($this->plugin_slug) ?>_affiliate_program&days="+dataDays+"&nonce=<?php echo esc_attr(wp_create_nonce($this->plugin_slug."_affiliate_program")) ?>",
[163] Fix | Delete
type: "post",
[164] Fix | Delete
success: function() {
[165] Fix | Delete
jQuery(".<?php echo esc_attr($this->plugin_slug) ?>-affiliate-popup").remove();
[166] Fix | Delete
jQuery(".<?php echo esc_attr($this->plugin_slug) ?>-premio-affiliate").remove();
[167] Fix | Delete
}
[168] Fix | Delete
});
[169] Fix | Delete
});
[170] Fix | Delete
});
[171] Fix | Delete
</script>
[172] Fix | Delete
<?php
[173] Fix | Delete
}
[174] Fix | Delete
}
[175] Fix | Delete
}
[176] Fix | Delete
$Poptin_affiliate_program = new Poptin_affiliate_program();
[177] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function