rebase from live enviornment
This commit is contained in:
@@ -383,4 +383,56 @@ class wfSupportController {
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function shouldShowSatisfactionPrompt() {
|
||||
//Don't show if overridden
|
||||
if (!wfConfig::getBool('satisfactionPromptOverride')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Only show on our pages
|
||||
if (!isset($_REQUEST['page'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!preg_match('/^Wordfence/', $_REQUEST['page'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Only show until dismissed
|
||||
if (wfConfig::get('satisfactionPromptDismissed') > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Only show to users installing after the release date of the version this was introduced
|
||||
if (WORDFENCE_FEEDBACK_EPOCH > wfConfig::get('satisfactionPromptInstallDate')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Don't show for at least 7 days post-install
|
||||
if ((time() - wfConfig::get('satisfactionPromptInstallDate')) < 86400 * 7) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function satisfactionPromptNotice() {
|
||||
?>
|
||||
<div id="wordfenceSatisfactionPrompt" class="fade notice notice-info">
|
||||
<p id="wordfenceSatisfactionPrompt-initial"><strong><?php printf(__('Are you enjoying using Wordfence Security?', 'wordfence')); ?></strong> <a href="#" onclick="WFAD.wordfenceSatisfactionChoice('yes'); return false;" class="wf-btn wf-btn-default wf-btn-sm" role="button"><?php printf(__('Yes', 'wordfence')); ?></a> <a href="#" onclick="WFAD.wordfenceSatisfactionChoice('no'); return false;" class="wf-btn wf-btn-default wf-btn-sm" role="button"><?php printf(__('No', 'wordfence')); ?></a></p>
|
||||
<div id="wordfenceSatisfactionPrompt-yes" style="display: none;">
|
||||
<p><?php printf(__('Please consider leaving us a 5-star review on wordpress.org. Your review helps other members of the WordPress community find plugins that fit their needs.', 'wordfence')); ?></p>
|
||||
<p><a href="https://wordpress.org/support/plugin/wordfence/reviews/" class="wf-btn wf-btn-default wf-btn-sm" role="button" target="_blank" rel="noopener noreferrer"><?php printf(__('Leave Review', 'wordfence')); ?></a></p>
|
||||
</div>
|
||||
<div id="wordfenceSatisfactionPrompt-no" style="display: none;">
|
||||
<p><?php printf(__('What can we do to improve Wordfence Security?', 'wordfence')); ?></p>
|
||||
<p><textarea rows="6" cols="50" id="wordfenceSatisfactionPrompt-feedback"></textarea></p>
|
||||
<p><a href="#" onclick="WFAD.wordfenceSatisfactionChoice('feedback'); return false;" class="wf-btn wf-btn-default wf-btn-sm" role="button" target="_blank" rel="noopener noreferrer"><?php printf(__('Submit Feedback', 'wordfence')); ?></a> <a href="#" onclick="WFAD.wordfenceSatisfactionChoice('dismiss'); return false;" class="wf-btn wf-btn-default wf-btn-sm" role="button"><?php printf(__('Dismiss', 'wordfence')); ?></a></p>
|
||||
</div>
|
||||
<p id="wordfenceSatisfactionPrompt-complete" style="display: none;"><?php printf(__('Thank you for providing your feedback on Wordfence Security', 'wordfence')); ?></p>
|
||||
<button type="button" class="notice-dismiss" onclick="WFAD.wordfenceSatisfactionChoice('dismiss'); return false;"><span class="screen-reader-text">Dismiss this notice.</span></button>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user