Sarvesh M Rao
Forum Replies Created
-
Forum: Reviews
In reply to: [WP Discord Invite] Not working@pnv28 Any updates?
Forum: Reviews
In reply to: [WP Discord Invite] Not working@pnv28 what is not working and what is the problem that you are facing? Explain a bit so that I can help you.
Forum: Plugins
In reply to: [WP Discord Invite] You Are Not Allowed To Access This PageHey, @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
Forum: Developing with WordPress
In reply to: How to convert this curl request to wp_remote_post()?@bcworkz thank you so much it works perfectly.
Forum: Developing with WordPress
In reply to: How to convert this curl request to wp_remote_post()?@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
Forum: Developing with WordPress
In reply to: Using Custom IDP with WordPress@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()
andadd_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 withadd_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.!!!