Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode( 'my-like-tools', 'my_like_tools' );
- function my_like_tools() {
- // Database connection details
- $host = 'localhost';
- $dbname = 'jnews_support_db';
- $username = 'root';
- $password = 'root';
- // Keep existing API configuration
- $API_KEYS = array(
- 'ind' => '153987',
- 'bd' => '153987',
- 'ru' => '153987',
- 'eu' => '153987',
- 'id' => '153987',
- 'mea' => '153987',
- 'pk' => '153987',
- 'sg' => '153987',
- 'th' => '153987',
- 'tw' => '153987',
- 'vn' => '153987',
- 'na' => '153987',
- 'br' => '153987',
- 'sac' => '153987',
- );
- define( 'API_BASE_URL', 'https://freefireinfolikesender.onrender.com/' );
- define( 'CLOUDFLARE_SECRET_KEY', '0x4AAAAAABAe_HDnLtGYzIW6tT-OBHlO4l4' );
- // Add profile API constant
- define( 'PROFILE_API_URL', 'https://freefireinfoxsmartclownprofileinfo.vercel.app/api' );
- // Whitelist IP addresses
- $WHITELIST_IPS = array(
- '2401:4900:7073:fbb9:82f6:33b3:e1a0:1110',
- '110.224.96.153',
- );
- $error = null;
- $result = null;
- $uid = '';
- $region = '';
- // Define absolute paths for log files
- $logDir = __DIR__;
- $ipLogFile = $logDir . '/ip_log.json';
- $countingLogFile = $logDir . '/counting_log.json';
- $historyLogFile = $logDir . '/history_log.json';
- // Database connection
- try {
- $pdo = new PDO( "mysql:host=$host;dbname=$dbname", $username, $password );
- $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- } catch ( PDOException $e ) {
- die( 'Database connection failed: ' . $e->getMessage() );
- }
- // Handle Form Submission
- if ( $_SERVER['REQUEST_METHOD'] === 'POST' ) {
- // Check if it's a redirect request from success/error popup
- if ( isset( $_POST['redirect'] ) ) {
- // Just redirect to the main page without showing error
- wp_redirect( get_permalink() );
- exit;
- }
- $token = $_POST['cf-turnstile-response'] ?? '';
- if ( empty( $token ) || ! verifyTurnstileToken( $token ) ) {
- $error = 'Human verification failed. Please try again.';
- } else {
- $uid = htmlspecialchars( $_POST['uid'] ?? '' );
- $userIP = getUserIP();
- if ( empty( $uid ) ) {
- $error = 'UID is required.';
- } else {
- $limitCheck = checkIPAndUIDLimit( $userIP, $uid );
- if ( ! $limitCheck['status'] ) {
- $error = $limitCheck['message'];
- } else {
- // Try to determine region
- $detectedRegion = tryRegions( $uid );
- if ( $detectedRegion === false ) {
- $error = 'Could not determine the correct region for this UID.';
- } else {
- $apiKey = $API_KEYS[ $detectedRegion ];
- $apiUrl = sprintf( '%s/%s/%s/%s', API_BASE_URL, $uid, $detectedRegion, $apiKey );
- $response = @file_get_contents( $apiUrl );
- if ( $response === false ) {
- $error = 'Failed to connect to the API.';
- } else {
- $result = json_decode( $response, true );
- // FIXED: Only increment region counter when likes are actually sent
- if ( isset( $result['status'] ) ) {
- incrementRegionCounter( $detectedRegion, $result['status'] );
- }
- if ( isset( $result['status'] ) && $result['status'] === 1 ) {
- // Log successful request (likes were actually sent)
- logSuccessfulRequest( $userIP, $uid );
- } else {
- // Log failed request (valid UID but likes were not sent)
- logFailedRequest( $userIP, $uid );
- }
- logApiResponse( $result );
- $_SESSION['last_submission'] = $result;
- wp_redirect( add_query_arg( 'success', '1', get_permalink() ) );
- exit;
- }
- }
- }
- }
- }
- }
- if ( isset( $_SESSION['last_submission'] ) && isset( $_GET['success'] ) ) {
- $result = $_SESSION['last_submission'];
- unset( $_SESSION['last_submission'] );
- }
- ?>
- <div class="my-like-tools">
- <h1 style="font-size: 20px;">Claim 100 Likes Via UID For Free</h1>
- <img src="https://freefireinfo.in/wp-content/uploads/2024/12/Claim-100-Likes-Via-UID-For-Free-1024x576.jpg" alt="Claim 100 Likes Via UID For Free" style="width: 100%; height: auto; margin-bottom: 15px;">
- <div class="like-sender-app">
- <span style="font-size: 18px;">In Game, likes show how cool and skilled a player is. If someone has lots of likes, it means others think they play really well. It also makes their profile look more popular and respected. Getting more likes can help you stand out and feel proud of your game skills!</span>
- <span style="font-size: 18px;">Before, players could get likes in Game through craftland maps. But now, all those official ways are closed.</span>
- <span style="font-size: 18px;">That's why I made this tool to give free likes, just like people wanted. You don't need any hack or appβjust the player's UID!</span>
- <h2><span style="font-size: 20px;">Steps to Get Free Likes:</span></h2>
- <ol>
- <li><span style="font-size: 18px;">Type your Game UID in the box.</span></li>
- <li><span style="font-size: 18px;">Click the "Claim" button.</span></li>
- <li><span style="font-size: 18px;">The system will send likes to your UID.</span></li>
- <li><span style="font-size: 18px;">Check the status under the status field below the input box.</span></li>
- </ol>
- <span style="font-size: 18px;">There are a few limitations to claim likes. It works on a first-come, first-served basis, so only the early users at the start of the day can get likes.</span>
- <h2><span style="font-size: 20px;">Important Notes:</span></h2>
- <span style="font-size: 18px;">A UID can receive only 100 likes in 24 hours. After claiming likes from this tool, the player cannot get any more likes from the game or this tool until the 24-hour limit resets. Even if teammates or profile visitors try to send likes in the game, those likes will not be added to the account. This rule is set by game officials.</span>
- <span style="font-size: 18px;">This tool is a simple and safe way to get free likes for your Game account. It works quickly and follows all the game rules without any risk of bans. Start using it today to make your profile stand out and look more popular!</span>
- <form method="POST" id="likeForm">
- <div class="form-group">
- <label for="uid">Enter UID:</label>
- <input type="text" name="uid" id="uid" value="<?php echo htmlspecialchars( $uid ); ?>" required
- placeholder="Enter your UID">
- </div>
- <!-- Cloudflare Turnstile widget -->
- <div class="cf-turnstile" data-sitekey="0x4AAAAAABAe_Da-31Q7nqIm"></div>
- <button type="submit">Claim Free Likes</button>
- </form>
- <div id="loading" class="loading">
- Trying to send likes...
- </div>
- <?php if ( isset( $_GET['success'] ) && $_GET['success'] == 1 && $result ) : ?>
- <div class="popup-overlay">
- <div class="popup-box">
- <h3 class="<?php echo ( isset( $result['status'] ) && $result['status'] === 1 ) ? 'success' : 'error'; ?>">
- <?php echo ( isset( $result['status'] ) && $result['status'] === 1 ) ? 'Success!' : 'Notification'; ?>
- </h3>
- <p>
- <?php
- if ( isset( $result['status'] ) && $result['status'] === 1 ) {
- echo '<p>Booyah! ' . htmlspecialchars( $result['PlayerNickname'] ) . ', You have successfully claimed ' . htmlspecialchars( $result['LikesGivenByAPI'] ) . ' likes!</p>' .
- "<p>Player's Nickname: " . htmlspecialchars( $result['PlayerNickname'] ) . '</p>' .
- "<p>Player's Uid: " . htmlspecialchars( $result['UID'] ) . '</p>' .
- '<p>Likes before Sent: ' . htmlspecialchars( $result['LikesbeforeCommand'] ) . '</p>' .
- '<p>Likes after Sent: ' . htmlspecialchars( $result['LikesafterCommand'] ) . '</p>' .
- '<p>Likes Given: ' . htmlspecialchars( $result['LikesGivenByAPI'] ) . '</p>' .
- '<p>Please come back after 24 hours to claim your free like again.</p>';
- } else {
- echo '<p>Oops! ' . htmlspecialchars( $result['PlayerNickname'] ) . ', ' .
- ( $result['status'] === 2 ?
- "you've received 100 likes in last 24 hours. Please try again later." :
- "Dear user, the system can't send likes because all available likes have already been claimed by other users. Since this service operates on a first-come, first-served basis, please come back tomorrow to claim your free likes." ) .
- '</p>';
- }
- ?>
- </p>
- <a href="<?php echo esc_url( get_permalink() ); ?>">
- <button class="popup-button <?php echo ( isset( $result['status'] ) && $result['status'] === 1 ) ? 'success' : 'error'; ?>">OK</button>
- </a>
- </div>
- </div>
- <?php elseif ( $error ) : ?>
- <div class="popup-overlay">
- <div class="popup-box">
- <h3 class="error">Notification</h3>
- <p><?php echo $error; ?></p>
- <a href="<?php echo esc_url( get_permalink() ); ?>">
- <button class="popup-button error">OK</button>
- </a>
- </div>
- </div>
- <?php endif; ?>
- <div class="navigation">
- <a href="https://tools.freefireinfo.in/history.php">Check History β</a>
- </div>
- </div>
- <span style="font-size: 18px;">This tool is a simple and safe way to get free likes for your Game account. It works quickly and follows all the game rules without any risk of bans. Start using it today to make your profile stand out and look more popular!</span>
- </div>
- <style>
- /* Keep existing CSS exactly the same */
- :root {
- --primary-color: #3498db;
- --secondary-color: #2c3e50;
- --success-color: #2ecc71;
- --error-color: #e74c3c;
- --bg-color: #FFFFFF;
- --border-radius: 8px;
- }
- .like-sender-app {
- font-family: 'Poppins', sans-serif;
- max-width: 100%;
- margin: 0 auto;
- padding: 20px;
- background-color: var(--bg-color);
- color: var(--secondary-color);
- }
- h1 {
- text-align: center;
- color: var(--secondary-color);
- margin-bottom: 30px;
- font-size: 2em;
- text-transform: uppercase;
- letter-spacing: 1px;
- }
- .form-group {
- margin-bottom: 20px;
- }
- label {
- display: block;
- margin-bottom: 8px;
- font-weight: 600;
- color: var(--secondary-color);
- }
- input, select {
- width: 100%;
- padding: 12px;
- border: 2px solid #ddd;
- border-radius: var(--border-radius);
- font-size: 16px;
- transition: all 0.3s ease;
- background-color: white;
- box-sizing: border-box;
- height: 45px;
- }
- input:focus, select:focus {
- border-color: var(--primary-color);
- outline: none;
- box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
- }
- button {
- width: 100%;
- padding: 12px;
- background-color: var(--primary-color);
- color: white;
- border: none;
- border-radius: var(--border-radius);
- font-size: 16px;
- cursor: pointer;
- transition: all 0.3s ease;
- text-transform: uppercase;
- letter-spacing: 1px;
- font-weight: 600;
- height: 45px;
- }
- button:hover {
- background-color: #2980b9;
- transform: translateY(-1px);
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
- }
- button:active {
- transform: translateY(0);
- box-shadow: none;
- }
- .loading {
- display: none;
- text-align: center;
- margin-top: 20px;
- }
- .loading.active {
- display: block;
- }
- @keyframes slideIn {
- from {
- transform: translateY(-20px);
- opacity: 0;
- }
- to {
- transform: translateY(0);
- opacity: 1;
- }
- }
- select {
- appearance: none;
- background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
- background-repeat: no-repeat;
- background-position: right 1rem center;
- background-size: 1em;
- padding-right: 2.5rem;
- }
- .cf-turnstile {
- margin: 20px 0;
- display: flex;
- justify-content: center;
- }
- /* Updated popup styles */
- .popup-overlay {
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.5);
- display: flex;
- justify-content: center;
- align-items: center;
- z-index: 1000;
- backdrop-filter: blur(8px);
- -webkit-backdrop-filter: blur(8px);
- }
- .popup-box {
- background: white;
- padding: 25px;
- border-radius: 10px;
- width: 280px;
- max-width: 85%;
- box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
- text-align: center;
- animation: popIn 0.3s ease-out;
- }
- @keyframes popIn {
- from {
- transform: scale(0.8);
- opacity: 0;
- }
- to {
- transform: scale(1);
- opacity: 1;
- }
- }
- .popup-box h3 {
- margin-top: 0;
- }
- .popup-box h3.success {
- color: var(--success-color);
- }
- .popup-box h3.error {
- color: var(--error-color);
- }
- .popup-box p {
- margin-bottom: 20px;
- line-height: 1.5;
- }
- .popup-button {
- width: 120px;
- margin: 0 auto;
- }
- .popup-button.success {
- background-color: var(--success-color);
- }
- .popup-button.success:hover {
- background-color: #27ae60;
- }
- .popup-button.error {
- background-color: var(--error-color);
- }
- .popup-button.error:hover {
- background-color: #c0392b;
- }
- .navigation {
- margin-top: 20px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .navigation a {
- text-decoration: none;
- color: #3498db;
- font-weight: 600;
- }
- .navigation a:hover {
- text-decoration: underline;
- }
- </style>
- <script>
- document.getElementById('likeForm').addEventListener('submit', function() {
- document.getElementById('loading').classList.add('active');
- });
- // Add the Cloudflare Turnstile script to the page
- // This script loads the Cloudflare Turnstile widget
- (function() {
- // Add the script to the page
- const script = document.createElement('script');
- script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
- script.async = true;
- script.defer = true;
- document.head.appendChild(script);
- })();
- </script>
- <?php
- }
- // Add new function to verify region
- function verifyRegion( $uid, $region ) {
- $apiUrl = PROFILE_API_URL . "?uid={$uid}®ion={$region}&key=1542045198";
- $response = @file_get_contents( $apiUrl );
- if ( $response === false ) {
- return false;
- }
- $data = json_decode( $response, true );
- return isset( $data['AccountInfo'] );
- }
- // Add new function to try regions
- function tryRegions( $uid ) {
- // Define regions to try in order
- $regionsToTry = array( 'sg', 'ind', 'na' );
- foreach ( $regionsToTry as $region ) {
- if ( verifyRegion( $uid, $region ) ) {
- return $region;
- }
- }
- return false;
- }
- // Keep all existing functions
- function verifyTurnstileToken( $token ) {
- $data = array(
- 'secret' => CLOUDFLARE_SECRET_KEY,
- 'response' => $token,
- 'remoteip' => $_SERVER['REMOTE_ADDR'],
- );
- $ch = curl_init( 'https://challenges.cloudflare.com/turnstile/v0/siteverify' );
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
- curl_setopt( $ch, CURLOPT_POST, true );
- curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) );
- $response = curl_exec( $ch );
- curl_close( $ch );
- $result = json_decode( $response, true );
- return isset( $result['success'] ) && $result['success'] === true;
- }
- function getUserIP() {
- if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
- return $_SERVER['HTTP_CLIENT_IP'];
- } elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
- return $_SERVER['HTTP_X_FORWARDED_FOR'];
- } else {
- return $_SERVER['REMOTE_ADDR'];
- }
- }
- function checkIPAndUIDLimit( $ip, $uid ) {
- global $WHITELIST_IPS, $ipLogFile;
- // Check if IP is in the whitelist
- if ( in_array( $ip, $WHITELIST_IPS ) ) {
- return array( 'status' => true ); // Whitelisted IPs have no limits
- }
- $currentTime = time();
- date_default_timezone_set( 'Asia/Kolkata' );
- $todayReset = strtotime( 'today 4:00' );
- $nextReset = $todayReset;
- if ( $currentTime > $todayReset ) {
- $nextReset = strtotime( 'tomorrow 4:00' );
- }
- $ipLog = array();
- if ( file_exists( $ipLogFile ) ) {
- $ipLog = json_decode( file_get_contents( $ipLogFile ), true ) ?? array();
- if ( $currentTime > $todayReset && isset( $ipLog['last_reset'] ) && $ipLog['last_reset'] < $todayReset ) {
- $ipLog = array(
- 'last_reset' => $currentTime,
- 'ips' => array(),
- 'uids' => array(),
- );
- }
- }
- if ( ! isset( $ipLog['ips'][ $ip ] ) ) {
- $ipLog['ips'][ $ip ] = array(
- 'count' => 0,
- 'timestamp' => array(),
- 'uids' => array(),
- );
- }
- if ( ! isset( $ipLog['uids'] ) ) {
- $ipLog['uids'] = array();
- }
- // FIXED: Check UID limit - if UID was used today, block regardless of likes sent status
- if ( isset( $ipLog['uids'][ $uid ] ) ) {
- $uidData = $ipLog['uids'][ $uid ];
- if ( $uidData['timestamp'] >= $todayReset ) {
- // Log this attempt
- if ( ! isset( $ipLog['blocked_attempts'] ) ) {
- $ipLog['blocked_attempts'] = array();
- }
- $ipLog['blocked_attempts'][] = array(
- 'uid' => $uid,
- 'ip' => $ip,
- 'original_ip' => $uidData['ip'],
- 'timestamp' => $currentTime,
- );
- file_put_contents( $ipLogFile, json_encode( $ipLog, JSON_PRETTY_PRINT ) );
- // Block the attempt regardless of whether likes were sent or not
- return array(
- 'status' => false,
- 'message' => 'This account (UID: ' . $uid . ') already attempted to receive likes today. Please wait 24 hours from the last claim.',
- );
- }
- }
- // Then check IP limit
- if ( $ipLog['ips'][ $ip ]['count'] >= 2 ) {
- return array(
- 'status' => false,
- 'message' => "System detected you've claimed free likes two times today. Come back tomorrow after 4 AM IST to claim free likes again.",
- );
- }
- return array( 'status' => true );
- }
- function logSuccessfulRequest( $ip, $uid ) {
- global $ipLogFile;
- $currentTime = time();
- $ipLog = array();
- if ( file_exists( $ipLogFile ) ) {
- $ipLog = json_decode( file_get_contents( $ipLogFile ), true ) ?? array();
- }
- if ( ! isset( $ipLog['ips'] ) ) {
- $ipLog['ips'] = array();
- }
- if ( ! isset( $ipLog['uids'] ) ) {
- $ipLog['uids'] = array();
- }
- if ( ! isset( $ipLog['ips'][ $ip ] ) ) {
- $ipLog['ips'][ $ip ] = array(
- 'count' => 0,
- 'timestamp' => array(),
- 'uids' => array(),
- );
- }
- ++$ipLog['ips'][ $ip ]['count'];
- $ipLog['ips'][ $ip ]['timestamp'][] = $currentTime;
- $ipLog['ips'][ $ip ]['uids'][] = $uid;
- $ipLog['uids'][ $uid ] = array(
- 'timestamp' => $currentTime,
- 'ip' => $ip,
- 'likes_sent' => true,
- );
- file_put_contents( $ipLogFile, json_encode( $ipLog, JSON_PRETTY_PRINT ) );
- }
- // New function to log UID attempts where likes were not sent
- function logFailedRequest( $ip, $uid ) {
- global $ipLogFile;
- $currentTime = time();
- $ipLog = array();
- if ( file_exists( $ipLogFile ) ) {
- $ipLog = json_decode( file_get_contents( $ipLogFile ), true ) ?? array();
- }
- if ( ! isset( $ipLog['uids'] ) ) {
- $ipLog['uids'] = array();
- }
- // Log only the UID, not counting against IP limit
- $ipLog['uids'][ $uid ] = array(
- 'timestamp' => $currentTime,
- 'ip' => $ip,
- 'likes_sent' => false,
- );
- file_put_contents( $ipLogFile, json_encode( $ipLog, JSON_PRETTY_PRINT ) );
- }
- function logApiResponse( $response ) {
- global $historyLogFile;
- date_default_timezone_set( 'Asia/Kolkata' );
- $logEntry = array(
- 'timestamp' => date( 'Y-m-d h:i:s A (T)' ),
- 'nickname' => $response['PlayerNickname'],
- 'uid' => $response['UID'],
- 'likes_given' => $response['LikesGivenByAPI'],
- 'likes_before' => $response['LikesbeforeCommand'],
- 'likes_after' => $response['LikesafterCommand'],
- );
- $existingLog = array();
- if ( file_exists( $historyLogFile ) ) {
- $existingLog = json_decode( file_get_contents( $historyLogFile ), true ) ?? array();
- }
- $existingLog[] = $logEntry;
- file_put_contents( $historyLogFile, json_encode( $existingLog, JSON_PRETTY_PRINT ) );
- }
- // FIXED: Completely rewritten function to independently check and reset counting_log.json at 4:00 AM IST
- function checkAndResetCountingLog() {
- global $countingLogFile;
- // Set timezone to IST
- date_default_timezone_set( 'Asia/Kolkata' );
- // Default structure
- $defaultCounters = array(
- 'IND_TOKEN' => 0,
- 'USA_TOKEN' => 0,
- 'SEA_TOKEN' => 0,
- 'last_reset' => 0,
- );
- // Current time and today's reset time (4:00 AM)
- $currentTime = time();
- $todayReset = strtotime( 'today 4:00' );
- // If file doesn't exist, create it with defaults
- if ( ! file_exists( $countingLogFile ) ) {
- file_put_contents( $countingLogFile, json_encode( $defaultCounters, JSON_PRETTY_PRINT ) );
- return $defaultCounters;
- }
- // Read current counting log
- $countingLog = json_decode( file_get_contents( $countingLogFile ), true ) ?? $defaultCounters;
- // Ensure last_reset exists
- if ( ! isset( $countingLog['last_reset'] ) ) {
- $countingLog['last_reset'] = 0;
- }
- // Check if we need to reset (current time is after 4:00 AM and last reset was before 4:00 AM today)
- if ( $currentTime > $todayReset && $countingLog['last_reset'] < $todayReset ) {
- // Reset counters but keep the format
- $countingLog = array(
- 'IND_TOKEN' => 0,
- 'USA_TOKEN' => 0,
- 'SEA_TOKEN' => 0,
- 'last_reset' => $currentTime,
- );
- // Save the reset log
- file_put_contents( $countingLogFile, json_encode( $countingLog, JSON_PRETTY_PRINT ) );
- }
- return $countingLog;
- }
- // FIXED: Function to increment region counter with independent reset check
- function incrementRegionCounter( $region, $apiStatus ) {
- global $countingLogFile;
- // Only increment counter if status is 1 (successful likes sent)
- if ( $apiStatus !== 1 ) {
- return; // Don't increment if likes weren't sent
- }
- // First check and reset if needed
- $countingLog = checkAndResetCountingLog();
- // Map the region code to the token name
- $tokenMap = array(
- 'ind' => 'IND_TOKEN',
- 'na' => 'USA_TOKEN',
- 'sg' => 'SEA_TOKEN',
- );
- // Increment the appropriate counter if the region is in our map
- if ( isset( $tokenMap[ $region ] ) ) {
- $tokenName = $tokenMap[ $region ];
- ++$countingLog[ $tokenName ];
- // Save the updated counters
- file_put_contents( $countingLogFile, json_encode( $countingLog, JSON_PRETTY_PRINT ) );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement