first commit

This commit is contained in:
2025-08-04 16:00:02 +02:00
commit 807c9b262f
7069 changed files with 2784666 additions and 0 deletions

View File

@@ -0,0 +1,157 @@
<div id="analyst-deactivate-modal" class="analyst-modal" style="display: none">
<div class="analyst-modal-content" style="width: 500px">
<div class="analyst-disable-modal-mask" id="analyst-disable-deactivate-modal-mask" style="display: none"></div>
<div style="display: flex">
<div class="analyst-install-image-block" style="width: 80px">
<img src="<?php echo $pencilImage; ?>"/>
</div>
<div class="analyst-install-description-block" style="padding-left: 20px">
<strong class="analyst-modal-header">Why do you deactivate?</strong>
<div class="analyst-install-description-text" style="padding-top: 2px">
Please let us know, so we can improve it! Thank you <img class="analyst-smile-image" src="<?php echo $smileImage; ?>" alt="">
</div>
</div>
</div>
<div>
<ul id="analyst-deactivation-reasons">
<li>
<label>
<span>
<input type="radio" name="deactivation-reason">
</span>
<span class="question" data-question="I couldn't understand how to make it work">I couldn't understand how to make it work</span>
</label>
</li>
<li data-input-type="textarea" data-input-placeholder="What should have worked, but didnt?">
<label>
<span>
<input type="radio" name="deactivation-reason">
</span>
<span class="question" data-question="The plugin didn't work as expected">The plugin didn't work as expected</span>
</label>
<div class="question-answer"></div>
</li>
<li data-input-type="input" data-input-placeholder="What is the plugin name?">
<label>
<span>
<input type="radio" name="deactivation-reason">
</span>
<span class="question" data-question="I found a better plugin">I found a better plugin</span>
</label>
<div class="question-answer"></div>
</li>
<li>
<label>
<span>
<input type="radio" name="deactivation-reason">
</span>
<span class="question" data-question="It's a temporary deactivation">It's a temporary deactivation</span>
</label>
<div class="question-answer"></div>
</li>
<li data-input-type="textarea" data-input-placeholder="Please provide the reason of deactivation">
<label>
<span>
<input type="radio" name="deactivation-reason">
</span>
<span class="question" data-question="Other">Other</span>
</label>
<div class="question-answer"></div>
</li>
</ul>
<p id="analyst-deactivation-error" style="color: #dc3232; font-size: 16px; display: none">Please let us know the reason for de-activation. Thank you!</p>
</div>
<div>
<button class="analyst-btn-grey" id="analyst-disabled-plugin-action">Deactivate</button>
</div>
<div class="" style="text-align: center; font-size: 18px; padding-top: 10px">
<button class="analyst-btn-secondary-ghost analyst-deactivate-modal-close" style="color: #cccccc">Cancel</button>
</div>
</div>
</div>
<script type="text/javascript">
(function ($) {
$('.deactivate').click(function (e) {
var anchor = $(this).find('[analyst-plugin-id]')
var pluginId = anchor.attr('analyst-plugin-id')
var isOptedIn = anchor.attr('analyst-plugin-opted-in') === '1'
// Do not ask for reason if not opted in
if (!isOptedIn) {
return
}
e.preventDefault()
$('#analyst-deactivate-modal')
.attr({
'analyst-plugin-id': pluginId,
'analyst-redirect-url': $(this).find('a').attr('href')
})
.show()
})
$('.analyst-deactivate-modal-close').click(function () {
$('#analyst-deactivate-modal').hide()
})
$('#analyst-deactivation-reasons input[name="deactivation-reason"]').change(function () {
$('.question-answer').empty()
var root = $('#analyst-deactivation-reasons input[name="deactivation-reason"]:checked').parents('li')
$('#analyst-deactivation-error').hide()
if (!root.attr('data-input-type')) return
var reasonInput = $('<' + root.attr('data-input-type') + '/>').attr({placeholder: root.attr('data-input-placeholder'), class: 'reason-answer'})
root.find('.question-answer').append(reasonInput)
})
$('#analyst-disabled-plugin-action').click(function () {
var pluginId = $('#analyst-deactivate-modal').attr('analyst-plugin-id')
var pluginDeactivationUrl = $('#analyst-deactivate-modal').attr('analyst-redirect-url')
var root = $('#analyst-deactivation-reasons input[name="deactivation-reason"]:checked').parents('li');
var reason = root.find('.question-answer .reason-answer').val();
var question = root.find('.question').attr('data-question').trim()
var $errorBlock = $('#analyst-deactivation-error')
if (!question) {
return $errorBlock.show()
}
$errorBlock.hide()
var data = {
action: 'analyst_plugin_deactivate_' + pluginId,
question: question,
nonce: analyst_opt_localize.nonce
}
if (reason) {
data['reason'] = reason.trim();
}
$(this).attr('disabled', true).text('Deactivating...');
$('#analyst-disable-deactivate-modal-mask').show();
$.ajax({
url: ajaxurl,
method: 'POST',
data: data
}).done(function () {
window.location.href = pluginDeactivationUrl
$('#analyst-disable-deactivate-modal-mask').hide();
})
})
})(jQuery)
</script>

View File

@@ -0,0 +1,117 @@
<div id="analyst-install-modal" class="analyst-modal" style="display: none" analyst-plugin-id="<?php echo $pluginToInstall; ?>">
<div class="analyst-modal-content" style="width: 450px">
<div class="analyst-disable-modal-mask" id="analyst-disable-install-modal-mask" style="display: none"></div>
<div style="display: flex">
<div class="analyst-install-image-block">
<img src="<?php echo $shieldImage; ?>"/>
</div>
<div class="analyst-install-description-block">
<strong class="analyst-modal-header">Stay on the safe side</strong>
<p class="analyst-install-description-text">Receive our plugins alerts in
case of <strong>critical security</strong>, feature & special deal
updates and allow non-sensitive
diagnostic tracking.</p>
</div>
</div>
<div class="analyst-modal-def-top-padding">
<button class="analyst-btn-success" id="analyst-install-action">Allow & Continue &gt;</button>
</div>
<div class="analyst-modal-def-top-padding" id="analyst-permissions-block" style="display: none">
<span>Youre granting these permissions:</span>
<ul class="analyst-install-permissions-list">
<li><strong>Your profile information</strong> (name and email) </li>
<li><strong>Your site information</strong> (URL, WP version, PHP info, plugins & themes)</li>
<li><strong>Plugin notices</strong> (updates, announcements, marketing, no spam)</li>
<li><strong>Plugin events</strong> (activation, deactivation and uninstall)</li>
</ul>
</div>
<div class="analyst-install-footer analyst-modal-def-top-padding">
<span class="analyst-action-text" id="analyst-permissions-toggle">Learn more</span>
<span id="analyst-powered-by" style="display: none;">Powered by <a href="https://sellcodes.com/blog/wordpress-feedback-system-for-plugin-creators/?utm_source=optin_screen" target="_blank" class="analyst-link">Sellcodes.com</a></span>
<span class="analyst-action-text analyst-install-modal-close" id="analyst-install-skip">Skip</span>
</div>
<div id="analyst-install-error" class="analyst-modal-def-top-padding" style="display: none; text-align: center">
<span style="color: #dc3232; font-size: 16px">Service unavailable. Please try again later</span>
</div>
</div>
</div>
<script type="text/javascript">
(function ($) {
var installPlugin = function (pluginId) {
var $error = $('#analyst-install-error')
$error.hide()
$.ajax({
url: ajaxurl,
method: 'POST',
data: {
action: 'analyst_install_' + pluginId,
nonce: analyst_opt_localize.nonce
},
success: function (data) {
if (data && !data.success) {
//error
$('#analyst-install-modal').hide()
return
}
window.location.reload()
},
error: function () {
$('#analyst-install-modal').hide()
}
}).done(function () {
$('#analyst-disable-install-modal-mask').hide()
$('#analyst-install-action')
.attr('disabled', false)
.text('Allow & Continue >')
})
}
if ($('#analyst-install-modal').attr('analyst-plugin-id')) {
$('#analyst-install-modal').show()
}
$('.analyst-install-modal-close').click(function () {
$('#analyst-install-modal').hide()
})
$('#analyst-install-action').click(function () {
var pluginId = $('#analyst-install-modal').attr('analyst-plugin-id')
$('#analyst-install-action')
.attr('disabled', true)
.text('Please wait...')
$('#analyst-disable-install-modal-mask').show()
installPlugin(pluginId)
})
$('#analyst-permissions-toggle').click(function () {
var isVisible = $('#analyst-permissions-block').toggle().is(':visible')
isVisible ? $(this).text('Close section') : $(this).text('Learn more')
var poweredBy = $('#analyst-powered-by')
isVisible ? poweredBy.show() : poweredBy.hide()
})
$('#analyst-install-skip').click(function () {
var pluginId = $('#analyst-install-modal').attr('analyst-plugin-id')
$.post(ajaxurl, {
action: 'analyst_skip_install_' + pluginId,
nonce: analyst_opt_localize.nonce
}).done(function () {
$('#analyst-install-modal').hide()
})
})
})(jQuery)
</script>