A WordPress plugin that displays detailed cloud cover data for any location worldwide. Perfect for photographers and astronomy enthusiasts who need to plan their activities based on cloud conditions. Inspired by the Clear Outside website and app.
- Total cloud cover percentage - Overall sky coverage
- Low altitude clouds (0-3km) - Cumulus, stratus, fog
- Medium altitude clouds (3-8km) - Altocumulus, altostratus
- High altitude clouds (8km+) - Cirrus, cirrostratus, cirrocumulus
- Hourly forecasts for up to 48 hours
- Sunset/sunrise times for golden hour planning
- Astronomical twilight times for night photography
- Moon phase and moonrise/moonset times
- Blue hour & golden hour indicators for optimal shooting windows
- Specialized rendering for photography planning
- Installable app - Add to your phone's home screen
- Offline support - View cached forecasts without internet
- 7-day extended forecast - Plan ahead with detailed forecasts
- Location management - Save multiple locations with notes
- Share locations - Share forecast links via messaging apps, email, or copy to clipboard
- Export/Import - Backup and restore locations as JSON
- Dark/Light themes - Automatic switching based on system preferences
- Local timezone display - Times shown in each location's timezone
- Coordinates: Use latitude and longitude directly
- Location names: City, country, or full addresses
- Smart geocoding: Automatic coordinate conversion
- Shortcode:
[cloud_cover location="London, UK" hours="24"] - Gutenberg Block: Visual block editor integration
- Admin Settings: Easy configuration panel
- Smart caching system reduces API calls
- Configurable cache TTL (default: 15 minutes weather, 24 hours geocoding)
- WordPress transients for efficient data storage
- Input validation for coordinates and location names
- Rate limiting to prevent API abuse
- Proxy-aware IP detection for CDN/reverse proxy compatibility
- API response validation to prevent XSS attacks
- Go to Plugins > Add New
- Search for "Cloud Cover Forecast"
- Click Install Now and Activate
- Download the plugin files
- Upload to
/wp-content/plugins/cloud-cover-forecast/ - Activate through the Plugins menu in WordPress
// Using coordinates
[cloud_cover lat="51.8986" lon="-8.4756" hours="24" label="Cork"]
// Using location name
[cloud_cover location="London, UK" hours="48"]
// Photography mode with astronomical data
[cloud_cover location="Paris, France" hours="12" show_astro="true"]- Add the "Cloud Cover Forecast" block in the block editor
- Configure location and settings in the block sidebar
- Preview your forecast in real-time
- Visit
yoursite.com/forecast-appto access the PWA - Click "Install App" to add it to your home screen
- Save locations, add notes, and view extended forecasts
- Export your locations as JSON for backup
- Go to Settings > Cloud Cover Forecast
- Set your default location and preferences
- Use the location search to find coordinates automatically
- Weather Data: Free, no API key required
- Geocoding: Automatic location name to coordinate conversion
- High Accuracy: Based on multiple meteorological models
- Global Coverage: Worldwide weather data
- Reverse Geocoding: Convert coordinates to location names
- Free Service: No API key required
- OpenStreetMap Data: Community-maintained geographic data
- Privacy Policy: https://nominatim.org/release-docs/latest/api/Reverse/
- Astronomical Data: Moon phase, moonrise/moonset times, and astronomical twilight
- High Precision: Accurate astronomical calculations for any location
- Professional Service: Enterprise-grade IP geolocation and astronomical data
- API Key Required: Free tier available with registration at ipgeolocation.io
- Trusted Worldwide: Used by companies like 8x8, Atlassian, Avan, and many others since 2017
IPGeolocation.io is a comprehensive IP intelligence platform that provides:
- Accurate IP Geolocation: Precise location data for any IP address
- Astronomy API: Detailed astronomical calculations including moon phases, sunrise/sunset times
- Timezone API: Exact timezone information for any location
- Security Intelligence: VPN, proxy, and threat detection
- Enterprise-Grade: Trusted by major companies worldwide since 2017
- Developer-Friendly: Easy integration with comprehensive documentation
- Free Tier: Generous free usage limits for development and testing
The plugin uses IPGeolocation.io specifically for astronomical data to provide photographers and astronomy enthusiasts with accurate moon phase information, moonrise/moonset times, and astronomical twilight calculations.
This plugin connects to external services to provide weather forecasts. By installing and activating this plugin, site administrators consent to these external API calls on behalf of site visitors.
Open-Meteo API (https://open-meteo.com)
- Purpose: Retrieve hourly cloud cover forecasts
- Data Sent: Geographic coordinates (latitude, longitude)
- Privacy Policy: https://open-meteo.com/en/terms
- Frequency: Once per location per cache period (default: 15 minutes)
- API Key: Not required
- User Consent: Automatic (required for core functionality)
Open-Meteo Geocoding API (https://geocoding-api.open-meteo.com)
- Purpose: Convert location names to coordinates
- Data Sent: Location name (e.g., "London, UK")
- Privacy Policy: https://open-meteo.com/en/terms
- Frequency: Once per location search (cached for 15 minutes)
- API Key: Not required
- User Consent: Automatic (required for core functionality)
Met.no Weather API (https://api.met.no)
- Purpose: Supplement cloud cover data (merged with Open-Meteo for accuracy)
- Data Sent: Geographic coordinates, your site URL and admin email in User-Agent header
- Privacy Policy: https://api.met.no/doc/TermsOfService
- Frequency: Once per location per cache period (default: 15 minutes)
- API Key: Not required
- User-Agent: Includes site name, URL, and admin email (required by Met.no terms)
- User Consent: Automatic (required for core functionality)
Nominatim/OpenStreetMap API (https://nominatim.openstreetmap.org)
- Purpose: Reverse geocoding - convert coordinates to location names
- Data Sent: Geographic coordinates
- Privacy Policy: https://osmfoundation.org/wiki/Privacy_Policy
- Frequency: Once per reverse geocode request (rate limited to 1 request/second)
- API Key: Not required
- User Consent: Automatic (used when saving locations in PWA)
IPGeolocation Astronomy API (https://api.ipgeolocation.io) - OPTIONAL
- Purpose: Moon phase, moonrise/moonset times, and astronomical twilight data
- Data Sent: Geographic coordinates, date
- Privacy Policy: https://ipgeolocation.io/privacy-policy.html
- Frequency: Once per day per location (cached for 24 hours)
- API Key: Required (free tier: 1000 requests/day)
- User Consent: Opt-in (disabled by default, requires admin to add API key)
No Personally Identifiable Information (PII) is collected or stored by this plugin.
- No user accounts or registration
- No cookies or tracking
- No analytics or metrics collection
- Only geographic coordinates and location names are sent to APIs
- No IP addresses logged or transmitted (except as standard HTTP requests)
- No email addresses collected from users
- Weather data is cached locally using WordPress transients
- Cache duration: 15 minutes for weather, 24 hours for astronomical data
- All cached data is automatically deleted after expiration
- Coordinates and location names are stored in WordPress options (admin settings only)
This plugin is GDPR-compliant:
- No personal data processing
- No cookies requiring consent
- Location lookups are anonymous
- No data shared with third parties beyond necessary API providers
- Users can request site administrators disable the plugin at any time
When using this plugin on a website that serves EU visitors:
- Disclose the use of external weather APIs in your privacy policy
- Inform users that location coordinates are sent to weather services
- Note that Met.no receives your site's admin email in the User-Agent header
- WordPress: 5.0 or higher
- PHP: 7.4 or higher
- Internet connection for API calls
- Gutenberg support (for block functionality)
- IPGeolocation.io API Key (for astronomical data - free tier available)
cloud-cover-forecast/
├── cloud-cover-forecast.php # Main plugin file
├── block.js # Gutenberg block JavaScript
├── public-block.js # Frontend block JavaScript
├── assets/ # CSS and JS assets
├── includes/ # PHP class files
│ ├── class-admin.php # Admin functionality
│ ├── class-api.php # API integration
│ ├── class-shortcode.php # Shortcode handling
│ ├── class-photography.php # Photography features
│ └── ...
└── readme.txt # WordPress plugin directory readme
- Main Plugin Class:
Cloud_Cover_Forecast_Plugin - API Integration: Open-Meteo weather and geocoding APIs
- Caching System: WordPress transients with configurable TTL
- Gutenberg Block: JavaScript-based block editor integration
- Admin Interface: Settings page with location search
This plugin uses vanilla JavaScript and PHP - no compilation or build steps needed.
- Test shortcode with various locations
- Test Gutenberg block functionality
- Test admin location search feature
- Test mobile responsiveness
- Test caching behavior
- Cork, Ireland (51.8986, -8.4756) - Default location for testing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- GitHub Issues: Report bugs or request features
- WordPress Support: Available through the WordPress plugin directory
This plugin is licensed under the GPL v2 or later.
- New: Progressive Web App (PWA) with installable forecast application
- New: Save and manage multiple locations with custom names and notes
- New: Share location forecasts via Web Share API or clipboard
- New: Export/import locations as JSON for backup and sharing
- New: 7-day extended forecast in PWA
- New: Light/dark theme support with automatic system preference detection
- New: Local timezone display for each location's forecast
- New: Reverse geocoding to get location names from coordinates
- New: Google Maps integration for location links
- New: 3-Day Sunrise & Sunset Forecast Gutenberg block
- New: PWA install button with browser-specific instructions
- Improved: Current hour highlighting with visual separator
- Improved: Blue hour and golden hour indicators
- Security: Added coordinate range validation for shortcodes
- Security: Improved IP detection for rate limiting behind CDNs and proxies
- Security: Added validation for localStorage and API responses
- Initial release
- Shortcode support with coordinate and location name input
- Gutenberg block with intuitive interface
- Admin settings page with location search
- Photography-focused rendering with astronomical data
- Responsive design and mobile support
- Smart caching system
- Integration with Open-Meteo API
Perfect for photographers, astronomy enthusiasts, and weather watchers! 📸🌙☁️