Plugin Directory

Changeset 3778033


Ignore:
Timestamp:
11/01/2026 12:45:04 PM (14 hours ago)
Author:
aslanaria2000
Message:

EZRate Price Widgets 2.3.0

Location:
ezrate-price-widgets
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ezrate-price-widgets/tags/2.3.0/assets/css/ezrpw.css

    r3777366 r3778033  
    9898/* footer */
    9999.ezrpw-ft { display: flex; justify-content: space-between; align-items: center; gap: .6em; padding: .4em 1em; border-top: 1px solid var(--ezrpw-border); font-size: .76em; color: var(--ezrpw-muted); flex-wrap: wrap; }
    100 .ezrpw-credit { color: var(--ezrpw-accent) !important; font-weight: 600; }
     100.ezrpw-credit { display: inline-flex; align-items: center; gap: .4em; color: var(--ezrpw-muted) !important; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
     101.ezrpw-credit img { width: 1.35em; height: 1.35em; border-radius: .3em; flex: none; margin: 0; box-shadow: none; }
     102.ezrpw-credit b { color: var(--ezrpw-accent); font-weight: 700; }
     103.ezrpw-credit:hover b { text-decoration: underline; }
     104/* ticker / price bar: the source at the end of the row */
     105.ezrpw-t-ticker { display: flex; align-items: center; }
     106.ezrpw-t-ticker .ezrpw-track-wrap { flex: 1; min-width: 0; }
     107.ezrpw-src { flex: none; display: inline-flex; align-items: center; padding: 0 .9em; font-size: .78em; border-inline-start: 1px solid var(--ezrpw-border); align-self: stretch; }
    101108/* placed automatically above / below the text of a post or page */
    102109.ezrpw-auto { margin: 0 0 1.5em; clear: both; }
  • ezrate-price-widgets/tags/2.3.0/blocks/widget/block.json

    r3777366 r3778033  
    33        "apiVersion": 3,
    44        "name": "ezrate-price-widgets/widget",
    5         "version": "2.2.0",
     5        "version": "2.3.0",
    66        "title": "EZRate price widget",
    77        "category": "widgets",
  • ezrate-price-widgets/tags/2.3.0/ezrate-price-widgets.php

    r3777366 r3778033  
    11<?php
    22/**
    3  * Plugin Name:       EZRate Price Widgets
     3 * Plugin Name:       EZRate Price Widgets – Live Dollar, Gold, Coin & Crypto Prices
    44 * Plugin URI:        https://ezrate.me/services/widgets/en
    55 * Description:       Live Iranian free-market rates (US dollar, euro, gold, coins, USDT and crypto) in Toman: ticker, price bar, cards, table and chart widgets. Shortcode, block and classic widget; every setting in your dashboard.
    6  * Version:           2.2.0
     6 * Version:           2.3.0
    77 * Requires at least: 6.3
    88 * Requires PHP:      7.4
    … …  
    2020}
    2121
    22 define( 'EZRPW_VERSION', '2.2.0' );
     22define( 'EZRPW_VERSION', '2.3.0' );
    2323define( 'EZRPW_FILE', __FILE__ );
    2424define( 'EZRPW_DIR', plugin_dir_path( __FILE__ ) );
  • ezrate-price-widgets/tags/2.3.0/includes/class-ezrpw-admin.php

    r3777366 r3778033  
    6969                add_action( 'admin_post_ezrpw_welcome_off', array( __CLASS__, 'welcome_off' ) );
    7070                add_action( 'admin_notices', array( __CLASS__, 'welcome' ) );
     71                add_action( 'admin_notices', array( __CLASS__, 'credit_ask' ) );
     72                add_action( 'admin_post_ezrpw_credit', array( __CLASS__, 'credit_answer' ) );
    7173                add_filter( 'plugin_action_links_' . plugin_basename( EZRPW_FILE ), array( __CLASS__, 'action_links' ) );
    7274        }
    … …  
    571573                                                <td>
    572574                                                        <label><input type="checkbox" name="ezrpw_settings[link_rates]" value="1" <?php checked( $s['link_rates'] ); ?>> <?php esc_html_e( 'Link each price to its page on ezrate.me (chart and history)', 'ezrate-price-widgets' ); ?></label><br>
    573                                                         <label><input type="checkbox" name="ezrpw_settings[credit]" value="1" <?php checked( $s['credit'] ); ?>> <?php esc_html_e( 'Show a small «Rates by EZRate» link under cards, tables and charts — thank you, it keeps this plugin free', 'ezrate-price-widgets' ); ?></label>
     575                                                        <label><input type="checkbox" name="ezrpw_settings[credit]" value="1" <?php checked( $s['credit'] ); ?>> <?php esc_html_e( 'Show a small «Source: EZRate» link (with its icon) in every widget — thank you, it keeps this plugin free', 'ezrate-price-widgets' ); ?></label>
    574576                                                        <p class="description"><?php esc_html_e( 'Both are off by default: the plugin adds no links to your site unless you allow it.', 'ezrate-price-widgets' ); ?></p>
    575577                                                </td></tr>
    … …  
    699701
    700702        /**
     703         * Asks once (administrators, on the dashboard, Plugins and EZRate screens) whether the widgets may show the small
     704         * «Source: EZRate» link. Nothing is added to the site unless the owner says yes; «No thanks» is never asked again.
     705         */
     706        public static function credit_ask() {
     707                if ( get_option( 'ezrpw_credit_asked' ) || get_option( 'ezrpw_welcome' ) || ! current_user_can( self::CAP ) || ! EZRPW_Widgets::all() ) {
     708                        return;
     709                }
     710                $s = EZRPW_Widgets::settings();
     711                if ( ! empty( $s['credit'] ) ) {
     712                        return;
     713                }
     714                $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
     715                if ( $screen && ! in_array( $screen->id, array( 'dashboard', 'plugins' ), true ) && false === strpos( (string) $screen->id, 'ezrpw' ) ) {
     716                        return;
     717                }
     718                $url = function ( $do ) {
     719                        return wp_nonce_url( admin_url( 'admin-post.php?action=ezrpw_credit&do=' . $do ), 'ezrpw_credit' );
     720                };
     721                echo '<div class="notice notice-info"><p><strong>' . esc_html__( 'May your price widgets show a small «Source: EZRate» link?', 'ezrate-price-widgets' ) . '</strong> '
     722                        . esc_html__( 'It names where the rates come from and helps keep this plugin and its data free. You can change this any time in EZRate › Settings.', 'ezrate-price-widgets' ) . '</p><p>'
     723                        . '<a class="button button-primary" href="' . esc_url( $url( 'on' ) ) . '">' . esc_html__( 'Yes, show the source', 'ezrate-price-widgets' ) . '</a> '
     724                        . '<a class="button" href="' . esc_url( $url( 'off' ) ) . '">' . esc_html__( 'No thanks', 'ezrate-price-widgets' ) . '</a></p></div>';
     725        }
     726
     727        /**
     728         * Answer of the «Source: EZRate» question.
     729         */
     730        public static function credit_answer() {
     731                self::guard( 'ezrpw_credit' );
     732                $do = isset( $_GET['do'] ) ? sanitize_key( wp_unslash( $_GET['do'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- checked by guard() above.
     733                update_option( 'ezrpw_credit_asked', 1, false );
     734                if ( 'on' === $do ) {
     735                        $s           = EZRPW_Widgets::settings();
     736                        $s['credit'] = true;
     737                        update_option( EZRPW_Widgets::SETTINGS, $s );
     738                }
     739                wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'admin.php?page=ezrpw-widgets' ) );
     740                exit;
     741        }
     742
     743        /**
    701744         * Dismiss the welcome notice.
    702745         */
  • ezrate-price-widgets/tags/2.3.0/includes/class-ezrpw-format.php

    r3777366 r3778033  
    3737                        'low'     => 'کمترین',
    3838                        'high'    => 'بیشترین',
    39                         'credit'  => 'قیمت‌ها از',
     39                        'credit'  => 'منبع:',
     40                        'brand'   => 'ایزی‌ریت',
    4041                        'nodata'  => 'قیمت‌ها به‌زودی نمایش داده می‌شود.',
    4142                ),
    … …  
    5556                        'low'     => 'Low',
    5657                        'high'    => 'High',
    57                         'credit'  => 'Rates by',
     58                        'credit'  => 'Source:',
     59                        'brand'   => 'EZRate',
    5860                        'nodata'  => 'Rates will appear shortly.',
    5961                ),
    … …  
    7375                        'low'     => 'الأدنى',
    7476                        'high'    => 'الأعلى',
    75                         'credit'  => 'الأسعار من',
     77                        'credit'  => 'المصدر:',
     78                        'brand'   => 'EZRate',
    7679                        'nodata'  => 'ستظهر الأسعار قريباً.',
    7780                ),
    … …  
    9194                        'low'     => 'Мин.',
    9295                        'high'    => 'Макс.',
    93                         'credit'  => 'Курсы от',
     96                        'credit'  => 'Источник:',
     97                        'brand'   => 'EZRate',
    9498                        'nodata'  => 'Курсы скоро появятся.',
    9599                ),
    … …  
    109113                        'low'     => 'En düşük',
    110114                        'high'    => 'En yüksek',
    111                         'credit'  => 'Kurlar:',
     115                        'credit'  => 'Kaynak:',
     116                        'brand'   => 'EZRate',
    112117                        'nodata'  => 'Kurlar birazdan görünecek.',
    113118                ),
  • ezrate-price-widgets/tags/2.3.0/includes/class-ezrpw-render.php

    r3777366 r3778033  
    265265                }
    266266                // the list twice: the animation slides by half its width and loops without a gap.
    267                 return '<div class="ezrpw-track-wrap"><div class="ezrpw-track">' . $items . '<span class="ezrpw-dup" aria-hidden="true">' . $items . '</span></div></div>';
     267                $credit = EZRPW_Widgets::settings()['credit'] ? '<span class="ezrpw-src">' . self::credit( $w['lang'], $data ) . '</span>' : '';
     268                return '<div class="ezrpw-track-wrap"><div class="ezrpw-track">' . $items . '<span class="ezrpw-dup" aria-hidden="true">' . $items . '</span></div></div>' . $credit;
    268269        }
    269270
    … …  
    280281                        $items .= self::item( $r, $w, $data );
    281282                }
    282                 return '<div class="ezrpw-row">' . $items . '</div>';
     283                $credit = EZRPW_Widgets::settings()['credit'] ? '<span class="ezrpw-src">' . self::credit( $w['lang'], $data ) . '</span>' : '';
     284                return '<div class="ezrpw-row">' . $items . $credit . '</div>';
    283285        }
    284286
    … …  
    422424                $time   = EZRPW_Format::date( $data['generated_at'], $lang, 'HH:mm' );
    423425                $text   = EZRPW_Format::t( $lang, 'updated' ) . ' ' . $time . ' - ' . EZRPW_Format::t( $lang, 'unit' ) . ': ' . EZRPW_Format::unit( $lang, isset( $w['cur'] ) ? $w['cur'] : 'irt' );
    424                 $credit = $s['credit'] ? '<a class="ezrpw-credit" href="' . esc_url( untrailingslashit( $data['site'] ) . '/' . $lang ) . '" target="_blank" rel="noopener">' . esc_html( EZRPW_Format::t( $lang, 'credit' ) ) . ' EZRate</a>' : '<span></span>';
     426                $credit = $s['credit'] ? self::credit( $lang, $data ) : '<span></span>';
    425427                return '<div class="ezrpw-ft">' . $credit . '<span>' . esc_html( $text ) . '</span></div>';
    426428        }
     429
     430        /**
     431         * «Source: [icon] EZRate» — only when the site owner allowed it (Settings, or «Yes» on the notice); the icon comes first
     432         * in the reading direction (right in Persian / Arabic, left in the others).
     433         *
     434         * @param string $lang Language.
     435         * @param array  $data Data.
     436         * @return string
     437         */
     438        public static function credit( $lang, $data ) {
     439                $site = untrailingslashit( ! empty( $data['site'] ) ? $data['site'] : 'https://ezrate.me' );
     440                return '<a class="ezrpw-credit" href="' . esc_url( $site . '/' . $lang ) . '" target="_blank" rel="noopener">'
     441                        . '<img src="' . esc_url( EZRPW_URL . 'assets/img/icon-128.png' ) . '" alt="" width="16" height="16" loading="lazy" decoding="async">'
     442                        . '<span>' . esc_html( EZRPW_Format::t( $lang, 'credit' ) ) . ' <b>' . esc_html( EZRPW_Format::t( $lang, 'brand' ) ) . '</b></span></a>';
     443        }
    427444}
  • ezrate-price-widgets/tags/2.3.0/readme.txt

    r3777366 r3778033  
    1 === EZRate Price Widgets ===
     1=== EZRate Price Widgets – Live Dollar, Gold, Coin & Crypto Prices ===
    22Contributors: aslanaria2000
    3 Tags: currency, exchange rate, gold price, toman, ticker
     3Tags: exchange rates, gold price, currency, crypto prices, toman
    44Requires at least: 6.3
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 2.2.0
     7Stable tag: 2.3.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Live Iranian free-market rates in Toman — US dollar, euro, gold, coins, USDT and crypto — as a ticker, price bar, cards, table or chart.
     11Live dollar, euro, gold, coin, USDT and crypto prices in Toman from Iran's free market — ticker, price bar, cards, table or chart widgets.
    1212
    1313== Description ==
    … …  
    4747
    4848The dashboard is in English and Persian (فارسی). Each widget has its own language, independent of the site language. A complete guide in both languages is under **EZRate › Help**.
     49
     50= به فارسی =
     51
     52افزونهٔ **ویجت قیمت ایزی‌ریت** قیمت لحظه‌ای دلار، یورو، درهم، لیر و بیش از ۲۰ ارز دیگر، قیمت طلای ۱۸ عیار و ۲۴ عیار، قیمت سکه امامی و بهار آزادی، انس طلا، قیمت تتر و بیت‌کوین را از بازار آزاد ایران به تومان در سایت وردپرسی شما نشان می‌دهد: زیرنویس متحرک قیمت، نوار قیمت بالای سایت، کارت و جدول قیمت ارز و طلا، و نمودار. بدون ثبت‌نام، بدون کلید API و بدون یک خط کدنویسی؛ همهٔ تنظیمات در پیشخوان وردپرس، با بلوک گوتنبرگ، ابزارک و شورت‌کد.
    4953
    5054== External services ==
    … …  
    8791Yes. Cached pages show the prices of the moment they were cached; most caching plugins refresh pages regularly.
    8892
     93= Does the plugin add links to my site? =
     94
     95Not unless you allow it. After you create a widget the plugin asks once whether your widgets may show a small «Source: EZRate» link with its icon; you can also switch it (and links from each price to its chart page) on or off in **EZRate › Settings**. Both are off until you say yes.
     96
    8997= Can I show the prices in English? =
    9098
    … …  
    110118
    111119== Changelog ==
     120
     121= 2.3.0 =
     122* New: optional «Source: EZRate» link with the EZRate icon in every widget type (ticker and price bar too), in the widget's language; asked once, off until you allow it.
     123* Better plugin name and description for search.
    112124
    113125= 2.2.0 =
  • ezrate-price-widgets/tags/2.3.0/uninstall.php

    r3777366 r3778033  
    1414        return;
    1515}
    16 foreach ( array( 'ezrpw_widgets', 'ezrpw_settings', 'ezrpw_last_data', 'ezrpw_status', 'ezrpw_welcome', 'ezrpw_welcome_shown', 'widget_ezrpw_widget' ) as $ezrpw_option ) {
     16foreach ( array( 'ezrpw_widgets', 'ezrpw_settings', 'ezrpw_last_data', 'ezrpw_status', 'ezrpw_welcome', 'ezrpw_welcome_shown', 'ezrpw_credit_asked', 'widget_ezrpw_widget' ) as $ezrpw_option ) {
    1717        delete_option( $ezrpw_option );
    1818}
  • ezrate-price-widgets/trunk/assets/css/ezrpw.css

    r3777366 r3778033  
    9898/* footer */
    9999.ezrpw-ft { display: flex; justify-content: space-between; align-items: center; gap: .6em; padding: .4em 1em; border-top: 1px solid var(--ezrpw-border); font-size: .76em; color: var(--ezrpw-muted); flex-wrap: wrap; }
    100 .ezrpw-credit { color: var(--ezrpw-accent) !important; font-weight: 600; }
     100.ezrpw-credit { display: inline-flex; align-items: center; gap: .4em; color: var(--ezrpw-muted) !important; font-weight: 500; text-decoration: none !important; white-space: nowrap; }
     101.ezrpw-credit img { width: 1.35em; height: 1.35em; border-radius: .3em; flex: none; margin: 0; box-shadow: none; }
     102.ezrpw-credit b { color: var(--ezrpw-accent); font-weight: 700; }
     103.ezrpw-credit:hover b { text-decoration: underline; }
     104/* ticker / price bar: the source at the end of the row */
     105.ezrpw-t-ticker { display: flex; align-items: center; }
     106.ezrpw-t-ticker .ezrpw-track-wrap { flex: 1; min-width: 0; }
     107.ezrpw-src { flex: none; display: inline-flex; align-items: center; padding: 0 .9em; font-size: .78em; border-inline-start: 1px solid var(--ezrpw-border); align-self: stretch; }
    101108/* placed automatically above / below the text of a post or page */
    102109.ezrpw-auto { margin: 0 0 1.5em; clear: both; }
  • ezrate-price-widgets/trunk/blocks/widget/block.json

    r3777366 r3778033  
    33        "apiVersion": 3,
    44        "name": "ezrate-price-widgets/widget",
    5         "version": "2.2.0",
     5        "version": "2.3.0",
    66        "title": "EZRate price widget",
    77        "category": "widgets",
  • ezrate-price-widgets/trunk/ezrate-price-widgets.php

    r3777366 r3778033  
    11<?php
    22/**
    3  * Plugin Name:       EZRate Price Widgets
     3 * Plugin Name:       EZRate Price Widgets – Live Dollar, Gold, Coin & Crypto Prices
    44 * Plugin URI:        https://ezrate.me/services/widgets/en
    55 * Description:       Live Iranian free-market rates (US dollar, euro, gold, coins, USDT and crypto) in Toman: ticker, price bar, cards, table and chart widgets. Shortcode, block and classic widget; every setting in your dashboard.
    6  * Version:           2.2.0
     6 * Version:           2.3.0
    77 * Requires at least: 6.3
    88 * Requires PHP:      7.4
    … …  
    2020}
    2121
    22 define( 'EZRPW_VERSION', '2.2.0' );
     22define( 'EZRPW_VERSION', '2.3.0' );
    2323define( 'EZRPW_FILE', __FILE__ );
    2424define( 'EZRPW_DIR', plugin_dir_path( __FILE__ ) );
  • ezrate-price-widgets/trunk/includes/class-ezrpw-admin.php

    r3777366 r3778033  
    6969                add_action( 'admin_post_ezrpw_welcome_off', array( __CLASS__, 'welcome_off' ) );
    7070                add_action( 'admin_notices', array( __CLASS__, 'welcome' ) );
     71                add_action( 'admin_notices', array( __CLASS__, 'credit_ask' ) );
     72                add_action( 'admin_post_ezrpw_credit', array( __CLASS__, 'credit_answer' ) );
    7173                add_filter( 'plugin_action_links_' . plugin_basename( EZRPW_FILE ), array( __CLASS__, 'action_links' ) );
    7274        }
    … …  
    571573                                                <td>
    572574                                                        <label><input type="checkbox" name="ezrpw_settings[link_rates]" value="1" <?php checked( $s['link_rates'] ); ?>> <?php esc_html_e( 'Link each price to its page on ezrate.me (chart and history)', 'ezrate-price-widgets' ); ?></label><br>
    573                                                         <label><input type="checkbox" name="ezrpw_settings[credit]" value="1" <?php checked( $s['credit'] ); ?>> <?php esc_html_e( 'Show a small «Rates by EZRate» link under cards, tables and charts — thank you, it keeps this plugin free', 'ezrate-price-widgets' ); ?></label>
     575                                                        <label><input type="checkbox" name="ezrpw_settings[credit]" value="1" <?php checked( $s['credit'] ); ?>> <?php esc_html_e( 'Show a small «Source: EZRate» link (with its icon) in every widget — thank you, it keeps this plugin free', 'ezrate-price-widgets' ); ?></label>
    574576                                                        <p class="description"><?php esc_html_e( 'Both are off by default: the plugin adds no links to your site unless you allow it.', 'ezrate-price-widgets' ); ?></p>
    575577                                                </td></tr>
    … …  
    699701
    700702        /**
     703         * Asks once (administrators, on the dashboard, Plugins and EZRate screens) whether the widgets may show the small
     704         * «Source: EZRate» link. Nothing is added to the site unless the owner says yes; «No thanks» is never asked again.
     705         */
     706        public static function credit_ask() {
     707                if ( get_option( 'ezrpw_credit_asked' ) || get_option( 'ezrpw_welcome' ) || ! current_user_can( self::CAP ) || ! EZRPW_Widgets::all() ) {
     708                        return;
     709                }
     710                $s = EZRPW_Widgets::settings();
     711                if ( ! empty( $s['credit'] ) ) {
     712                        return;
     713                }
     714                $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
     715                if ( $screen && ! in_array( $screen->id, array( 'dashboard', 'plugins' ), true ) && false === strpos( (string) $screen->id, 'ezrpw' ) ) {
     716                        return;
     717                }
     718                $url = function ( $do ) {
     719                        return wp_nonce_url( admin_url( 'admin-post.php?action=ezrpw_credit&do=' . $do ), 'ezrpw_credit' );
     720                };
     721                echo '<div class="notice notice-info"><p><strong>' . esc_html__( 'May your price widgets show a small «Source: EZRate» link?', 'ezrate-price-widgets' ) . '</strong> '
     722                        . esc_html__( 'It names where the rates come from and helps keep this plugin and its data free. You can change this any time in EZRate › Settings.', 'ezrate-price-widgets' ) . '</p><p>'
     723                        . '<a class="button button-primary" href="' . esc_url( $url( 'on' ) ) . '">' . esc_html__( 'Yes, show the source', 'ezrate-price-widgets' ) . '</a> '
     724                        . '<a class="button" href="' . esc_url( $url( 'off' ) ) . '">' . esc_html__( 'No thanks', 'ezrate-price-widgets' ) . '</a></p></div>';
     725        }
     726
     727        /**
     728         * Answer of the «Source: EZRate» question.
     729         */
     730        public static function credit_answer() {
     731                self::guard( 'ezrpw_credit' );
     732                $do = isset( $_GET['do'] ) ? sanitize_key( wp_unslash( $_GET['do'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- checked by guard() above.
     733                update_option( 'ezrpw_credit_asked', 1, false );
     734                if ( 'on' === $do ) {
     735                        $s           = EZRPW_Widgets::settings();
     736                        $s['credit'] = true;
     737                        update_option( EZRPW_Widgets::SETTINGS, $s );
     738                }
     739                wp_safe_redirect( wp_get_referer() ? wp_get_referer() : admin_url( 'admin.php?page=ezrpw-widgets' ) );
     740                exit;
     741        }
     742
     743        /**
    701744         * Dismiss the welcome notice.
    702745         */
  • ezrate-price-widgets/trunk/includes/class-ezrpw-format.php

    r3777366 r3778033  
    3737                        'low'     => 'کمترین',
    3838                        'high'    => 'بیشترین',
    39                         'credit'  => 'قیمت‌ها از',
     39                        'credit'  => 'منبع:',
     40                        'brand'   => 'ایزی‌ریت',
    4041                        'nodata'  => 'قیمت‌ها به‌زودی نمایش داده می‌شود.',
    4142                ),
    … …  
    5556                        'low'     => 'Low',
    5657                        'high'    => 'High',
    57                         'credit'  => 'Rates by',
     58                        'credit'  => 'Source:',
     59                        'brand'   => 'EZRate',
    5860                        'nodata'  => 'Rates will appear shortly.',
    5961                ),
    … …  
    7375                        'low'     => 'الأدنى',
    7476                        'high'    => 'الأعلى',
    75                         'credit'  => 'الأسعار من',
     77                        'credit'  => 'المصدر:',
     78                        'brand'   => 'EZRate',
    7679                        'nodata'  => 'ستظهر الأسعار قريباً.',
    7780                ),
    … …  
    9194                        'low'     => 'Мин.',
    9295                        'high'    => 'Макс.',
    93                         'credit'  => 'Курсы от',
     96                        'credit'  => 'Источник:',
     97                        'brand'   => 'EZRate',
    9498                        'nodata'  => 'Курсы скоро появятся.',
    9599                ),
    … …  
    109113                        'low'     => 'En düşük',
    110114                        'high'    => 'En yüksek',
    111                         'credit'  => 'Kurlar:',
     115                        'credit'  => 'Kaynak:',
     116                        'brand'   => 'EZRate',
    112117                        'nodata'  => 'Kurlar birazdan görünecek.',
    113118                ),
  • ezrate-price-widgets/trunk/includes/class-ezrpw-render.php

    r3777366 r3778033  
    265265                }
    266266                // the list twice: the animation slides by half its width and loops without a gap.
    267                 return '<div class="ezrpw-track-wrap"><div class="ezrpw-track">' . $items . '<span class="ezrpw-dup" aria-hidden="true">' . $items . '</span></div></div>';
     267                $credit = EZRPW_Widgets::settings()['credit'] ? '<span class="ezrpw-src">' . self::credit( $w['lang'], $data ) . '</span>' : '';
     268                return '<div class="ezrpw-track-wrap"><div class="ezrpw-track">' . $items . '<span class="ezrpw-dup" aria-hidden="true">' . $items . '</span></div></div>' . $credit;
    268269        }
    269270
    … …  
    280281                        $items .= self::item( $r, $w, $data );
    281282                }
    282                 return '<div class="ezrpw-row">' . $items . '</div>';
     283                $credit = EZRPW_Widgets::settings()['credit'] ? '<span class="ezrpw-src">' . self::credit( $w['lang'], $data ) . '</span>' : '';
     284                return '<div class="ezrpw-row">' . $items . $credit . '</div>';
    283285        }
    284286
    … …  
    422424                $time   = EZRPW_Format::date( $data['generated_at'], $lang, 'HH:mm' );
    423425                $text   = EZRPW_Format::t( $lang, 'updated' ) . ' ' . $time . ' - ' . EZRPW_Format::t( $lang, 'unit' ) . ': ' . EZRPW_Format::unit( $lang, isset( $w['cur'] ) ? $w['cur'] : 'irt' );
    424                 $credit = $s['credit'] ? '<a class="ezrpw-credit" href="' . esc_url( untrailingslashit( $data['site'] ) . '/' . $lang ) . '" target="_blank" rel="noopener">' . esc_html( EZRPW_Format::t( $lang, 'credit' ) ) . ' EZRate</a>' : '<span></span>';
     426                $credit = $s['credit'] ? self::credit( $lang, $data ) : '<span></span>';
    425427                return '<div class="ezrpw-ft">' . $credit . '<span>' . esc_html( $text ) . '</span></div>';
    426428        }
     429
     430        /**
     431         * «Source: [icon] EZRate» — only when the site owner allowed it (Settings, or «Yes» on the notice); the icon comes first
     432         * in the reading direction (right in Persian / Arabic, left in the others).
     433         *
     434         * @param string $lang Language.
     435         * @param array  $data Data.
     436         * @return string
     437         */
     438        public static function credit( $lang, $data ) {
     439                $site = untrailingslashit( ! empty( $data['site'] ) ? $data['site'] : 'https://ezrate.me' );
     440                return '<a class="ezrpw-credit" href="' . esc_url( $site . '/' . $lang ) . '" target="_blank" rel="noopener">'
     441                        . '<img src="' . esc_url( EZRPW_URL . 'assets/img/icon-128.png' ) . '" alt="" width="16" height="16" loading="lazy" decoding="async">'
     442                        . '<span>' . esc_html( EZRPW_Format::t( $lang, 'credit' ) ) . ' <b>' . esc_html( EZRPW_Format::t( $lang, 'brand' ) ) . '</b></span></a>';
     443        }
    427444}
  • ezrate-price-widgets/trunk/readme.txt

    r3777366 r3778033  
    1 === EZRate Price Widgets ===
     1=== EZRate Price Widgets – Live Dollar, Gold, Coin & Crypto Prices ===
    22Contributors: aslanaria2000
    3 Tags: currency, exchange rate, gold price, toman, ticker
     3Tags: exchange rates, gold price, currency, crypto prices, toman
    44Requires at least: 6.3
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 2.2.0
     7Stable tag: 2.3.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Live Iranian free-market rates in Toman — US dollar, euro, gold, coins, USDT and crypto — as a ticker, price bar, cards, table or chart.
     11Live dollar, euro, gold, coin, USDT and crypto prices in Toman from Iran's free market — ticker, price bar, cards, table or chart widgets.
    1212
    1313== Description ==
    … …  
    4747
    4848The dashboard is in English and Persian (فارسی). Each widget has its own language, independent of the site language. A complete guide in both languages is under **EZRate › Help**.
     49
     50= به فارسی =
     51
     52افزونهٔ **ویجت قیمت ایزی‌ریت** قیمت لحظه‌ای دلار، یورو، درهم، لیر و بیش از ۲۰ ارز دیگر، قیمت طلای ۱۸ عیار و ۲۴ عیار، قیمت سکه امامی و بهار آزادی، انس طلا، قیمت تتر و بیت‌کوین را از بازار آزاد ایران به تومان در سایت وردپرسی شما نشان می‌دهد: زیرنویس متحرک قیمت، نوار قیمت بالای سایت، کارت و جدول قیمت ارز و طلا، و نمودار. بدون ثبت‌نام، بدون کلید API و بدون یک خط کدنویسی؛ همهٔ تنظیمات در پیشخوان وردپرس، با بلوک گوتنبرگ، ابزارک و شورت‌کد.
    4953
    5054== External services ==
    … …  
    8791Yes. Cached pages show the prices of the moment they were cached; most caching plugins refresh pages regularly.
    8892
     93= Does the plugin add links to my site? =
     94
     95Not unless you allow it. After you create a widget the plugin asks once whether your widgets may show a small «Source: EZRate» link with its icon; you can also switch it (and links from each price to its chart page) on or off in **EZRate › Settings**. Both are off until you say yes.
     96
    8997= Can I show the prices in English? =
    9098
    … …  
    110118
    111119== Changelog ==
     120
     121= 2.3.0 =
     122* New: optional «Source: EZRate» link with the EZRate icon in every widget type (ticker and price bar too), in the widget's language; asked once, off until you allow it.
     123* Better plugin name and description for search.
    112124
    113125= 2.2.0 =
  • ezrate-price-widgets/trunk/uninstall.php

    r3777366 r3778033  
    1414        return;
    1515}
    16 foreach ( array( 'ezrpw_widgets', 'ezrpw_settings', 'ezrpw_last_data', 'ezrpw_status', 'ezrpw_welcome', 'ezrpw_welcome_shown', 'widget_ezrpw_widget' ) as $ezrpw_option ) {
     16foreach ( array( 'ezrpw_widgets', 'ezrpw_settings', 'ezrpw_last_data', 'ezrpw_status', 'ezrpw_welcome', 'ezrpw_welcome_shown', 'ezrpw_credit_asked', 'widget_ezrpw_widget' ) as $ezrpw_option ) {
    1717        delete_option( $ezrpw_option );
    1818}
Note: See TracChangeset for help on using the changeset viewer.