expresstechsoftware / connect-memberpress-discord-add-on

This add-on enables connecting your MemberPress enabled website to your discord server. Now you can add/remove MemberPress members directly to your discord server roles, assign roles according to your member levels, unassign roles when they expire, change role when they change membership.
GNU General Public License v2.0
4 stars 1 forks source link

Wrong place of code #80

Closed ravisoni6262 closed 2 years ago

ravisoni6262 commented 2 years ago

This code is written inside Public class, which is wrong place to put this code.

`if ( isset( $_GET['action'] ) && 'discord-connectToBot' === $_GET['action'] ) { $params = array( 'client_id' => sanitize_text_field( trim( get_option( 'ets_memberpress_discord_client_id' ) ) ), 'permissions' => MEMBERPRESS_DISCORD_BOT_PERMISSIONS, 'scope' => 'bot', 'guild_id' => sanitize_text_field( trim( get_option( 'ets_memberpress_discord_server_id' ) ) ), ); $discord_authorise_api_url = MEMBERPRESS_DISCORD_API_URL . 'oauth2/authorize?' . http_build_query( $params );

            wp_redirect( $discord_authorise_api_url, 302, get_site_url() );
            exit;
        }`