Plugin Directory

Changeset 2854429


Ignore:
Timestamp:
01/25/2023 02:43:50 PM (3 years ago)
Author:
blocksera
Message:

Security Fixes for ajax and other post methods
Code Enhancements

Location:
cryptocurrency-widgets-pack
Files:
91 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • cryptocurrency-widgets-pack/trunk/assets/admin/js/common.js

    r2751462 r2854429  
    22    $ = jQuery.noConflict();
    33
    4     $('#crypto_custom_css').each(function(e) {
    5         while($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
    6             $(this).height($(this).height()+1);
    7         };
    8     }).css('overflow','hidden');
    9 
    10     $('#crypto_custom_css').keyup(function(e) {
    11         while($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
    12             $(this).height($(this).height()+1);
    13         };
    14     });
     4    autosize($('#crypto_custom_css'));
    155
    166    function select_all(el) {
     
    7969            control.clear();
    8070        });
    81        
     71
    8272        $('.form-radio .img-pro').click(function(){
    8373            $('.prodemo img').each(function(){
     
    9989                $('label[for="crypto_background_color"]:first-child').show();
    10090            }
    101            
     91
    10292            if (this.value == 'ticker') {
    10393                $('.ticker-position').removeClass('cc-hide');
     
    122112                $('.text-position').removeClass('cc-hide');
    123113            }
    124            
     114
    125115            $('.prodemo img').each(function(){
    126116                var imgsrc = $(this).attr('src');
     
    129119            });
    130120        });
    131        
     121
    132122        $('.crypto-edit input[type=radio][name=crypto_ticker_position]').change(function() {
    133123            $('.crypto-edit input[type=radio][name=crypto_ticker_position]').each(function(){
     
    136126                $(this).closest('label').find('img').attr('src',allimgsrc);
    137127            });
    138            
     128
    139129            var curimg = $(this).closest('label').find('img').attr('src');
    140130            curimg = curimg.replace('.png','') + 'hover' + '.png';
     
    206196        })
    207197    });
     198
    208199    $(document).on('click', '.mcwp-notice .notice-dismiss, .mcwp-notice .mcwp-done', function() {
    209200        var $mcwprate = $(this).closest('.mcwp-notice');
  • cryptocurrency-widgets-pack/trunk/assets/public/js/common.js

    r2751462 r2854429  
    184184                    {
    185185                        targets: 0,
    186                         data: 'id',
    187                         name: 'id',
     186                        data: 'rank',
     187                        name: 'rank',
    188188                        render: function(data, type, row, meta) {
    189189                            return data;
  • cryptocurrency-widgets-pack/trunk/cryptocurrency-widgets-pack.php

    r2751469 r2854429  
    77 * Description:         Price ticker, table, cards, label widget for all cryptocurrencies using Coingecko API.
    88 * Requires PHP:        5.6
    9  * Requires at least:   5.6
    10  * Tested up to:        6.0
    11  * Version:             1.8.1
     9 * Requires at least:   4.3.0
     10 * Tested up to:        6.1.1
     11 * Version:             2.0
    1212 * License:             GPL v3
    1313 * Text Domain:         cryptocurrency-widgets-pack
     
    1919if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    2020
    21 define('MCWP_VERSION', '1.8.1');
     21define('MCWP_VERSION', '2.0');
    2222define('MCWP_PATH', plugin_dir_path(__FILE__));
    2323define('MCWP_URL', plugin_dir_url(__FILE__));
    2424
    25 register_activation_hook(__FILE__, array('MCWP_Crypto','activate'));
    26 register_deactivation_hook(__FILE__, array('MCWP_Crypto','deactivate'));
     25require_once MCWP_PATH . 'includes/display.php';
     26require_once MCWP_PATH . 'includes/shortcodes.php';
     27
    2728
    2829if ( ! class_exists( 'MCWP_Crypto' ) ) {
    2930class MCWP_Crypto {
    30    
    31     private static $_instance = null;
    32     public $allpostmetas = array(
    33         'crypto_ticker',
    34         'crypto_ticker_coin',
    35         'crypto_ticker_position',
    36         'crypto_bunch_select',
    37         'crypto_speed',
    38         'crypto_ticker_columns',
    39         'crypto_card_columns',
    40         'crypto_table_columns',
    41         'crypto_background_color',
    42         'crypto_text_color',
    43         'crypto_custom_css'
    44     );
     31
     32    private static $_instance = null;
    4533
    4634    public static function get_instance() {
     
    5139        return self::$_instance;
    5240    }
    53    
    54     public static function activate() {
    55         global $wpdb;
     41
     42    public function __construct() {
     43        global $wpdb;
     44
     45        if ( self::$_instance ) {
     46            return;
     47        }
     48
     49        self::$_instance = $this;
     50        $this->wpdb = $wpdb;
     51        $this->tablename = $this->wpdb->prefix . "mcwp_coins";
     52
     53        $this->display = new MCWP_Display();
     54        $this->shortcode = new CryptoPack_Shortcodes();
     55       
     56        require_once(MCWP_PATH . 'includes/duplicate.php');
     57       
     58        add_action('admin_enqueue_scripts',             array($this, 'admin_scripts'));
     59        add_action('wp_enqueue_scripts',                array($this, 'frontend_scripts'));
     60        add_shortcode('cryptopack',                     array($this, 'shortcode'));
     61        add_action('wp_footer',                         array($this, 'global_ticker'));
     62        add_action('wp_ajax_mcwp_table',                array($this, 'table_data'));
     63        add_action('wp_ajax_nopriv_mcwp_table',         array($this, 'table_data'));
     64
     65        $this->create_post_type();
     66        $this->upgrade_version();
     67
     68        register_activation_hook(__FILE__, array($this, 'activate'));
     69        register_deactivation_hook(__FILE__, array($this, 'deactivate'));
     70    }
     71
     72    public static function activate() {
     73        global $wpdb;
    5674        $charset_collate = $wpdb->get_charset_collate();
    5775        $table_name = $wpdb->prefix . 'mcwp_coins';
     
    7492        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    7593        dbDelta( $sql );
    76     }
    77    
    78     public static function deactivate() {
     94    }
     95
     96    public static function deactivate() {
    7997        global $wpdb;
    80         $table_name = $wpdb->prefix . 'mcwp_coins';
     98        $table_name = $wpdb->prefix . 'mcwp_coins';
    8199        $wpdb->query("DROP TABLE IF EXISTS " . $table_name);
    82100        delete_transient('mcwp-data-time');
    83     }
    84    
    85     public function __construct() {
    86         global $wpdb;
    87        
    88         if ( self::$_instance ) {
    89             return;
    90         }
    91        
    92         self::$_instance = $this;
    93         $this->wpdb = $wpdb;
    94         $this->tablename = $this->wpdb->prefix . "mcwp_coins";
    95         $this->mcwp_includes();
    96         $this->upgrade_version();
    97        
    98         require_once(MCWP_PATH . 'includes/duplicate.php');
    99        
    100         add_action('admin_init',                        array($this, 'mcwp_admin_hooks'));
    101         add_action('admin_enqueue_scripts',             array($this,'mcwp_scripts'));
    102         add_action('admin_enqueue_scripts',             array($this,'mcwp_frontend_scripts'));
    103         add_action('wp_enqueue_scripts',                array($this,'mcwp_frontend_scripts'));
    104         add_shortcode('cryptopack',                     array($this,'mcwp_shortcode'));
    105         add_action('wp_footer',                         array($this,'mcwp_tickerHeadFooter'));
    106         add_action('wp_ajax_mcwp_table',                array($this,'mcwp_tables'));
    107         add_action('wp_ajax_nopriv_mcwp_table',         array($this,'mcwp_tables'));
    108     }
    109 
    110     public function mcwp_admin_hooks() {
    111         add_filter('plugin_action_links',               array($this,'mcwp_action_links'), 10, 2 );
    112         add_filter('plugin_row_meta',                   array($this,'mcwp_row_meta'), 10, 2 );
    113 
    114         if(!get_option('mcwp-notice')){
    115             add_option('mcwp-notice','1');
    116         }
    117         if(get_option('mcwp-notice') && get_option('mcwp-notice') != 0) {
    118             add_action('wp_ajax_mcwp_notice',           array($this,'mcwp_notice_dismiss'));
    119         }
    120 
    121         if(!get_option('mcwp-top-notice')){
    122             add_option('mcwp-top-notice',strtotime(current_time('mysql')));
    123         }
    124         if(get_option('mcwp-top-notice') && get_option('mcwp-top-notice') != 0) {
    125             if( get_option('mcwp-top-notice') < strtotime('-3 days')) { //if greater than 3 days
    126                 add_action('admin_notices',             array($this,'mcwp_top_admin_notice'));
    127                 add_action('wp_ajax_mcwp_top_notice',   array($this,'mcwp_top_notice_dismiss'));
    128             }
    129         }
    130101    }
    131102
     
    149120            set_transient('mcwp_version', MCWP_VERSION);
    150121        }
    151        
    152        
     122
    153123        if (version_compare($mcwp_installed_version, '1.6.1', '<')) {
    154124           
    155             $query = "ALTER TABLE " . $this->tablename . " ADD COLUMN img VARCHAR(150) NOT NULL AFTER rank";
    156             $this->wpdb->query($query);
     125            $query = "ALTER TABLE %s ADD COLUMN img VARCHAR(150) NOT NULL AFTER rank";
     126            $this->wpdb->query($this->wpdb->prepare($query, [$this->tablename]));
    157127            delete_transient('mcwp-data-time');
    158128            set_transient('mcwp_version', MCWP_VERSION);
     
    160130
    161131    }
    162    
    163     public function mcwp_scripts(){
    164         wp_enqueue_style(   'wp-color-picker');
    165         wp_enqueue_script(  'wp-color-picker');
    166         wp_enqueue_style(   'mcwpa-crypto-css',         MCWP_URL . 'assets/admin/css/style.css',array(),MCWP_VERSION,'all');
    167         wp_enqueue_style(   'mcwpa-crypto-select-css',  MCWP_URL . 'assets/admin/css/selectize.default.css',array(),MCWP_VERSION,'all');
    168         wp_enqueue_script(  'mcwpa-crypto-es5',         MCWP_URL . 'assets/admin/js/es5.js',array('jquery'), MCWP_VERSION,true);
    169         wp_script_add_data( 'mcwpa-crypto-es5',         'conditional', 'lt IE 9' );
    170         wp_enqueue_script(  'mcw-crypto-select',        MCWP_URL . 'assets/admin/js/selectize.min.js',array('jquery'), MCWP_VERSION,true);
    171         wp_enqueue_script(  'mcwpa-crypto-common',      MCWP_URL . 'assets/admin/js/common.js',array('jquery'), MCWP_VERSION,true);
    172     }
    173    
    174     public function mcwp_frontend_scripts(){
    175        
    176        
    177         wp_enqueue_style(   'mcwp-crypto-css',              MCWP_URL . 'assets/public/css/style.css',array(),MCWP_VERSION,'all');
    178         wp_enqueue_style(   'mcwp-crypto-datatable-css',    MCWP_URL . 'assets/public/css/datatable-style.css',array(),MCWP_VERSION,'all');
    179         wp_enqueue_script(  'mcwp-crypto-datatable-js',     MCWP_URL . 'assets/public/js/jquery.dataTables.min.js',array('jquery'), MCWP_VERSION, true);
    180         wp_enqueue_script(  'mcwp-crypto-datatable-resp',   MCWP_URL . 'assets/public/js/dataTables.responsive.min.js',array('jquery'), MCWP_VERSION, true);
    181         wp_register_script( 'mcwp-crypto-common',           MCWP_URL . 'assets/public/js/common.js',array('jquery'), MCWP_VERSION,true);
    182         wp_localize_script( 'mcwp-crypto-common',           'mcwpajax', array('url' => MCWP_URL, 'ajax_url' => admin_url('admin-ajax.php')));
    183         wp_enqueue_script(  'mcwp-crypto-common');
    184     }
    185    
    186     public function mcwp_all_collection($cquery) {
     132
     133    public function admin_scripts() {
     134
     135        $screen = get_current_screen();
     136
     137        wp_enqueue_style('wp-color-picker');
     138        wp_enqueue_script('wp-color-picker');
     139        wp_enqueue_style('mcwpa-crypto-css',        MCWP_URL . 'assets/admin/css/style.css', array(), MCWP_VERSION, 'all');
     140        wp_enqueue_style('mcwpa-crypto-select-css', MCWP_URL . 'assets/admin/css/selectize.default.css', array(), MCWP_VERSION, 'all');
     141        wp_enqueue_script('mcwpa-crypto-es5',       MCWP_URL . 'assets/admin/js/es5.js', array('jquery'), MCWP_VERSION, true);
     142        wp_script_add_data('mcwpa-crypto-es5',      'conditional', 'lt IE 9' );
     143        wp_enqueue_script('mcw-autosize',           MCWP_URL . 'assets/admin/js/autosize.min.js', array('jquery'), MCWP_VERSION, true);
     144        wp_enqueue_script('mcw-crypto-select',      MCWP_URL . 'assets/admin/js/selectize.min.js', array('jquery'), MCWP_VERSION, true);
     145        wp_enqueue_script('mcwpa-crypto-common',    MCWP_URL . 'assets/admin/js/common.js', array('jquery'), MCWP_VERSION, true);
     146
     147        if ($screen->post_type === 'mcwp' && $screen->base === 'post') {
     148            $this->frontend_scripts();
     149        }
     150    }
     151
     152    public function frontend_scripts() {
     153        wp_enqueue_style('mcwp-crypto-css',             MCWP_URL . 'assets/public/css/style.css',array(), MCWP_VERSION, 'all');
     154        wp_enqueue_style('mcwp-crypto-datatable-css',   MCWP_URL . 'assets/public/css/datatable-style.css', array(), MCWP_VERSION, 'all');
     155        wp_enqueue_script('mcwp-crypto-datatable-js',   MCWP_URL . 'assets/public/js/jquery.dataTables.min.js', array('jquery'), MCWP_VERSION, true);
     156        wp_enqueue_script('mcwp-crypto-datatable-resp', MCWP_URL . 'assets/public/js/dataTables.responsive.min.js', array('jquery'), MCWP_VERSION, true);
     157        wp_register_script('mcwp-crypto-common',        MCWP_URL . 'assets/public/js/common.js', array('jquery'), MCWP_VERSION, true);
     158        wp_localize_script('mcwp-crypto-common',        'mcwpajax', array('url' => MCWP_URL, 'ajax_url' => admin_url('admin-ajax.php')));
     159        wp_enqueue_script('mcwp-crypto-common');
     160    }
     161
     162    public function fetch_coins($cquery) {
    187163       
    188164        $mcwp_data_time = get_transient('mcwp-data-time');
     
    190166        //update old database
    191167        if($mcwp_data_time === false){
    192             $mcwp_request       = wp_remote_get('https://api.blocksera.com/v1/tickers');
     168            $mcwp_request       = wp_remote_get('https://api.blocksera.com/v1/tickers?limit=2000&sort=market_cap_usd');
    193169            $mcwp_body          = wp_remote_retrieve_body($mcwp_request);
    194170            $mcwp_data          = json_decode($mcwp_body);
     
    198174                $weeklyresult = $this->wpdb->get_results($wquery);
    199175                $output = [];
     176
    200177                foreach($weeklyresult as $eachweek){
    201178                    $output[$eachweek->cid] = [
     
    204181                    ];
    205182                }
    206                 $truncate = $this->wpdb->query('TRUNCATE '.$this->tablename);
     183                $truncate = $this->wpdb->query('TRUNCATE ' . $this->tablename);
    207184               
    208185                if($truncate){
    209                     $prefix = "INSERT INTO `".$this->tablename."` (`cid`, `name`, `symbol`, `rank`, `img`, `price_usd`, `market_cap_usd`, `percent_change_24h`, `weekly`, `weekly_not_expire`) VALUES ";
     186                    $prefix = "INSERT INTO `{$this->tablename}` (`cid`, `name`, `symbol`, `rank`, `img`, `price_usd`, `market_cap_usd`, `percent_change_24h`, `weekly`, `weekly_not_expire`) VALUES ";
    210187                   
    211188                    $numItems = count($mcwp_data);
     
    213190                    $qstring = [];
    214191                    foreach ( $mcwp_data as $j => $coins ) {
    215                         if (!($coins->market_cap === null || $coins->market_cap_rank === null) && ($j < 2000)) {
     192                        if (!($coins->market_cap === null || $coins->market_cap_rank === null)) {
    216193                            if(array_key_exists($coins->id, $output)){
    217                                 $insweekly = '"'.$output[$coins->id]['weekly'].'"';
    218                                 $insweeklyexpire = '"'.$output[$coins->id]['weekly_not_expire'].'"';
     194                                $insweekly = $output[$coins->id]['weekly'];
     195                                $insweeklyexpire = $output[$coins->id]['weekly_not_expire'];
    219196                            } else {
    220                                 $insweekly = '""';
    221                                 $insweeklyexpire = '"'.gmdate("Y-m-d H:i:s").'"';
     197                                $insweekly = '';
     198                                $insweeklyexpire = gmdate("Y-m-d H:i:s");
    222199                            }
    223200                           
     
    226203                            $coinssymbol = strtoupper($coins->symbol);
    227204                            $coinsrank = $coins->market_cap_rank;
    228                             $coinsimg = '"'.(($coins->image != 'missing_large.png') ? explode('?',explode('images/',$coins->image)[1])[0] : 'error').'"';
     205                            $coinsimg = (($coins->image != 'missing_large.png') ? explode('?', explode('images/', $coins->image)[1])[0] : 'error');
    229206                            $coinspriceusd = floatval($coins->current_price);
    230207                            $coinsmarketcapusd = floatval($coins->market_cap);
    231208                            $coinspercentchange24h = floatval($coins->price_change_percentage_24h);
    232209                           
    233                             $qstring[] = '("'.$coinsid.'", "'.$coinsname.'", "'.$coinssymbol.'", '.$coinsrank.', '.$coinsimg.', '.$coinspriceusd.', '.$coinsmarketcapusd.', '.$coinspercentchange24h.', '.$insweekly.', '.$insweeklyexpire.')';
     210                            $qstring[] = array($coinsid, $coinsname, $coinssymbol, $coinsrank, $coinsimg, $coinspriceusd, $coinsmarketcapusd, $coinspercentchange24h, $insweekly, $insweeklyexpire);
    234211                        }
    235212                    }
     
    238215
    239216                    foreach($qstring as $chunk) {
    240                        
    241                         $query = $prefix.implode(',', $chunk);
    242                         $result = $this->wpdb->query($query);
     217                        $placeholder = "(%s, %s, %s, %d, %s, %0.14f, %0.2f, %0.2f, %s, %s)";
     218                        $query = $prefix . implode(", ", array_fill(0, count($chunk), $placeholder));
     219                        $this->wpdb->query($this->wpdb->prepare($query, call_user_func_array('array_merge', $chunk)));
    243220                    }
    244221
     
    252229            }
    253230        }
    254        
     231
    255232        $mcwp_data = $this->wpdb->get_results($cquery);
    256233
    257234        return $mcwp_data;
    258235    }
    259    
    260     public function mcwp_image_id($image,$size = 'thumb') {
    261         if($image == 'error'){
    262             return MCWP_URL.'assets/public/img/error.png';
    263         } else {
    264             $image = str_replace('large/',$size.'/',$image);
    265             return 'https://assets.coingecko.com/coins/images/'.$image;
    266         }
    267     }
    268    
    269     public function mcwp_coinsyms() {   
    270         $query = "SELECT cid, name, symbol FROM " . $this->tablename;
    271         $mcwp_coinsyms = array('cid' => array(), 'names' => array(), 'symbols' => array());
    272         $mcwp_data = $this->mcwp_all_collection($query);
    273         foreach($mcwp_data as $mcwp_each_data) {
    274             $mcwp_coinsyms['cid'][] = strtolower($mcwp_each_data->cid);
    275             $mcwp_coinsyms['names'][] = strtolower($mcwp_each_data->name);
    276             $mcwp_coinsyms['symbols'][] = strtolower($mcwp_each_data->symbol);
    277         }
    278         return $mcwp_coinsyms;
    279     }
    280    
    281     public function mcwp_tables_updates(){
    282        
    283         $mcwp_post_id  = intval($_GET['mcwp_id']);
    284         $allpostmetas = $this->allpostmetas;
    285         for($k=0;$k<sizeof($allpostmetas);$k++){
    286             $temp = $allpostmetas[$k];
    287             ${$temp} = get_post_meta( $mcwp_post_id, $temp, true );
    288         }
    289        
    290         $mcwp_coinsyms = $this->mcwp_coinsyms();
    291         $mcwp_cid = $mcwp_coinsyms['cid'];
    292         $selectedcoins = array();
    293        
    294         if($crypto_bunch_select > 0){
    295             for($k=0;$k<sizeof($mcwp_cid);$k++){
    296                 if($k < $crypto_bunch_select) {
    297                     array_push($selectedcoins,$mcwp_cid[$k]);
    298                 }
    299             }
    300         } else {
    301             for($k=0;$k<sizeof($mcwp_cid);$k++){
    302                 if(is_array($crypto_ticker_coin) && in_array($mcwp_cid[$k],$crypto_ticker_coin)){
    303                     array_push($selectedcoins,$mcwp_cid[$k]);
    304                 }
    305             }
    306         }
    307        
    308         $ORDERBY = $_GET['columns'][$_GET['order'][0]['column']]['name'];
    309         $ORDERDIR = $_GET['order'][0]['dir'];
    310         $START = $_GET['start'];
    311         $LENGTH = $_GET['length'];
    312        
    313         $query = 'SELECT * FROM `' . $this->tablename . '` WHERE `cid` IN ("' . implode('","', $selectedcoins) . '") ORDER BY '.$ORDERBY.' ' . $ORDERDIR . ' LIMIT '.$START.', '.$LENGTH;
    314 
    315         $mcwp_names = array();
    316         $mcwp_data = $this->mcwp_all_collection($query);
    317        
    318         $arr = [];
    319        
    320        
    321         $eachcid = [];
    322         foreach($mcwp_data as $mcwp_each_data) {
    323             array_push($eachcid,$mcwp_each_data->cid);
    324         }
    325         $postcoins = implode(',',$eachcid);
    326         $weekly = $this->mcwp_weekly_chart($postcoins);
    327        
    328         foreach($mcwp_data as $mcwp_each_data) {
    329             $key=array();
    330             $key['id']          = intval($mcwp_each_data->id);
    331             $key['name']        = $mcwp_each_data->name;
    332             $key['symbol']      = $mcwp_each_data->symbol;
    333             $key['price']       = $mcwp_each_data->price_usd;
    334             $key['mcap']        = $mcwp_each_data->market_cap_usd;
    335             $key['change']      = $mcwp_each_data->percent_change_24h;
    336             $key['weekly']      = $weekly[$mcwp_each_data->cid];
    337             $key['cid']         = $mcwp_each_data->cid;
    338             $key['imgpath']     = $this->mcwp_image_id($mcwp_each_data->img);
    339             if(is_array($crypto_table_columns) && in_array('coingecko',$crypto_table_columns)) {
    340                 $key['link']    = true;
    341             }
    342             $arr[] = $key;
    343            
    344         }
    345        
    346         $output = array(
    347             'recordsTotal' => sizeof($selectedcoins),
    348             'recordsFiltered' => sizeof($selectedcoins),
    349             'draw'=> $_GET['draw'],
    350             'data'=> $arr
    351         );
    352         return $output;
    353     }
    354     public function mcwp_tables() {
    355        
    356         $success = $this->mcwp_tables_updates();
    357        
    358         if($success){
    359             if ( !empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) && strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) {
    360                 $result = $success;
    361                 echo json_encode($result);
    362             } else {
    363                 header( "location:" . $_SERVER["HTTP_REFERER"] );
    364             }
    365             exit;
    366         }
    367     }
    368     public function mcwp_weekly_chart($postcoins){
     236
     237    public function weekly_chart($postcoins) {
    369238        //check sql
    370         $query = "SELECT cid, symbol, weekly, weekly_not_expire FROM `" . $this->tablename . "` WHERE `cid` IN ('" . implode("','", explode(",",$postcoins)) . "')";
     239        $query = "SELECT cid, symbol, weekly, weekly_not_expire FROM `{$this->tablename}` WHERE `cid` IN ('" . implode("','", explode(",", $postcoins)) . "')";
    371240        $results = $this->wpdb->get_results($query);
    372241       
    373242        $output = []; $expiredcoins = [];
    374243        foreach($results as $res) {
    375             array_push($output,$res->cid);
     244            array_push($output, $res->cid);
    376245           
    377246            //create list of coins to request and update to sql
     
    380249           
    381250            if(($dateFromDatabase < $dateTwelveHoursAgo) || ($res->weekly == '')){
    382                 array_push($expiredcoins,$res->cid);
     251                array_push($expiredcoins, $res->cid);
    383252            }
    384253        }
    385254       
    386255        if(!empty($expiredcoins)){
    387             $url            = 'https://api.blocksera.com/v1/tickers/weekly?coins='.strtolower(implode(',',$expiredcoins)).'&limit=24';
     256            $url            = 'https://api.blocksera.com/v1/tickers/weekly?coins='.strtolower(implode(',', $expiredcoins)).'&limit=24';
    388257            $mcwp_request   = wp_remote_get($url);
    389258            $mcwp_body      = wp_remote_retrieve_body($mcwp_request);
     
    391260       
    392261            if(!is_wp_error($mcwp_request) && wp_remote_retrieve_response_code($mcwp_request) === 200 && !empty($mcwp_data)){
    393                 foreach($expiredcoins as $j=>$sym){
    394                     $weekquery  = "UPDATE `".$this->tablename."` SET `weekly` = '" . implode(',', $mcwp_data->$sym) . "', `weekly_not_expire` = '" . gmdate("Y-m-d H:i:s") . "' WHERE `cid` = '".$expiredcoins[$j]."'";
    395                     $weekresult = $this->wpdb->query($weekquery);
     262                foreach($expiredcoins as $j => $sym) {
     263                    $weekquery  = "UPDATE `{$this->tablename}` SET `weekly` = '%s', `weekly_not_expire` = '%s' WHERE `cid` = '%s'";
     264                    $weekresult = $this->wpdb->query($this->wpdb->prepare($weekquery, [implode(',', $mcwp_data->$sym), gmdate("Y-m-d H:i:s"), $expiredcoins[$j]]));
    396265                }
    397266            } else {
    398                 foreach($expiredcoins as $j=>$sym){
    399                     $weekquery  = "UPDATE `".$this->tablename."` SET `weekly_not_expire` = '" . gmdate("Y-m-d H:i:s",strtotime("-55 minutes")) . "' WHERE `cid` = '".$expiredcoins[$j]."'";
    400                     $weekresult = $this->wpdb->query($weekquery);
     267                foreach($expiredcoins as $j => $sym) {
     268                    $weekquery  = "UPDATE `{$this->tablename}` SET `weekly_not_expire` = '%s' WHERE `cid` = '%s'";
     269                    $weekresult = $this->wpdb->query($this->wpdb->prepare($weekquery, [gmdate("Y-m-d H:i:s", strtotime("-55 minutes")), $expiredcoins[$j]]));
    401270                }
    402271            }
     
    405274        $newarr = [];
    406275        foreach($results as $res){
    407             $newarr[$res->cid] = (isset($mcwp_data->{$res->cid})) ? $mcwp_data->{$res->cid} : explode(',',$res->weekly);
     276            $newarr[$res->cid] = (isset($mcwp_data->{$res->cid})) ? $mcwp_data->{$res->cid} : explode(',', $res->weekly);
    408277        }
    409278       
    410279        return $newarr;
    411280    }
    412     public function mcwp_includes() {
     281
     282    public function create_post_type() {
     283
    413284        function mcwp_hide_title() {
    414285            remove_post_type_support('mcwp', 'title');
    415286        }
     287
    416288        function mcwp_create_post_type() {
     289
    417290            $labels = array(
    418291                'name'                  => _x( 'Cryptocurrency Widgets Pack', 'Post Type General Name', 'cryptocurrency-widgets-pack' ),
     
    443316                'filter_items_list'     => __( 'Filter widgets list', 'cryptocurrency-widgets-pack' ),
    444317            );
     318
    445319            $args = array(
    446320                'label'                 => __( 'Cryptocurrency Widgets Pack', 'cryptocurrency-widgets-pack' ),
     
    465339                'capability_type'       => 'page',
    466340            );
    467             register_post_type( 'mcwp', $args );
    468         }
    469        
    470         add_action('init',              'mcwp_create_post_type' );
     341
     342            register_post_type('mcwp', $args);
     343        }
     344       
     345        add_action('init',              'mcwp_create_post_type');
    471346        add_action('admin_init',        'mcwp_hide_title');
    472         add_action('admin_menu',        array( $this, 'mcwp_register_menu'), 12 );
    473         add_action('add_meta_boxes',    array( $this, 'mcwp_crypto_widget_box' ) );
    474         add_action('save_post',         array( $this, 'mcwp_crypto_widget_box_save' ) );
    475         add_filter('manage_mcwp_posts_columns',       array($this,'mcwp_columns_content'));
    476         add_action('manage_mcwp_posts_custom_column', array($this,'mcwp_custom_column'), 10, 2);
     347        add_action('admin_menu',        array($this->display, 'register_menu'), 12);
     348        add_action('add_meta_boxes',    array($this, 'widget_box'));
     349        add_action('save_post',         array($this, 'save_widget'));
     350
     351        add_filter('manage_mcwp_posts_columns',       array($this, 'posts_columns_content'));
     352        add_action('manage_mcwp_posts_custom_column', array($this, 'posts_custom_column'), 10, 2);
     353
    477354        load_plugin_textdomain('cryptocurrency-widgets-pack', false, dirname(plugin_basename(__FILE__)) . '/languages' );
    478355    }
    479356
    480     public function mcwp_notice_dismiss(){
    481         update_option('mcwp-notice','0');
    482         exit();
    483     }
    484 
    485     public function mcwp_top_notice_dismiss(){
    486         update_option('mcwp-top-notice','0');
    487         exit();
    488     }
    489    
    490     public function mcwp_top_admin_notice(){
    491         ?>
    492             <div class="mcwp-notice notice notice-success is-dismissible">
    493                 <img class="mcwp-iconimg" src="<?php echo MCWP_URL; ?>assets/admin/images/icon.png" style="float:left;" />
    494                 <p style="width:80%;"><?php _e('Enjoying our <strong>Cryptocurrency Widgets Pack?</strong> We hope you liked it! If you feel this plugin helped you, You can give us a 5 star rating!<br>It will motivate us to serve you more !','cryptocurrency-widgets-pack'); ?> </p>
    495                 <a href="https://wordpress.org/support/plugin/cryptocurrency-widgets-pack/reviews/#new-post" class="button button-primary" style="margin-right: 10px !important;color: black;background: white;box-shadow: none !important;text-shadow: none !important;border: 0 none !important;" target="_blank"><?php _e('Rate the Plugin!','cryptocurrency-widgets-pack'); ?> &#11088;&#11088;&#11088;&#11088;&#11088;</a>
    496                 <a href="https://massivecryptopro.blocksera.com" class="button button-secondary" target="_blank"><?php _e('Go Pro','cryptocurrency-widgets-pack'); ?></a>
    497                 <span class="mcwp-done"><?php _e('Already Done','cryptocurrency-widgets-pack'); ?></span>
    498             </div>
    499         <?php
    500     }
    501    
    502     public function mcwp_action_links($actions, $plugin_file){
    503         if( false === strpos( $plugin_file, basename(__FILE__) ) ) return $actions;
    504        
    505         $settings_link = '<a href="'.admin_url().'post-new.php?post_type=mcwp" style="font-weight:bold;">' . __('Add Widgets','cryptocurrency-widgets-pack') . '</a>';
    506         $faq_link = '<a target="_blank" href="https://massivecryptopro.blocksera.com/#faq" style="color:#eda600;font-weight:bold;">' . __('FAQ','cryptocurrency-widgets-pack') . '</a>';
    507         $gopro_link = '<a target="_blank" href="https://massivecryptopro.blocksera.com" style="color:#39b54a;font-weight:bold;">' . __('Go Pro','cryptocurrency-widgets-pack') . '</a>';
    508        
    509         array_unshift( $actions, $gopro_link );
    510         array_unshift( $actions, $faq_link );
    511         array_unshift( $actions, $settings_link );
    512 
    513         return $actions;
    514     }
    515 
    516     public function mcwp_row_meta( $meta, $plugin_file ){
    517         if( false === strpos( $plugin_file, basename(__FILE__) ) ) return $meta;
    518 
    519         $meta[] = '<a href="https://blocksera.com/contact/" target="_blank">' . __('Support','cryptocurrency-widgets-pack') . '</a>';
    520         return $meta;
    521     }
    522 
    523     public function mcwp_register_menu() {
    524 
    525         // Register plugin premium page
    526         add_submenu_page(
    527             'edit.php?post_type=mcwp',
    528             __('Upgrade To PRO - Massive Cryptocurrency Widgets','cryptocurrency-widgets-pack'),
    529             '<span style="color:greenyellow;">'.__('Upgrade to PRO&nbsp;&nbsp;&#x27a4;', 'cryptocurrency-widgets-pack').'</span>',
    530             'manage_options',
    531             'mcwp-premium',
    532             array($this, 'mcwp_premium_page')
    533         );
    534     }
    535 
    536     public function mcwp_premium_page() {
    537         include_once( MCWP_PATH . '/includes/mcwp-premium.php' );
    538     }
    539 
    540     public function mcwp_columns_content($columns) {
     357    public function widget_box() {
     358        add_meta_box( 'mcwp_crypto_widget_box', __( 'Cryptocurrency Widgets Pack Settings', 'cryptocurrency-widgets-pack' ), array( $this, 'widget_settings' ), 'mcwp', 'normal', 'high' );
     359        add_meta_box( 'mcwp_crypto_widget_shortcode', __( 'Crypto Widgets Shortcode', 'cryptocurrency-widgets-pack' ), array( $this->display, 'shortcode' ), 'mcwp', 'side', 'high' );
     360        add_meta_box( 'mcwp_crypto_widget_pro', __( 'Rate the Plugin & Pro Features', 'cryptocurrency-widgets-pack' ), array( $this->display, 'pro' ), 'mcwp', 'side', 'low' );
     361    }
     362
     363    public function posts_columns_content($columns) {
    541364        $newcolumn = array();
    542365        foreach($columns as $key => $title) {
     
    547370            $newcolumn[$key] = $title;
    548371        }
    549         return $newcolumn;
    550     }
    551    
    552     public function mcwp_custom_column($column, $post_id) {
     372        return $newcolumn;
     373    }
     374
     375    public function posts_custom_column($column, $post_id) {
    553376        switch ($column) {
    554             case 'type':
    555                 $type = get_post_meta($post_id, 'crypto_ticker', true);
    556                 _e(ucfirst($type), 'mcwp');
    557                 break;
    558             case 'shortcode':
    559                 echo '<code>[cryptopack id="' . $post_id . '"]</code>';
    560                 break;
    561         }
    562     }
    563    
    564     public function mcwp_crypto_widget_box() {
    565         add_meta_box( 'mcwp_crypto_widget_box', __( 'Cryptocurrency Widgets Pack Settings', 'cryptocurrency-widgets-pack' ),    array( $this, 'mcwp_crypto_widget_box_content' ), 'mcwp', 'normal', 'high' );
    566         add_meta_box( 'mcwp_crypto_widget_shortcode', __( 'Crypto Widgets Shortcode', 'cryptocurrency-widgets-pack' ), array( $this, 'mcwp_crypto_shortcode_content' ), 'mcwp', 'side', 'high' );
    567         add_meta_box( 'mcwp_crypto_widget_pro', __( 'Rate the Plugin & Pro Features', 'cryptocurrency-widgets-pack' ), array( $this, 'mcwp_crypto_shortcode_pro' ), 'mcwp', 'side', 'low' );
    568     }
    569    
    570     public function mcwp_crypto_shortcode_pro( $post ) {
    571         ?>
    572         <div class="mcwp-pro">
    573             <h3><b><?php _e('Plugin Rating:','cryptocurrency-widgets-pack'); ?></b></h3>
    574             <div class="mcwp-anime">
    575                 <a href="https://wordpress.org/support/plugin/cryptocurrency-widgets-pack/reviews/#new-post" target="_blank">
    576                     <span><img src="<?php echo MCWP_URL . 'assets/admin/images/star.png'; ?>" /></span>
    577                     <span><img src="<?php echo MCWP_URL . 'assets/admin/images/star.png'; ?>" /></span>
    578                     <span><img src="<?php echo MCWP_URL . 'assets/admin/images/star.png'; ?>" /></span>
    579                     <span><img src="<?php echo MCWP_URL . 'assets/admin/images/star.png'; ?>" /></span>
    580                     <span><img src="<?php echo MCWP_URL . 'assets/admin/images/star.png'; ?>" /></span>
    581                 </a>
    582             </div>
    583             <p><?php _e('Did Cryptocurrency Widgets Pack help you out? Please leave us a 5 star review.<br/>Thank you!','cryptocurrency-widgets-pack'); ?></p>
    584             <div class="buy"><a target="_blank" href="https://wordpress.org/support/plugin/cryptocurrency-widgets-pack/reviews/#new-post"><?php _e('Write a Review','cryptocurrency-widgets-pack'); ?></a></div>
    585             <hr>
    586             <h3><?php _e('Massive Cryptocurrency Widgets | Crypto Plugin','cryptocurrency-widgets-pack'); ?></h3>
    587             <a target="_blank" href="https://massivecryptopro.blocksera.com"><img style="max-width: 100%;" src="https://massivecryptopro.blocksera.com/wp-content/uploads/2020/08/mcw-banner.jpg" /></a>
    588             <ul>
    589                 <li><?php _e('5,000+ Cryptocurrencies','cryptocurrency-widgets-pack'); ?></li>
    590                 <li><?php _e('Powered by Coingecko','cryptocurrency-widgets-pack'); ?></li>
    591                 <li><?php _e('Stylish crypto widgets','cryptocurrency-widgets-pack'); ?></li>
    592                 <li><?php _e('Feature-rich widget editor','cryptocurrency-widgets-pack'); ?></li>
    593                 <li><?php _e('Unlimited customizations','cryptocurrency-widgets-pack'); ?></li>
    594             </ul>
    595             <hr/>
    596             <h3><?php _e('Coinpress - Cryptocurrency Pages for WordPress','cryptocurrency-widgets-pack'); ?></h3>
    597             <a target="_blank" href="https://coinpress.blocksera.com"><img style="max-width: 100%;" src="https://massivecryptopro.blocksera.com/wp-content/uploads/2020/08/coinpress-banner.jpg" /></a>
    598             <ul>
    599                 <li><?php _e('5,000+ Coin detail pages','cryptocurrency-widgets-pack'); ?></li>
    600                 <li><?php _e('Search, Currency Changer, Watchlist','cryptocurrency-widgets-pack'); ?></li>
    601                 <li><?php _e('Line & Candlestick charts','cryptocurrency-widgets-pack'); ?></li>
    602                 <li><?php _e('Historical Data & Markets','cryptocurrency-widgets-pack'); ?></li>
    603                 <li><?php _e('Social Feed & Comments','cryptocurrency-widgets-pack'); ?></li>
    604                 <li><?php _e('News section & Responsive Design','cryptocurrency-widgets-pack'); ?></li>
    605             </ul>
    606             <hr/>
    607             <h3><?php _e('Massive Stock Market & Forex Widgets','cryptocurrency-widgets-pack'); ?></h3>
    608             <a target="_blank" href="https://stockwidgets.blocksera.com"><img style="max-width: 100%;" src="https://massivecryptopro.blocksera.com/wp-content/uploads/2020/08/msf-banner.jpg" /></a>
    609             <ul>
    610                 <li><?php _e('Global stock exchanges','cryptocurrency-widgets-pack'); ?></li>
    611                 <li><?php _e('Powered by Yahoo API','cryptocurrency-widgets-pack'); ?></li>
    612                 <li><?php _e('Up to 100,000 companies list','cryptocurrency-widgets-pack'); ?></li>
    613                 <li><?php _e('Powerful search option','cryptocurrency-widgets-pack'); ?></li>
    614                 <li><?php _e('Stylish widgets','cryptocurrency-widgets-pack'); ?></li>
    615                 <li><?php _e('Feature-rich widget editor','cryptocurrency-widgets-pack'); ?></li>
    616                 <li><?php _e('Unlimited customizations','cryptocurrency-widgets-pack'); ?></li>
    617             </ul>
    618         </div>
    619         <?php
    620     }
    621    
    622     public function mcwp_crypto_shortcode_content( $post ) {
    623         $dynamic_attr = '[cryptopack id=&quot;'.get_the_id().'&quot;]';
    624        
    625         echo '<div class="mcwp-shortcode">' . __('Paste this shortcode anywhere like page, post or widgets','cryptocurrency-widgets-pack');
    626        
    627         echo '<br/><br/><div>'.$dynamic_attr.'</div></div>';
    628         echo '<div class="mcwp-pro-add"><a href="https://coinpress.blocksera.com" target="_blank">' . __("Create 5,000+ coin pages instantly", "cryptocurrency-widgets-pack") . '</a></div>';
    629     }
    630    
    631     public function mcwp_crypto_widget_box_content( $post ) {
    632         wp_nonce_field( plugin_basename( __FILE__ ), 'mcwp_crypto_widget_box_content_nonce' );
    633        
    634         $allpostmetas = $this->allpostmetas;
    635         for($k=0;$k<sizeof($allpostmetas);$k++){
    636             $temp = $allpostmetas[$k];
    637             ${$temp} = get_post_meta( $post->ID, $temp, true );
    638         }
    639        
    640         require_once(MCWP_PATH . 'includes/mcwp-settings.php');
    641     }
    642 
    643     public function mcwp_crypto_widget_box_save( $post_id ) {
    644         if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
     377            case 'type':
     378                $type = get_post_meta($post_id, 'crypto_ticker', true);
     379                _e(ucfirst($type), 'mcwp');
     380                break;
     381            case 'shortcode':
     382                echo '<code>[cryptopack id="' . $post_id . '"]</code>';
     383                break;
     384        }
     385    }
     386
     387    public function widget_settings($post) {
     388
     389        wp_nonce_field(plugin_basename( __FILE__ ), 'mcwp_widget_nonce');
     390        $data = $this->shortcode->data($post->ID);
     391
     392        require_once(MCWP_PATH . 'includes/settings.php');
     393    }
     394
     395    public function save_widget($post_id) {
     396
     397        if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
    645398        return;
    646399
    647         if ( !isset($_POST['mcwp_crypto_widget_box_content_nonce']) || !wp_verify_nonce( $_POST['mcwp_crypto_widget_box_content_nonce'], plugin_basename( __FILE__ ) ) )
     400        if (!isset($_POST['mcwp_widget_nonce']) || !wp_verify_nonce($_POST['mcwp_widget_nonce'], plugin_basename( __FILE__ )))
    648401            return;
    649402
    650         if ( 'page' == $_POST['post_type'] ) {
    651             if ( !current_user_can( 'edit_page', $post_id ) )
     403        if ('page' == $_POST['post_type'] ) {
     404            if (!current_user_can('edit_page', $post_id))
    652405                return;
    653406        } else {
    654             if ( !current_user_can( 'edit_post', $post_id ) )
     407            if (!current_user_can('edit_post', $post_id))
    655408                return;
    656409        }
    657         $allpostmetas = $this->allpostmetas;
    658         for($k=0;$k<sizeof($allpostmetas);$k++){
     410
     411        $allpostmetas = $this->shortcode->allpostmetas;
     412       
     413        for($k = 0; $k < sizeof($allpostmetas); $k++) {
     414           
    659415            $temp = $allpostmetas[$k];
    660416
    661417            if($temp == 'crypto_ticker_coin' || $temp == 'crypto_ticker_columns' || $temp == 'crypto_card_columns' || $temp == 'crypto_table_columns'){
    662418                $mcwptags    =  isset( $_POST[$temp] ) ? (array) $_POST[$temp] : array();
    663                 $mcwptags    =  array_map( 'esc_attr', $mcwptags );             
    664                 ${$temp}     =  $mcwptags;
    665    
     419                $mcwptags    =  array_map('sanitize_text_field', $mcwptags);
     420                $value       =  $mcwptags;
     421
    666422            } elseif ($temp ==  'crypto_speed' || $temp == 'crypto_bunch_select') {
    667                 ${$temp}     =  (int) $_POST[$temp];
     423                $value       =  intval($_POST[$temp]);
    668424
    669425            } elseif ($temp ==  'crypto_text_color' || $temp == 'crypto_background_color') {
    670                 ${$temp}     =  sanitize_hex_color($_POST[$temp]);
     426                $value       =  sanitize_hex_color($_POST[$temp]);
    671427
    672428            } elseif ($temp ==  'crypto_custom_css'){
    673                 ${$temp}     =  trim( strip_tags($_POST[$temp] ) );
     429                $value       =  trim(strip_tags($_POST[$temp]));
    674430
    675431            } else {
    676                 ${$temp}     =  sanitize_text_field($_POST[$temp]);
    677             }
    678 
    679             update_post_meta( $post_id, $temp, ${$temp} );
    680         }
    681     }
    682 
    683     public function is_edit_page($new_edit = null){
    684         global $pagenow;
    685         //make sure we are on the backend
    686         if (!is_admin()) return false;
    687 
    688 
    689         if($new_edit == "edit")
    690             return in_array( $pagenow, array( 'post.php',  ) );
    691         elseif($new_edit == "new") //check for new post page
    692             return in_array( $pagenow, array( 'post-new.php' ) );
    693         else //check for either new or edit
    694             return in_array( $pagenow, array( 'post.php', 'post-new.php' ) );
    695     }
    696 
    697     public function mcwp_shortcode($atts){
     432                $value       =  sanitize_text_field($_POST[$temp]);
     433            }
     434
     435            update_post_meta($post_id, $temp, $value);
     436        }
     437    }
     438
     439    public function mcwp_coinsyms() {
     440
     441        $query = "SELECT cid, name, symbol FROM `{$this->tablename}` ORDER BY `rank` ASC";
     442       
     443        $output = array('cid' => array(), 'names' => array(), 'symbols' => array());
     444        $coins = $this->fetch_coins($query);
     445
     446        foreach($coins as $coin) {
     447            $output['cid'][] = strtolower($coin->cid);
     448            $output['names'][] = strtolower($coin->name);
     449            $output['symbols'][] = strtolower($coin->symbol);
     450        }
     451       
     452        return $output;
     453    }
     454
     455    public function shortcode($atts) {
     456
    698457        $atts = shortcode_atts(array(
    699             'id' => '',
    700         ), $atts, 'cryptopack');
    701 
    702         $mcwp_post_id  = esc_attr((int) $atts['id']);
     458            'id' => '',
     459        ), $atts, 'cryptopack');
     460
     461        $mcwp_post_id  = intval($atts['id']);
    703462
    704463        if((get_post_status( $mcwp_post_id ) != 'publish') && (!is_admin())) {
     
    706465        }
    707466
    708         $allpostmetas = $this->allpostmetas;
    709         for($k=0;$k<sizeof($allpostmetas);$k++){
    710             $temp = $allpostmetas[$k];
    711             ${$temp} = get_post_meta( $mcwp_post_id, $temp, true );
    712         }
     467        $data = $this->shortcode->data($mcwp_post_id);
    713468
    714469        $mcwp_coinsyms = $this->mcwp_coinsyms();
    715470        $mcwp_cid = $mcwp_coinsyms['cid'];
    716         $selectedcoins = array();
    717 
    718         $output = '';
    719 
    720         if($crypto_bunch_select > 0){
    721             for($k=0;$k<sizeof($mcwp_cid);$k++){
    722                 if($k < $crypto_bunch_select) {
    723                     array_push($selectedcoins,$mcwp_cid[$k]);
    724                 }
    725             }
     471        $selectedcoins = $this->shortcode->selectedCoins($mcwp_cid, $data);
     472
     473        $custom_css = '';
     474        if(!empty($selectedcoins)){
     475
     476            $query = "SELECT * FROM `{$this->tablename}` WHERE `cid` IN (".implode(', ', array_fill(0, count($selectedcoins), '%s')).") ORDER BY `rank` ASC";
     477            $coins = $this->fetch_coins($this->wpdb->prepare($query, call_user_func_array('array_merge', [$selectedcoins])));
     478           
     479            if($data->crypto_custom_css != ''){
     480               
     481                $custom_css .= $data->crypto_custom_css;
     482            }
     483           
     484            $output = '<div class="mcwp-crypto" id="mcwp-'.$mcwp_post_id.'">';
     485
     486            // ticker
     487            if($data->crypto_ticker == 'ticker')
     488            {
     489                if(($data->crypto_ticker_position != 'header') && ($data->crypto_ticker_position != 'footer') || (is_admin()))
     490                {
     491                    if($data->crypto_text_color !== ''){
     492                        $custom_css .= '#mcwp-'.$mcwp_post_id.'.mcwp-crypto .cc-coin b { color: '.esc_attr($data->crypto_text_color).'; }';
     493                    }
     494
     495                    $output = $this->shortcode->ticker($output, $coins, $data);
     496                }
     497
     498            // table
     499            } elseif($data->crypto_ticker == 'table') {
     500
     501                $output = $this->shortcode->table($output, $selectedcoins, $data);
     502
     503            // card
     504            } elseif($data->crypto_ticker == 'card') {
     505
     506                if($data->crypto_text_color !== '') {
     507                    $custom_css .= '#mcwp-'.$mcwp_post_id.'.mcwp-crypto div.mcwp-card * { color: '.esc_attr($data->crypto_text_color).'; }';
     508                }
     509               
     510                $output = $this->shortcode->card($output, $selectedcoins, $coins, $data);
     511
     512            // label
     513            } elseif($data->crypto_ticker == 'label') {
     514
     515                if($data->crypto_text_color !== '') {
     516                    $custom_css .= '#mcwp-'.$mcwp_post_id.'.mcwp-crypto div.mcwp-label * { color: '.esc_attr($data->crypto_text_color).'; }';
     517                }
     518
     519                $output = $this->shortcode->label($output, $selectedcoins, $coins, $data);
     520            }
     521
     522            $output .= '</div>';
     523
    726524        } else {
    727             for($k=0;$k<sizeof($mcwp_cid);$k++){
    728                 if(is_array($crypto_ticker_coin) && in_array($mcwp_cid[$k],$crypto_ticker_coin)){
    729                     array_push($selectedcoins,$mcwp_cid[$k]);
    730                 }
    731             }
    732         }
    733 
    734 
    735         if(!empty($selectedcoins)){
    736 
    737             $query = 'SELECT * FROM `' . $this->tablename . '` WHERE `cid` IN ("' . implode('","', $selectedcoins) . '") ORDER BY `rank` ASC';
    738             $mcwp_data = $this->mcwp_all_collection($query);
    739            
    740             if($crypto_custom_css != ''){
    741                 $output .= '<style type="text/css">'."\n".$crypto_custom_css."\n".'</style>';
    742             }
    743             $output .= '<div class="mcwp-crypto" id="mcwp-'.$mcwp_post_id.'">';
    744 
    745 
    746             // ticker
    747             if($crypto_ticker == 'ticker'){
    748                 if(($crypto_ticker_position != 'header') && ($crypto_ticker_position != 'footer') || (is_admin())) {
    749                     $output .= '<div class="mcwp-ticker mcwp-'. $crypto_ticker_position .'" data-speed="'.$crypto_speed.'">';
    750 
    751                     if($crypto_text_color !== ''){
    752                         $output .= '<style type="text/css">
    753                                 #mcwp-'.$mcwp_post_id.'.mcwp-crypto .cc-coin b {
    754                                     color: '.$crypto_text_color.';
    755                                 }
    756                             </style>';
    757                            
    758                         $crypto_background_color = ($crypto_background_color == '') ? '#fff' : $crypto_background_color;
    759                     }
    760                    
    761                         $output .= '<div class="cc-ticker cc-white-color"';
    762                     if($crypto_background_color !== ''){
    763                         $output .= ' style="background-color:'.$crypto_background_color.';"';
    764                     }
    765                     $output .= '><ul class="cc-stats">';
    766                     foreach($mcwp_data as $j=>$coins) {
    767                         $imagename  = esc_attr($this->mcwp_image_id($coins->img));
    768                         $coinscid   = esc_attr($coins->cid);
    769                         $coinsname  = esc_attr($coins->name);
    770                         $coinssymbol= esc_attr($coins->symbol);
    771                         $price      = esc_attr($this->mcwp_currency_convert($coins->price_usd));
    772                        
    773                         $output .= '<li class="cc-coin"><div><img src="'.$imagename.'" alt="'.$coinscid.'">';
    774                         $output .= '<b>';
    775                         if(is_array($crypto_ticker_columns) && in_array('coingecko',$crypto_ticker_columns)) {
    776                             $output .= '<a rel="nofollow" href="https://coingecko.com/coins/'.$coinscid.'" target="_blank">';
    777                         }
    778                         $output .= $coinsname . ' <span>('.$coinssymbol.')</span>';
    779                         if(is_array($crypto_ticker_columns) && in_array('coingecko',$crypto_ticker_columns)) {
    780                             $output .= '</a>';
    781                         }
    782                         $output .= ' <span>'.$price.'</span>';
    783                         if(is_array($crypto_ticker_columns) && in_array('changes',$crypto_ticker_columns)) {
    784                             $output .= $this->mcwp_24h_percentage(esc_attr($coins->percent_change_24h),'span');
    785                         }
    786                         $output .= '</b></div></li>';
    787                     }
    788                     $output .= '</ul></div>';
    789                     $output .= '</div>';
    790                 }
    791 
    792             // table
    793             } elseif($crypto_ticker == 'table') {
    794 
    795                 $tablecoins = (sizeof($selectedcoins) > 50) ? 50 : sizeof($selectedcoins);
    796 
    797                 $theme = ($crypto_background_color !== '') ? 'custom' : 'light';
    798                 $output .= '<svg style="width: 0; height: 0; opacity: 0; visibility: hidden;">
    799                         <defs>
    800                             <linearGradient id="red" x1="1" x2="0" y1="1" y2="0">
    801                                 <stop offset="0" stop-color="white"></stop>
    802                                 <stop offset="1" stop-color="#ef3e3e"></stop>
    803                             </linearGradient>
    804                             <linearGradient id="green" x1="1" x2="0" y1="1" y2="0">
    805                                 <stop offset="0" stop-color="white"></stop>
    806                                 <stop offset="1" stop-color="#3cef3c"></stop>
    807                             </linearGradient>
    808                         </defs>
    809                     </svg>';
    810                 $output .= '<table class="mcwp-datatable table-processing '.$theme.'" data-theme="'.$theme.'" data-color="'.$crypto_text_color.'" data-bgcolor="'.$crypto_background_color.'" data-length="'.$tablecoins.'"><thead><tr>';
    811                 $output .= '<th>#</th><th>' . __('Name','cryptocurrency-widgets-pack') . '</th><th>' . __('Price','cryptocurrency-widgets-pack') . '</th><th>' . __('Market Cap','cryptocurrency-widgets-pack') . '</th><th>' . __('Change','cryptocurrency-widgets-pack') . '</th><th>' . __('Price Graph (24h)','cryptocurrency-widgets-pack') . '</th>';
    812                 $output .= '</tr></thead><tbody>';
    813 
    814                 for( $i = 0; $i < $tablecoins; $i++ ) {
    815                     $output .= '<tr><td colspan="56" height="30"><span></span></td></tr>';
    816                 }
    817 
    818                 $output .= '</tbody></table>';
    819 
    820             // card
    821             } elseif($crypto_ticker == 'card') {
    822 
    823                 if($crypto_text_color !== '') {
    824                     $output .= '<style type="text/css">
    825                         #mcwp-'.$mcwp_post_id.'.mcwp-crypto div.mcwp-card * {
    826                             color: '.$crypto_text_color.';
    827                         }
    828                     </style>';
    829                 }
    830 
    831                 foreach($mcwp_data as $j=>$coins) {
    832                     if(in_array(strtolower($coins->cid),$selectedcoins)) {
    833                         $imagename  = esc_attr($this->mcwp_image_id($coins->img));
    834                         $coinscid   = esc_attr($coins->cid);
    835                         $coinsname  = esc_attr($coins->name);
    836                         $coinssymbol= esc_attr($coins->symbol);
    837                         $price      = esc_attr($this->mcwp_currency_convert($coins->price_usd));
    838 
    839                         $output .= (is_array($crypto_card_columns) && in_array('fullwidth',$crypto_card_columns)) ? '' : '<div class="cc-card-col">';
    840                         $output .= '<div class="mcwp-card mcwp-card-1 mcwp-card-white"';
    841                         if($crypto_background_color !== '') {
    842                             $output .= ' style="background-color:'.$crypto_background_color.';"';
    843                         }
    844                         $output .= '><div class="bg"><img src="'.esc_attr($this->mcwp_image_id($coins->img,'large')).'" alt="'.$coinscid.'"></div>';
    845                         $output .= '<div class="mcwp-card-head"><div><img src="'.$imagename.'" alt="'.$coinscid.'">';
    846                         $output .= '<p>';
    847                         if(is_array($crypto_card_columns) && in_array('coingecko',$crypto_card_columns)) {
    848                             $output .= '<a rel="nofollow" href="https://coingecko.com/coins/'.$coinscid.'" target="_blank">';
    849                         }
    850                         $output .= $coinsname.' ('.$coinssymbol.')';
    851                         if(is_array($crypto_card_columns) && in_array('coingecko',$crypto_card_columns)) {
    852                             $output .= '</a>';
    853                         }
    854                         if(is_array($crypto_card_columns) && in_array('percentage',$crypto_card_columns)) {
    855                             $class = floatval($coins->percent_change_24h) > 0 ? "high" : "low";
    856                             $output .= '<small class="'.$class.'">'.abs($coins->percent_change_24h).'</small></p>';
    857                         }
    858                         $output .= '</p>';
    859                         $output .= '</div></div><div class="mcwp-pricelabel">Price</div>';
    860                         $output .= '<div class="mcwp-price">'.$price.'</div>';
    861                         $output .= '</div>';
    862                         $output .= (is_array($crypto_card_columns) && in_array('fullwidth',$crypto_card_columns)) ? '' : '</div>';
    863                     }
    864                 }
    865             // label
    866             } elseif($crypto_ticker == 'label') {
    867 
    868                 if($crypto_text_color !== '') {
    869                     $output .= '<style type="text/css">
    870                         #mcwp-'.$mcwp_post_id.'.mcwp-crypto div.mcwp-label * {
    871                             color: '.$crypto_text_color.';
    872                         }
    873                     </style>';
    874                 }
    875                
    876                 foreach($mcwp_data as $j=>$coins) {
    877                     if(in_array(strtolower($coins->cid),$selectedcoins)) {
    878                         $imagename  = esc_attr($this->mcwp_image_id($coins->img));
    879                         $coinscid   = esc_attr($coins->cid);
    880                         $coinsname  = esc_attr($coins->name);
    881                         $coinssymbol= esc_attr($coins->symbol);
    882                         $price      = esc_attr($this->mcwp_currency_convert($coins->price_usd));
    883                        
    884                         $output .= (is_array($crypto_card_columns) && in_array('fullwidth',$crypto_card_columns)) ? '' : '<div class="cc-label-col">';
    885                         $output .= '<div class="mcwp-label mcwp-label-1 mcwp-label-white"';
    886                         if($crypto_background_color !== '') {
    887                             $output .= '" style="background-color:'.$crypto_background_color.';"';
    888                         }
    889                         $output .= '><div class="mcwp-label-dn1-head"><div class="mcwp-card-head"><div><img src="'.$imagename.'" alt="'.$coinscid.'">';
    890                         $output .= '<p>';
    891                         if(is_array($crypto_card_columns) && in_array('coingecko',$crypto_card_columns)) {
    892                             $output .= '<a rel="nofollow" href="https://coingecko.com/coins/'.$coinscid.'" target="_blank">';
    893                         }
    894                         $output .= $coinsname.' ('.$coinssymbol.')';
    895                         if(is_array($crypto_card_columns) && in_array('coingecko',$crypto_card_columns)) {
    896                             $output .= '</a>';
    897                         }
    898                         $output .= '</p>';
    899                         $output .= '</div></div></div><div class="mcwp-label-dn1-body"><b>'.$price.'</b>';
    900                         if(is_array($crypto_card_columns) && in_array('percentage',$crypto_card_columns)) {
    901                             $class = floatval($coins->percent_change_24h) > 0 ? "high" : "low";
    902                             $output .= '<small class="'.$class.'">'.abs($coins->percent_change_24h).'</small>';
    903                         }
    904                         $output .= '</div></div>';
    905                         $output .= (is_array($crypto_card_columns) && in_array('fullwidth',$crypto_card_columns)) ? '' : '</div>';
    906                     }
    907                 }
    908             }
    909             $output .= '</div>';
    910         } else {
    911             $output .= $this->crypto_four_not_four();
    912         }
     525            $output = $this->display->crypto_four_not_four();
     526        }
     527       
     528        wp_register_style('mcwp-custom', false);
     529        wp_enqueue_style('mcwp-custom');
     530        wp_add_inline_style('mcwp-custom', $custom_css);
     531
    913532        return $output;
    914533    }
    915534
    916     public function mcwp_tickerHeadFooter(){
     535    public function global_ticker() {
    917536       
    918537        //get your custom posts ids as an array
     
    925544            )
    926545        );
     546
     547        $custom_css = '';
    927548       
    928549        //loop over each post
    929         foreach($posts as $p){
     550        foreach($posts as $p) {
    930551            //get the meta you need form each post
    931            
    932             $crypto_ticker           = esc_attr(get_post_meta($p->ID,"crypto_ticker",true));
    933             $crypto_ticker_coin      =array_map('esc_attr',get_post_meta($p->ID,"crypto_ticker_coin",true) );
    934             $crypto_ticker_position  = esc_attr(get_post_meta($p->ID,"crypto_ticker_position",true));
    935             $crypto_speed            = esc_attr(get_post_meta($p->ID,"crypto_speed",true));
    936             $crypto_ticker_columns   =array_map('esc_attr',get_post_meta($p->ID,"crypto_ticker_columns",true) );
    937             $crypto_text_color       = esc_attr(get_post_meta($p->ID,"crypto_text_color",true));
    938             $crypto_background_color = esc_attr(get_post_meta($p->ID,"crypto_background_color",true));
    939             $crypto_bunch_select     = esc_attr(get_post_meta($p->ID,"crypto_bunch_select",true));
    940             $crypto_custom_css       = esc_attr(get_post_meta($p->ID,"crypto_custom_css",true));
    941            
     552            if(get_post_meta($p->ID, 'crypto_ticker', true) != 'ticker') {
     553                continue;
     554            }
     555
    942556            $output = '';
    943            
    944             if($crypto_ticker == 'ticker') {
    945                 if(($crypto_ticker_position == 'header') || ($crypto_ticker_position == 'footer')) {
    946                    
    947                     $mcwp_coinsyms = $this->mcwp_coinsyms();
    948                     $mcwp_cid = $mcwp_coinsyms['cid'];
    949                     $selectedcoins = array();
    950                    
    951 
    952                     if($crypto_bunch_select > 0){
    953                         for($k=0;$k<sizeof($mcwp_cid);$k++){
    954                             if($k < $crypto_bunch_select) {
    955                                 array_push($selectedcoins,$mcwp_cid[$k]);
    956                             }
    957                         }
    958                     } else {
    959                         for($k=0;$k<sizeof($mcwp_cid);$k++){
    960                             if(is_array($crypto_ticker_coin) && in_array($mcwp_cid[$k],$crypto_ticker_coin)){
    961                                 array_push($selectedcoins,$mcwp_cid[$k]);
    962                             }
    963                         }
     557
     558            if(in_array(get_post_meta($p->ID, 'crypto_ticker_position', true), ['header', 'footer'])) {
     559
     560                $data = $this->shortcode->data($p->ID);
     561
     562                $mcwp_coinsyms = $this->mcwp_coinsyms();
     563                $mcwp_cid = $mcwp_coinsyms['cid'];
     564                $selectedcoins = $this->shortcode->selectedCoins($mcwp_cid, $data);
     565
     566
     567                if(!empty($selectedcoins))
     568                {
     569                    $query = "SELECT * FROM `{$this->tablename}` WHERE `cid` IN (".implode(', ', array_fill(0, count($selectedcoins), '%s')).") ORDER BY `rank` ASC";
     570                    $coins = $this->fetch_coins($this->wpdb->prepare($query, call_user_func_array('array_merge', [$selectedcoins])));
     571
     572                    if($data->crypto_custom_css != '') {
     573                        $custom_css .= $data->crypto_custom_css;
    964574                    }
    965            
    966 
    967                     if(!empty($selectedcoins)){
    968 
    969                         $query = 'SELECT * FROM `' . $this->tablename . '` WHERE `cid` IN ("' . implode('","', $selectedcoins) . '") ORDER BY `rank` ASC';
    970                         $mcwp_data = $this->mcwp_all_collection($query);
    971 
    972                         if($crypto_custom_css != ''){
    973                             $output .= '<style type="text/css">'."\n".$crypto_custom_css."\n".'</style>';
    974                         }
    975                        
    976                         $output .= '<div class="mcwp-crypto" id="mcwp-'.$p->ID.'">';
    977                         $output .= '<div class="mcwp-ticker mcwp-'. $crypto_ticker_position .'" data-speed="'.$crypto_speed.'">';
    978                         if ($crypto_text_color !== '') {
    979                             $output .= '<style type="text/css">
    980                                     #mcwp-'.$p->ID.'.mcwp-crypto .cc-coin b {
    981                                         color: '.$crypto_text_color.';
    982                                     }
    983                                 </style>';
    984 
    985                             $crypto_background_color = ($crypto_background_color == '') ? '#fff' : $crypto_background_color;
    986                         }
    987                         $output .= '<div class="cc-ticker cc-white-color"';
    988                         if ($crypto_background_color !== '') {
    989                             $output .= ' style="background-color:'.$crypto_background_color.';"';
    990                         }
    991                         $output .= '><ul class="cc-stats">';
    992                         foreach($mcwp_data as $j=>$coins) {
    993                             $imagename  = esc_attr($this->mcwp_image_id($coins->img));
    994                             $coinscid   = esc_attr($coins->cid);
    995                             $coinsname  = esc_attr($coins->name);
    996                             $coinssymbol= esc_attr($coins->symbol);
    997                             $price      = esc_attr($this->mcwp_currency_convert($coins->price_usd));
    998                            
    999                             $output .= '<li class="cc-coin"><div><img src="'.$imagename.'" alt="'.$coinscid.'">';
    1000                             $output .= '<b>';
    1001                             if(is_array($crypto_ticker_columns) && in_array('coingecko',$crypto_ticker_columns)) {
    1002                                 $output .= '<a rel="nofollow" href="https://coingecko.com/coins/'.$coinscid.'" target="_blank">';
    1003                             }
    1004                             $output .= $coinsname . ' <span>('.$coinssymbol.')</span>';
    1005                             if(is_array($crypto_ticker_columns) && in_array('coingecko',$crypto_ticker_columns)) {
    1006                                 $output .= '</a>';
    1007                             }
    1008                             $output .= ' <span>'.$price.'</span>';
    1009                             if(is_array($crypto_ticker_columns) && in_array('changes',$crypto_ticker_columns)) {
    1010                                 $output .= $this->mcwp_24h_percentage(esc_attr($coins->percent_change_24h),'span');
    1011                             }
    1012                             $output .= '</b></div></li>';
    1013                         }
    1014                         $output .= '</ul></div></div></div>';
    1015                         echo apply_filters('cwp_show_ticker', $output);
     575
     576                    $output .= '<div class="mcwp-crypto" id="mcwp-'.$p->ID.'">';
     577
     578                    if($data->crypto_text_color !== ''){
     579                        $custom_css .= '#mcwp-'.$p->ID.'.mcwp-crypto .cc-coin b { color: '.esc_attr($data->crypto_text_color).'; }';
    1016580                    }
    1017                     break;
    1018                 }
    1019             }
     581
     582                    $output = $this->shortcode->ticker($output, $coins, $data);
     583
     584                    echo apply_filters('cwp_show_ticker', $output);
     585                }
     586                break;
     587            }
     588
     589            wp_register_style('mcwp-custom-ticker', false);
     590            wp_enqueue_style('mcwp-custom-ticker');
     591            wp_add_inline_style('mcwp-custom-ticker', $custom_css);
     592
    1020593            echo $output;
    1021594        }
    1022595    }
    1023    
    1024     public function mcwp_24h_percentage($percent,$tag){
    1025         $up = ($percent > 0) ? 'mcwpup' : 'mcwpdown';
     596
     597    public function table_data() {
     598
     599        $allowed_orders = [
     600            'rank',
     601            'name',
     602            'price_usd',
     603            'market_cap_usd',
     604            'percent_change_24h',
     605        ];
     606       
     607        //sanitization
     608        $mcwp_post_id  = intval($_GET['mcwp_id']);
     609
     610        $orderby = sanitize_text_field($_GET['columns'][intval($_GET['order'][0]['column'])]['name']);
     611        $orderdir = sanitize_text_field($_GET['order'][0]['dir']);
     612        $orderdir = 'DESC' === strtoupper($orderdir) ? 'DESC' : 'ASC';
     613       
     614        $orderby = in_array($orderby, $allowed_orders) ? $orderby : 'rank';
     615        $order = sanitize_sql_orderby("{$orderby} {$orderdir}");
     616
     617        $start = intval($_GET['start']);
     618        $length = intval($_GET['length']);
     619
     620        $data = $this->shortcode->data($mcwp_post_id);
     621       
     622        $mcwp_coinsyms = $this->mcwp_coinsyms();
     623        $mcwp_cid = $mcwp_coinsyms['cid'];
     624        $selectedcoins = $this->shortcode->selectedCoins($mcwp_cid, $data);
     625       
    1026626        $output = '';
    1027         $output .= '<'.$tag.' class="'.$up.'"> '.abs($percent).'%</'.$tag.'>';
    1028 
    1029         return $output;
    1030     }
    1031    
    1032     public function mcwp_currency_convert($price){
    1033        
    1034         if(($price >= 1) || ($price == 0)){
    1035             $price = number_format((float)$price,'2');
    1036         } else {
    1037             $count = strspn(number_format($price,'10'), "0", strpos($price, ".")+1);
    1038             $count = ($count > 5) ? 8 : 6;
    1039             $price = number_format($price,$count);
    1040         }
    1041        
    1042         $output = '$ '.$price;
    1043         return substr($output, -1) == '.' ? substr($output,0,-1) : $output;
    1044     }
    1045    
    1046     public function crypto_four_not_four(){
    1047         return '<div class="crypto-404">No Coins Selected</div>';
    1048     }
     627       
     628        $query = "SELECT * FROM `{$this->tablename}` WHERE `cid` IN (\"" . implode('","', $selectedcoins) . "\") ORDER BY {$order} LIMIT %d, %d";
     629
     630        $mcwp_names = [];
     631        $coins = $this->fetch_coins($this->wpdb->prepare($query, [$start, $length]));
     632
     633        $arr = [];
     634
     635
     636        $eachcid = [];
     637        foreach($coins as $coin) {
     638            array_push($eachcid, $coin->cid);
     639        }
     640
     641        $postcoins = implode(',', $eachcid);
     642        $weekly = $this->weekly_chart($postcoins);
     643
     644        foreach($coins as $coin) {
     645            $key = [];
     646            $key['rank']        = intval($coin->rank);
     647            $key['name']        = esc_html($coin->name);
     648            $key['symbol']      = esc_html($coin->symbol);
     649            $key['price']       = esc_html($coin->price_usd);
     650            $key['mcap']        = esc_html($coin->market_cap_usd);
     651            $key['change']      = esc_html($coin->percent_change_24h);
     652            $key['weekly']      = array_map('esc_html', $weekly[$coin->cid]);
     653            $key['cid']         = esc_html($coin->cid);
     654            $key['imgpath']     = esc_url($this->shortcode->mcwp_image_id($coin->img));
     655
     656            if(is_array($data->crypto_table_columns) && in_array('coingecko', $data->crypto_table_columns)) {
     657                $key['link']    = true;
     658            }
     659
     660            $arr[] = $key;
     661        }
     662       
     663        $output = array(
     664            'recordsTotal' => sizeof($selectedcoins),
     665            'recordsFiltered' => sizeof($selectedcoins),
     666            'draw'=> $_GET['draw'],
     667            'data'=> $arr
     668        );
     669
     670        return wp_send_json($output);
     671    }
     672
    1049673}
    1050 
    1051674}
     675
    1052676function MCWP_Crypto() {
    1053677    return MCWP_Crypto::get_instance();
  • cryptocurrency-widgets-pack/trunk/languages/cryptocurrency-widgets-pack.pot

    r2751462 r2854429  
    66msgstr ""
    77"Project-Id-Version: Cryptocurrency Widgets Pack v1.5\n"
    8 "POT-Creation-Date: 2020-08-28 16:17+0530\n"
     8"Report-Msgid-Bugs-To: Translator Name <[email protected]>\n"
     9"POT-Creation-Date: 2023-01-24 15:24+0530\n"
    910"PO-Revision-Date: \n"
    1011"Last-Translator: Your Name <[email protected]>\n"
    1112"Language-Team: Blocksera <[email protected]>\n"
    12 "Report-Msgid-Bugs-To: Translator Name <[email protected]>\n"
     13"Language: en_US\n"
    1314"MIME-Version: 1.0\n"
    1415"Content-Type: text/plain; charset=UTF-8\n"
     
    2223"_nc:4c,1,2\n"
    2324"X-Poedit-Basepath: ..\n"
    24 "Language: en_US\n"
    25 "X-Generator: Poedit 2.4.1\n"
     25"X-Generator: Poedit 3.2.2\n"
    2626"X-Poedit-SearchPath-0: .\n"
    2727
    28 #: cryptocurrency-widgets-pack.php:418
     28#: cryptocurrency-widgets-pack.php:290
    2929msgctxt "Post Type General Name"
    3030msgid "Cryptocurrency Widgets Pack"
    3131msgstr ""
    3232
    33 #: cryptocurrency-widgets-pack.php:419
     33#: cryptocurrency-widgets-pack.php:291
    3434msgctxt "Post Type Singular Name"
    3535msgid "Cryptocurrency Widgets Pack"
    3636msgstr ""
    3737
    38 #: cryptocurrency-widgets-pack.php:420
     38#: cryptocurrency-widgets-pack.php:292
    3939msgid "Crypto Widgets"
    4040msgstr ""
    4141
    42 #: cryptocurrency-widgets-pack.php:421
     42#: cryptocurrency-widgets-pack.php:293
    4343msgid "Post Type"
    4444msgstr ""
    4545
    46 #: cryptocurrency-widgets-pack.php:422
     46#: cryptocurrency-widgets-pack.php:294
    4747msgid "Widget Archives"
    4848msgstr ""
    4949
    50 #: cryptocurrency-widgets-pack.php:423
     50#: cryptocurrency-widgets-pack.php:295
    5151msgid "Widget Attributes"
    5252msgstr ""
    5353
    54 #: cryptocurrency-widgets-pack.php:424
     54#: cryptocurrency-widgets-pack.php:296
    5555msgid "Parent Widget:"
    5656msgstr ""
    5757
    58 #: cryptocurrency-widgets-pack.php:425
     58#: cryptocurrency-widgets-pack.php:297
    5959msgid "All Widgets"
    6060msgstr ""
    6161
    62 #: cryptocurrency-widgets-pack.php:426
     62#: cryptocurrency-widgets-pack.php:298
    6363msgid "Add New Crypto Widget"
    6464msgstr ""
    6565
    66 #: cryptocurrency-widgets-pack.php:427
     66#: cryptocurrency-widgets-pack.php:299
    6767msgid "Add New"
    6868msgstr ""
    6969
    70 #: cryptocurrency-widgets-pack.php:428
     70#: cryptocurrency-widgets-pack.php:300
    7171msgid "New Widget"
    7272msgstr ""
    7373
    74 #: cryptocurrency-widgets-pack.php:429
     74#: cryptocurrency-widgets-pack.php:301
    7575msgid "Edit Widget"
    7676msgstr ""
    7777
    78 #: cryptocurrency-widgets-pack.php:430
     78#: cryptocurrency-widgets-pack.php:302
    7979msgid "View Widget"
    8080msgstr ""
    8181
    82 #: cryptocurrency-widgets-pack.php:431
     82#: cryptocurrency-widgets-pack.php:303
    8383msgid "View Widgets"
    8484msgstr ""
    8585
    86 #: cryptocurrency-widgets-pack.php:432
     86#: cryptocurrency-widgets-pack.php:304
    8787msgid "Search Widget"
    8888msgstr ""
    8989
    90 #: cryptocurrency-widgets-pack.php:433
     90#: cryptocurrency-widgets-pack.php:305
    9191msgid "Not found"
    9292msgstr ""
    9393
    94 #: cryptocurrency-widgets-pack.php:434
     94#: cryptocurrency-widgets-pack.php:306
    9595msgid "Not found in Trash"
    9696msgstr ""
    9797
    98 #: cryptocurrency-widgets-pack.php:435
     98#: cryptocurrency-widgets-pack.php:307
    9999msgid "Featured Image"
    100100msgstr ""
    101101
    102 #: cryptocurrency-widgets-pack.php:436
     102#: cryptocurrency-widgets-pack.php:308
    103103msgid "Set featured image"
    104104msgstr ""
    105105
    106 #: cryptocurrency-widgets-pack.php:437
     106#: cryptocurrency-widgets-pack.php:309
    107107msgid "Remove featured image"
    108108msgstr ""
    109109
    110 #: cryptocurrency-widgets-pack.php:438
     110#: cryptocurrency-widgets-pack.php:310
    111111msgid "Use as featured image"
    112112msgstr ""
    113113
    114 #: cryptocurrency-widgets-pack.php:439
     114#: cryptocurrency-widgets-pack.php:311
    115115msgid "Insert into widget"
    116116msgstr ""
    117117
    118 #: cryptocurrency-widgets-pack.php:440
     118#: cryptocurrency-widgets-pack.php:312
    119119msgid "Uploaded to this widget"
    120120msgstr ""
    121121
    122 #: cryptocurrency-widgets-pack.php:441
     122#: cryptocurrency-widgets-pack.php:313
    123123msgid "Widgets list"
    124124msgstr ""
    125125
    126 #: cryptocurrency-widgets-pack.php:442
     126#: cryptocurrency-widgets-pack.php:314
    127127msgid "Widgets list navigation"
    128128msgstr ""
    129129
    130 #: cryptocurrency-widgets-pack.php:443
     130#: cryptocurrency-widgets-pack.php:315
    131131msgid "Filter widgets list"
    132132msgstr ""
    133133
    134 #: cryptocurrency-widgets-pack.php:446
     134#: cryptocurrency-widgets-pack.php:319
    135135msgid "Cryptocurrency Widgets Pack"
    136136msgstr ""
    137137
    138 #: cryptocurrency-widgets-pack.php:447
     138#: cryptocurrency-widgets-pack.php:320
    139139msgid "Post Type Description"
    140140msgstr ""
    141141
    142 #: cryptocurrency-widgets-pack.php:494
     142#: cryptocurrency-widgets-pack.php:357
     143msgid "Cryptocurrency Widgets Pack Settings"
     144msgstr ""
     145
     146#: cryptocurrency-widgets-pack.php:358
     147msgid "Crypto Widgets Shortcode"
     148msgstr ""
     149
     150#: cryptocurrency-widgets-pack.php:359
     151msgid "Rate the Plugin & Pro Features"
     152msgstr ""
     153
     154#: cryptocurrency-widgets-pack.php:366
     155msgid "Shortcode"
     156msgstr ""
     157
     158#: cryptocurrency-widgets-pack.php:367 includes/settings.php:21
     159msgid "Widget Type"
     160msgstr ""
     161
     162#: includes/display.php:53
    143163msgid ""
    144164"Enjoying our <strong>Cryptocurrency Widgets Pack?</strong> We hope you "
     
    147167msgstr ""
    148168
    149 #: cryptocurrency-widgets-pack.php:495
     169#: includes/display.php:54
    150170msgid "Rate the Plugin!"
    151171msgstr ""
    152172
    153 #: cryptocurrency-widgets-pack.php:496 cryptocurrency-widgets-pack.php:507
     173#: includes/display.php:55 includes/display.php:66
    154174msgid "Go Pro"
    155175msgstr ""
    156176
    157 #: cryptocurrency-widgets-pack.php:497
     177#: includes/display.php:56
    158178msgid "Already Done"
    159179msgstr ""
    160180
    161 #: cryptocurrency-widgets-pack.php:505
     181#: includes/display.php:64
    162182msgid "Add Widgets"
    163183msgstr ""
    164184
    165 #: cryptocurrency-widgets-pack.php:506
     185#: includes/display.php:65
    166186msgid "FAQ"
    167187msgstr ""
    168188
    169 #: cryptocurrency-widgets-pack.php:519
     189#: includes/display.php:78
    170190msgid "Support"
    171191msgstr ""
    172192
    173 #: cryptocurrency-widgets-pack.php:528
     193#: includes/display.php:87
    174194msgid "Upgrade To PRO - Massive Cryptocurrency Widgets"
    175195msgstr ""
    176196
    177 #: cryptocurrency-widgets-pack.php:529
     197#: includes/display.php:88
    178198msgid "Upgrade to PRO&nbsp;&nbsp;&#x27a4;"
    179199msgstr ""
    180200
    181 #: cryptocurrency-widgets-pack.php:544
    182 msgid "Shortcode"
    183 msgstr ""
    184 
    185 #: cryptocurrency-widgets-pack.php:545 includes/mcwp-settings.php:21
    186 msgid "Widget Type"
    187 msgstr ""
    188 
    189 #: cryptocurrency-widgets-pack.php:565
    190 msgid "Cryptocurrency Widgets Pack Settings"
    191 msgstr ""
    192 
    193 #: cryptocurrency-widgets-pack.php:566
    194 msgid "Crypto Widgets Shortcode"
    195 msgstr ""
    196 
    197 #: cryptocurrency-widgets-pack.php:567
    198 msgid "Rate the Plugin & Pro Features"
    199 msgstr ""
    200 
    201 #: cryptocurrency-widgets-pack.php:573
     201#: includes/display.php:102
     202msgid "Paste this shortcode anywhere like page, post or widgets"
     203msgstr ""
     204
     205#: includes/display.php:105
     206msgid "Create 5,000+ coin pages instantly"
     207msgstr ""
     208
     209#: includes/display.php:111
    202210msgid "Plugin Rating:"
    203211msgstr ""
    204212
    205 #: cryptocurrency-widgets-pack.php:583
     213#: includes/display.php:121
    206214msgid ""
    207215"Did Cryptocurrency Widgets Pack help you out? Please leave us a 5 star "
     
    209217msgstr ""
    210218
    211 #: cryptocurrency-widgets-pack.php:584
     219#: includes/display.php:122
    212220msgid "Write a Review"
    213221msgstr ""
    214222
    215 #: cryptocurrency-widgets-pack.php:586
     223#: includes/display.php:124
    216224msgid "Massive Cryptocurrency Widgets | Crypto Plugin"
    217225msgstr ""
    218226
    219 #: cryptocurrency-widgets-pack.php:589
     227#: includes/display.php:127
    220228msgid "5,000+ Cryptocurrencies"
    221229msgstr ""
    222230
    223 #: cryptocurrency-widgets-pack.php:590
     231#: includes/display.php:128
    224232msgid "Powered by Coingecko"
    225233msgstr ""
    226234
    227 #: cryptocurrency-widgets-pack.php:591
     235#: includes/display.php:129
    228236msgid "Stylish crypto widgets"
    229237msgstr ""
    230238
    231 #: cryptocurrency-widgets-pack.php:592 cryptocurrency-widgets-pack.php:615
     239#: includes/display.php:130 includes/display.php:153
    232240msgid "Feature-rich widget editor"
    233241msgstr ""
    234242
    235 #: cryptocurrency-widgets-pack.php:593 cryptocurrency-widgets-pack.php:616
     243#: includes/display.php:131 includes/display.php:154
    236244msgid "Unlimited customizations"
    237245msgstr ""
    238246
    239 #: cryptocurrency-widgets-pack.php:596
     247#: includes/display.php:134
    240248msgid "Coinpress - Cryptocurrency Pages for WordPress"
    241249msgstr ""
    242250
    243 #: cryptocurrency-widgets-pack.php:599
     251#: includes/display.php:137
    244252msgid "5,000+ Coin detail pages"
    245253msgstr ""
    246254
    247 #: cryptocurrency-widgets-pack.php:600
     255#: includes/display.php:138
    248256msgid "Search, Currency Changer, Watchlist"
    249257msgstr ""
    250258
    251 #: cryptocurrency-widgets-pack.php:601
     259#: includes/display.php:139
    252260msgid "Line & Candlestick charts"
    253261msgstr ""
    254262
    255 #: cryptocurrency-widgets-pack.php:602
     263#: includes/display.php:140
    256264msgid "Historical Data & Markets"
    257265msgstr ""
    258266
    259 #: cryptocurrency-widgets-pack.php:603
     267#: includes/display.php:141
    260268msgid "Social Feed & Comments"
    261269msgstr ""
    262270
    263 #: cryptocurrency-widgets-pack.php:604
     271#: includes/display.php:142
    264272msgid "News section & Responsive Design"
    265273msgstr ""
    266274
    267 #: cryptocurrency-widgets-pack.php:607
     275#: includes/display.php:145
    268276msgid "Massive Stock Market & Forex Widgets"
    269277msgstr ""
    270278
    271 #: cryptocurrency-widgets-pack.php:610
     279#: includes/display.php:148
    272280msgid "Global stock exchanges"
    273281msgstr ""
    274282
    275 #: cryptocurrency-widgets-pack.php:611
     283#: includes/display.php:149
    276284msgid "Powered by Yahoo API"
    277285msgstr ""
    278286
    279 #: cryptocurrency-widgets-pack.php:612
     287#: includes/display.php:150
    280288msgid "Up to 100,000 companies list"
    281289msgstr ""
    282290
    283 #: cryptocurrency-widgets-pack.php:613
     291#: includes/display.php:151
    284292msgid "Powerful search option"
    285293msgstr ""
    286294
    287 #: cryptocurrency-widgets-pack.php:614
     295#: includes/display.php:152
    288296msgid "Stylish widgets"
    289 msgstr ""
    290 
    291 #: cryptocurrency-widgets-pack.php:625
    292 msgid "Paste this shortcode anywhere like page, post or widgets"
    293 msgstr ""
    294 
    295 #: cryptocurrency-widgets-pack.php:628
    296 msgid "Create 5,000+ coin pages instantly"
    297 msgstr ""
    298 
    299 #: cryptocurrency-widgets-pack.php:811
    300 msgid "Name"
    301 msgstr ""
    302 
    303 #: cryptocurrency-widgets-pack.php:811 includes/mcwp-premium.php:26
    304 msgid "Price"
    305 msgstr ""
    306 
    307 #: cryptocurrency-widgets-pack.php:811
    308 msgid "Market Cap"
    309 msgstr ""
    310 
    311 #: cryptocurrency-widgets-pack.php:811
    312 msgid "Change"
    313 msgstr ""
    314 
    315 #: cryptocurrency-widgets-pack.php:811
    316 msgid "Price Graph (24h)"
    317297msgstr ""
    318298
     
    325305msgstr ""
    326306
    327 #: includes/mcwp-premium.php:7
     307#: includes/premium.php:7
    328308msgid "Massive Cryptocurrency Widgets"
    329309msgstr ""
    330310
    331 #: includes/mcwp-premium.php:8
     311#: includes/premium.php:8
    332312msgid "Upgrade"
    333313msgstr ""
    334314
    335 #: includes/mcwp-premium.php:8
     315#: includes/premium.php:8
    336316msgid "plugin within a minute and unlock many features now!!!"
    337317msgstr ""
    338318
    339 #: includes/mcwp-premium.php:20
     319#: includes/premium.php:20
    340320msgid "Free"
    341321msgstr ""
    342322
    343 #: includes/mcwp-premium.php:21
     323#: includes/premium.php:21
    344324msgid "Pro"
    345325msgstr ""
    346326
    347 #: includes/mcwp-premium.php:21
     327#: includes/premium.php:21
    348328msgid "Recommended"
    349329msgstr ""
    350330
    351 #: includes/mcwp-premium.php:32
     331#: includes/premium.php:26 includes/shortcodes.php:143
     332msgid "Price"
     333msgstr ""
     334
     335#: includes/premium.php:32
    352336msgid "Unlimited Cryptocurrencies"
    353337msgstr ""
    354338
    355 #: includes/mcwp-premium.php:33
     339#: includes/premium.php:33
    356340msgid ""
    357341"More than 5,000 cryptocurrencies available and new currencies are added "
     
    359343msgstr ""
    360344
    361 #: includes/mcwp-premium.php:40
     345#: includes/premium.php:40
    362346msgid "Modern Layout"
    363347msgstr ""
    364348
    365 #: includes/mcwp-premium.php:41
     349#: includes/premium.php:41
    366350msgid ""
    367351"Supports modern layouts which are compatible with most OS, browsers and "
     
    369353msgstr ""
    370354
    371 #: includes/mcwp-premium.php:48
     355#: includes/premium.php:48
    372356msgid "Shortcodes"
    373357msgstr ""
    374358
    375 #: includes/mcwp-premium.php:49
     359#: includes/premium.php:49
    376360msgid "Shortcode can be easily copied and pasted anywhere on your site"
    377361msgstr ""
    378362
    379 #: includes/mcwp-premium.php:56
     363#: includes/premium.php:56
    380364msgid "Auto Ticker Enable"
    381365msgstr ""
    382366
    383 #: includes/mcwp-premium.php:57
     367#: includes/premium.php:57
    384368msgid ""
    385369"Header, footer ticker showed on site, shortcode does not need to be placed"
    386370msgstr ""
    387371
    388 #: includes/mcwp-premium.php:64
     372#: includes/premium.php:64
    389373msgid "Preview"
    390374msgstr ""
    391375
    392 #: includes/mcwp-premium.php:65
     376#: includes/premium.php:65
    393377msgid "Widget preview is shown on the right side while editing"
    394378msgstr ""
    395379
    396 #: includes/mcwp-premium.php:72
     380#: includes/premium.php:72
    397381msgid "Feature Rich Admin Panel"
    398382msgstr ""
    399383
    400 #: includes/mcwp-premium.php:73
     384#: includes/premium.php:73
    401385msgid ""
    402386"Customized admin panel to provide a feature-rich experience to create "
     
    404388msgstr ""
    405389
    406 #: includes/mcwp-premium.php:80 includes/mcwp-settings.php:107
     390#: includes/premium.php:80 includes/settings.php:107
    407391msgid "Ticker Speed"
    408392msgstr ""
    409393
    410 #: includes/mcwp-premium.php:81
     394#: includes/premium.php:81
    411395msgid "Ticker speed can be controlled easily"
    412396msgstr ""
    413397
    414 #: includes/mcwp-premium.php:88
     398#: includes/premium.php:88
    415399msgid "Real Time Price Update"
    416400msgstr ""
    417401
    418 #: includes/mcwp-premium.php:89
     402#: includes/premium.php:89
    419403msgid "Real time can be enabled or disabled for any widget"
    420404msgstr ""
    421405
    422 #: includes/mcwp-premium.php:96
     406#: includes/premium.php:96
    423407msgid "Unlimited Fiat Currencies"
    424408msgstr ""
    425409
    426 #: includes/mcwp-premium.php:97
     410#: includes/premium.php:97
    427411msgid "150+ fiat currency change options for all widgets"
    428412msgstr ""
    429413
    430 #: includes/mcwp-premium.php:104
     414#: includes/premium.php:104
    431415msgid "Number Of Themes"
    432416msgstr ""
    433417
    434 #: includes/mcwp-premium.php:105
     418#: includes/premium.php:105
    435419msgid "Beautiful default themes available for all widgets"
    436420msgstr ""
    437421
    438 #: includes/mcwp-premium.php:112
     422#: includes/premium.php:112
    439423msgid "Top/Unlimited Coins"
    440424msgstr ""
    441425
    442 #: includes/mcwp-premium.php:113
     426#: includes/premium.php:113
    443427msgid ""
    444428"Coins - option to select top 100, 300 coins or all coins, also with remove "
     
    446430msgstr ""
    447431
    448 #: includes/mcwp-premium.php:120
     432#: includes/premium.php:120
    449433msgid "Customize All Colors"
    450434msgstr ""
    451435
    452 #: includes/mcwp-premium.php:121
     436#: includes/premium.php:121
    453437msgid "Custom text and background colors for all widgets"
    454438msgstr ""
    455439
    456 #: includes/mcwp-premium.php:128
     440#: includes/premium.php:128
    457441msgid "Price Formats"
    458442msgstr ""
    459443
    460 #: includes/mcwp-premium.php:129
     444#: includes/premium.php:129
    461445msgid "Price format option for all widgets"
    462446msgstr ""
    463447
    464 #: includes/mcwp-premium.php:136
     448#: includes/premium.php:136
    465449msgid "Ticker Display Options"
    466450msgstr ""
    467451
    468 #: includes/mcwp-premium.php:137
     452#: includes/premium.php:137
    469453msgid ""
    470454"Display options - 24h change, 24h volume enable/disable, rounded corners"
    471455msgstr ""
    472456
    473 #: includes/mcwp-premium.php:144
     457#: includes/premium.php:144
    474458msgid "Table Styles"
    475459msgstr ""
    476460
    477 #: includes/mcwp-premium.php:145
     461#: includes/premium.php:145
    478462msgid "Table styles like light, dark, gloss, custom are available"
    479463msgstr ""
    480464
    481 #: includes/mcwp-premium.php:152
     465#: includes/premium.php:152
    482466msgid "Pagination"
    483467msgstr ""
    484468
    485 #: includes/mcwp-premium.php:153
     469#: includes/premium.php:153
    486470msgid ""
    487471"Table row length to control no. of coins shown when the page loads. "
     
    489473msgstr ""
    490474
    491 #: includes/mcwp-premium.php:160
     475#: includes/premium.php:160
    492476msgid "Link coin pages to the table"
    493477msgstr ""
    494478
    495 #: includes/mcwp-premium.php:161
     479#: includes/premium.php:161
    496480msgid "Create any particular coin pages and link it to tables"
    497481msgstr ""
    498482
    499 #: includes/mcwp-premium.php:168
     483#: includes/premium.php:168
    500484msgid "Charts View"
    501485msgstr ""
    502486
    503 #: includes/mcwp-premium.php:169
     487#: includes/premium.php:169
    504488msgid ""
    505489"Two type of option for chart view - line chart and candlestick which "
     
    508492msgstr ""
    509493
    510 #: includes/mcwp-premium.php:176
     494#: includes/premium.php:176
    511495msgid "Chart Options"
    512496msgstr ""
    513497
    514 #: includes/mcwp-premium.php:177
     498#: includes/premium.php:177
    515499msgid ""
    516500"Chart features - smooth, non-smooth edges, Theme - light and dark, Chart "
     
    518502msgstr ""
    519503
    520 #: includes/mcwp-premium.php:184
     504#: includes/premium.php:184
    521505msgid "Card & Label Designs"
    522506msgstr ""
    523507
    524 #: includes/mcwp-premium.php:185
     508#: includes/premium.php:185
    525509msgid ""
    526510"Card widgets, labels provides default six and three types of designs "
     
    528512msgstr ""
    529513
    530 #: includes/mcwp-premium.php:192
     514#: includes/premium.php:192
    531515msgid "Card Display Options"
    532516msgstr ""
    533517
    534 #: includes/mcwp-premium.php:193
     518#: includes/premium.php:193
    535519msgid "Cards, labels support full width option as well as round corners"
    536520msgstr ""
    537521
    538 #: includes/mcwp-premium.php:200
     522#: includes/premium.php:200
    539523msgid "All Rounder Converter"
    540524msgstr ""
    541525
    542 #: includes/mcwp-premium.php:201
     526#: includes/premium.php:201
    543527msgid ""
    544528"Converter available with four types: crypto to fiat, fiat to crypto, crypto "
     
    546530msgstr ""
    547531
    548 #: includes/mcwp-premium.php:208
     532#: includes/premium.php:208
    549533msgid "Auto/Manual Converter"
    550534msgstr ""
    551535
    552 #: includes/mcwp-premium.php:209
     536#: includes/premium.php:209
    553537msgid ""
    554538"Manual convert button can be added if the automatic conversion is not "
     
    556540msgstr ""
    557541
    558 #: includes/mcwp-premium.php:216
     542#: includes/premium.php:216
    559543msgid "List Widgets"
    560544msgstr ""
    561545
    562 #: includes/mcwp-premium.php:217
     546#: includes/premium.php:217
    563547msgid "Three Beautiful designs with animated spark line charts"
    564548msgstr ""
    565549
    566 #: includes/mcwp-premium.php:224
     550#: includes/premium.php:224
    567551msgid "Box Widgets"
    568552msgstr ""
    569553
    570 #: includes/mcwp-premium.php:225
     554#: includes/premium.php:225
    571555msgid "Five Beautiful designs with animated spark line charts"
    572556msgstr ""
    573557
    574 #: includes/mcwp-premium.php:232
     558#: includes/premium.php:232
    575559msgid "Text Widgets"
    576560msgstr ""
    577561
    578 #: includes/mcwp-premium.php:233
     562#: includes/premium.php:233
    579563msgid ""
    580564"Add cryptocurrency data anywhere in articles, sidebars, etc., with static "
     
    582566msgstr ""
    583567
    584 #: includes/mcwp-premium.php:240
     568#: includes/premium.php:240
    585569msgid "Changelly Widgets"
    586570msgstr ""
    587571
    588 #: includes/mcwp-premium.php:241
     572#: includes/premium.php:241
    589573msgid ""
    590574"Embed changelly widgets to your site for buy/sell and earn commissions on "
     
    592576msgstr ""
    593577
    594 #: includes/mcwp-premium.php:248
     578#: includes/premium.php:248
    595579msgid "News Widgets"
    596580msgstr ""
    597581
    598 #: includes/mcwp-premium.php:249
     582#: includes/premium.php:249
    599583msgid ""
    600584"Add latest crypto news on your site with our elegant and responsive widgets"
    601585msgstr ""
    602586
    603 #: includes/mcwp-premium.php:258
     587#: includes/premium.php:258
    604588msgid "Installed"
    605589msgstr ""
    606590
    607 #: includes/mcwp-premium.php:264
     591#: includes/premium.php:264
    608592msgid "Upgrade Now"
    609593msgstr ""
    610594
    611 #: includes/mcwp-settings.php:11
     595#: includes/settings.php:11
    612596msgid "Widget Title"
    613597msgstr ""
    614598
    615 #: includes/mcwp-settings.php:25
     599#: includes/settings.php:25
    616600msgid "Ticker"
    617601msgstr ""
    618602
    619 #: includes/mcwp-settings.php:28
     603#: includes/settings.php:28
    620604msgid "Table"
    621605msgstr ""
    622606
    623 #: includes/mcwp-settings.php:31
     607#: includes/settings.php:31
    624608msgid "Card"
    625609msgstr ""
    626610
    627 #: includes/mcwp-settings.php:34
     611#: includes/settings.php:34
    628612msgid "Label"
    629613msgstr ""
    630614
    631 #: includes/mcwp-settings.php:42
     615#: includes/settings.php:42
    632616msgid "Coins"
    633617msgstr ""
    634618
    635 #: includes/mcwp-settings.php:42
     619#: includes/settings.php:42
    636620msgid "Clear"
    637621msgstr ""
    638622
    639 #: includes/mcwp-settings.php:45 includes/mcwp-settings.php:46
     623#: includes/settings.php:45 includes/settings.php:46
    640624msgid "Select a Cryptocurrency Coin"
    641625msgstr ""
    642626
    643 #: includes/mcwp-settings.php:58
     627#: includes/settings.php:58
    644628msgid "or show top"
    645629msgstr ""
    646630
    647 #: includes/mcwp-settings.php:67
     631#: includes/settings.php:67
    648632msgid "coins"
    649633msgstr ""
    650634
    651 #: includes/mcwp-settings.php:73
     635#: includes/settings.php:73
    652636msgid ""
    653637"Thank you for installing our plugin. We hope you will like it very much. "
     
    655639msgstr ""
    656640
    657 #: includes/mcwp-settings.php:75
     641#: includes/settings.php:75
    658642msgid "I'll Rate Later"
    659643msgstr ""
    660644
    661 #: includes/mcwp-settings.php:76
     645#: includes/settings.php:76
    662646msgid "Sure, I'll Rate"
    663647msgstr ""
    664648
    665 #: includes/mcwp-settings.php:85
     649#: includes/settings.php:85
    666650msgid "Ticker Position"
    667651msgstr ""
    668652
    669 #: includes/mcwp-settings.php:116 includes/mcwp-settings.php:127
    670 #: includes/mcwp-settings.php:136
     653#: includes/settings.php:116 includes/settings.php:127
     654#: includes/settings.php:136
    671655msgid "Display Options"
    672656msgstr ""
    673657
    674 #: includes/mcwp-settings.php:120
     658#: includes/settings.php:120
    675659msgid "24h Change"
    676660msgstr ""
    677661
    678 #: includes/mcwp-settings.php:122 includes/mcwp-settings.php:131
    679 #: includes/mcwp-settings.php:142
     662#: includes/settings.php:122 includes/settings.php:131
     663#: includes/settings.php:142
    680664msgid "Link to Coingecko"
    681665msgstr ""
    682666
    683 #: includes/mcwp-settings.php:140
     667#: includes/settings.php:140
    684668msgid "Full Width"
    685669msgstr ""
    686670
    687 #: includes/mcwp-settings.php:147
     671#: includes/settings.php:144
     672msgid "Add 24h Change Percentage"
     673msgstr ""
     674
     675#: includes/settings.php:149
    688676msgid "Custom Text Color"
    689677msgstr ""
    690678
    691 #: includes/mcwp-settings.php:155
     679#: includes/settings.php:157
    692680msgid "Custom Background Color"
    693681msgstr ""
    694682
    695 #: includes/mcwp-settings.php:163
     683#: includes/settings.php:165
    696684msgid "Add Custom CSS"
    697685msgstr ""
    698686
    699 #: includes/mcwp-settings.php:176 includes/mcwp-settings.php:228
    700 #: includes/mcwp-settings.php:235 includes/mcwp-settings.php:242
    701 #: includes/mcwp-settings.php:248 includes/mcwp-settings.php:254
    702 #: includes/mcwp-settings.php:260 includes/mcwp-settings.php:266
    703 #: includes/mcwp-settings.php:272 includes/mcwp-settings.php:278
    704 #: includes/mcwp-settings.php:284 includes/mcwp-settings.php:290
    705 #: includes/mcwp-settings.php:296 includes/mcwp-settings.php:302
    706 #: includes/mcwp-settings.php:308 includes/mcwp-settings.php:314
    707 #: includes/mcwp-settings.php:320 includes/mcwp-settings.php:326
     687#: includes/settings.php:178 includes/settings.php:230
     688#: includes/settings.php:237 includes/settings.php:244
     689#: includes/settings.php:250 includes/settings.php:256
     690#: includes/settings.php:262 includes/settings.php:268
     691#: includes/settings.php:274 includes/settings.php:280
     692#: includes/settings.php:286 includes/settings.php:292
     693#: includes/settings.php:298 includes/settings.php:304
     694#: includes/settings.php:310 includes/settings.php:316
     695#: includes/settings.php:322 includes/settings.php:328
    708696msgid "Available in Pro Version"
    709697msgstr ""
    710698
    711 #: includes/mcwp-settings.php:178
     699#: includes/settings.php:180
    712700msgid "More Widgets (Pro)"
    713701msgstr ""
    714702
    715 #: includes/mcwp-settings.php:332
     703#: includes/settings.php:334
    716704msgid "Publish or update to preview"
    717705msgstr ""
     706
     707#: includes/shortcodes.php:143
     708msgid "Name"
     709msgstr ""
     710
     711#: includes/shortcodes.php:143
     712msgid "Market Cap"
     713msgstr ""
     714
     715#: includes/shortcodes.php:143
     716msgid "Change"
     717msgstr ""
     718
     719#: includes/shortcodes.php:143
     720msgid "Price Graph (24h)"
     721msgstr ""
  • cryptocurrency-widgets-pack/trunk/readme.txt

    r2751469 r2854429  
    44Tags: cryptocurrency, bitcoin price, ticker, table, coinmarketcap, shortcodes, crypto widgets
    55Requires PHP: 5.6
    6 Requires at least: 5.6
    7 Tested up to: 6.0
    8 Stable tag: 1.8.1
     6Requires at least: 4.3.0
     7Tested up to: 6.1.1
     8Stable tag: 2.0
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    153153== Changelog ==
    154154
     155= 2.0 [24-01-2023] =
     156* [Fix] Security Fixes
     157
    155158= 1.8.1 [04-07-2022] =
    156159* [Improved] WordPress 6 Compatibility Update
Note: See TracChangeset for help on using the changeset viewer.