webhook_title = esc_html__( 'Review Broken Link Checker plugin', 'broken-link-checker' ); } /** * Executes the webhook action(s). * * @param $wp * * @return void */ public function webhook_action( &$wp ) { $this->settings = Settings::instance()->get(); $token = $_GET['token'] ?? null; if ( empty( $token ) ) { wp_die( esc_html__( 'It seems there is some missing input', 'broken-link-checker' ), esc_html__( 'Invalid action', 'broken-link-checker' ) ); } $this->user_recipient = Recipients::get_recipient_by_key( $token ); if ( empty( $this->user_recipient ) || empty( $this->user_recipient['user_id'] ) ) { wp_die( esc_html__( 'No user found for given input data.', 'broken-link-checker' ), esc_html__( 'Invalid action', 'broken-link-checker' ) ); } Recipients::flag_recipient_reviewed( $this->user_recipient['user_id'] ); wp_redirect( 'https://wordpress.org/support/plugin/broken-link-checker/reviews/#new-post' ); } }