Changeset 3007221
- Timestamp:
- 12/08/2023 11:08:40 AM (2 years ago)
- Location:
- replybox
- Files:
-
- 6 edited
- 1 copied
-
tags/1.2.0 (copied) (copied from replybox/trunk)
-
tags/1.2.0/readme.txt (modified) (2 diffs)
-
tags/1.2.0/replybox.php (modified) (5 diffs)
-
tags/1.2.0/views/admin-page.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/replybox.php (modified) (5 diffs)
-
trunk/views/admin-page.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
replybox/tags/1.2.0/readme.txt
r2844475 r3007221 3 3 Tags: comment, comments 4 4 Requires at least: 4.7 5 Tested up to: 6. 1.15 Tested up to: 6.4.2 6 6 Requires PHP: 7.0 7 Stable tag: 1. 1.27 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 77 = 1.2.0 = 78 * Add saved notices on admin area 79 * Add notice on comment management 80 * Disable comments via wp-comments-post.php 81 77 82 = 1.1.2 = 78 83 * Support for WordPress Twenty Twenty Three and Block Themes -
replybox/tags/1.2.0/replybox.php
r2844475 r3007221 3 3 * Plugin Name: ReplyBox — Better WordPress Comments 4 4 * Description: A simple, honest comment system which works everywhere. No ads, no dodgy affiliate links, no fluff. 5 * Version: 1. 1.25 * Version: 1.2.0 6 6 * Author: ReplyBox 7 7 * Author URI: https://getreplybox.com … … 73 73 add_filter( 'comment_row_actions', array( $this, 'comments_row_actions' ) ); 74 74 add_filter( 'comment_status_links', array( $this, 'comments_status_links' ) ); 75 add_action( 'admin_notices', array( $this, 'add_replybox_comments_notice' ) ); 76 add_action( 'init', array( $this, 'disable_comments_post' ) ); 77 75 78 76 79 register_activation_hook( __FILE__, array( $this, 'activate' ) ); … … 159 162 */ 160 163 public function show_admin_page() { 164 if ( ! empty( $_GET['settings-updated'] ) ) { 165 add_settings_error( 'replybox', 'settings-updated', __( 'Settings saved.', 'replybox' ), 'updated' ); 166 } 167 161 168 require_once plugin_dir_path( __FILE__ ) . 'views/admin-page.php'; 162 169 } … … 179 186 180 187 $url = sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ); 188 $url = add_query_arg( 'settings-updated', 'true', $url ); 181 189 182 190 wp_safe_redirect( urldecode( $url ) ); … … 629 637 630 638 /** 639 * Add ReplyBox notice on comment page. 640 * 641 * @return void 642 */ 643 public function add_replybox_comments_notice() { 644 global $pagenow; 645 646 if ( empty( $pagenow ) || 'edit-comments.php' !== $pagenow || apply_filters( 'replybox_hide_comments_notice', false ) ) { 647 return; 648 } 649 650 $site_id = $this->get_option( 'site_id' ); 651 $url = ! empty( $site_id ) ? 'https://app.getreplybox.com/sites/' . $site_id : 'https://app.getreplybox.com'; 652 653 ?> 654 <style> 655 .notice-replybox { 656 border-left-color: #6C2BD9; 657 } 658 659 .notice-replybox a { 660 color: #6C2BD9; 661 } 662 663 .notice-replybox a:hover, 664 .notice-replybox a:active, 665 .notice-replybox a:focus { 666 color: #551fb2; 667 } 668 669 .wp-core-ui .notice-replybox .button-primary { 670 background: #6C2BD9; 671 border-color: #6C2BD9; 672 } 673 674 .wp-core-ui .notice-replybox .button-primary:hover, 675 .wp-core-ui .notice-replybox .button-primary:active, 676 .wp-core-ui .notice-replybox .button-primary:focus { 677 background: #551fb2; 678 border-color: #551fb2; 679 } 680 </style> 681 <div class="notice notice-info notice-replybox"> 682 <p><strong><?php _e( 'You are using ReplyBox!', 'replybox' ); ?></strong> <?php _e( "Please go to the ReplyBox app to manage your site's comments.", 'replybox' ); ?></p> 683 <p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary" target="_blank"><?php _e( 'Manage comments in ReplyBox', 'replybox' ); ?></a> <span style="margin: 0 4px;">or</span> <a href="https://getreplybox.com/?utm_source=replybox&utm_medium=plugin&utm_campaign=comments-notice" target="_blank">learn more</a> </p> 684 </div> 685 <?php 686 } 687 688 /* 689 * Don't allow comments to be posted to wp-comments-post.php. 690 * 691 * @return void 692 */ 693 public function disable_comments_post() { 694 global $pagenow; 695 696 if ( empty( $pagenow ) || 'wp-comments-post.php' !== $pagenow ) { 697 return; 698 } 699 700 wp_die( __( "Sorry, you can't post comments using this method.", 'replybox' ), '', array( 'response' => 403 ) ); 701 } 702 703 /** 631 704 * Protected constructor to prevent creating a new instance of the 632 705 * class via the `new` operator from outside of this class. -
replybox/tags/1.2.0/views/admin-page.php
r2451514 r3007221 5 5 <div class="wrap"> 6 6 <h1><?php _e('ReplyBox', 'replybox'); ?></h1> 7 8 <?php settings_errors( 'replybox' ); ?> 7 9 8 10 <form method="POST" action="<?php echo esc_html(admin_url('admin-post.php')); ?>"> -
replybox/trunk/readme.txt
r2844475 r3007221 3 3 Tags: comment, comments 4 4 Requires at least: 4.7 5 Tested up to: 6. 1.15 Tested up to: 6.4.2 6 6 Requires PHP: 7.0 7 Stable tag: 1. 1.27 Stable tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 75 75 == Changelog == 76 76 77 = 1.2.0 = 78 * Add saved notices on admin area 79 * Add notice on comment management 80 * Disable comments via wp-comments-post.php 81 77 82 = 1.1.2 = 78 83 * Support for WordPress Twenty Twenty Three and Block Themes -
replybox/trunk/replybox.php
r2844475 r3007221 3 3 * Plugin Name: ReplyBox — Better WordPress Comments 4 4 * Description: A simple, honest comment system which works everywhere. No ads, no dodgy affiliate links, no fluff. 5 * Version: 1. 1.25 * Version: 1.2.0 6 6 * Author: ReplyBox 7 7 * Author URI: https://getreplybox.com … … 73 73 add_filter( 'comment_row_actions', array( $this, 'comments_row_actions' ) ); 74 74 add_filter( 'comment_status_links', array( $this, 'comments_status_links' ) ); 75 add_action( 'admin_notices', array( $this, 'add_replybox_comments_notice' ) ); 76 add_action( 'init', array( $this, 'disable_comments_post' ) ); 77 75 78 76 79 register_activation_hook( __FILE__, array( $this, 'activate' ) ); … … 159 162 */ 160 163 public function show_admin_page() { 164 if ( ! empty( $_GET['settings-updated'] ) ) { 165 add_settings_error( 'replybox', 'settings-updated', __( 'Settings saved.', 'replybox' ), 'updated' ); 166 } 167 161 168 require_once plugin_dir_path( __FILE__ ) . 'views/admin-page.php'; 162 169 } … … 179 186 180 187 $url = sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ); 188 $url = add_query_arg( 'settings-updated', 'true', $url ); 181 189 182 190 wp_safe_redirect( urldecode( $url ) ); … … 629 637 630 638 /** 639 * Add ReplyBox notice on comment page. 640 * 641 * @return void 642 */ 643 public function add_replybox_comments_notice() { 644 global $pagenow; 645 646 if ( empty( $pagenow ) || 'edit-comments.php' !== $pagenow || apply_filters( 'replybox_hide_comments_notice', false ) ) { 647 return; 648 } 649 650 $site_id = $this->get_option( 'site_id' ); 651 $url = ! empty( $site_id ) ? 'https://app.getreplybox.com/sites/' . $site_id : 'https://app.getreplybox.com'; 652 653 ?> 654 <style> 655 .notice-replybox { 656 border-left-color: #6C2BD9; 657 } 658 659 .notice-replybox a { 660 color: #6C2BD9; 661 } 662 663 .notice-replybox a:hover, 664 .notice-replybox a:active, 665 .notice-replybox a:focus { 666 color: #551fb2; 667 } 668 669 .wp-core-ui .notice-replybox .button-primary { 670 background: #6C2BD9; 671 border-color: #6C2BD9; 672 } 673 674 .wp-core-ui .notice-replybox .button-primary:hover, 675 .wp-core-ui .notice-replybox .button-primary:active, 676 .wp-core-ui .notice-replybox .button-primary:focus { 677 background: #551fb2; 678 border-color: #551fb2; 679 } 680 </style> 681 <div class="notice notice-info notice-replybox"> 682 <p><strong><?php _e( 'You are using ReplyBox!', 'replybox' ); ?></strong> <?php _e( "Please go to the ReplyBox app to manage your site's comments.", 'replybox' ); ?></p> 683 <p><a href="<?php echo esc_url( $url ); ?>" class="button button-primary" target="_blank"><?php _e( 'Manage comments in ReplyBox', 'replybox' ); ?></a> <span style="margin: 0 4px;">or</span> <a href="https://getreplybox.com/?utm_source=replybox&utm_medium=plugin&utm_campaign=comments-notice" target="_blank">learn more</a> </p> 684 </div> 685 <?php 686 } 687 688 /* 689 * Don't allow comments to be posted to wp-comments-post.php. 690 * 691 * @return void 692 */ 693 public function disable_comments_post() { 694 global $pagenow; 695 696 if ( empty( $pagenow ) || 'wp-comments-post.php' !== $pagenow ) { 697 return; 698 } 699 700 wp_die( __( "Sorry, you can't post comments using this method.", 'replybox' ), '', array( 'response' => 403 ) ); 701 } 702 703 /** 631 704 * Protected constructor to prevent creating a new instance of the 632 705 * class via the `new` operator from outside of this class. -
replybox/trunk/views/admin-page.php
r2451514 r3007221 5 5 <div class="wrap"> 6 6 <h1><?php _e('ReplyBox', 'replybox'); ?></h1> 7 8 <?php settings_errors( 'replybox' ); ?> 7 9 8 10 <form method="POST" action="<?php echo esc_html(admin_url('admin-post.php')); ?>">
Note: See TracChangeset
for help on using the changeset viewer.