Plugin Directory

Changeset 2170236


Ignore:
Timestamp:
10/08/2019 07:36:04 PM (6 years ago)
Author:
hermit931
Message:

Code review and plugin update

Location:
easy-liqpay
Files:
73 added
4 deleted
9 edited
5 copied
1 moved

Legend:

Unmodified
Added
Removed
  • easy-liqpay/tags/0.8.4/include/classes/ELiq_Pay_Page_Builder.php

    • Property svn:eol-style set to native
    r1403809 r2170236  
    11<?php
    22
    3 class ELiqPayPageBuilder
     3class ELiq_Pay_Page_Builder
    44{
    55    private $fields =[];
    66    private $user_capability = 'manage_options';
    77    private $current_section = '';
    8     private $eliqpal_option;
    98    private $subpages = [];
    109    private $fieldsController;
     
    1211
    1312    function __construct() {
    14         $this->eliqpal_option = elp_get_option();
    15 
    1613        add_action( 'admin_menu', [ $this, '_registerAdminPages' ] );
    1714        add_action( 'admin_init', [ $this, '_registerSettingsFields' ] );
     
    6663
    6764    private function getFieldName( $name ) {
    68         return ELIQPAY_OPTION_NAME ."[$name]";
     65        return ELiq_Pay::OPTION_NAME ."[$name]";
    6966    }
    7067
     
    9592                    'eliqpay_setup',
    9693                    $sp['callback'],
    97                     plugins_url( ELIQPAY_NAME .'/img/menu-icon.png' ),
     94                    plugins_url('easyliqpay/img/menu-icon.png' ),
    9895                    85
    9996                );
     
    162159
    163160
    164         $value = $this->getValue( $args['name'] );
     161        $value = ELiq_Pay::get($args['name']);
    165162
    166163        if ( isset( $args['value'] ) ) {
     
    180177    }
    181178
    182     public function getValue( $field_name ) {
    183         return isset( $this->eliqpal_option[ $field_name ] ) ? $this->eliqpal_option[ $field_name ] : null;
    184     }
    185 
    186179
    187180    public function handlerPreUpdateOptionFilter( $value, $option, $old_value ) {
  • easy-liqpay/tags/0.8.4/include/load_fields.php

    • Property svn:eol-style set to native
  • easy-liqpay/tags/0.8.4/public/widgets/donat/ELiq_Pay_Donat_Widget.php

    • Property svn:eol-style set to native
    r1403809 r2170236  
    11<?php
    2 class ELiqPayWidgetDonat extends WP_Widget {
     2class ELiq_Pay_Donat_Widget extends WP_Widget {
    33
    44    function __construct() {       
    55        $widget_ops = array(
    66            'classname' => 'elp_widget_donat',
    7             'description' => __( 'Donat with LiqPay', 'eliqpay' ),
     7            'description' => __( 'Donat by LiqPay', ELIQPAY_TEXTDOMAIN ),
    88        );
    99       
    10         parent::__construct( 'elp_widget_donat', __( 'Donations', 'eliqpay' ), $widget_ops );
     10        parent::__construct( 'elp_widget_donat', __( 'Donations', ELIQPAY_TEXTDOMAIN ), $widget_ops );
    1111    }
    1212
     
    1515        echo $args['before_widget'];
    1616
    17         if ( !empty( $instance['currency'] ) ) {
    18             $instance['currency'] = array_combine(
    19                 array_values( $instance['currency'] ),
    20                 array_pad(
    21                     [],
    22                     count($instance['currency']),
    23                     1
    24                 )
    25             );
    26         } else {
    27             $instance['currency'] = elp_get_option('currency');
    28         }
    29 
    30         echo elp_donat_template( $instance );
     17        echo ELiq_Pay_Donat::template( $instance );
    3118
    3219        echo $args['after_widget'];
     
    3926        $instance['default_amount'] = !empty( $new_instance['default_amount'] ) ? $new_instance['default_amount']  : '';
    4027        $instance['description'] = !empty( $new_instance['description'] ) ? strip_tags( $new_instance['description'] ) : '';
    41         $instance['currency'] = !empty( $new_instance['currency'] ) ? $new_instance['currency'] : array_keys( elp_get_option('curreny') );
     28        $instance['currency'] = !empty( $new_instance['currency'] ) ? $new_instance['currency'] : array();
    4229        $instance['language'] = !empty( $new_instance['language'] ) ? $new_instance['language'] : '';
    4330        $instance['result_url'] = !empty( $new_instance['result_url'] ) ? strip_tags( $new_instance['result_url'] ) : '';
     
    4734
    4835    function form( $instance ) {
    49         $options = elp_get_option();
    50 
    51         $title = !empty( $instance['title'] ) ? $instance['title'] : __('Donation', 'eliqpay' ) ;
     36        $title = !empty( $instance['title'] ) ? $instance['title'] : __('Donation', ELIQPAY_TEXTDOMAIN ) ;
    5237        $text_before = !empty( $instance['text_before'] ) ? $instance['text_before'] : '';
    5338        $default_amount = isset( $instance['default_amount'] ) ? $instance['default_amount'] : '';
    54         $description = !empty( $instance['description'] ) ? $instance['description'] : $options['payment_description'];
    55         $currency = !empty( $instance['currency'] ) ? $instance['currency'] : array_keys( $options['currency'] );
    56         $language = !empty( $instance['language'] ) ? $instance['language'] : $options['language'];
    57         $result_url = !empty( $instance['result_url'] ) ? $instance['result_url'] : $options['result_url'];
     39        $description = !empty( $instance['description'] ) ? $instance['description'] : ELiq_Pay::get('payment_description');
     40        $currency = !empty( $instance['currency'] ) ? $instance['currency'] : array_keys( ELiq_Pay::get('currency') );
     41        $language = !empty( $instance['language'] ) ? $instance['language'] : ELiq_Pay::get('language');
     42        $result_url = !empty( $instance['result_url'] ) ? $instance['result_url'] : ELiq_Pay::get('result_url');
    5843
    5944        ?>
    6045        <p>
    61             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'eliqpay' ); ?>:</label>
     46            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    6247            <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
    6348        </p>
    6449        <p>
    65             <label for="<?php echo $this->get_field_id( 'text_before' ); ?>"><?php _e( 'Text before form', 'eliqpay' ); ?>:</label>
     50            <label for="<?php echo $this->get_field_id( 'text_before' ); ?>"><?php _e( 'Text before form', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    6651            <input class="widefat" id="<?php echo $this->get_field_id( 'text_before' ); ?>" name="<?php echo $this->get_field_name( 'text_before' ); ?>" type="text" value="<?php echo esc_attr( $text_before ); ?>">
    6752        </p>
    6853        <p>
    69             <label for="<?php echo $this->get_field_id( 'default_amount' ); ?>"><?php _e( 'Default amount', 'eliqpay' ); ?>:</label>
     54            <label for="<?php echo $this->get_field_id( 'default_amount' ); ?>"><?php _e( 'Default amount', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    7055            <input class="widefat" id="<?php echo $this->get_field_id( 'default_amount' ); ?>" name="<?php echo $this->get_field_name( 'default_amount' ); ?>" type="text" value="<?php echo esc_attr( $default_amount ); ?>">
    7156        </p>
    7257        <p>
    73             <label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Payment description', 'eliqpay' ); ?>:</label>
     58            <label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Payment description', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    7459            <input class="widefat" id="<?php echo $this->get_field_id( 'description' ); ?>" name="<?php echo $this->get_field_name( 'description' ); ?>" type="text" value="<?php echo esc_attr( $description ); ?>">
    7560        </p>
    7661        <p>
    77             <label for="<?php echo $this->get_field_id( 'currency' ); ?>"><?php _e( 'Currency', 'eliqpay' ); ?>:</label>
     62            <label for="<?php echo $this->get_field_id( 'currency' ); ?>"><?php _e( 'Currency', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    7863            <?php
    7964            $avaible_curreny = [
    80                 'UAH' => __('UAH', 'eliqpay' ),
    81                 'RUB' => __('RUB', 'eliqpay' ),
    82                 'USD' => __('USD', 'eliqpay' ),
    83                 'EUR' => __('EUR', 'eliqpay' )
     65                'UAH' => __('UAH', ELIQPAY_TEXTDOMAIN ),
     66                'RUB' => __('RUB', ELIQPAY_TEXTDOMAIN ),
     67                'USD' => __('USD', ELIQPAY_TEXTDOMAIN ),
     68                'EUR' => __('EUR', ELIQPAY_TEXTDOMAIN )
    8469            ];
    8570            foreach ($avaible_curreny as $key => $value) {
     
    9075        </p>
    9176        <p>
    92             <label for="<?php echo $this->get_field_id( 'language' ); ?>"><?php _e( 'Language', 'eliqpay' ); ?>:</label>
     77            <label for="<?php echo $this->get_field_id( 'language' ); ?>"><?php _e( 'Language', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    9378            <select id="<?php echo $this->get_field_id( 'language' ); ?>" name="<?php echo $this->get_field_name( 'language' ); ?>">
    9479            <?php
    9580            $avaible_languages = [
    96                 'ru' => __('Russian', 'eliqpay' ),
    97                 'en' => __('English', 'eliqpay' )
     81                'ru' => __('Russian', ELIQPAY_TEXTDOMAIN ),
     82                'en' => __('English', ELIQPAY_TEXTDOMAIN )
    9883            ];
    9984            foreach ($avaible_languages as $key => $value) {
     
    10590        </p>
    10691        <p>
    107             <label for="<?php echo $this->get_field_id( 'result_url' ); ?>"><?php _e( 'Result URL', 'eliqpay' ); ?>:</label>
     92            <label for="<?php echo $this->get_field_id( 'result_url' ); ?>"><?php _e( 'Result URL', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    10893            <input class="widefat" id="<?php echo $this->get_field_id( 'result_url' ); ?>" name="<?php echo $this->get_field_name( 'result_url' ); ?>" type="text" value="<?php echo esc_attr( $result_url ); ?>">
    10994        </p>
     
    11196    }
    11297}
    113 
    114 function elp_register_widgets() {
    115     register_widget( 'ELiqPayWidgetDonat' );
    116 }
    117 
    118 add_action( 'widgets_init', 'elp_register_widgets' );
  • easy-liqpay/trunk/admin/admin.php

    r1403805 r2170236  
    11<?php
    2 require_once ELIQPAY_CLASSES_PATH .'/ELiqPayPageBuilder.php';
    32
    4 add_option( ELIQPAY_OPTION_NAME, $default_options, false, false );
     3add_action('init', 'admin_page_handler');
    54
    6 $admin = new ELiqPayPageBuilder();
     5function admin_page_handler() {
     6    #Set init
     7   
     8    require_once ELIQPAY_CLASSES_PATH .'/ELiq_Pay_Page_Builder.php';
     9   
     10    #$eLiqPaySettings
     11
     12    $admin = new ELiq_Pay_Page_Builder();
    713
    814$admin->registerSubpage(
     
    6571            'section' => 'required_setting',
    6672            'required' => true,
    67             'value' => $default_options['payment_description'],
     73            'value' => ELiq_Pay::get('payment_description'),
    6874            'attr' => [
    6975                'rows' => '5',
     
    7783            'section' => 'required_setting',
    7884            'required' => true,
    79             'checked' => array_keys( $default_options['currency'] ),
     85            'checked' => array_keys( ELiq_Pay::get('currency') ),
    8086            'values' => [
    8187                'UAH' => __( 'UAH', 'eliqpay'  ),
     
    96102            'label' => __( 'Result URL', 'eliqpay' ),
    97103            'section' => 'optional_setting',
    98             'value' => $default_options['result_url'],
     104            'value' => ELiq_Pay::get('result_url'),
    99105            'attr' => [
    100106                'size' => '40'
     
    107113            'section' => 'optional_setting',
    108114            'required' => true,
    109             'value' => $default_options['default_amount'],
     115            'value' => ELiq_Pay::get('default_amount'),
    110116            'description' => ''
    111117        ],
     
    115121            'label' => __( 'Language', 'eliqpay' ),
    116122            'section' => 'optional_setting',
    117             'value' => $default_options['language'],
     123            'value' => ELiq_Pay::get('language'),
    118124            'values' => [
    119125                'ru' => __('Russian', 'eliqpay' ),
     
    132138);
    133139
     140}
     141
     142
    134143function elp_setup_page() {
    135144    require_once ELIQPAY_ADMIN_PATH . '/setting.php';
  • easy-liqpay/trunk/common.php

    r1403794 r2170236  
    55        wp_register_script( 'elq_scripts', plugins_url( 'public/assets/js/elp-scripts.js', __FILE__ ), ['jquery'], ELIQPAY_VERSION, true );
    66       
    7         $elp_data = [
     7        $elp_data = array(
    88            'ajaxurl' => admin_url('admin-ajax.php')
    9         ];
     9        );
    1010        wp_localize_script( 'elq_scripts', 'elp', $elp_data );
    1111    }
    1212
    1313    if ( !wp_style_is( 'elq_styles', 'registered' ) ) {
    14         wp_register_style( 'elq_styles', plugins_url( 'public/assets/css/elp-common.css', __FILE__ ), [], ELIQPAY_VERSION );
     14        wp_register_style( 'elq_styles', plugins_url( 'public/assets/css/elp-common.css', __FILE__ ), array(), ELiq_Pay::VERSION );
    1515    }
    1616}
     
    2727
    2828add_action('wp_footer', 'elq_load_styles');
    29 
    30 function elp_get_option( $opt_name = '' ) {
    31     $options = get_option( ELIQPAY_OPTION_NAME, [] );
    32 
    33     if ( !empty( $opt_name ) ) {
    34         return isset( $options[$opt_name] ) ? $options[$opt_name] : null;
    35     }
    36 
    37     return $options;
    38 }
  • easy-liqpay/trunk/easy-liqpay.php

    r1403809 r2170236  
    11<?php
    22/*
    3 Plugin Name: Easy LiqPay
    4 Description: Wordpress LiqPay donation plugin
    5 Version: 0.8.1
    6 Author: Nick Antal
    7 License: GPLv2 or later
    8 Text Domain: eliqpay
    9 Domain Path: /languages
     3 * Plugin Name: Easy LiqPay
     4 * Description: Wordpress LiqPay donation plugin
     5 * Version: 0.8.2
     6 * Author: Nick Antal
     7 * License: GPLv2 or later
     8 * Text Domain: eliqpay
     9 * Domain Path: /languages
    1010*/
    1111
     
    2727*/
    2828
    29 define( 'ELIQPAY_VERSION', '0.8.1');
    30 define( 'ELIQPAY_NAME', 'easy-liqpay');
     29define( 'ELIQPAY_VERSION', '0.8.2'); #deprecated
    3130define( 'ELIQPAY_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    3231define( 'ELIQPAY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    33 define( 'ELIQPAY_CORE', ELIQPAY_PLUGIN_PATH .'core' );
     32define( 'ELIQPAY_CORE', ELIQPAY_PLUGIN_PATH .'include' );
    3433define( 'ELIQPAY_CLASSES_PATH', ELIQPAY_CORE . '/classes' );
    3534define( 'ELIQPAY_ADMIN_PATH', ELIQPAY_PLUGIN_PATH . 'admin' );
     
    3736define( 'ELIQPAY_WIDGETS_PATH', ELIQPAY_PUBLIC_PATH . '/widgets' );
    3837define( 'ELIQPAY_CALLBACK_API', ELIQPAY_PLUGIN_URL .'elp-callback-api.php' );
    39 define( 'ELIQPAY_OPTION_NAME', 'eliqpay_option' );
     38define( 'ELIQPAY_OPTION_NAME', 'eliqpay_option' ); #depricated
     39define( 'ELIQPAY_TEXTDOMAIN', 'eliqpay');
    4040
    4141// Localization
    4242add_action( 'plugins_loaded', 'eliqpay_load_textdomain' );
    4343function eliqpay_load_textdomain() {
    44     load_plugin_textdomain( 'eliqpay', false, basename( dirname( __FILE__ ) ) . '/languages' );
     44    load_plugin_textdomain( ELIQPAY_TEXTDOMAIN, false, ELIQPAY_PLUGIN_PATH . 'languages' );
    4545}
    4646
    47 //require_once ELIQPAY_PLUGIN_PATH .'/languages/l10n.php';
     47require_once ELIQPAY_CLASSES_PATH.'/ELiq_Pay_Exception.php';
     48require_once ELIQPAY_CLASSES_PATH.'/ELiq_Pay.php';
    4849
     50try {
     51    $ELiqPay = ELiq_Pay::getInstance();
     52} catch (ELiq_Pay_Exception $ex) {
     53    wp_die($ex);
     54}
    4955require_once ELIQPAY_PLUGIN_PATH .'/common.php';
    50 require_once ELIQPAY_PUBLIC_PATH .'/utils.php';
    51 
    52 add_action( 'init', function() {
    53     //die();
    54    
    55     if ( is_admin() ) {
    56         $default_options = [
    57             'private_key'   => '',
    58             'public_key'    => '',
    59             'payment_description' => __( 'Donation', 'eliqpay' ),
    60             'currency' => ['UAH' => '1'],
    61             'result_url' => get_bloginfo('url'),
    62             'default_amount' => '10',
    63             'language' => 'ru'
    64         ];
    65         require_once ELIQPAY_ADMIN_PATH . '/admin.php';
    66     }
    67 } );
    68 
    69 require_once ELIQPAY_WIDGETS_PATH .'/widget-donat.php';
    70 
    71 require_once ELIQPAY_CLASSES_PATH .'/ELiqPayProcess.php';
  • easy-liqpay/trunk/include/classes/ELiq_Pay_Page_Builder.php

    • Property svn:eol-style set to native
    r1403809 r2170236  
    11<?php
    22
    3 class ELiqPayPageBuilder
     3class ELiq_Pay_Page_Builder
    44{
    55    private $fields =[];
    66    private $user_capability = 'manage_options';
    77    private $current_section = '';
    8     private $eliqpal_option;
    98    private $subpages = [];
    109    private $fieldsController;
     
    1211
    1312    function __construct() {
    14         $this->eliqpal_option = elp_get_option();
    15 
    1613        add_action( 'admin_menu', [ $this, '_registerAdminPages' ] );
    1714        add_action( 'admin_init', [ $this, '_registerSettingsFields' ] );
     
    6663
    6764    private function getFieldName( $name ) {
    68         return ELIQPAY_OPTION_NAME ."[$name]";
     65        return ELiq_Pay::OPTION_NAME ."[$name]";
    6966    }
    7067
     
    9592                    'eliqpay_setup',
    9693                    $sp['callback'],
    97                     plugins_url( ELIQPAY_NAME .'/img/menu-icon.png' ),
     94                    plugins_url('easyliqpay/img/menu-icon.png' ),
    9895                    85
    9996                );
     
    162159
    163160
    164         $value = $this->getValue( $args['name'] );
     161        $value = ELiq_Pay::get($args['name']);
    165162
    166163        if ( isset( $args['value'] ) ) {
     
    180177    }
    181178
    182     public function getValue( $field_name ) {
    183         return isset( $this->eliqpal_option[ $field_name ] ) ? $this->eliqpal_option[ $field_name ] : null;
    184     }
    185 
    186179
    187180    public function handlerPreUpdateOptionFilter( $value, $option, $old_value ) {
  • easy-liqpay/trunk/include/load_fields.php

    • Property svn:eol-style set to native
  • easy-liqpay/trunk/public/assets/css/elp-common.css

    r1403805 r2170236  
    1717    font-weight: bold;
    1818    outline: none;
    19    
     19
    2020    padding-left: 18px;
    2121    padding-right: 30px;
    22    
     22
    2323    text-align: center;
    2424    -webkit-transition: all 0.2s ease-in-out;
     
    141141
    142142.elp-conteiner .elp-title {
    143     margin: -20px -20px 0;
     143    margin: -21px -21px 0;
    144144    border-radius: 20px 20px 0 0;
    145145    padding: 10px 20px;
  • easy-liqpay/trunk/public/assets/js/elp-scripts.js

    r1403805 r2170236  
    1111            $('select.elp-input-currency').niceSelect();
    1212        }
    13        
     13
    1414        var elpForm = $('form.elp-donat-form');
    1515
    16        
     16
    1717        elpForm.attr('action', 'https://www.liqpay.com/api/checkout' ).on('submit', function(e, submitForm) {
    1818            if ( submitForm ) {
    1919                return true;
    2020            }
    21            
     21
    2222            e.preventDefault();
    2323
    2424            var self = $(this),
    2525                sendData = {
    26                     action: 'elp_process',
     26                    action: 'elp_donat',
    2727                    amount: $('[name="amount"]', self).val(),
    2828                    currency: $('[name="currency"]', self).val()
  • easy-liqpay/trunk/public/noscripthandler.php

    r1403805 r2170236  
     1<?php
     2/*
     3    1. include liqpay sdk
     4    2. generate form from param
     5 *  3. Style form --> move button to middle of screen
     6 *
     7 */
     8?>
     9
    110<form action='https://www.liqpay.com/api/checkout' method='POST' accept-charset="utf-8" name="elpform">
    211<?php
  • easy-liqpay/trunk/public/widgets/donat/ELiq_Pay_Donat_Widget.php

    • Property svn:eol-style set to native
    r1403809 r2170236  
    11<?php
    2 class ELiqPayWidgetDonat extends WP_Widget {
     2class ELiq_Pay_Donat_Widget extends WP_Widget {
    33
    44    function __construct() {       
    55        $widget_ops = array(
    66            'classname' => 'elp_widget_donat',
    7             'description' => __( 'Donat with LiqPay', 'eliqpay' ),
     7            'description' => __( 'Donat by LiqPay', ELIQPAY_TEXTDOMAIN ),
    88        );
    99       
    10         parent::__construct( 'elp_widget_donat', __( 'Donations', 'eliqpay' ), $widget_ops );
     10        parent::__construct( 'elp_widget_donat', __( 'Donations', ELIQPAY_TEXTDOMAIN ), $widget_ops );
    1111    }
    1212
     
    1515        echo $args['before_widget'];
    1616
    17         if ( !empty( $instance['currency'] ) ) {
    18             $instance['currency'] = array_combine(
    19                 array_values( $instance['currency'] ),
    20                 array_pad(
    21                     [],
    22                     count($instance['currency']),
    23                     1
    24                 )
    25             );
    26         } else {
    27             $instance['currency'] = elp_get_option('currency');
    28         }
    29 
    30         echo elp_donat_template( $instance );
     17        echo ELiq_Pay_Donat::template( $instance );
    3118
    3219        echo $args['after_widget'];
     
    3926        $instance['default_amount'] = !empty( $new_instance['default_amount'] ) ? $new_instance['default_amount']  : '';
    4027        $instance['description'] = !empty( $new_instance['description'] ) ? strip_tags( $new_instance['description'] ) : '';
    41         $instance['currency'] = !empty( $new_instance['currency'] ) ? $new_instance['currency'] : array_keys( elp_get_option('curreny') );
     28        $instance['currency'] = !empty( $new_instance['currency'] ) ? $new_instance['currency'] : array();
    4229        $instance['language'] = !empty( $new_instance['language'] ) ? $new_instance['language'] : '';
    4330        $instance['result_url'] = !empty( $new_instance['result_url'] ) ? strip_tags( $new_instance['result_url'] ) : '';
     
    4734
    4835    function form( $instance ) {
    49         $options = elp_get_option();
    50 
    51         $title = !empty( $instance['title'] ) ? $instance['title'] : __('Donation', 'eliqpay' ) ;
     36        $title = !empty( $instance['title'] ) ? $instance['title'] : __('Donation', ELIQPAY_TEXTDOMAIN ) ;
    5237        $text_before = !empty( $instance['text_before'] ) ? $instance['text_before'] : '';
    5338        $default_amount = isset( $instance['default_amount'] ) ? $instance['default_amount'] : '';
    54         $description = !empty( $instance['description'] ) ? $instance['description'] : $options['payment_description'];
    55         $currency = !empty( $instance['currency'] ) ? $instance['currency'] : array_keys( $options['currency'] );
    56         $language = !empty( $instance['language'] ) ? $instance['language'] : $options['language'];
    57         $result_url = !empty( $instance['result_url'] ) ? $instance['result_url'] : $options['result_url'];
     39        $description = !empty( $instance['description'] ) ? $instance['description'] : ELiq_Pay::get('payment_description');
     40        $currency = !empty( $instance['currency'] ) ? $instance['currency'] : array_keys( ELiq_Pay::get('currency') );
     41        $language = !empty( $instance['language'] ) ? $instance['language'] : ELiq_Pay::get('language');
     42        $result_url = !empty( $instance['result_url'] ) ? $instance['result_url'] : ELiq_Pay::get('result_url');
    5843
    5944        ?>
    6045        <p>
    61             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'eliqpay' ); ?>:</label>
     46            <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    6247            <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>">
    6348        </p>
    6449        <p>
    65             <label for="<?php echo $this->get_field_id( 'text_before' ); ?>"><?php _e( 'Text before form', 'eliqpay' ); ?>:</label>
     50            <label for="<?php echo $this->get_field_id( 'text_before' ); ?>"><?php _e( 'Text before form', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    6651            <input class="widefat" id="<?php echo $this->get_field_id( 'text_before' ); ?>" name="<?php echo $this->get_field_name( 'text_before' ); ?>" type="text" value="<?php echo esc_attr( $text_before ); ?>">
    6752        </p>
    6853        <p>
    69             <label for="<?php echo $this->get_field_id( 'default_amount' ); ?>"><?php _e( 'Default amount', 'eliqpay' ); ?>:</label>
     54            <label for="<?php echo $this->get_field_id( 'default_amount' ); ?>"><?php _e( 'Default amount', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    7055            <input class="widefat" id="<?php echo $this->get_field_id( 'default_amount' ); ?>" name="<?php echo $this->get_field_name( 'default_amount' ); ?>" type="text" value="<?php echo esc_attr( $default_amount ); ?>">
    7156        </p>
    7257        <p>
    73             <label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Payment description', 'eliqpay' ); ?>:</label>
     58            <label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Payment description', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    7459            <input class="widefat" id="<?php echo $this->get_field_id( 'description' ); ?>" name="<?php echo $this->get_field_name( 'description' ); ?>" type="text" value="<?php echo esc_attr( $description ); ?>">
    7560        </p>
    7661        <p>
    77             <label for="<?php echo $this->get_field_id( 'currency' ); ?>"><?php _e( 'Currency', 'eliqpay' ); ?>:</label>
     62            <label for="<?php echo $this->get_field_id( 'currency' ); ?>"><?php _e( 'Currency', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    7863            <?php
    7964            $avaible_curreny = [
    80                 'UAH' => __('UAH', 'eliqpay' ),
    81                 'RUB' => __('RUB', 'eliqpay' ),
    82                 'USD' => __('USD', 'eliqpay' ),
    83                 'EUR' => __('EUR', 'eliqpay' )
     65                'UAH' => __('UAH', ELIQPAY_TEXTDOMAIN ),
     66                'RUB' => __('RUB', ELIQPAY_TEXTDOMAIN ),
     67                'USD' => __('USD', ELIQPAY_TEXTDOMAIN ),
     68                'EUR' => __('EUR', ELIQPAY_TEXTDOMAIN )
    8469            ];
    8570            foreach ($avaible_curreny as $key => $value) {
     
    9075        </p>
    9176        <p>
    92             <label for="<?php echo $this->get_field_id( 'language' ); ?>"><?php _e( 'Language', 'eliqpay' ); ?>:</label>
     77            <label for="<?php echo $this->get_field_id( 'language' ); ?>"><?php _e( 'Language', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    9378            <select id="<?php echo $this->get_field_id( 'language' ); ?>" name="<?php echo $this->get_field_name( 'language' ); ?>">
    9479            <?php
    9580            $avaible_languages = [
    96                 'ru' => __('Russian', 'eliqpay' ),
    97                 'en' => __('English', 'eliqpay' )
     81                'ru' => __('Russian', ELIQPAY_TEXTDOMAIN ),
     82                'en' => __('English', ELIQPAY_TEXTDOMAIN )
    9883            ];
    9984            foreach ($avaible_languages as $key => $value) {
     
    10590        </p>
    10691        <p>
    107             <label for="<?php echo $this->get_field_id( 'result_url' ); ?>"><?php _e( 'Result URL', 'eliqpay' ); ?>:</label>
     92            <label for="<?php echo $this->get_field_id( 'result_url' ); ?>"><?php _e( 'Result URL', ELIQPAY_TEXTDOMAIN ); ?>:</label>
    10893            <input class="widefat" id="<?php echo $this->get_field_id( 'result_url' ); ?>" name="<?php echo $this->get_field_name( 'result_url' ); ?>" type="text" value="<?php echo esc_attr( $result_url ); ?>">
    10994        </p>
     
    11196    }
    11297}
    113 
    114 function elp_register_widgets() {
    115     register_widget( 'ELiqPayWidgetDonat' );
    116 }
    117 
    118 add_action( 'widgets_init', 'elp_register_widgets' );
  • easy-liqpay/trunk/readme.txt

    r1403809 r2170236  
    3131== Changelog ==
    3232
     33= 0.8.2 =
     34Update LiqPay SDK. Fix install bugs
     35
    3336= 0.8.1 =
    3437Small fix
Note: See TracChangeset for help on using the changeset viewer.