HWBD Weather Alert
Real-time weather monitoring for hamster safety with "Feels Like" temperature alerts.
by Tanvir Rana Rabbi · github.com/tararauzumaki/hwbd-weather-alert · website
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/tararauzumaki/hwbd-weather-alert/archive/refs/heads/main.zipReal-time weather monitoring for hamster safety with "Feels Like" temperature alerts
A WordPress plugin that monitors weather conditions across Bangladesh to prevent hamster heatstroke and hibernation risks. Displays live weather data with smart alerts based on humidity-adjusted "feels like" temperatures.
🎯 Features
🌡️ Temperature Monitoring
- Feels Like Temperature: Displays humidity-adjusted temperature (crucial for hamsters)
- Smart Alerts: Automatic warnings for hot (>28°C), cold (<18°C), or safe conditions
- Real-time Data: Powered by OpenWeatherMap API
🗺️ Bangladesh Coverage
Monitors all 8 major divisions:
- Dhaka
- Chittagong
- Sylhet
- Khulna
- Rajshahi
- Barishal
- Rangpur
- Mymensingh
🎨 Elementor Integration
- Custom Widget: Drag-and-drop weather widget for Elementor
- Full Customization:
- Individual color controls for all text elements
- Background color options
- Padding and spacing controls
- Border radius settings
- Responsive Design: Optimized for desktop, tablet, and mobile
- User Selection: Visitors can switch between divisions
🔒 Security & Performance
- Server-Side Proxy: API key never exposed to frontend
- Smart Caching: 1-hour transient cache per district
- API Optimization: Stays within 1,000 free API calls/day limit
- WordPress Standards: Follows WordPress coding standards and security best practices
📋 Admin Dashboard
- Easy configuration in Settings > HWBD Weather
- Customizable alert messages for each condition
- Secure API key storage
📋 Requirements
- WordPress: 5.8 or higher
- PHP: 7.4 or higher
- Elementor: Latest version (for widget functionality)
- OpenWeatherMap API Key: Get free API key
🚀 Installation
Method 1: Upload via WordPress Admin
- Download the plugin ZIP file
- Go to WordPress Admin → Plugins → Add New
- Click Upload Plugin
- Choose the ZIP file and click Install Now
- Click Activate
Method 2: Manual Installation
- Download and extract the plugin
- Upload the
hwbd-weather-alertfolder to/wp-content/plugins/ - Go to WordPress Admin → Plugins
- Find HWBD Weather Alert and click Activate
⚙️ Configuration
1. Get OpenWeatherMap API Key
- Visit OpenWeatherMap
- Sign up for a free account
- Generate your API key (free tier: 1,000 calls/day)
2. Configure Plugin Settings
- Go to WordPress Admin → Settings → HWBD Weather
- Enter your OpenWeatherMap API Key
- Customize alert messages (optional):
- Hot Weather Message (>28°C)
- Cold Weather Message (<18°C)
- Safe Range Message (18-28°C)
- Click Save Settings
3. Add Widget to Page
- Edit a page with Elementor
- Search for "HWBD Weather Alert" widget
- Drag it to your desired location
- Configure widget settings:
- Content Tab: Select default division
- Style Tab: Customize colors, padding, border radius
🎨 Customization Options
Style Controls (Elementor)
Text Colors:
- District Name Color
- Temperature Color
- Label Color
- Weather Details Color
- Alert Message Color
- Division Selector Color
Background:
- Background Color (default: transparent)
Spacing:
- Padding (all sides)
- Border Radius
🌡️ Temperature Thresholds
| Condition | Temperature Range | Alert Type |
|---|---|---|
| Hot 🔥 | Feels Like > 28°C | Heatstroke Risk |
| Safe ✅ | Feels Like 18-28°C | Comfortable Range |
| Cold ❄️ | Feels Like < 18°C | Hibernation Risk |
📁 File Structure
hwbd-weather-alert/
├── hwbd-weather-alert.php # Main plugin file
├── includes/
│ └── api-handler.php # REST API & caching logic
├── widgets/
│ └── weather-widget.php # Elementor widget class
├── assets/
│ ├── css/
│ │ └── style.css # Frontend styles
│ └── js/
│ └── script.js # Frontend logic
├── README.md # This file
└── LICENSE # GPL v2 license
🔧 Technical Details
REST API Endpoint
GET /wp-json/hwbd/v1/weather?district={name}
Parameters:
district(required): Division name (e.g., "Dhaka", "Chittagong")
Response:
{
"success": true,
"cached": false,
"data": {
"district": "Dhaka",
"feels_like": 32.5,
"temp": 30.2,
"humidity": 75,
"description": "scattered clouds",
"timestamp": "2025-12-26 10:30:00"
}
}
Caching Strategy
- Method: WordPress Transients API
- Duration: 1 hour per district
- Key Format:
hwbd_weather_{district} - Purpose: Optimize API usage and improve performance
🐛 Troubleshooting
Weather data not loading?
- Check API Key: Verify it's correctly entered in Settings
- Check API Quota: Ensure you haven't exceeded 1,000 calls/day
- Clear Cache: Delete transient:
delete_transient('hwbd_weather_Dhaka'); - Check Browser Console: Look for JavaScript errors
Division selector not working?
- Clear Browser Cache: Force refresh (Ctrl+F5 / Cmd+Shift+R)
- Check jQuery: Ensure jQuery is loaded
- Elementor Compatibility: Update Elementor to latest version
Styling issues?
- Theme Conflict: Check for CSS conflicts with your theme
- Elementor Cache: Clear Elementor cache (Elementor → Tools → Regenerate CSS)
- Custom CSS: Add custom CSS via Elementor's Custom CSS option
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
📝 Changelog
Version 1.0.0 (2025-12-26)
- Initial release
- Real-time weather monitoring for 8 Bangladesh divisions
- Elementor widget with full customization
- Smart caching system
- Security-first architecture
- Responsive design
- User-facing division selector
👨💻 Author
Tanvir Rana Rabbi
- Website: hwbd.org
- Organization: Hamster Welfare Bangladesh
📄 License
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
🙏 Acknowledgments
- OpenWeatherMap for providing free weather API
- Elementor for the widget framework
- WordPress community for excellent documentation
💖 Support
If you find this plugin helpful for your hamster care community, please consider:
- ⭐ Starring this repository
- 🐛 Reporting bugs and issues
- 💡 Suggesting new features
- 📢 Sharing with others
📧 Contact
For support, questions, or suggestions:
- Website: hwbd.org
- GitHub Issues: Create an issue
Made with ❤️ for hamster welfare in Bangladesh 🐹