WP Manifestindependent plugin directory
manifest / utilities / hwbd-weather-alert

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

★ 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/tararauzumaki/hwbd-weather-alert/archive/refs/heads/main.zip

Real-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

  1. Download the plugin ZIP file
  2. Go to WordPress Admin → Plugins → Add New
  3. Click Upload Plugin
  4. Choose the ZIP file and click Install Now
  5. Click Activate

Method 2: Manual Installation

  1. Download and extract the plugin
  2. Upload the hwbd-weather-alert folder to /wp-content/plugins/
  3. Go to WordPress Admin → Plugins
  4. Find HWBD Weather Alert and click Activate

⚙️ Configuration

1. Get OpenWeatherMap API Key

  1. Visit OpenWeatherMap
  2. Sign up for a free account
  3. Generate your API key (free tier: 1,000 calls/day)

2. Configure Plugin Settings

  1. Go to WordPress Admin → Settings → HWBD Weather
  2. Enter your OpenWeatherMap API Key
  3. Customize alert messages (optional):
    • Hot Weather Message (>28°C)
    • Cold Weather Message (<18°C)
    • Safe Range Message (18-28°C)
  4. Click Save Settings

3. Add Widget to Page

  1. Edit a page with Elementor
  2. Search for "HWBD Weather Alert" widget
  3. Drag it to your desired location
  4. 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?

  1. Check API Key: Verify it's correctly entered in Settings
  2. Check API Quota: Ensure you haven't exceeded 1,000 calls/day
  3. Clear Cache: Delete transient: delete_transient('hwbd_weather_Dhaka');
  4. Check Browser Console: Look for JavaScript errors

Division selector not working?

  1. Clear Browser Cache: Force refresh (Ctrl+F5 / Cmd+Shift+R)
  2. Check jQuery: Ensure jQuery is loaded
  3. Elementor Compatibility: Update Elementor to latest version

Styling issues?

  1. Theme Conflict: Check for CSS conflicts with your theme
  2. Elementor Cache: Clear Elementor cache (Elementor → Tools → Regenerate CSS)
  3. Custom CSS: Add custom CSS via Elementor's Custom CSS option

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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:


Made with ❤️ for hamster welfare in Bangladesh 🐹