Title: Saudi Riyal Icon
Author: sh8adat
Published: <strong>2025 年 4 月 29 日</strong>
Last modified: 2026 年 7 月 31 日

---

搜索插件

![](https://s.w.org/plugins/geopattern-icon/saudi-riyal-icon.svg)

# Saudi Riyal Icon

 作者：[sh8adat](https://profiles.wordpress.org/sh8adat/)

[下载](https://downloads.wordpress.org/plugin/saudi-riyal-icon.1.2.0.zip)

 * [详情](https://cn.wordpress.org/plugins/saudi-riyal-icon/#description)
 * [评价](https://cn.wordpress.org/plugins/saudi-riyal-icon/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/saudi-riyal-icon/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/saudi-riyal-icon/#developers)

 [支持](https://wordpress.org/support/plugin/saudi-riyal-icon/)

## 描述

The Saudi Riyal Icon plugin replaces the “SAR” or “ر.س” currency symbol with a custom
SVG icon on your WordPress site. Designed for seamless integration with WooCommerce,
it enhances the visual appeal of prices in the shop, cart, checkout, customer order
details, and emails. For PDF invoices it uses the standard text symbol “ر.س” for
reliable rendering. No coding required — just activate and it works automatically!

#### Features

 * Replaces “SAR” or “ر.س” with a custom SVG icon in WooCommerce prices (shop, product
   pages, cart, checkout, thank-you page, admin order details, customer order details,
   and emails).
 * Uses the text symbol “ر.س” in PDF invoices for reliable rendering (compatible
   with WooCommerce PDF Invoices & Packing slips).
 * Supports non-WooCommerce sites by safely replacing “SAR” or “ر.س” in page content.
 * Automatically adjusts icon spacing for RTL (Arabic) and LTR (English) layouts.
 * Ensures consistent 20px icon size across all contexts (except PDFs, which use
   text).
 * Lightweight, secure, and translation-ready (includes Arabic .po/.mo support).
 * Proper WooCommerce checks to prevent errors when WooCommerce is not active.

## 安装

 1. Upload the `saudi-riyal-icon` folder to the `/wp-content/plugins/` directory.
 2. Activate the plugin through the “Plugins” menu in WordPress.
 3. Done! The “SAR” or “ر.س” symbol will be replaced with the SVG icon automatically(
    PDF invoices use the text symbol “ر.س”).

## 常见问题

### Does this plugin require WooCommerce?

No. It works with or without WooCommerce. It replaces “SAR” or “ر.س” in WooCommerce
prices and also in regular page content.

### Where is the SVG icon stored?

The SVG icon is located in `assets/sr.svg` inside the plugin folder. Make sure this
file is present.

### Why does the plugin use a text symbol in PDF invoices?

To ensure compatibility and compliance with WordPress guidelines. PDF invoices use
the standard “ر.س” text symbol instead of an image.

### Can I customize the icon size?

The SVG icon size is set to 20px for optimal display. Developers can modify the 
CSS in the `add_icon_styles` and `add_admin_icon_styles` methods.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Saudi Riyal Icon」是开源软件。 以下人员对此插件做出了贡献。

贡献者

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

[帮助将「Saudi Riyal Icon」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/saudi-riyal-icon)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/saudi-riyal-icon/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/saudi-riyal-icon/)，或通过[RSS](https://plugins.trac.wordpress.org/log/saudi-riyal-icon/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/saudi-riyal-icon/)。

## 更新日志

#### 1.2.0

 * Complete rewrite for better stability and security.
 * Fixed fatal errors when WooCommerce is not active.
 * Proper UTF-8 support for the Arabic symbol “ر.س”.
 * Safer content replacement (word-boundary for “SAR”).
 * Fixed PDF invoice filter add/remove logic.
 * Added full internationalization support (text domain + Arabic .po/.mo).
 * Removed forced price separators that overrode store settings.
 * Improved code structure and performance.
 * Updated to version 1.2.0.

#### 1.1.16

 * Fixed: Properly enqueued CSS using `wp_register_style()` and `wp_enqueue_style()`
   per WordPress.org guidelines.
 * Improved: Simplified price formatting logic for better performance.
 * Updated: Short description in readme.txt to meet 150-character limit.

#### 1.1.15

 * Changed PDF invoices to use the text symbol “ر.س” instead of a PNG icon to comply
   with WordPress plugin guidelines.
 * Removed PNG icon support and related media library integration for simplicity.

#### 1.1.14

 * Improved documentation in code to clarify PDF invoice image handling (PNG support
   later removed in 1.1.15).

#### 1.1.13

 * Replaced debugging logs with WooCommerce’s logging system for production safety.
 * Integrated PNG icon with WordPress media library for PDF invoices (reverted in
   1.1.15).

#### 1.1.12

 * Fixed security issue by properly escaping debug output to prevent XSS vulnerabilities.
 * Improved logging to only activate in debug mode.

#### 1.1.11

 * Fixed a syntax error in the PDF invoice integration that caused a fatal error.
 * Improved error handling for missing PNG files in PDF invoices.

#### 1.1.10

 * Added support for PDF invoices using a PNG version of the icon (`sr.png`).
 * Integrated with WooCommerce PDF Invoices & Packing Slips.

#### 1.1.9

 * Added support for customer order details page (`/my-account/orders/view-order/`).
 * Ensured the SVG icon appears in customer-facing order details.

#### 1.1.8

 * Fixed icon size in WooCommerce order details (admin, thank-you page, emails) 
   to be consistently 20px.
 * Added inline SVG width and height attributes for better email compatibility.

#### 1.1.7

 * Removed SVG sanitization to restore icon visibility in cart, shop, and product
   pages.
 * Replaced SVG `<style>` block with inline styles.
 * Set icon size to 20px across all contexts.

#### 1.1.6

 * Added minimal SVG sanitization to prevent stripping in checkout totals and invoices.
 * Fixed `.cls-1 { fill: #888ea8; }` issue.
 * Improved logging for debugging.

#### 1.1.5

 * Initial attempt to fix `.cls-1 { fill: #888ea8; }` issue in checkout totals and
   invoices.

#### 1.1

 * Fixed icon size to 12px for better display.
 * Added support for replacing “ر.س” in addition to “SAR”.
 * Improved compatibility with WooCommerce and non-WooCommerce sites.

#### 1.0

 * Initial release.

## 额外信息

 *  版本 **1.2.0**
 *  最后更新：**2 月前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **7.0.6**
 *  PHP 版本 ** 7.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/saudi-riyal-icon/)
 * 标签
 * [currency](https://cn.wordpress.org/plugins/tags/currency/)[saudi riyal](https://cn.wordpress.org/plugins/tags/saudi-riyal/)
   [SVG icon](https://cn.wordpress.org/plugins/tags/svg-icon/)[woocommerce](https://cn.wordpress.org/plugins/tags/woocommerce/)
 *  [高级视图](https://cn.wordpress.org/plugins/saudi-riyal-icon/advanced/)

## 评级

尚未提交反馈。

[您的评价](https://wordpress.org/support/plugin/saudi-riyal-icon/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/saudi-riyal-icon/reviews/)

## 贡献者

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

## 支持

最近两个月解决的问题：

     总计 1，已解决 1

 [查看支持论坛](https://wordpress.org/support/plugin/saudi-riyal-icon/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://sh8adat.com/home/donate/)