SolarDawn Sunrise & Sunset Widget adds a responsive frontend card for sunrise and sunset information. It works in posts, pages, widget areas, Gutenberg shortcode blocks, and page builders through the [solardawn_sunrise_sunset] shortcode.
The widget can use a default country/state/city dropdown selection, manual latitude/longitude, shortcode location attributes, or optional visitor country detection by public IP. Sunrise, sunset, twilight, and daylight details are calculated locally from the selected coordinates and timezone, then cached with WordPress transients.
Features include:
Default settings:
[solardawn_sunrise_sunset]
Country:
[solardawn_sunrise_sunset country="Sri Lanka"]
Country, state, and city without manual coordinates:
[solardawn_sunrise_sunset country="Sri Lanka" state="Western" city="Colombo"]
City search within a country:
[solardawn_sunrise_sunset country="Japan" city="Tokyo"]
Manual coordinates:
[solardawn_sunrise_sunset lat="6.9271" lon="79.8612" timezone="Asia/Colombo"]
Custom title:
[solardawn_sunrise_sunset country="United States" title="Today's Sun Times"]<h3>Privacy</h3>
This plugin calculates sunrise and sunset data locally from the selected latitude, longitude, timezone, and date.
Visitor country detection is disabled by default. When an administrator enables visitor country detection, the plugin sends the visitor IP address to ipapi.co to estimate the visitor’s country. If visitor country detection is disabled, no request is sent to ipapi.co.
The plugin does not store the full IP address in the database. It stores only a salted hash in the transient key and caches the detected country for 12 hours.
This plugin can use one external service only when an administrator explicitly enables automatic visitor country detection.
Service name: ipapi
Service URL: https://ipapi.co/
Purpose: Used only to estimate the visitor’s country when the admin enables automatic visitor country detection.
Data sent: The visitor IP address is sent to ipapi.co when country auto-detection is used.
When data is sent: Only when the widget/page loads and the auto-detect country feature is enabled.
If auto-detection is disabled, no request is sent to ipapi.co.
Terms of Service: https://ipapi.co/terms/
Privacy Policy: https://ipapi.co/privacy/
You can view a live sunrise and sunset calculator here:
Live Sunrise and Sunset for your location Calculator
solardawn-sunrise-sunset-widget.solardawn-sunrise-sunset-widget.php.solardawn-sunrise-sunset-widget/solardawn-sunrise-sunset-widget.php at the top level.country, state, and city attributes and confirm it renders without manual coordinates.settings_fields().wp_remote_get() only for the opt-in ipapi.co country detection feature.solardawn or SolarDawn.