Title: Fale Hafez
Author: 6arshid
Published: <strong>July 12, 2024</strong>
Last modified: June 25, 2026

---

Search plugins

![](https://ps.w.org/fale-hafez/assets/banner-772x250.png?rev=3117093)

![](https://ps.w.org/fale-hafez/assets/icon-256x256.png?rev=3117094)

# Fale Hafez

 By [6arshid](https://profiles.wordpress.org/6arshid/)

[Download](https://downloads.wordpress.org/plugin/fale-hafez.1.0.2.zip)

 * [Details](https://wordpress.org/plugins/fale-hafez/#description)
 * [Reviews](https://wordpress.org/plugins/fale-hafez/#reviews)
 *  [Installation](https://wordpress.org/plugins/fale-hafez/#installation)
 * [Development](https://wordpress.org/plugins/fale-hafez/#developers)

 [Support](https://wordpress.org/support/plugin/fale-hafez/)

## Description

**Hafez Poetry Randomizer Plugin**
 The Hafez Poetry Randomizer is a delightful 
WordPress plugin that brings the enchanting world of Hafez’s poetry to your website.
With just a simple shortcode, you can easily display random verses of Hafez’s timeless
poetry to your visitors, adding a touch of cultural elegance to your site’s content.

**About Hafez**
 Hafez, whose full name is Shams-ud-Din Muhammad Hafez, was a 14th-
century Persian poet renowned for his mystical and lyrically beautiful poetry. Born
in Shiraz, Iran, Hafez is often referred to as the “Tongue of the Hidden” due to
his ability to convey deep spiritual and philosophical insights through his verses.
His poetry, collected in the Divan-e-Hafez, remains an enduring treasure of Persian
literature and Sufi mysticism. Hafez’s works explore themes of love, spirituality,
fate, and the human condition, and his ghazals (lyric poems) continue to inspire
and resonate with people around the world, transcending time and culture. His verses
are celebrated for their profound wisdom and the way they capture the essence of
human emotions and the divine in a unique and enchanting manner.

**Features**

**Random Poetry Display**: The plugin allows you to effortlessly display randomly
selected verses from the poetry collection of the renowned Persian poet, Hafez.

**Easy Integration**: By using the [Hafez_random] shortcode, you can seamlessly 
insert the random poetry generator into any post, page, or widget area.

**Cultural Enrichment**: Share the beauty and wisdom of Hafez’s poetry with your
website visitors, introducing them to the rich literary heritage of Persian culture.

**Demo**
 Experience the magic of the Hafez Poetry Randomizer yourself by visiting
our website [6arshid](https://6arshid.com/apps/wordpress/fale-hafez).

**Feedback and Support**
 We appreciate your interest in the Hafez Poetry Randomizer
plugin. If you have any questions, feedback, or issues, please don’t hesitate to
[contact our support team](https://6arshid.com).

## Screenshots

[⌊Panel of Hafez Plugin⌉⌊Panel of Hafez Plugin⌉[

Panel of Hafez Plugin

[⌊Demo of Hafez Plugin⌉⌊Demo of Hafez Plugin⌉[

Demo of Hafez Plugin

[[

## Installation

**Usage** Install and activate the Hafez Poetry Randomizer plugin.

To showcase a random Hafez poem, simply insert the [Hafez_random] shortcode into
your desired content area.

Publish or update your post or page, and watch as the plugin magically displays 
a new verse every time the content is loaded.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Fale Hafez” is open source software. The following people have contributed to this
plugin.

Contributors

 *   [ 6arshid ](https://profiles.wordpress.org/6arshid/)

“Fale Hafez” has been translated into 1 locale. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/fale-hafez/contributors)
for their contributions.

[Translate “Fale Hafez” into your language.](https://translate.wordpress.org/projects/wp-plugins/fale-hafez)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/fale-hafez/), check
out the [SVN repository](https://plugins.svn.wordpress.org/fale-hafez/), or subscribe
to the [development log](https://plugins.trac.wordpress.org/log/fale-hafez/) by 
[RSS](https://plugins.trac.wordpress.org/log/fale-hafez/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 0.0.1

 * Unveiling the Inaugural Release of the Hafez WordPress Plugin

#### 1.0.1

 * Edit information

#### 1.0.2

 * Added [FAL_PAGE] shortcode – displays a fully styled Hafez fortune-telling intro
   page with an editable title, subtitle, description, and a call-to-action button
   that links to the random poem page
 * Added “Fal Page” sub-menu under the Fale Hafez admin menu for editing all content
   of the intro page without touching code
 * Added live preview panel in the admin settings page that updates in real time
   as the admin types
 * Added “Auto-detect” button that automatically finds the page containing [HAFEZ_RANDOM]
   and fills in the link field
 * Added one-click “Create Page” button in the Fal Page settings that creates a 
   WordPress page with [FAL_PAGE] and saves the page ID
 * Redesigned the main admin panel (Fale Hafez  Fale Hafez) with a full PHP-rendered
   dashboard replacing the previous JavaScript innerHTML approach
 * Added two status cards showing whether the random poem page and the intro page
   have been created, with direct View and Edit links
 * Added “Create All Pages Automatically” button on the main panel that creates 
   both required pages in one click and links them together — no shortcode copy-
   pasting needed
 * Added shortcode reference grid on the main panel for quick access
 * Fixed the CTA button on [FAL_PAGE] not navigating anywhere when the random page
   URL had not been saved yet — added automatic URL detection fallback at render
   time
 * Wrapped [HAFEZ_RANDOM] output in a decorative gold-bordered frame with ornamental
   dividers above and below the poem
 * Added “فال جدید” (New Fortune) button below every random poem
 * New fortune is fetched via AJAX — the page does not reload; the poem fades out,
   updates, and fades back in smoothly
 * Added spinning refresh icon animation on the button during loading
 * Registered wp_ajax and wp_ajax_nopriv action fh_get_random as the AJAX endpoint
 * Added ABSPATH guard to class-faleHafez-public.php to prevent direct file execution
 * Added current_user_can() capability check to all admin form handlers in addition
   to nonce verification — prevents privilege escalation if a valid nonce were obtained
   by a lower-privilege user
 * Applied wp_kses_post() to the return value of the [faleHafez_hafez_poem] shortcode
   to prevent XSS if database content were ever tampered with
 * Changed SELECT * to SELECT content in all poem database queries to minimise data
   exposure
 * Added per-IP rate limiting (30 requests per 60 seconds) to the public AJAX endpoint
   using WordPress transients to prevent database spam
 * Removed debug error_log(json_encode($content)) call that was leaking poem data
   to the server error log
 * Changed relative require_once(‘functions.php’) to an absolute path using **DIR**
   for reliability across all server configurations

## Meta

 *  Version **1.0.2**
 *  Last updated **4 weeks ago**
 *  Active installations **10+**
 *  WordPress version ** 4.7.0 or higher **
 *  Tested up to **7.0.2**
 *  Languages
 * [English (US)](https://wordpress.org/plugins/fale-hafez/) and [Persian](https://fa.wordpress.org/plugins/fale-hafez/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/fale-hafez)
 *  [Advanced View](https://wordpress.org/plugins/fale-hafez/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/fale-hafez/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/fale-hafez/reviews/)

## Contributors

 *   [ 6arshid ](https://profiles.wordpress.org/6arshid/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/fale-hafez/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://6arshid.com/donate/)