Changeset 3740441
- Timestamp:
- 10/12/2026 03:44:04 AM (6 weeks ago)
- Location:
- really-simple-under-construction/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
really-simple-under-construction.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
really-simple-under-construction/trunk/readme.txt
r3740435 r3740441 3 3 Requires at least: 6.0.0 4 4 Tested up to: 7.1 5 Stable tag: 1.6. 25 Stable tag: 1.6.3 6 6 License: GPLv2 or later 7 7 Contributors: jonashjalmarsson … … 40 40 41 41 == Changelog == 42 43 = 1.6.3 = 44 * A small, dismissible review request on this plugin's own settings page (never a site-wide notice). It appears once the under-construction page has been switched on and the settings page has been in use for 7 days, only to administrators. "Maybe later" hides it for 30 days, "Don't ask again" for good. No external requests are made — it is a plain link to the plugin's review page on wordpress.org. 42 45 43 46 = 1.6.2 = … … 140 143 == Upgrade Notice == 141 144 145 = 1.6.3 = 146 Adds a small dismissible review request on the plugin's own settings page after 7 days of use. No external requests. 147 142 148 = 1.6.2 = 143 149 The secret-word bypass link is cleaned from the address bar after use. -
really-simple-under-construction/trunk/really-simple-under-construction.php
r3740435 r3740441 4 4 Plugin URI: https://wordpress.org/plugins/really-simple-under-construction/ 5 5 Description: ...or Hide From Google functionality. Adds a really simple version of a Under Construction page. Use whitelisted IP and secret word to skip under construction page. Also good to have when you want to hide the site from search bots when developing a new site. 6 Version: 1.6. 26 Version: 1.6.3 7 7 Author: jonashjalmarsson 8 8 Author URI: http://jonashjalmarsson.se … … 467 467 <?php 468 468 } ); 469 470 /* REVIEW REQUEST (1.6.3, #673) 471 * 472 * One small, dismissible card on this plugin's OWN settings page — never a 473 * site-wide admin notice. Shown only to users who can manage_options, only 474 * after the under-construction page has been switched on and the settings 475 * page has been used for at least 7 days. "Maybe later" hides it for 30 days, 476 * "Don't ask again" for good (both per user). No external requests are made; 477 * the button is a plain link to the plugin's review page on wordpress.org. 478 */ 479 define( 'RSUC_REVIEW_URL', 'https://wordpress.org/support/plugin/really-simple-under-construction/reviews/#new-post' ); 480 481 /** 482 * Handle the "Maybe later" / "Don't ask again" links (nonce + capability checked). 483 */ 484 add_action( 'admin_init', function () { 485 if ( ! isset( $_GET['rsuc_review'], $_GET['_wpnonce'] ) ) { 486 return; 487 } 488 if ( ! current_user_can( 'manage_options' ) ) { 489 return; 490 } 491 $action = sanitize_key( wp_unslash( $_GET['rsuc_review'] ) ); 492 if ( ! in_array( $action, array( 'later', 'never' ), true ) ) { 493 return; 494 } 495 if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'rsuc_review_' . $action ) ) { 496 return; 497 } 498 $user_id = get_current_user_id(); 499 if ( 'never' === $action ) { 500 update_user_meta( $user_id, 'rsuc_review_dismissed', 1 ); 501 } else { 502 update_user_meta( $user_id, 'rsuc_review_snooze_until', time() + ( 30 * DAY_IN_SECONDS ) ); 503 } 504 wp_safe_redirect( admin_url( 'options-general.php?page=rsuc-submenu-page' ) ); 505 exit; 506 } ); 507 508 add_action( 'rsuc_render_after_heading', function () { 509 if ( ! current_user_can( 'manage_options' ) ) { 510 return; 511 } 512 $user_id = get_current_user_id(); 513 if ( get_user_meta( $user_id, 'rsuc_review_dismissed', true ) ) { 514 return; 515 } 516 if ( (int) get_user_meta( $user_id, 'rsuc_review_snooze_until', true ) > time() ) { 517 return; 518 } 519 // Only ask someone who has actually switched the page on. 520 if ( 1 != get_option( 'rsuc-enable' ) ) { 521 return; 522 } 523 // Remember when the settings page was first opened; ask after 7 days. 524 $first_seen = (int) get_option( 'rsuc-review-first-seen', 0 ); 525 if ( ! $first_seen ) { 526 update_option( 'rsuc-review-first-seen', time(), false ); 527 return; 528 } 529 if ( time() - $first_seen < 7 * DAY_IN_SECONDS ) { 530 return; 531 } 532 $later_url = wp_nonce_url( admin_url( 'options-general.php?page=rsuc-submenu-page&rsuc_review=later' ), 'rsuc_review_later' ); 533 $never_url = wp_nonce_url( admin_url( 'options-general.php?page=rsuc-submenu-page&rsuc_review=never' ), 'rsuc_review_never' ); 534 ?> 535 <div class="rsuc-review-card" style="background:#fff;border:1px solid #dcdcde;border-left:4px solid #2271b1;border-radius:4px;padding:.8em 1.25em;margin:1em 0 1.5em;max-width:760px;"> 536 <p style="margin:.2em 0 .7em;"><?php esc_html_e( 'Enjoying Really Simple Under Construction? A short review on wordpress.org helps other people find it.', 'really-simple-under-construction' ); ?></p> 537 <p style="margin:0;"> 538 <a class="button button-primary" href="<?php echo esc_url( RSUC_REVIEW_URL ); ?>" target="_blank" rel="noopener"> 539 <?php esc_html_e( 'Leave a review', 'really-simple-under-construction' ); ?> 540 </a> 541 <a class="button" href="<?php echo esc_url( $later_url ); ?>" style="margin-left:.4em;"> 542 <?php esc_html_e( 'Maybe later', 'really-simple-under-construction' ); ?> 543 </a> 544 <a href="<?php echo esc_url( $never_url ); ?>" style="margin-left:.8em;font-size:12px;"> 545 <?php esc_html_e( "Don't ask again", 'really-simple-under-construction' ); ?> 546 </a> 547 </p> 548 </div> 549 <?php 550 } );
Note:
See TracChangeset
for help on using the changeset viewer.