Plugin Directory

Changeset 2821418


Ignore:
Timestamp:
11/21/2022 10:37:58 AM (3 years ago)
Author:
Goback2
Message:

New ver 2.9.1

Location:
pardakht-delkhah
Files:
47 added
6 edited

Legend:

Unmodified
Added
Removed
  • pardakht-delkhah/trunk/admin-settings.php

    r2692773 r2821418  
    126126            </p>
    127127            <p class="admin_fields">
     128                <strong><?php _e('Send text sms , enter your mobile number', 'cupri') ?></strong>
     129                <input type="number" id="cupri_send_test_sms_mobile" placeholder="0900000000">
     130
     131                <span data-nonce="<?=   wp_create_nonce('cupri_send_test_sms_mobile_nonce');?>" class="button-secondary" id="cupri_send_test_sms_btn"><?= _e('send', 'cupri'); ?></span>
     132                <br>
     133            </p>
     134            <p class="admin_fields">
    128135                <strong><?php _e('SMS format', 'cupri') ?></strong><br>
    129136                <textarea name="cupri_general[admin_sms_format]"
     
    213220                <?php
    214221                $form_scheme = isset($cupri_general['form_scheme']) ? $cupri_general['form_scheme'] : 1;
    215                 $schemes = [1,2,3];
     222                $schemes = [1, 2, 3];
    216223                ?>
    217224                <select name="cupri_general[form_scheme]">
    218                 <?php
    219                 foreach ($schemes as $scheme) {
    220                     echo '<option '.selected($form_scheme,$scheme).' value="'.$scheme.'">'.$scheme.'</option>';
    221                 }
    222                 ?>
     225                    <?php
     226                    foreach ($schemes as $scheme) {
     227                        echo '<option ' . selected($form_scheme, $scheme) . ' value="' . $scheme . '">' . $scheme . '</option>';
     228                    }
     229                    ?>
    223230                </select>
    224231                <span class="desc"></span>
  • pardakht-delkhah/trunk/assets/admin.js

    r2508739 r2821418  
    1 jQuery(document).ready(function($) {
    2     function cupri_concat_url($url,$key, $value) {
    3         $key = encodeURIComponent($key);
    4         $value = encodeURIComponent($value);
     1jQuery(document).ready(function ($) {
     2    function cupri_concat_url($url, $key, $value) {
     3        $key = encodeURIComponent($key);
     4        $value = encodeURIComponent($value);
    55
    6         var $newurl='';
     6        var $newurl = '';
    77
    8         $url = $url.toString().trim();
    9         $key = $key.toString().trim();
    10         $value = $value.toString().trim();
     8        $url = $url.toString().trim();
     9        $key = $key.toString().trim();
     10        $value = $value.toString().trim();
    1111
    12         if($url.indexOf('?')>-1)
    13         {
    14             // has ?
    15             $newurl = $url+'&'+$key+'='+$value;
     12        if ($url.indexOf('?') > -1) {
     13            // has ?
     14            $newurl = $url + '&' + $key + '=' + $value;
    1615
    17         }else{
    18             // no ? sign
    19             if(!$url.endsWith('/'))
    20             {
    21                 $url = $url+'/';
    22             }
    23             $newurl = $url+'?'+$key+'='+$value;
     16        } else {
     17            // no ? sign
     18            if (!$url.endsWith('/')) {
     19                $url = $url + '/';
     20            }
     21            $newurl = $url + '?' + $key + '=' + $value;
    2422
    25         }
     23        }
    2624
    27         return $newurl;
    28     }
     25        return $newurl;
     26    }
    2927
    30     $('#cupri_create_link').on('click',function(e){
    31         e.preventDefault();
    32         $url = $('#cupri_link').val();
    33         $price = $('#cupri_price').val();
    34         $cupri_link_result = $('#cupri_link_result');
    35         $cupri_link_result.val(cupri_concat_url($url,'cupri_fprice',$price));
    36     });
    37     $('._cupri_delete_row').on('click',function(e){
    38         e.preventDefault();
    39         var ths = $(this);
    40         var post_id = $(this).data('post-id');
    41         if(confirm('اطمینان دارید؟'))
    42         {
    43             $.ajax({
    44                 url: ajaxurl,
    45                 type: 'POST',
    46                 dataType: 'json',
    47                 data: {
    48                     action: 'cupri_delete_post',
    49                     post_id:post_id,
    50                     nonce:$(this).data('nonce')
    51                 },
    52             })
    53             .done(function(data) {
    54                 ths.closest('tr').fadeOut('slow');
    55                 console.log("success");
    56             })
    57             .fail(function() {
    58                 console.log("error");
    59             })
    60             .always(function() {
    61                 console.log("complete");
    62             });
    63            
    64         }
    65     });
     28    $('#cupri_create_link').on('click', function (e) {
     29        e.preventDefault();
     30        $url = $('#cupri_link').val();
     31        $price = $('#cupri_price').val();
     32        $cupri_link_result = $('#cupri_link_result');
     33        $cupri_link_result.val(cupri_concat_url($url, 'cupri_fprice', $price));
     34    });
     35    $('._cupri_delete_row').on('click', function (e) {
     36        e.preventDefault();
     37        var ths = $(this);
     38        var post_id = $(this).data('post-id');
     39        if (confirm('اطمینان دارید؟')) {
     40            $.ajax({
     41                url: ajaxurl,
     42                type: 'POST',
     43                dataType: 'json',
     44                data: {
     45                    action: 'cupri_delete_post',
     46                    post_id: post_id,
     47                    nonce: $(this).data('nonce')
     48                },
     49            })
     50                .done(function (data) {
     51                    ths.closest('tr').fadeOut('slow');
     52                    console.log("success");
     53                })
     54                .fail(function () {
     55                    console.log("error");
     56                })
     57                .always(function () {
     58                    console.log("complete");
     59                });
     60
     61        }
     62    });
     63
     64    $('#cupri_send_test_sms_btn').on('click', function () {
     65        let cupri_send_test_sms_mobile = $('#cupri_send_test_sms_mobile').val();
     66        $.ajax({
     67            url: ajaxurl,
     68            type: 'POST',
     69            dataType: 'json',
     70            data: {
     71                action: 'cupri_send_test_sms',
     72                mobile: cupri_send_test_sms_mobile,
     73                nonce: $(this).data('nonce')
     74            },
     75        })
     76            .done(function (data) {
     77                alert(data);
     78                console.log("success");
     79            })
     80            .fail(function () {
     81                console.log("error");
     82            })
     83            .always(function () {
     84                console.log("complete");
     85            });
     86    });
    6687});
  • pardakht-delkhah/trunk/cupri.php

    r2692773 r2821418  
    55Author: استاد وردپرس
    66Author URI: http://wp-master.ir
    7 Version: 2.9
     7Version: 2.9.1
    88Description: با این پلاگین میتونید سیستم پرداخت خودتون رو راه اندازی کنید.
    99 */
     
    307307        if (is_admin() && isset($_GET['post_type']) && $_GET['post_type'] == 'cupri_pay') {
    308308            wp_enqueue_style('cupri-admin-css', cupri_url . '/assets/admin.min.css');
    309             wp_enqueue_script('cupri-admin-js', cupri_url . '/assets/admin.min.js', array('jquery'));
     309            wp_enqueue_script('cupri-admin-js', cupri_url . '/assets/admin.js', array('jquery'));
    310310        }
    311311    }
  • pardakht-delkhah/trunk/extra.php

    r2692773 r2821418  
    440440function cupri_get_currency()
    441441{
    442     __('Toman','cupri');
    443     __('Rial','cupri');
     442    __('Toman', 'cupri');
     443    __('Rial', 'cupri');
    444444    return __(cupri_get_currency_value(), 'cupri');
    445445}
     
    527527function cupri_delete_post()
    528528{
     529    if (!current_user_can('manage_options')) {
     530        return __('You dont have access to do this action', 'cupri');
     531    }
    529532    $nonce = $_POST['nonce'];
    530533    if (!wp_verify_nonce($nonce, 'cupri_row_delete')) {
     
    536539    echo json_encode(array('ok' => 'ok'));
    537540    wp_delete_post($post_id, true);
     541    die();
     542}
     543
     544add_action('wp_ajax_cupri_send_test_sms', 'cupri_send_test_sms');
     545function cupri_send_test_sms()
     546{
     547    if (!current_user_can('manage_options')) {
     548        echo json_encode([__('You dont have access to do this action', 'cupri')]);
     549        die();
     550    }
     551    $nonce = $_POST['nonce'];
     552    if (!wp_verify_nonce($nonce, 'cupri_send_test_sms_mobile_nonce')) {
     553        echo json_encode([__('You dont have access to do this action', 'cupri')]);
     554        die();
     555
     556    }
     557    if (!isset($_POST['mobile'])) {
     558        echo json_encode([__('Mobile is empty', 'cupri')]);
     559        die();
     560
     561    }
     562    $mobile = $_POST['mobile'];
     563    if (empty($mobile)) {
     564        echo json_encode([__('Mobile is empty', 'cupri')]);
     565        die();
     566
     567    }
     568    if (!function_exists('wp_sms_send')) {
     569        echo json_encode([__('wp-sms plugin not detected', 'cupri')]);
     570        die();
     571
     572    }
     573    $to [] = $mobile;
     574    $msg = __('Test sms from pardakht-delkhah plugin') . '(' . get_bloginfo('url') . ')';
     575    $is_flash = false;
     576    $log = wp_sms_send($to, $msg, $is_flash);
     577    echo json_encode([var_export($log, 1)]);
     578
    538579    die();
    539580}
  • pardakht-delkhah/trunk/gateways/class-cupri-abstract-gateway.php

    r2499611 r2821418  
    125125            $coutdown_value = (int)$coutdown_value;
    126126            $to_redirect = trim($to_redirect);
    127             $to_redirect = add_query_arg(array('order_id' => $order_id), $to_redirect);
     127            $to_redirect = add_query_arg(array('cupri_redirected_order_id' => $order_id), $to_redirect);
    128128            echo '<p style="text-align: center; font-style: oblique; display: block; margin: auto; font-size: 0.9em; background: #f3f3f3; padding: 5px; border-bottom: 2px solid #bbb; border-top: 2px solid #bbb;" class="cupri_redirect_counter">شما تا <span id="cupri_counter" style="font-weight: bold;">' . $coutdown_value . '</span> ثانیه دیگر منتقل خواهید شد.</p>
    129129            <script type="text/javascript">
  • pardakht-delkhah/trunk/readme.txt

    r2692773 r2821418  
    22Contributors: goback2
    33Donate link: http://wp-master.ir
    4 Tags: custom price payment,donaite,pardakhte delkhah ,پرداخت دلخواه,فرم پرداخت,دونیت,پرداخت,ردیافت وجه
     4Tags: custom price payment,donaite,pardakhte delkhah ,پرداخت دلخواه,فرم پرداخت,دونیت,پرداخت,دریافت وجه
    55Requires at least: 4.6
    6 Tested up to: 5.9.1
    7 Stable tag: trunk
     6Tested up to: 6.1.1
     7Stable tag: 2.9.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5858
    5959== Changelog ==
     60= 2.9.1 =
     61* ریدایرت به فحه موفق خطای"این پرداخت قبلا تکمیل شده است." میداد ، حل شد
     62
    6063= 2.9 =
    6164* قابلیت انتخاب چند طرح برای فرم
Note: See TracChangeset for help on using the changeset viewer.