Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
=== Al-Quran Reader === Contributors: miftahafina Tags: quran, mushaf, islam, al-quran Requires at least: 6.0 Requires PHP: 7.4 Tested up to: 7.1 Stable tag: 0.3.1 License: GPLv2 or later A lightweight Al-Quran reader for WordPress powered by the Quran Foundation Content API, featuring the QCF V2 Mushaf with 604 pages. == Description == Al-Quran Reader adds a page-based Al-Quran reader to your WordPress website using the QCF V2 Mushaf. The plugin retrieves Mushaf data through the Quran Foundation Content API and renders the pages using the QCF font provided by Quran Foundation. ### Features * QCF V2 Mushaf with 604 pages. * Page-based Mushaf reading experience. * Powered by the Quran Foundation Content API. * Server-side OAuth2 authentication using Client ID and Client Secret. * API access tokens are securely handled on the WordPress server. * Mushaf page data is cached for one week to reduce repeated API requests. * Browser-side page caching for smoother navigation during reading sessions. * Simple `[al_quran]` shortcode for embedding the reader on any WordPress page. == Requirements == * WordPress 6.0 or later. * PHP 7.4 or later. * A free Quran Foundation account. * A Quran Foundation application with access to the Content API. == Installation == 1. Go to Plugins > Add New Plugin > Upload Plugin. 2. Upload the `al-quran-reader.zip` file. 3. Activate the plugin. 4. Go to Settings > Al-Quran Reader. 5. Enter your Client ID and Client Secret. See "How to Get a Client ID and Client Secret" below. 6. Click Save Credentials. 7. Click Test Connection to verify the API connection. 8. Create a new WordPress page and add the `[al_quran]` shortcode. == How to Get a Client ID and Client Secret == This plugin requires OAuth2 credentials (Client ID and Client Secret) from Quran Foundation to access the Content API. The credentials are free, but you need to create them through your own Quran Foundation account. ### 1. Open the Developer Console Visit https://dev-console.quran.foundation/ and click "Continue with Quran.Foundation" to sign in. If you do not have a Quran Foundation account yet, you can create one from the same page. ### 2. Create an Application After signing in, create a new application/project for your website. Select the **Backend/Server** application type using client credentials. Do not use a frontend/mobile application type, because the Client Secret needs to remain on your WordPress server and must not be exposed to visitors' browsers. When selecting the environment, choose **production** for a live website. If you are developing and testing the plugin on a local environment, you can use **prelive** instead. The plugin uses the production endpoint (`apis.quran.foundation`) when making API requests, so prelive credentials will not work on a production website. ### 3. Enable Content API Access Make sure your application has access to the **Content API** with the `content` scope. The plugin uses this API to retrieve Surah, verse, and page-based Mushaf data. A Redirect URI is not required because the plugin does not use user login or user authorization. It uses the OAuth2 client credentials flow. ### 4. Copy Your Credentials After creating the application, the Developer Console will provide your Client ID and Client Secret. Save both values securely. The Client Secret may only be displayed once, so make sure you copy it before leaving the page. ### 5. Add the Credentials to WordPress In your WordPress admin area, go to: **Settings > Al-Quran Reader** Enter the Client ID and Client Secret in the corresponding fields, then click **Save Credentials**. ### 6. Test the Connection Click **Test Connection** to verify that your WordPress installation can obtain an access token from Quran Foundation. If the connection test fails, check the following: * The Client ID is correct. * The Client Secret is correct. * The application is configured for the correct environment. * The application has access to the Content API. * The required `content` scope is enabled. If access to the application requires approval from Quran Foundation, wait for the approval confirmation before testing the credentials. For more information, see the official Quran Foundation API documentation: https://api-docs.quran.foundation/ == Data, Caching, and Privacy == The Client Secret is used exclusively on the WordPress server to obtain an access token. It is not exposed to website visitors or sent to the browser. The access token is stored using a WordPress transient. Content API requests are made server-side by WordPress. Mushaf page data is also cached as a WordPress transient for one week. This reduces repeated requests to the upstream API because the Mushaf content itself does not change. The plugin does not bundle the QCF font. The QCF font is loaded directly from the Quran Foundation CDN in accordance with their documentation. The plugin does not use a user login or OAuth authorization flow for website visitors. == Mushaf == This plugin uses: * Mushaf: QCF V2 * Mushaf ID: 1 * Pages: 604 The QCF font is provided through the Quran Foundation CDN. == Frequently Asked Questions == = Why do I need a Client ID and Client Secret? = The Quran Foundation Content API requires OAuth2 client credentials for server-to-server API access. = Is the Quran Foundation API credential free? = The credentials can be obtained through the Quran Foundation Developer Console. Refer to their current documentation and access requirements for the latest information. = Is my Client Secret exposed to visitors? = No. The Client Secret is used only on the WordPress server. It is not sent to the browser. = Do I need a Redirect URI? = No. This plugin uses the OAuth2 client credentials flow and does not require user login or authorization. = Why are Mushaf pages cached? = Mushaf content does not change, so the plugin caches page data for one week to reduce unnecessary requests to the Quran Foundation Content API. == Changelog == = 0.3.1 = * Added one-week transient caching for the `/page/{page}` endpoint to reduce repeated requests to the upstream API. * Added a browser-side `pageCache` size limit to prevent the cache from growing indefinitely during long reading sessions. * Removed the unused `.al-quran__word` CSS class. * Synchronized the plugin version across the plugin header, PHP constant, and stable tag. == License == This plugin is licensed under the GPL v2 or later.