# Muslim Prayer Times WordPress Plugin

This plugin calculates, stores, and displays Islamic prayer times and iqama schedules through
Gutenberg blocks, shortcodes, and public REST endpoints.

## Installation

### Option 1: Standard Installation
1. Upload the plugin folder to your `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Run `composer install` in the plugin directory to install dependencies

### Option 2: Manual Dependency Installation
If you don't have Composer available:
1. Upload the plugin folder to your `/wp-content/plugins/` directory
2. Download the [Islamic Network Prayer Times library](https://github.com/islamic-network/prayer-times)
3. Extract it to the `vendor/` directory inside the plugin folder
4. Activate the plugin through the 'Plugins' menu in WordPress

## Usage

Add one of the blocks in the **Muslim Prayer Times** category, or use a shortcode:

- `[muslprti_daily_prayer_times]`
- `[muslprti_monthly_prayer_times]`
- `[muslprti_live_prayer_times]`
- `[muslprti_jumuah_prayer_times]`

The Daily and Monthly block reports share cached raw prayer-time data for the next five days,
next 30 days, or the displayed calendar month. The Live block retrieves the current prayer
schedule through its REST endpoint.

## Configuration

Go to Settings > Muslim Prayer Times to configure default settings for the plugin.
Use Asr Calculation Method for Asr iqama generation and Asr Athan Method to choose whether
blocks and the SalahAPI CSV URL display the stored Standard or Hanafi Asr athan time.

## Caching

Prayer-time object-cache entries are versioned with the current REST ETag and expire after one
day. Saving settings or importing prayer times creates a new ETag, so subsequent requests use
fresh cache entries automatically. Cached raw data ranges contain no more than 31 days; CSV
responses over 31 days remain supported but are generated without an object-cache entry.

If your host or a cache plugin caches pages, exclude every page containing a Muslim Prayer Times
block or shortcode. Also exclude these dynamic routes from page caching:

- `/wp-json/muslim-prayer-times/v1/salah-api`
- `/wp-json/muslim-prayer-times/v1/last-updated`
- `/wp-json/muslim-prayer-times/v1/prayer-times-csv`
- `/wp-json/prayer-times/v1/times/*`

Configure these exclusions in the host or cache plugin's Never Cache/Exclude URL list. The
plugin does not configure or purge a specific page-cache provider automatically.
