Plugin Directory

Changeset 3007221


Ignore:
Timestamp:
12/08/2023 11:08:40 AM (2 years ago)
Author:
jamesckemp
Message:

Update to version 1.2.0 from GitHub

Location:
replybox
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • replybox/tags/1.2.0/readme.txt

    r2844475 r3007221  
    33Tags: comment, comments
    44Requires at least: 4.7
    5 Tested up to: 6.1.1
     5Tested up to: 6.4.2
    66Requires PHP: 7.0
    7 Stable tag: 1.1.2
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     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
    7782= 1.1.2 =
    7883* Support for WordPress Twenty Twenty Three and Block Themes
  • replybox/tags/1.2.0/replybox.php

    r2844475 r3007221  
    33 * Plugin Name: ReplyBox — Better WordPress Comments
    44 * Description: A simple, honest comment system which works everywhere. No ads, no dodgy affiliate links, no fluff.
    5  * Version: 1.1.2
     5 * Version: 1.2.0
    66 * Author: ReplyBox
    77 * Author URI: https://getreplybox.com
     
    7373        add_filter( 'comment_row_actions', array( $this, 'comments_row_actions' ) );
    7474        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
    7578
    7679        register_activation_hook( __FILE__, array( $this, 'activate' ) );
     
    159162     */
    160163    public function show_admin_page() {
     164        if ( ! empty( $_GET['settings-updated'] ) ) {
     165            add_settings_error( 'replybox', 'settings-updated', __( 'Settings saved.', 'replybox' ), 'updated' );
     166        }
     167
    161168        require_once plugin_dir_path( __FILE__ ) . 'views/admin-page.php';
    162169    }
     
    179186
    180187        $url = sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) );
     188        $url = add_query_arg( 'settings-updated', 'true', $url );
    181189
    182190        wp_safe_redirect( urldecode( $url ) );
     
    629637
    630638    /**
     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    /**
    631704     * Protected constructor to prevent creating a new instance of the
    632705     * class via the `new` operator from outside of this class.
  • replybox/tags/1.2.0/views/admin-page.php

    r2451514 r3007221  
    55<div class="wrap">
    66    <h1><?php _e('ReplyBox', 'replybox'); ?></h1>
     7
     8    <?php settings_errors( 'replybox' ); ?>
    79
    810    <form method="POST" action="<?php echo esc_html(admin_url('admin-post.php')); ?>">
  • replybox/trunk/readme.txt

    r2844475 r3007221  
    33Tags: comment, comments
    44Requires at least: 4.7
    5 Tested up to: 6.1.1
     5Tested up to: 6.4.2
    66Requires PHP: 7.0
    7 Stable tag: 1.1.2
     7Stable tag: 1.2.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7575== Changelog ==
    7676
     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
    7782= 1.1.2 =
    7883* Support for WordPress Twenty Twenty Three and Block Themes
  • replybox/trunk/replybox.php

    r2844475 r3007221  
    33 * Plugin Name: ReplyBox — Better WordPress Comments
    44 * Description: A simple, honest comment system which works everywhere. No ads, no dodgy affiliate links, no fluff.
    5  * Version: 1.1.2
     5 * Version: 1.2.0
    66 * Author: ReplyBox
    77 * Author URI: https://getreplybox.com
     
    7373        add_filter( 'comment_row_actions', array( $this, 'comments_row_actions' ) );
    7474        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
    7578
    7679        register_activation_hook( __FILE__, array( $this, 'activate' ) );
     
    159162     */
    160163    public function show_admin_page() {
     164        if ( ! empty( $_GET['settings-updated'] ) ) {
     165            add_settings_error( 'replybox', 'settings-updated', __( 'Settings saved.', 'replybox' ), 'updated' );
     166        }
     167
    161168        require_once plugin_dir_path( __FILE__ ) . 'views/admin-page.php';
    162169    }
     
    179186
    180187        $url = sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) );
     188        $url = add_query_arg( 'settings-updated', 'true', $url );
    181189
    182190        wp_safe_redirect( urldecode( $url ) );
     
    629637
    630638    /**
     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    /**
    631704     * Protected constructor to prevent creating a new instance of the
    632705     * class via the `new` operator from outside of this class.
  • replybox/trunk/views/admin-page.php

    r2451514 r3007221  
    55<div class="wrap">
    66    <h1><?php _e('ReplyBox', 'replybox'); ?></h1>
     7
     8    <?php settings_errors( 'replybox' ); ?>
    79
    810    <form method="POST" action="<?php echo esc_html(admin_url('admin-post.php')); ?>">
Note: See TracChangeset for help on using the changeset viewer.