Plugin Directory

Changeset 2090930


Ignore:
Timestamp:
05/19/2019 07:59:29 PM (7 years ago)
Author:
nikitaglobal
Message:

v.1.1

Location:
ng-mail2telegram/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ng-mail2telegram/trunk/ng-mail2telegram.php

    r2090893 r2090930  
    55     * Description: Cross copy mail to telegram
    66     * Author: Nikita Menshutin
    7      * Version: 1.0
     7     * Version: 1.1
    88     * Author URI: http://nikita.global
    99     *
     
    3737        public function __construct()
    3838        {
    39             $this->prefix      = 'Ngmailtelegram';
    40             $this->version     = '1.0';
     39            $this->prefix  = 'Ngmailtelegram';
     40            $this->version = '1.1';
     41            load_plugin_textdomain(
     42                $this->prefix,
     43                false,
     44                'ng-mail2telegram/languages'
     45            );
    4146            $this->pluginName  = __('NG WP Mail to telegram', $this->prefix);
    4247            $this->options     = get_option($this->prefix);
     
    4752                    'title'       => __('Bot token', $this->prefix),
    4853                    'placeholder' => __('Bot token', $this->prefix),
    49                     'group'       => 'bot settings',
     54                    'group'       => 'Bot settings',
    5055                    'type'        => 'text',
    5156                    'required'    => true,
     
    5459                    'key'      => 'botreset',
    5560                    'title'    => __('init webhooks for this site', $this->prefix),
    56                     'group'    => 'bot settings',
     61                    'group'    => 'Bot settings',
    5762                    'type'     => 'checkbox',
    5863                    'required' => false,
     
    6166                    'key'      => 'messagefilter',
    6267                    'title'    => __('Message filter', $this->prefix),
    63                     'group'    => 'bot settings',
     68                    'group'    => 'Bot settings',
    6469                    'type'     => 'select',
    6570                    'required' => false,
    6671                    'args'     => apply_filters(
    6772                        $this->prefix . 'messageFilters', array(
    68                             'none'      => __('Do not filter', $this->prefix),
    69                             'subject'   => __('Send subject only', $this->prefix),
    70                             'html'      => __('Send as html', $this->prefix),
    71                             'short'     => __('Cut long message', $this->prefix),
    72                             'stripTags' => __('Strip html tags', $this->prefix),
    73                             'file'      => __('Send file', $this->prefix)
     73                            'none'      => 'Do not filter',
     74                            'subject'   => 'Send subject only',
     75                            'html'      => 'Send as html',
     76                            'short'     => 'Cut long message',
     77                            'stripTags' => 'Strip html tags',
     78                            'file'      => 'Send file'
    7479                        )
    7580                    )
     
    8186                }
    8287            }
     88            add_action('init', array($this, 'loadTranslation'));
    8389            add_action('admin_init', array($this, 'settingsRegister'));
    8490            add_action('admin_init', array($this, 'processGetQuery'));
     
    233239            return $args;
    234240        }
    235    
     241           
    236242        /**
    237243         * Query filter - html content
     
    318324            unset($args['chat_id']);
    319325            unset($args['text']);
    320             $linebreak = "\r\n";
    321             $boundary  = $this->prefix . crc32($text);
     326            $linebreak       = "\r\n";
     327            $boundary        = $this->prefix . crc32($text);
    322328            $args['headers'] = array(
    323329                'Content-Type' => 'multipart/form-data; boundary=' . $boundary . '',
     
    389395            $current_user = wp_get_current_user();
    390396            if ($current_user->ID == 0) {
    391                 wp_die(__($this->strings['notloggedin']));
     397                wp_die(__($this->strings['notloggedin'], $this->prefix));
    392398            }
    393399            update_user_meta($current_user->ID, $this->prefix, $data['data']);
     
    395401            die(
    396402                __(
    397                     $this->strings['subscribed']
     403                    $this->strings['subscribed'],
     404                    $this->prefix
    398405                )
    399406            );
     
    689696               
    690697            $reply = (wp_remote_post($url, $this->args));
    691             $body=(wp_remote_retrieve_body($reply));
     698            $body  = (wp_remote_retrieve_body($reply));
    692699               
    693700               
     
    796803                }
    797804                echo ">";
    798                 echo $v;
     805                _e($v, $this->prefix);
    799806                echo '</option>';
    800807                   
     
    815822            echo $args['key'] . ']" ';
    816823            if (isset($args['placeholder'])) {
    817                 echo ' placeholder="' . $args['placeholder'] . '"';
     824                echo ' placeholder="';
     825                echo __($args['placeholder'], $this->prefix) . '"';
    818826            }
    819827            if (isset($args['required']) && $args['required']) {
     
    887895                    array(
    888896                            get_available_languages(),
    889                             $this->strings
     897                            $this->strings,
     898                            $this->version
    890899                        )
    891900                )
     
    903912                    update_option(
    904913                        $this->prefix . crc32($text . $shortslug),
    905                         __($text, $this->prefix) . $lang
     914                        __($text, $this->prefix, $this->prefix)
    906915                    );
    907916                }
     
    927936               
    928937            return $text;
     938        }
     939           
     940        /**
     941         * Loading language files
     942         *
     943         * @return void
     944         */
     945        public function loadTranslation()
     946        {
     947           
    929948        }
    930949           
  • ng-mail2telegram/trunk/readme.txt

    r2090900 r2090930  
    66Requires at least: 3.6
    77Tested up to: 5.2
    8 Stable tag: 1.4
     8Stable tag: 1.1
    99Requires PHP: 5.6
    10 Version: 1.0
     10Version: 1.1
    1111License:            GPLv2 or later
    1212License URI:        http://www.gnu.org/licenses/gpl-2.0.html
     13
     14== Description ==
     15
     16Create your own notification bot which will send emails to your dashboard users via telegram.
    1317
    1418Sends all mails to telegram user via your own bot.
    1519No need in many other plugins as you can use any email notifications which will be redirected to telegram
    1620
    17 Developed by Nikita Menshutin
    18 
    1921[https://nikita.global/](https://nikita.global)
    20 
    21 ** Set up **
    22 1. Register your own bot as described [https://core.telegram.org/bots#3-how-do-i-create-a-bot](here)
    23 2. Fill in plugin settings with your bot token
    24 3. Each user which has access to wp-admin should start chat with your bot and follow the subscription link
    2522
    2623Your website should support https.
     
    3330to send notifications.
    3431
    35 == Description ==
    36 
    37 Create your own notification bot which will send emails to your dashboard users via telegram.
    38 
    3932== Installation ==
    4033
     
    46394. Register your own bot as described [https://core.telegram.org/bots#6-botfather](here)
    47405. Fill in plugin settings with your bot token
     416. Each user which has access to wp-admin should start chat with your bot and follow the subscription link
    4842
    4943== Changelog ==
    5044
     45= 1.1 (2019-05-19) =
     46* Better multilanguage support
    5147
    5248= 1.0 (2019-05-16) =
Note: See TracChangeset for help on using the changeset viewer.