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 contexts like the shop, cart, checkout, customer order details, and emails. For PDF invoices, it uses the standard “ر.س” symbol to ensure compatibility. 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 plugins like WooCommerce PDF Invoices & Packing Slips).
  • Supports non-WooCommerce sites by replacing “SAR” or “ر.س” in page content.
  • Automatically adjusts icon spacing for RTL (e.g., Arabic) and LTR (e.g., English) layouts.
  • Ensures consistent 20px icon size across all contexts (except PDFs, which use text).
  • Lightweight, secure, and easy to use.

Встановлення

  1. Upload the saudi-rial-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 in page content for non-WooCommerce sites.

Where is the SVG icon stored?

The SVG icon is located in assets/sr.svg within the plugin folder. Ensure this file is included for the plugin to function correctly.

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

To ensure compatibility and compliance with WordPress guidelines, PDF invoices use the standard “ر.س” symbol instead of an image, providing reliable rendering with plugins like WooCommerce PDF Invoices & Packing Slips.

Can I customize the icon size?

The SVG icon size is set to 20px for optimal display across all contexts. Developers can modify the CSS in the plugin code (add_icon_styles and add_admin_icon_styles methods) to adjust it.

Відгуки

Для цього плагіна немає відгуків.

Учасники та розробники

“Saudi Riyal Icon” — проект з відкритим вихідним кодом. В розвиток плагіну внесли свій вклад наступні учасники:

Учасники

Перекладіть “Saudi Riyal Icon” на вашу мову.

Цікавитесь розробкою?

Перегляньте код, перегляньте сховище SVN або підпишіться на журнал розробки за допомогою RSS.

Журнал змін

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, though PNG support was 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, aligning with WordPress best practices.

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 to display the Riyal icon in PDF invoices.

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 (e.g., subtotals, discounts, totals).

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 to prevent .cls-1 leakage in sanitized contexts.
  • 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 in checkout totals, discounts, and invoices.
  • Improved logging for debugging.

1.1.5

  • Initial attempt to fix .cls-1 { fill: #888ea8; } issue in checkout totals and invoices (later refined in 1.1.6).

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.