Changeset 3384756
- Timestamp:
- 10/26/2025 02:32:14 PM (7 weeks ago)
- Location:
- coming-soon/trunk/admin
- Files:
-
- 1 added
- 1 edited
-
includes/review-functions.php (modified) (4 diffs)
-
js/review-notice.js (added)
Legend:
- Unmodified
- Added
- Removed
-
coming-soon/trunk/admin/includes/review-functions.php
r3381273 r3384756 21 21 */ 22 22 function seedprod_lite_v2_init_review_request() { 23 // Temporarily disabled - will be converted to trigger-based system 24 return; 25 23 26 // Only show for Lite builds 24 27 if ( 'lite' !== SEEDPROD_BUILD ) { … … 26 29 } 27 30 31 // Enqueue review notice JavaScript 32 add_action( 'admin_enqueue_scripts', 'seedprod_lite_v2_enqueue_review_scripts' ); 33 28 34 // Admin notice requesting review 29 35 add_action( 'admin_notices', 'seedprod_lite_v2_review_request' ); … … 33 39 } 34 40 add_action( 'admin_init', 'seedprod_lite_v2_init_review_request' ); 41 42 /** 43 * Enqueue review notice JavaScript 44 * 45 * Only loads on pages where review notice might display. 46 * 47 * @since 7.0.0 48 */ 49 function seedprod_lite_v2_enqueue_review_scripts() { 50 // Only enqueue for super admins (same check as review display) 51 if ( ! is_super_admin() ) { 52 return; 53 } 54 55 // Don't load on SeedProd pages (review notice doesn't show there) 56 $screen = get_current_screen(); 57 if ( $screen && strpos( $screen->id, 'seedprod' ) !== false ) { 58 return; 59 } 60 61 // Enqueue the review notice handler 62 wp_enqueue_script( 63 'seedprod-review-notice', 64 plugin_dir_url( dirname( __FILE__ ) ) . 'js/review-notice.js', 65 array( 'jquery' ), 66 SEEDPROD_VERSION, 67 true 68 ); 69 70 // Localize script with nonce for AJAX security 71 wp_localize_script( 72 'seedprod-review-notice', 73 'seedprodReviewNotice', 74 array( 75 'nonce' => wp_create_nonce( 'seedprod_review_dismiss' ), 76 ) 77 ); 78 } 35 79 36 80 /** … … 180 224 */ 181 225 function seedprod_lite_v2_review_dismiss() { 182 // Security check 226 // Verify nonce for security 227 check_ajax_referer( 'seedprod_review_dismiss', 'nonce' ); 228 229 // Security check - verify user capability 183 230 if ( ! current_user_can( 'manage_options' ) ) { 184 231 wp_die(); 185 232 } 186 233 187 // Check if this is a permanent dismissal 188 $permanent = isset( $_POST['permanent'] ) && $_POST['permanent']=== 'true';234 // Check if this is a permanent dismissal (sanitize input) 235 $permanent = isset( $_POST['permanent'] ) && sanitize_text_field( wp_unslash( $_POST['permanent'] ) ) === 'true'; 189 236 190 237 if ( $permanent ) {
Note: See TracChangeset
for help on using the changeset viewer.