PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 3.2.1
Wp Social Login and Register Social Counter v3.2.1
3.2.1 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 / share / share-html.php
wp-social / template / share Last commit date
primary_content.php 1 week ago share-html.php 1 week ago
share-html.php
153 lines
1 <?php
2
3 use WP_Social\App\Settings;
4
5 defined('ABSPATH') || exit;
6
7 $share_settings = Settings::instance()->get_providers_settings_share();
8 $share_settings = isset( $share_settings['social'] ) ? $share_settings['social'] : $share_settings ;
9 $wanted_providers = $provider;
10 $selected_share_style = $shareStyleKey;
11
12 $uri_hash = md5($currentUrl);
13
14
15 if(!empty($wanted_providers) && is_array($wanted_providers)) :
16
17 if(!empty($styles[$selected_share_style]['package']) && $styles[$selected_share_style]['package'] == 'pro' && !WP_Social::is_pro_active()) {
18
19 ?>
20 <div class="xs_social_share_widget xs_share_url">
21 <ul>
22 <li class="xs-share-li wslu-no-extra-data"><?php esc_html_e('Pro plugin deactivated or invalid', 'wp-social'); ?></li>
23 </ul>
24 </div>
25 <?php
26
27 return;
28 } ?>
29
30 <div class="xs_social_share_widget xs_share_url <?php echo esc_attr($customClass) . ' '; ?>
31 <?php echo esc_attr($fixed_display) . ' '; ?> <?php echo esc_attr($widget_style); ?>">
32
33 <?php if($showCountMarkup): ?>
34
35 <div class="wslu-share-count">
36 <span class="wslu-share-count--total"><?php echo esc_html(xs_format_num($totalSCount)); ?></span>
37 <span class="wslu-share-count--text"><?php esc_html_e('Shares', 'wp-social') ?></span>
38 </div>
39
40 <?php endif; ?>
41
42 <ul>
43 <?php
44 $content = isset($styles[$selected_share_style]['content']) ? $styles[$selected_share_style]['content'] : '';
45
46 // Check if the wp-social-pro plugin is active
47 $is_wp_social_pro_active = in_array('wp-social-pro/wp-social-pro.php', apply_filters('active_plugins', get_option('active_plugins')));
48
49
50 foreach($wanted_providers as $key) {
51
52 // Skip rendering Line app if wp-social-pro plugin is inactive
53 if ($key === 'lineapp' && !$is_wp_social_pro_active) {
54 continue;
55 }
56
57 if(!empty($enabled_providers[$key]['enable'])) {
58
59 $counter = empty($share_counting[$key]['count']) ? 0 : $share_counting[$key]['count'];
60
61 $label = isset($share_settings[$key]['data']['label']) ? $share_settings[$key]['data']['label'] : ucfirst($key);
62 $def = isset($share_settings[$key]['data']['value']) ? intval($share_settings[$key]['data']['value']) : 0;
63 $text = isset($share_settings[$key]['data']['text']) ? $share_settings[$key]['data']['text'] : '';
64
65 $getUrl = isset($core_provider[$key]['url']) ? $core_provider[$key]['url'] : '';
66 $pData = isset($core_provider[$key]['params']) ? $core_provider[$key]['params'] : [];
67
68 $urlCon = empty($core_provider[$key]['params']) ? [] : $core_provider[$key]['params'];
69
70 $old_count = Settings::get_old_count($key);
71 $counter = ( $counter + $old_count > 0 ) ? $counter + $old_count : $def;
72
73 foreach($urlCon as $k => $v) {
74
75 $urlCon[$k] = str_replace(
76 ['[%url%]', '[%title%]', '[%author%]', '[%details%]', '[%source%]', '[%media%]', '[%app_id%]'],
77 [$currentUrl, $title, $author, $details, $source, $media, $app_id],
78 $v
79 );
80 }
81
82 $params = http_build_query($urlCon, '&');
83
84 ?>
85 <li class="xs-share-li <?php echo esc_attr($key); ?>
86 <?php echo esc_attr(Settings::get_extra_data_class($selected_share_style, $styles)) ?>">
87 <a href="#"
88 class="xs-share-link"
89 id="xs_feed_<?php echo esc_attr($key) ?>"
90 data-pid="<?php echo esc_attr($postId) ?>"
91 data-uri_hash="<?php echo esc_attr($uri_hash) ?>"
92 data-key="<?php echo esc_attr($key); ?>"
93 data-xs-href="<?php echo esc_attr($getUrl . '?' . $params); ?>">
94
95 <div class="xs-social-icon">
96 <span class="met-social met-social-<?php echo esc_attr($key); ?>"></span>
97 </div>
98
99 <?php if(!empty($styles[$selected_share_style]['content']) != '') : ?>
100 <div class="wslu-both-counter-text ">
101
102 <?php if(Settings::has_number_content_in_selected_style($selected_share_style, $styles)) : ?>
103 <div class="xs-social-follower">
104 <?php echo esc_html(xs_format_num($counter)); ?>
105 </div>
106 <?php endif; ?>
107
108 <?php if(Settings::has_text_content_in_selected_style($selected_share_style, $styles)) : ?>
109 <div class="xs-social-follower-text">
110 <?php echo esc_html($text); ?>
111 </div>
112 <?php endif; ?>
113
114 <?php if(Settings::has_label_content_in_selected_style($selected_share_style, $styles)) : ?>
115 <div class="xs-social-follower-label">
116 <?php echo esc_html($label); ?>
117 </div>
118 <?php endif; ?>
119 </div>
120 <?php endif; ?>
121
122 <div class="wslu-hover-content">
123 <div class="xs-social-followers">
124 <?php echo esc_html(xs_format_num($counter)); ?>
125 </div>
126 <div class="xs-social-follower-text">
127 <?php echo esc_html($text); ?>
128 </div>
129 <div class="xs-social-follower-label">
130 <?php echo esc_html($label); ?>
131 </div>
132 </div>
133 </a>
134 </li>
135 <?php
136 }
137 } ?>
138 </ul>
139 </div> <?php
140
141 elseif(!empty($styles[$selected_share_style]['package']) && $styles[$selected_share_style]['package'] == 'pro'): ?>
142
143 <div class="xs_social_share_widget xs_share_url">
144 <ul>
145 <li class="xs-share-li wslu-no-extra-data"><?php esc_html_e('Pro plugin deactivated', 'wp-social'); ?></li>
146 </ul>
147 </div>
148
149 <?php
150
151 endif; ?>
152
153