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/ninja-fo.../includes/Admin
File: SurveyPromo.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* NF_Survey_Promo Class
[3] Fix | Delete
*
[4] Fix | Delete
* @since 3.6
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
class NF_Admin_SurveyPromo
[8] Fix | Delete
{
[9] Fix | Delete
public $isDashboard = false;
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
*
[13] Fix | Delete
*/
[14] Fix | Delete
public function __construct()
[15] Fix | Delete
{
[16] Fix | Delete
if ( ! $this->isTargetPage() ) {
[17] Fix | Delete
return;
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
if ( array_key_exists( 'nf-dismiss-survey-notice', $_REQUEST ) ) {
[21] Fix | Delete
$this->dismiss();
[22] Fix | Delete
}
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
public function show()
[26] Fix | Delete
{
[27] Fix | Delete
if ( ! $this->isTargetPage() ) {
[28] Fix | Delete
return;
[29] Fix | Delete
}
[30] Fix | Delete
if ( ! $this->shouldShow() ) {
[31] Fix | Delete
return;
[32] Fix | Delete
}
[33] Fix | Delete
$this->getNoticeHtml();
[34] Fix | Delete
}
[35] Fix | Delete
[36] Fix | Delete
public function isTargetPage()
[37] Fix | Delete
{
[38] Fix | Delete
if ( ! is_admin() ) {
[39] Fix | Delete
return false;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
global $pagenow;
[43] Fix | Delete
$show = false;
[44] Fix | Delete
[45] Fix | Delete
if( 'edit.php' == $pagenow && \array_key_exists( 'post_type', $_REQUEST ) && 'nf_sub' == $_REQUEST[ 'post_type' ] ) {
[46] Fix | Delete
$show = true;
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
if( \array_key_exists( 'page', $_REQUEST ) ) {
[50] Fix | Delete
$targets = ['nf-import-export', 'nf-submissions', 'nf-settings'];
[51] Fix | Delete
if( in_array( $_REQUEST['page'], $targets ) ) {
[52] Fix | Delete
$show = true;
[53] Fix | Delete
} elseif( $_REQUEST['page'] == 'ninja-forms' && ! \array_key_exists('form_id', $_REQUEST) ) {
[54] Fix | Delete
$show = true;
[55] Fix | Delete
$this->isDashboard = true;
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
return $show;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/**
[63] Fix | Delete
* Check if we should show the survey promo
[64] Fix | Delete
*
[65] Fix | Delete
* @return bool
[66] Fix | Delete
*/
[67] Fix | Delete
public function shouldShow()
[68] Fix | Delete
{
[69] Fix | Delete
[70] Fix | Delete
$nf_settings = get_option( 'ninja_forms_settings' );
[71] Fix | Delete
[72] Fix | Delete
if (
[73] Fix | Delete
isset( $nf_settings[ 'disable_admin_notices' ] ) &&
[74] Fix | Delete
$nf_settings[ 'disable_admin_notices' ] == 1
[75] Fix | Delete
) {
[76] Fix | Delete
return false;
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
if ( get_option('ninja_forms_disable_survey_promo') ) {
[80] Fix | Delete
return false;
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
if ( get_transient('ninja_forms_disable_survey_promo') ) {
[84] Fix | Delete
return false;
[85] Fix | Delete
}
[86] Fix | Delete
[87] Fix | Delete
return true;
[88] Fix | Delete
}
[89] Fix | Delete
[90] Fix | Delete
public function isDashboard()
[91] Fix | Delete
{
[92] Fix | Delete
return $this->isDashboard;
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
/**
[96] Fix | Delete
* Set the ninja_forms_disable_survey_promo transient
[97] Fix | Delete
*
[98] Fix | Delete
* @return Void
[99] Fix | Delete
*/
[100] Fix | Delete
public function dismiss()
[101] Fix | Delete
{
[102] Fix | Delete
if( $_REQUEST['nf-dismiss-survey-notice'] == 'now' ) {
[103] Fix | Delete
set_transient('ninja_forms_disable_survey_promo', 1, DAY_IN_SECONDS * 14);
[104] Fix | Delete
} elseif( $_REQUEST['nf-dismiss-survey-notice'] == 'always' ) {
[105] Fix | Delete
add_option('ninja_forms_disable_survey_promo', 1, '', false);
[106] Fix | Delete
}
[107] Fix | Delete
}
[108] Fix | Delete
[109] Fix | Delete
/**
[110] Fix | Delete
* Echo the html for the notice
[111] Fix | Delete
*
[112] Fix | Delete
* @return Void
[113] Fix | Delete
*/
[114] Fix | Delete
public function getNoticeHtml()
[115] Fix | Delete
{
[116] Fix | Delete
$html = '<div id="nf-top-notice">
[117] Fix | Delete
<div class="nf-top-inner">
[118] Fix | Delete
<div class="nf-survey-actions"><a class="nf-survey-btn" href="https://ninjaforms.com/core-plugin-survey/?utm_source=Ninja+Forms+Plugin&utm_medium=Admin+Banner&utm_campaign=Core+Plugin+Survey" target="_blank">Win a $100 Amazon gift card!</a>
[119] Fix | Delete
<p class="nf-survey-alt-actions"><a class="nf-survey-remind" href="' . add_query_arg('nf-dismiss-survey-notice', 'now') . '">' . esc_html__('Remind me later', 'ninja-forms') . '</a><span><a class="nf-survey-hide" href="' . add_query_arg('nf-dismiss-survey-notice', 'always') . '">' . esc_html__('Dismiss forever', 'ninja-forms') . '</a></span></p>
[120] Fix | Delete
</div>
[121] Fix | Delete
<div class="nf-survey-content">
[122] Fix | Delete
<p>' . esc_html__("Learning more about why you're using Ninja Forms helps us shape the future of the plugin to best match your needs. That's really important to us, and why we're offering a chance to win prizes like a $100 Amazon gift card for just a few minutes of your time.", 'ninja-forms') . '</p>
[123] Fix | Delete
<p><strong>' . esc_html__("If you have five minutes to spare, we'd love your feedback on this brief, multiple-choice survey.", 'ninja-forms') . '</strong></p>
[124] Fix | Delete
</div>
[125] Fix | Delete
</div>
[126] Fix | Delete
</div>
[127] Fix | Delete
<style type="text/css">
[128] Fix | Delete
#nf-top-notice {
[129] Fix | Delete
width: 100%;
[130] Fix | Delete
border-bottom: 2px solid #97C9ED;
[131] Fix | Delete
color: #424242;
[132] Fix | Delete
font-size: 14px;
[133] Fix | Delete
font-weight: normal;
[134] Fix | Delete
line-height: 1.25;
[135] Fix | Delete
margin: 0;';
[136] Fix | Delete
if( ! $this->isDashboard() ) {
[137] Fix | Delete
$html .= 'margin-left: -20px;
[138] Fix | Delete
padding-right: 20px;';
[139] Fix | Delete
}
[140] Fix | Delete
$html .= 'background: #DBF2FD url("https://ninjaforms.com/wp-content/uploads/2024/06/nf-plugin-asset-survey-bg.png") no-repeat 100%/50%;
[141] Fix | Delete
background-size: contain;
[142] Fix | Delete
}
[143] Fix | Delete
#nf-top-notice .nf-top-inner {
[144] Fix | Delete
display: flex;
[145] Fix | Delete
flex-flow: row nowrap;
[146] Fix | Delete
gap: 24px;
[147] Fix | Delete
align-content: stretch;
[148] Fix | Delete
align-items: center;
[149] Fix | Delete
padding: 8px 16vw 8px 16px;
[150] Fix | Delete
}
[151] Fix | Delete
#nf-top-notice .nf-top-inner > div {
[152] Fix | Delete
flex: 0 auto;
[153] Fix | Delete
}
[154] Fix | Delete
#nf-top-notice p {
[155] Fix | Delete
margin-top: 0;
[156] Fix | Delete
margin-bottom: 8px;
[157] Fix | Delete
}
[158] Fix | Delete
#nf-top-notice :last-child {
[159] Fix | Delete
margin-bottom: 0;
[160] Fix | Delete
}
[161] Fix | Delete
#nf-top-notice .nf-survey-actions {
[162] Fix | Delete
text-align: center;
[163] Fix | Delete
font-size: 12px;
[164] Fix | Delete
}
[165] Fix | Delete
#nf-top-notice .nf-survey-alt-actions a {
[166] Fix | Delete
color: #424242;
[167] Fix | Delete
}
[168] Fix | Delete
#nf-top-notice .nf-survey-alt-actions span {
[169] Fix | Delete
opacity: 0.85;
[170] Fix | Delete
font-size: 0.9em;
[171] Fix | Delete
margin-left: 45px;
[172] Fix | Delete
}
[173] Fix | Delete
#nf-top-notice .nf-survey-remind {
[174] Fix | Delete
font-weight: bold;
[175] Fix | Delete
}
[176] Fix | Delete
#nf-top-notice .nf-survey-content {
[177] Fix | Delete
flex: 1 100%;
[178] Fix | Delete
}
[179] Fix | Delete
#nf-top-notice .nf-survey-btn {
[180] Fix | Delete
display: block;
[181] Fix | Delete
border-radius: 8px;
[182] Fix | Delete
background: #EF4748;
[183] Fix | Delete
color: #FFF;
[184] Fix | Delete
font-size: 20px;
[185] Fix | Delete
font-style: normal;
[186] Fix | Delete
font-weight: 700;
[187] Fix | Delete
line-height: 24px;
[188] Fix | Delete
/* 100% */
[189] Fix | Delete
text-transform: uppercase;
[190] Fix | Delete
text-decoration: none;
[191] Fix | Delete
text-wrap: nowrap;
[192] Fix | Delete
padding: 12px 24px;
[193] Fix | Delete
margin-bottom: 8px;
[194] Fix | Delete
}
[195] Fix | Delete
</style>
[196] Fix | Delete
';
[197] Fix | Delete
echo $html;
[198] Fix | Delete
}
[199] Fix | Delete
}
[200] Fix | Delete
[201] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function