Receive push notifications for suspicious activity in Wordpress

Learn how to send real-time push notifications for suspicious activity on your WordPress site with Operational for improved security.

What is suspicious activity monitoring in Wordpress

Monitoring suspicious activity in WordPress helps you detect potential threats. It can alert you when someone tries multiple failed logins or unauthorized changes. For example, if a user fails to log in three times, you can get a push notification and investigate.

Tracking Suspicious Activity with Operational

Operational lets you track events from your WordPress site. You can send custom events for logins, file changes, or admin actions. The platform shows events in real time, helping you stay informed and secure.

Operational in action

Setting Up Operational

  1. Go to app.operational.co and sign up for a free account.
  2. In the dashboard, create a new project for your WordPress site.
  3. Copy your API key from the project settings.
  4. Install the Operational PHP SDK or use curl to send events.

Sending Suspicious Activity Events with PHP

<?php

$apiKey = 'YOUR_API_KEY';
$payload = [
  'name' => 'Suspicious login detected',
  'avatar' => '🚨',
  'content' => 'Multiple failed login attempts for user admin from IP 192.0.2.1'
];

$ch = curl_init('https://api.operational.co/events');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Content-Type: application/json',
  'Authorization: Bearer ' . $apiKey,
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;

This code sends a suspicious activity event to Operational. Replace YOUR_API_KEY with the key from your dashboard.

Conclusion

Sending push notifications for suspicious activity helps you act fast and keep your site safe. Operational removes manual setup and gives you a clear view of events. Learn more at https://operational.co Try the playground to test snippets: https://operational.co/playground