PluginProbe ʕ •ᴥ•ʔ
WP STAGING – WordPress Backups, Restore, Migration & Clone / 4.11.0
WP STAGING – WordPress Backups, Restore, Migration & Clone v4.11.0
4.11.0 4.10.0 4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.1 trunk 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.10.0 3.2.0 3.3.1 3.3.2 3.3.3 3.4.1 3.4.3 3.5.0 3.6.0 3.7.1 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.7.2 4.7.3 4.8.0
wp-staging / views / notices / review-prompt-handlers.php
wp-staging / views / notices Last commit date
_partial 1 month ago aios-salt-postfix-enabled.php 1 year ago analytics-consent-failed.php 1 year ago analytics-consent-refused.php 1 year ago analytics-modal.php 1 week ago backup-plugins-notice.php 8 months ago beta.php 1 year ago cache-directory-permission-problem.php 1 year ago cli-integration-notice.php 2 days ago cron-warning-notice.php 2 days ago directory-listing-could-not-be-prevented.php 8 months ago disabled-items-notice.php 1 year ago disabled-optimizer-notice.php 1 year ago elementor-cloud-notice.php 5 months ago logs-directory-permission-problem.php 1 year ago low-memory-limit.php 1 year ago mu-plugin-directory-permission-problem.php 1 year ago next-gen-engine-notice.php 1 month ago no-db-prefix-notice.php 1 year ago object-cache-skipped.php 1 year ago outdated-wp-staging-hooks.php 1 year ago outdated-wp-staging-version.php 1 year ago pro-crons-notice.php 1 year ago review-prompt-handlers.php 1 month ago review-prompt-modal.php 1 month ago settings_option_corrupt.php 1 year ago staging-directory-permission-problem.php 2 weeks ago staging-symlink-enabled-notice.php 11 months ago table-tmp-prefix-conflict-notice.php 1 year ago transient.php 1 year ago uploads-outside-wp-root.php 1 year ago vars-directory-permission-problem.php 1 year ago wordfence-userini-renamed.php 7 months ago wp-options-missing-pk.php 7 months ago wp-version-compat-notice.php 5 months ago wpe-permalink-issue-notice.php 1 year ago wrong-scheme.php 1 year ago
review-prompt-handlers.php
67 lines
1 <?php
2
3 /**
4 * Page-level delegated handlers for the success-based review prompt.
5 *
6 * The prompt lives in content that is added at runtime — the staging listing
7 * (injected via innerHTML) and the backup completion modal (SweetAlert) — so an
8 * inline <script> inside those fragments never executes. These handlers are
9 * delegated from the document and the partial is included once on every page
10 * that can show the prompt (the staging dashboard and the Backup & Migration
11 * page). Both surfaces share the same wpstg_rating state, so dismissing or
12 * snoozing in one silences the review everywhere.
13 *
14 * Selectors (shared by the strip and the modal):
15 * .wpstg-leave-review -> opens the review page (default) + permanently dismisses
16 * .wpstg_rate_later -> progressive snooze (14 / 30 / 180 days)
17 * .wpstg_hide_rating -> permanently dismisses
18 */
19
20 ?>
21 <script>
22 (function () {
23 var PROMPT_SELECTOR = '.wpstg_fivestar';
24
25 function dismiss(action, promptEl) {
26 var body = new URLSearchParams();
27 body.append('action', action);
28 body.append('nonce', wpstg.nonce);
29
30 fetch(ajaxurl, {
31 method: 'POST',
32 credentials: 'same-origin',
33 headers: {'Content-Type': 'application/x-www-form-urlencoded'},
34 body: body.toString()
35 }).then(function () {
36 if (promptEl) {
37 promptEl.style.display = 'none';
38 }
39 });
40 }
41
42 document.addEventListener('click', function (event) {
43 var rateLater = event.target.closest('.wpstg_rate_later');
44 if (rateLater) {
45 event.preventDefault();
46 dismiss('wpstg_hide_later', rateLater.closest(PROMPT_SELECTOR));
47 return;
48 }
49
50 var hideRating = event.target.closest('.wpstg_hide_rating');
51 if (hideRating) {
52 event.preventDefault();
53 dismiss('wpstg_hide_rating', hideRating.closest(PROMPT_SELECTOR));
54 return;
55 }
56
57 // Keep the default action so the review page opens in a new tab, then dismiss.
58 // Class hook (not an id): the block is cloned from a hidden host into the
59 // success modal, so an id would be duplicated in the DOM while the modal is open.
60 var leaveReview = event.target.closest('.wpstg-leave-review');
61 if (leaveReview) {
62 dismiss('wpstg_hide_rating', leaveReview.closest(PROMPT_SELECTOR));
63 }
64 });
65 })();
66 </script>
67