PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.4
Wp Social Login and Register Social Counter v2.2.4
trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / template / counter / counter-html.php
wp-social / template / counter Last commit date
counter-html.php 3 years ago
counter-html.php
138 lines
1 <?php
2
3 defined('ABSPATH') || exit;
4
5 $enabled_providers = \WP_Social\App\Settings::get_enabled_provider_conf_counter();
6
7 $show_core_provider = \WP_Social\App\Providers::get_core_providers_count();
8 $show_core_provider = array_keys($show_core_provider);
9
10 if(!empty($enabled_providers)) : ?>
11
12 <div class="xs_social_counter_widget <?php echo esc_attr($className); ?>">
13 <ul class="xs_counter_url <?php echo esc_attr($widget_style); ?>">
14
15 <?php
16
17 $factory = new \WP_Social\Lib\Provider\Counter_Factory();
18 $cache_time = \WP_Social\App\Settings::get_counter_cache_time();
19
20 foreach($show_core_provider as $key) {
21
22 if(!empty($enabled_providers[$key]['enable'])) {
23
24 // check if provider list is provided from widget
25 if(!in_array($key, $provider)) {
26 continue;
27 }
28
29 $p_obj = $factory->make($key);
30 //$follower_count = $p_obj->get_cached_count($cache_time);
31
32 $label = isset($counter_provider[$key]['label']) ? $counter_provider[$key]['label'] : '';
33 $def = isset($counter_provider[$key]['data']['value']) ? $counter_provider[$key]['data']['value'] : 0;
34 $text = isset($counter_provider[$key]['data']['text']) ? $counter_provider[$key]['data']['text'] : '';
35
36 /**
37 * We will give priority to the actual number, if actual number is zero then we will show the default value.
38 */
39 $counter = !empty($counter_data[$key]) ? $counter_data[$key] : $def;
40 #$counter = ($def) > 0 ? $def : $counter;
41
42 $id = isset($counter_provider[$key]['id']) ? $counter_provider[$key]['id'] : '';
43 $user_name = isset($counter_provider[$key]['user_name']) ? $counter_provider[$key]['user_name'] : '';
44 $type = isset($counter_provider[$key]['type']) ? $counter_provider[$key]['type'] : '';
45 $getUrl = isset($core_provider[$key]['data']['url']) ? $core_provider[$key]['data']['url'] : '#';
46
47 if($key == 'youtube') {
48 $url = sprintf($getUrl, strtolower($type), $id);
49
50 } elseif($key == 'linkedin') {
51
52 if($type == 'Profile') {
53 $url = sprintf($getUrl, 'in', $id);
54
55 } else {
56 $url = sprintf($getUrl, 'company', $id);
57 }
58 } elseif($key == 'dribbble') {
59
60 $url = get_option('home_url_dribbble_count', 'https://dribbble.com/');
61
62 } elseif($key == 'instagram') {
63
64 $url = sprintf($getUrl, $user_name);
65
66 }else {
67 $url = sprintf($getUrl, $id);
68 }
69
70 ?>
71 <li class="xs-counter-li <?php echo esc_attr($key); ?>" data-key="<?php echo esc_attr($key); ?>">
72 <a href="<?php echo esc_url($url); ?>" target="_blank">
73 <div class="xs-social-icon">
74 <span class="met-social met-social-<?php echo esc_attr($key); ?>"></span>
75 </div>
76
77 <?php
78
79 if(!empty($styleArr[$cntStyleKey]['content'])) {
80
81 if(!empty($styleArr[$cntStyleKey]['content']['number'])) {
82
83 ?>
84 <div class="xs-social-follower">
85 <?php echo esc_html(xs_format_num($counter)); ?>
86 </div>
87
88 <?php
89 }
90
91 if(!empty($styleArr[$cntStyleKey]['content']['label'])) {
92
93 ?>
94 <div class="xs-social-follower-text">
95 <?php echo esc_html($text); ?>
96 </div>
97 <?php
98 }
99
100 } else {
101
102 ?>
103 <div class="xs-social-follower">
104 <?php echo esc_html(xs_format_num($counter)); ?>
105 </div>
106
107 <div class="xs-social-follower-text">
108 <?php echo esc_html($text); ?>
109 </div>
110
111 <?php
112 }
113 ?>
114
115 <div class="wslu-hover-content">
116 <div class="xs-social-followers">
117 <?php echo esc_html(xs_format_num($counter)); ?>
118 </div>
119 <div class="xs-social-follower-text">
120 <?php echo esc_html($text); ?>
121 </div>
122 </div>
123
124 </a>
125 </li>
126 <?php
127 }
128 }
129
130 ?>
131
132 </ul>
133 </div>
134
135 <?php
136
137 endif;
138