Ileti Merkezi SMS 2FA
wordpress ileti merkezi sms eklentisi
by IntegrumArt · github.com/integrumart/wordpressiletimerkezisms · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/integrumart/wordpressiletimerkezisms/archive/refs/heads/main.zipWordPress Ileti Merkezi SMS 2FA Plugin
WordPress SMS plugin integrated with Ileti Merkezi API featuring Two-Factor Authentication (2FA) for login security.
Features
- SMS Integration: Send SMS messages using Ileti Merkezi API
- Two-Factor Authentication: Add an extra layer of security to WordPress login with SMS-based OTP verification
- Admin Settings Page: Easy configuration of API credentials and OTP settings
- User Profile Integration: Users can add their phone numbers directly in their profile
- Security Features:
- Nonce verification
- Input sanitization
- Rate limiting with maximum attempt limits
- OTP expiration
- Secure session handling
Installation
- Download the plugin files
- Upload to
/wp-content/plugins/ileti-merkezi-sms/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Configure your Ileti Merkezi API credentials in Settings → SMS 2FA
Configuration
Step 1: Configure API Credentials
- Go to Settings → SMS 2FA in WordPress admin
- Enter your Ileti Merkezi API credentials:
- API Username
- API Password
- Sender Title (the name that appears as SMS sender)
- Click Save Settings
Step 2: Configure OTP Settings
Configure the One-Time Password settings:
- OTP Length: Number of digits in verification code (4-8, default: 6)
- OTP Expiry: How long the code is valid in minutes (1-60, default: 5)
- Maximum Verification Attempts: How many times a user can try to verify (1-10, default: 3)
Step 3: Test Your Configuration
- Enter a test phone number with country code (e.g., 905xxxxxxxxx)
- Click Send Test SMS
- Verify you receive the SMS
Step 4: Enable 2FA for Users
For each user who should have 2FA:
- Go to Users → All Users
- Edit the user profile
- Scroll to SMS Two-Factor Authentication section
- Enter phone number with country code (e.g., 905xxxxxxxxx)
- Click Update Profile
Usage
Once configured and a user has a phone number set:
- User enters username and password on login page
- If credentials are correct, an SMS with a 6-digit code is sent
- User enters the verification code on the login page
- After successful verification, user is logged in
Requirements
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Ileti Merkezi API account
- User phone numbers in international format
Security Features
- Nonce Protection: All forms use WordPress nonces
- Input Sanitization: All user inputs are sanitized
- OTP Expiration: Codes expire after configured time
- Attempt Limiting: Maximum verification attempts to prevent brute force
- Session Security: Secure session handling for pending verifications
- Database Cleanup: Automatic cleanup of expired OTPs
Plugin Structure
ileti-merkezi-sms/
├── ileti-merkezi-sms.php # Main plugin file
├── admin/
│ └── class-admin-settings.php # Admin settings page
├── includes/
│ ├── class-ileti-merkezi-api.php # API integration
│ ├── class-otp-manager.php # OTP generation and verification
│ └── class-login-handler.php # Login process interception
├── assets/
│ ├── css/
│ │ ├── admin.css # Admin page styles
│ │ └── login.css # Login page styles
└── README.md
API Integration
The plugin uses Ileti Merkezi SMS API v1 with XML requests. The API class handles:
- XML request building
- HTTP communication
- Response parsing
- Error handling
- Phone number formatting (Turkish numbers)
Database Schema
The plugin creates a table wp_imsms_otp with the following structure:
id: Primary keyuser_id: WordPress user IDotp_code: Generated verification codephone_number: User's phone numbercreated_at: When OTP was createdexpires_at: When OTP expiresverified: Verification statusattempts: Number of verification attempts
Troubleshooting
SMS Not Sending
- Verify API credentials are correct
- Check Ileti Merkezi account has sufficient credits
- Verify sender title is approved
- Check phone number format (should start with country code)
User Can't Login
- Verify user has phone number in profile
- Check OTP hasn't expired
- Ensure user hasn't exceeded max attempts
- Check WordPress error log for details
Test SMS Fails
- Verify all API credentials are entered correctly
- Check phone number includes country code (90 for Turkey)
- Verify Ileti Merkezi account is active
Support
For issues and questions:
- GitHub: https://github.com/integrumart/wordpressiletimerkeziSMS
- Check WordPress debug log when WP_DEBUG is enabled
License
GPL v2 or later
Changelog
1.0.0
- Initial release
- Ileti Merkezi API integration
- Two-factor authentication with SMS
- Admin settings page
- User profile phone number field
- OTP generation and verification
- Security features and error handling