Plugin Directory

Changeset 3092528


Ignore:
Timestamp:
05/25/2024 04:58:25 PM (21 months ago)
Author:
Persianscript
Message:

v 7.1.5

Location:
persian-woocommerce
Files:
2 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • persian-woocommerce/tags/7.1.5/include/class-address.php

    r3089342 r3092528  
    352352
    353353                $(document.body).on('change', '#<?php echo esc_attr( $type ); ?>_country', function () {
    354                     var is_iran = $('#<?php echo esc_attr( $type ); ?>_country').val() == '<?php echo $this->country ?>' ? 'yes' : 'no';
     354                    var is_iran = $('#<?php echo esc_attr( $type ); ?>_country').val() == '<?php echo esc_attr($this->country); ?>' ? 'yes' : 'no';
    355355                    set_iran_cities_field('<?php echo esc_attr( $type ); ?>', is_iran);
    356356                });
  • persian-woocommerce/tags/7.1.5/include/class-core.php

    r3089342 r3092528  
    6666                'title'      => 'تاریخ شمسی',
    6767                'capability' => 'manage_options',
    68                 'slug'       => admin_url( 'admin.php?page=persian-wc-tools&tab=date' ),
     68                'slug'       => esc_url( admin_url( 'admin.php?page=persian-wc-tools&tab=date' )),
    6969                'callback'   => '',
    7070            ],
     
    7878                'title'      => 'سوپر ادمین',
    7979                'capability' => 'manage_options',
    80                 'slug'       => admin_url( 'admin.php?page=persian-wc-tools&tab=super_admin' ),
     80                'slug'       => esc_url(admin_url( 'admin.php?page=persian-wc-tools&tab=super_admin' )),
    8181                'callback'   => '',
    8282            ],
  • persian-woocommerce/tags/7.1.5/include/class-gateways.php

    r3091092 r3092528  
    713713    }
    714714
    715     protected function nusoap() {
    716         if ( ! class_exists( 'nusoap_client' ) ) {
    717             include_once( 'lib/nusoap.php' );
    718         }
    719     }
    720715
    721716    /*
  • persian-woocommerce/tags/7.1.5/include/class-notice.php

    r3089342 r3092528  
    5151
    5252                        $.ajax({
    53                             url: "<?php echo admin_url( 'admin-ajax.php' ) ?>",
     53                            url: "<?php echo esc_url(admin_url( 'admin-ajax.php' )) ?>",
    5454                            type: 'post',
    5555                            data: {
     
    6464
    6565                $.ajax({
    66                     url: "<?php echo admin_url( 'admin-ajax.php' ) ?>",
     66                    url: "<?php echo esc_url(admin_url( 'admin-ajax.php' )) ?>",
    6767                    type: 'post',
    6868                    data: {
  • persian-woocommerce/tags/7.1.5/include/class-tools.php

    r3089342 r3092528  
    6262
    6363        if ( count( $html_sections ) ) {
    64             printf( '<ul class="subsubsub">%s</ul><br>', implode( " | ", $html_sections ) );
     64            printf( '<ul class="subsubsub">%s</ul><br>', esc_html(implode( " | ", $html_sections ) ));
    6565        }
    6666
     
    444444                }
    445445                ?>
    446             </select> <br/><a class="select_all button" href="#"><?php _e( 'Select all', 'woocommerce' ); ?></a> <a
    447                     class="select_none button" href="#"><?php _e( 'Select none', 'woocommerce' ); ?></a>
     446            </select> <br/><a class="select_all button" href="#">انتخاب همه</a> <a
     447                    class="select_none button" href="#">هیچکدام</a>
    448448        </td>
    449449        </tr><?php
  • persian-woocommerce/tags/7.1.5/include/class-translate.php

    r3089342 r3092528  
    136136        ?>
    137137        <form action="" method="post" id="woocommerce_persian_translate">
    138             <input type="hidden" name="s" value="<?php echo esc_attr( $_GET['s'] ?? null ); ?>"/>
     138            <input type="hidden" name="s" value="<?php echo esc_attr( sanitize_text_field( $_GET['s'] ?? null ) ); ?>"/>
    139139            <input type="hidden" name="action" value="pw_save_translates"/>
    140140            <input type="hidden" name="security"
     
    269269
    270270    public function __construct() {
    271 
    272271        global $wpdb;
    273272
    274         $search  = '';
     273        $table   = $wpdb->prefix . 'woocommerce_ir';
    275274        $perPage = 20;
    276275        $db_page = ( $this->get_pagenum() - 1 ) * $perPage;
    277276
    278         if ( isset( $_GET['s'] ) && ! empty( $_GET['s'] ) ) {
    279             $s      = sanitize_text_field( $_GET['s'] );
    280             $search = " WHERE text1 LIKE '%{$s}%' OR text2 LIKE '%{$s}%'";
    281         }
    282 
    283         $this->data = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}woocommerce_ir`{$search} ORDER BY id DESC LIMIT $db_page, $perPage;", ARRAY_A );
     277        $s = sanitize_text_field( trim( $_GET['s'] ?? '' ) );
     278
     279        $query       = $wpdb->prepare( "SELECT * FROM %i
     280                                 WHERE `text1` LIKE '%%%s%' OR `text2` LIKE '%%%s%'
     281                             ORDER BY `id` DESC LIMIT %d, %d;", $table, $s, $s, $db_page, $perPage );
     282        $total_query = $wpdb->prepare( "SELECT COUNT(*) FROM %i WHERE `text1` LIKE '%%%s%' OR `text2` LIKE '%%%s%';", $table, $s, $s );
     283
     284        $this->data = $wpdb->get_results( $query, ARRAY_A );
    284285
    285286        $this->set_pagination_args( [
    286             'total_items' => $wpdb->get_var( "SELECT COUNT(*) FROM `{$wpdb->prefix}woocommerce_ir`{$search};" ),
    287             'per_page'    => $perPage,
     287          'total_items' => $wpdb->get_var( $total_query ),
     288          'per_page'    => $perPage,
    288289        ] );
    289290
  • persian-woocommerce/tags/7.1.5/include/gateways/class-zibal.php

    r3091092 r3092528  
    1212add_action( 'after_plugin_row_zibal-payment-gateway-for-woocommerce/index.php', function ( $plugin_file, $plugin_data, $status ) {
    1313    echo '<tr class="inactive"><td>&nbsp;</td><td colspan="2">
    14             <div class="notice inline notice-warning notice-alt"><p>افزونه «<strong>درگاه پرداخت زیبال برای فروشگاه ساز ووکامرس</strong>» درون بسته ووکامرس فارسی وجود دارد و نیاز به فعال سازی نیست. به صفحه <a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout' ) . '">ووکامرس > پیکربندی > تسویه حساب</a> مراجعه کنید.</p></div>
     14            <div class="notice inline notice-warning notice-alt"><p>افزونه «<strong>درگاه پرداخت زیبال برای فروشگاه ساز ووکامرس</strong>» درون بسته ووکامرس فارسی وجود دارد و نیاز به فعال سازی نیست. به صفحه <a href="' . esc_url(admin_url( 'admin.php?page=wc-settings&tab=checkout' )) . '">ووکامرس > پیکربندی > تسویه حساب</a> مراجعه کنید.</p></div>
    1515            </td>
    1616        </tr>';
  • persian-woocommerce/tags/7.1.5/include/tools/class-date.php

    r3089342 r3092528  
    304304        foreach ( $dates as $year => $months ) {
    305305
    306             printf( '<optgroup label="سال %s">', CalendarUtils::convertNumbers( $year ) );
     306            printf( '<optgroup label="سال %s">', esc_attr(CalendarUtils::convertNumbers( $year) ));
    307307
    308308            foreach ( $months as $month => $count ) {
     
    417417        foreach ( $dates as $year => $months ) {
    418418
    419             printf( '<optgroup label="سال %s">', CalendarUtils::convertNumbers( $year ) );
     419            printf( '<optgroup label="سال %s">', esc_attr(CalendarUtils::convertNumbers( $year ) ));
    420420
    421421            foreach ( $months as $month => $count ) {
  • persian-woocommerce/tags/7.1.5/include/tools/class-general.php

    r3089342 r3092528  
    11<?php
    2 
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    35class PW_Tools_General {
    46
  • persian-woocommerce/tags/7.1.5/include/tools/class-price.php

    r3089342 r3092528  
    7676            if ( WC()->cart->get_total( null ) < $minimum ) {
    7777
    78                 $message = sprintf( __( 'مبلغ سفارش شما %s می باشد، حداقل مبلغ جهت ثبت سفارش %s است.' ), wc_price( WC()->cart->get_total( null ) ), wc_price( $minimum ) );
     78                $message = sprintf('مبلغ سفارش شما %s می باشد، حداقل مبلغ جهت ثبت سفارش %s است.', wc_price( WC()->cart->get_total( null ) ), wc_price( $minimum ) );
    7979
    8080                if ( is_cart() ) {
  • persian-woocommerce/tags/7.1.5/include/view/html-admin-page-about.php

    r3089342 r3092528  
     1<?php
     2     if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     3     ?>
    14<div class="wrap about-wrap persian-woocommerce">
    25    <h2>به دنیای ووکامرس فارسی خوش آمدید!</h2>
     
    58
    69    <div class="wp-badge"
    7          style="background-color:#d8bfd8 !important;background-image:url('<?php echo PW()->plugin_url( 'assets/images/about.png' ); ?>') !important;background-position: center center;background-size: 167px auto !important;"></div>
     10         style="background-color:#d8bfd8 !important;background-image:url('<?php echo esc_url(PW()->plugin_url( 'assets/images/about.png' )); ?>') !important;background-position: center center;background-size: 167px auto !important;"></div>
    811
    912   
  • persian-woocommerce/tags/7.1.5/include/view/html-admin-page-melipayamak.php

    r3089342 r3092528  
    8383
    8484            <div class="text-center  mb-2">
    85                 <a href="<?php echo admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' ); ?>"
     85                <a href="<?php echo esc_url(admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' )); ?>"
    8686                   class="flex w-full items-center justify-center gap-2 bg-gray-button rounded-[3px] py-3 sm:px-5 px-3  hover:shadow-xl hover:-translate-y-0.5 a2:hover"
    8787                   target="_blank">
     
    256256
    257257            <div class="text-center  mb-2">
    258                 <a href="<?php echo admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' ); ?>"
     258                <a href="<?php echo esc_url(admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' )); ?>"
    259259                   class="flex w-full items-center justify-center gap-2 bg-gray-button rounded-[3px] py-3 sm:px-5 px-3  hover:shadow-xl hover:-translate-y-0.5 a2:hover"
    260260                   target="_blank">
  • persian-woocommerce/trunk/include/class-address.php

    r2861939 r3092528  
    352352
    353353                $(document.body).on('change', '#<?php echo esc_attr( $type ); ?>_country', function () {
    354                     var is_iran = $('#<?php echo esc_attr( $type ); ?>_country').val() == '<?php echo $this->country ?>' ? 'yes' : 'no';
     354                    var is_iran = $('#<?php echo esc_attr( $type ); ?>_country').val() == '<?php echo esc_attr($this->country); ?>' ? 'yes' : 'no';
    355355                    set_iran_cities_field('<?php echo esc_attr( $type ); ?>', is_iran);
    356356                });
  • persian-woocommerce/trunk/include/class-core.php

    r3013709 r3092528  
    6666                'title'      => 'تاریخ شمسی',
    6767                'capability' => 'manage_options',
    68                 'slug'       => admin_url( 'admin.php?page=persian-wc-tools&tab=date' ),
     68                'slug'       => esc_url( admin_url( 'admin.php?page=persian-wc-tools&tab=date' )),
    6969                'callback'   => '',
    7070            ],
     
    7878                'title'      => 'سوپر ادمین',
    7979                'capability' => 'manage_options',
    80                 'slug'       => admin_url( 'admin.php?page=persian-wc-tools&tab=super_admin' ),
     80                'slug'       => esc_url(admin_url( 'admin.php?page=persian-wc-tools&tab=super_admin' )),
    8181                'callback'   => '',
    8282            ],
  • persian-woocommerce/trunk/include/class-gateways.php

    r3091092 r3092528  
    713713    }
    714714
    715     protected function nusoap() {
    716         if ( ! class_exists( 'nusoap_client' ) ) {
    717             include_once( 'lib/nusoap.php' );
    718         }
    719     }
    720715
    721716    /*
  • persian-woocommerce/trunk/include/class-notice.php

    r2988022 r3092528  
    5151
    5252                        $.ajax({
    53                             url: "<?php echo admin_url( 'admin-ajax.php' ) ?>",
     53                            url: "<?php echo esc_url(admin_url( 'admin-ajax.php' )) ?>",
    5454                            type: 'post',
    5555                            data: {
     
    6464
    6565                $.ajax({
    66                     url: "<?php echo admin_url( 'admin-ajax.php' ) ?>",
     66                    url: "<?php echo esc_url(admin_url( 'admin-ajax.php' )) ?>",
    6767                    type: 'post',
    6868                    data: {
  • persian-woocommerce/trunk/include/class-tools.php

    r2988022 r3092528  
    6262
    6363        if ( count( $html_sections ) ) {
    64             printf( '<ul class="subsubsub">%s</ul><br>', implode( " | ", $html_sections ) );
     64            printf( '<ul class="subsubsub">%s</ul><br>', esc_html(implode( " | ", $html_sections ) ));
    6565        }
    6666
     
    444444                }
    445445                ?>
    446             </select> <br/><a class="select_all button" href="#"><?php _e( 'Select all', 'woocommerce' ); ?></a> <a
    447                     class="select_none button" href="#"><?php _e( 'Select none', 'woocommerce' ); ?></a>
     446            </select> <br/><a class="select_all button" href="#">انتخاب همه</a> <a
     447                    class="select_none button" href="#">هیچکدام</a>
    448448        </td>
    449449        </tr><?php
  • persian-woocommerce/trunk/include/class-translate.php

    r3014213 r3092528  
    136136        ?>
    137137        <form action="" method="post" id="woocommerce_persian_translate">
    138             <input type="hidden" name="s" value="<?php echo esc_attr( $_GET['s'] ?? null ); ?>"/>
     138            <input type="hidden" name="s" value="<?php echo esc_attr( sanitize_text_field( $_GET['s'] ?? null ) ); ?>"/>
    139139            <input type="hidden" name="action" value="pw_save_translates"/>
    140140            <input type="hidden" name="security"
     
    269269
    270270    public function __construct() {
    271 
    272271        global $wpdb;
    273272
    274         $search  = '';
     273        $table   = $wpdb->prefix . 'woocommerce_ir';
    275274        $perPage = 20;
    276275        $db_page = ( $this->get_pagenum() - 1 ) * $perPage;
    277276
    278         if ( isset( $_GET['s'] ) && ! empty( $_GET['s'] ) ) {
    279             $s      = sanitize_text_field( $_GET['s'] );
    280             $search = " WHERE text1 LIKE '%{$s}%' OR text2 LIKE '%{$s}%'";
    281         }
    282 
    283         $this->data = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}woocommerce_ir`{$search} ORDER BY id DESC LIMIT $db_page, $perPage;", ARRAY_A );
     277        $s = sanitize_text_field( trim( $_GET['s'] ?? '' ) );
     278
     279        $query       = $wpdb->prepare( "SELECT * FROM %i
     280                                 WHERE `text1` LIKE '%%%s%' OR `text2` LIKE '%%%s%'
     281                             ORDER BY `id` DESC LIMIT %d, %d;", $table, $s, $s, $db_page, $perPage );
     282        $total_query = $wpdb->prepare( "SELECT COUNT(*) FROM %i WHERE `text1` LIKE '%%%s%' OR `text2` LIKE '%%%s%';", $table, $s, $s );
     283
     284        $this->data = $wpdb->get_results( $query, ARRAY_A );
    284285
    285286        $this->set_pagination_args( [
    286             'total_items' => $wpdb->get_var( "SELECT COUNT(*) FROM `{$wpdb->prefix}woocommerce_ir`{$search};" ),
    287             'per_page'    => $perPage,
     287          'total_items' => $wpdb->get_var( $total_query ),
     288          'per_page'    => $perPage,
    288289        ] );
    289290
  • persian-woocommerce/trunk/include/gateways/class-zibal.php

    r3091092 r3092528  
    1212add_action( 'after_plugin_row_zibal-payment-gateway-for-woocommerce/index.php', function ( $plugin_file, $plugin_data, $status ) {
    1313    echo '<tr class="inactive"><td>&nbsp;</td><td colspan="2">
    14             <div class="notice inline notice-warning notice-alt"><p>افزونه «<strong>درگاه پرداخت زیبال برای فروشگاه ساز ووکامرس</strong>» درون بسته ووکامرس فارسی وجود دارد و نیاز به فعال سازی نیست. به صفحه <a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout' ) . '">ووکامرس > پیکربندی > تسویه حساب</a> مراجعه کنید.</p></div>
     14            <div class="notice inline notice-warning notice-alt"><p>افزونه «<strong>درگاه پرداخت زیبال برای فروشگاه ساز ووکامرس</strong>» درون بسته ووکامرس فارسی وجود دارد و نیاز به فعال سازی نیست. به صفحه <a href="' . esc_url(admin_url( 'admin.php?page=wc-settings&tab=checkout' )) . '">ووکامرس > پیکربندی > تسویه حساب</a> مراجعه کنید.</p></div>
    1515            </td>
    1616        </tr>';
  • persian-woocommerce/trunk/include/tools/class-date.php

    r2988022 r3092528  
    304304        foreach ( $dates as $year => $months ) {
    305305
    306             printf( '<optgroup label="سال %s">', CalendarUtils::convertNumbers( $year ) );
     306            printf( '<optgroup label="سال %s">', esc_attr(CalendarUtils::convertNumbers( $year) ));
    307307
    308308            foreach ( $months as $month => $count ) {
     
    417417        foreach ( $dates as $year => $months ) {
    418418
    419             printf( '<optgroup label="سال %s">', CalendarUtils::convertNumbers( $year ) );
     419            printf( '<optgroup label="سال %s">', esc_attr(CalendarUtils::convertNumbers( $year ) ));
    420420
    421421            foreach ( $months as $month => $count ) {
  • persian-woocommerce/trunk/include/tools/class-general.php

    r2863440 r3092528  
    11<?php
    2 
     2if ( ! defined( 'ABSPATH' ) ) {
     3    exit;
     4}
    35class PW_Tools_General {
    46
  • persian-woocommerce/trunk/include/tools/class-price.php

    r2861939 r3092528  
    7676            if ( WC()->cart->get_total( null ) < $minimum ) {
    7777
    78                 $message = sprintf( __( 'مبلغ سفارش شما %s می باشد، حداقل مبلغ جهت ثبت سفارش %s است.' ), wc_price( WC()->cart->get_total( null ) ), wc_price( $minimum ) );
     78                $message = sprintf('مبلغ سفارش شما %s می باشد، حداقل مبلغ جهت ثبت سفارش %s است.', wc_price( WC()->cart->get_total( null ) ), wc_price( $minimum ) );
    7979
    8080                if ( is_cart() ) {
  • persian-woocommerce/trunk/include/view/html-admin-page-about.php

    r2861939 r3092528  
     1<?php
     2     if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     3     ?>
    14<div class="wrap about-wrap persian-woocommerce">
    25    <h2>به دنیای ووکامرس فارسی خوش آمدید!</h2>
     
    58
    69    <div class="wp-badge"
    7          style="background-color:#d8bfd8 !important;background-image:url('<?php echo PW()->plugin_url( 'assets/images/about.png' ); ?>') !important;background-position: center center;background-size: 167px auto !important;"></div>
     10         style="background-color:#d8bfd8 !important;background-image:url('<?php echo esc_url(PW()->plugin_url( 'assets/images/about.png' )); ?>') !important;background-position: center center;background-size: 167px auto !important;"></div>
    811
    912   
  • persian-woocommerce/trunk/include/view/html-admin-page-melipayamak.php

    r2988022 r3092528  
    8383
    8484            <div class="text-center  mb-2">
    85                 <a href="<?php echo admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' ); ?>"
     85                <a href="<?php echo esc_url(admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' )); ?>"
    8686                   class="flex w-full items-center justify-center gap-2 bg-gray-button rounded-[3px] py-3 sm:px-5 px-3  hover:shadow-xl hover:-translate-y-0.5 a2:hover"
    8787                   target="_blank">
     
    256256
    257257            <div class="text-center  mb-2">
    258                 <a href="<?php echo admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' ); ?>"
     258                <a href="<?php echo esc_url(admin_url( 'plugin-install.php?tab=plugin-information&plugin=persian-woocommerce-sms' )); ?>"
    259259                   class="flex w-full items-center justify-center gap-2 bg-gray-button rounded-[3px] py-3 sm:px-5 px-3  hover:shadow-xl hover:-translate-y-0.5 a2:hover"
    260260                   target="_blank">
Note: See TracChangeset for help on using the changeset viewer.