Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Sarvesh M Rao

    (@sarveshmrao)

    @pnv28 Any updates?

    Plugin Author Sarvesh M Rao

    (@sarveshmrao)

    @pnv28 what is not working and what is the problem that you are facing? Explain a bit so that I can help you.

    Plugin Author Sarvesh M Rao

    (@sarveshmrao)

    Hey, @manek43509 sorry for the late reply.

    Thanks for reporting the issue.

    It has been fixed in the latest release.

    Please update your plugin.

    If you enjoy using this plugin please leave a review here. That would motivate me a lot.

    Thanks for using this plugin.

    Sarvesh M Rao
    https://sarveshmrao.in

    • This reply was modified 3 years, 6 months ago by Sarvesh M Rao. Reason: added blockquote
    Thread Starter Sarvesh M Rao

    (@sarveshmrao)

    @bcworkz thank you so much it works perfectly.

    Thread Starter Sarvesh M Rao

    (@sarveshmrao)

    @diddledan thanks for your reply.!

    
    function discordmsg($site, $errorcode, $desc, $webhook, $name){
        $msg = json_decode('
    {   
    "content": "Monitoring update, read more in the embed below! If you believe a false alarm has been triggered or something has gone wrong, email us ", 
    "embeds": [ 
    { 
    "title": "Uptime Alert", 
    "description": "Your site '.$site.' ('.$name.') is down, Expected response 200/302, Got response '.$errorcode.' (Which means '.$desc.')",
    "color": 16711680, 
    "footer": { 
    	"text": "This was given by the automatic monitoring system provided by example" 
    	} 
    } 
    ], 
    "username": "Monitoring Update" } ', true);
    
        if($webhook != "") {
            $response =wp_remote_post( $webhook, array( 'payload_json' => json_encode( $msg ) ) );
    
    if ( is_wp_error( $response ) ) {
        $errorResponse = $response->get_error_message();
        );
    } else {
        echo 'Response:<pre>';
        print_r( $response );
        echo '</pre>';
    }}}
    
    discordmsg('test site', '404', 'teset it desc', 'https://discord.com/api/webhooks/xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'test name')
    

    What response I’m getting is

    
        [body] => {"message": "Cannot send an empty message", "code": 50006}
        [response] => Array
            (
                [code] => 400
                [message] => Bad Request
            )
    
    • This reply was modified 3 years, 10 months ago by Sarvesh M Rao. Reason: Removed a snippet of code which is not needed here
    Thread Starter Sarvesh M Rao

    (@sarveshmrao)

    @joyously and @bcworkz thanks for your reply.

    What I mean by IDP is Identity Provider

    What I need is when the user goes to wp-login.php the user must be redirected. That is customising the wp-login with some code. (Maybe PHP or JS). But which hook to use?

    Then the IDP sends the user to the callback URL. I was able to create a callback URL WITH create_custom_page() and add_filter().

    Then the script should check if the user exists in the DB (for that I guess get_user_by() will work) when the user does not exist it’ll add a new user (maybe with add_user(). If the user exists it must log in the user. (This is the part where I’m not able to find any hook). If you can help me with this then that would be great.!!!

Viewing 6 replies - 1 through 6 (of 6 total)