Version Description
- fix/update security issue
Download this release
Release Info
Developer | cybernetikz |
Plugin | Easy Social Icons |
Version | 3.1.1 |
Comparing to | |
See all releases |
Code changes from version 3.1.0 to 3.1.1
- easy-social-icons.php +30 -33
- readme.txt +4 -1
easy-social-icons.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Easy Social Icons
|
4 |
Plugin URI: http://www.cybernetikz.com
|
5 |
Description: You can upload your own social icon, set your social URL, choose weather you want to display vertical or horizontal. You can use the shortcode <strong>[cn-social-icon]</strong> in page/post, template tag for php file <strong><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></strong> also you can use the widget <strong>"Easy Social Icons"</strong> for sidebar.
|
6 |
-
Version: 3.1.
|
7 |
Author: cybernetikz
|
8 |
Author URI: http://www.cybernetikz.com
|
9 |
License: GPL2
|
@@ -17,10 +17,10 @@ $cnssBaseURL = $cnssUploadDir['baseurl'].'';
|
|
17 |
$cnssPluginsURI = plugins_url('/', __FILE__);
|
18 |
|
19 |
add_action('init', 'cnss_init_script');
|
20 |
-
add_action('init', '
|
21 |
add_action('wp_ajax_update-social-icon-order', 'cnss_save_ajax_order' );
|
22 |
add_action('admin_menu', 'cnss_add_menu_pages');
|
23 |
-
add_action('wp_head', '
|
24 |
add_action('admin_enqueue_scripts', 'cnss_admin_style');
|
25 |
if( isset($_GET['page']) ) {
|
26 |
if( $_GET['page']=='cnss_social_icon_add' ) {
|
@@ -121,7 +121,7 @@ function cnss_get_all_icons($where_sql = '') {
|
|
121 |
}
|
122 |
}
|
123 |
|
124 |
-
function
|
125 |
if ($key == '') {
|
126 |
return;
|
127 |
}
|
@@ -149,13 +149,13 @@ function cn_esi_get_option($key='') {
|
|
149 |
}
|
150 |
}
|
151 |
|
152 |
-
function
|
153 |
|
154 |
-
$social_profile_links =
|
155 |
-
$cnss_original_icon_color =
|
156 |
-
$icon_bg_color =
|
157 |
-
$icon_bg_hover_color =
|
158 |
-
$icon_hover_color =
|
159 |
|
160 |
$icons = cnss_get_all_icons();
|
161 |
if ( !empty($icons) && $social_profile_links == 1 ) {
|
@@ -191,7 +191,6 @@ function social_profile_links_fn() {
|
|
191 |
|
192 |
function cnss_add_menu_pages() {
|
193 |
add_menu_page('Easy Social Icons', 'Easy Social Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn', 'dashicons-share');
|
194 |
-
//add_menu_page('Easy Social Icons', 'Easy Social Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn', 'dashicons-share' );
|
195 |
|
196 |
add_submenu_page('cnss_social_icon_page', 'All Icons', 'All Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn');
|
197 |
|
@@ -201,11 +200,11 @@ function cnss_add_menu_pages() {
|
|
201 |
|
202 |
add_submenu_page('cnss_social_icon_page', 'Settings & Instructions', 'Settings & Instructions', 'manage_options', 'cnss_social_icon_option', 'cnss_social_icon_option_fn');
|
203 |
|
204 |
-
add_action( 'admin_init', '
|
205 |
|
206 |
}
|
207 |
|
208 |
-
function
|
209 |
register_setting( 'cnss-settings-group', 'cnss-width' );
|
210 |
register_setting( 'cnss-settings-group', 'cnss-height' );
|
211 |
register_setting( 'cnss-settings-group', 'cnss-margin' );
|
@@ -266,15 +265,15 @@ function cnss_social_icon_option_fn() {
|
|
266 |
<table class="form-table">
|
267 |
<tr valign="top">
|
268 |
<th scope="row">Icon Width</th>
|
269 |
-
<td><input type="number" name="cnss-width" id="cnss-width" class="small-text" value="<?php echo $cnss_width?>" />px</td>
|
270 |
</tr>
|
271 |
<tr valign="top">
|
272 |
<th scope="row">Icon Height</th>
|
273 |
-
<td><input type="number" name="cnss-height" id="cnss-height" class="small-text" value="<?php echo $cnss_height?>" />px</td>
|
274 |
</tr>
|
275 |
<tr valign="top">
|
276 |
<th scope="row">Icon Margin</th>
|
277 |
-
<td><input type="number" name="cnss-margin" id="cnss-margin" class="small-text" value="<?php echo $cnss_margin?>" />px <em><small>(Gap between each icon)</small></em></td>
|
278 |
</tr>
|
279 |
|
280 |
<tr valign="top">
|
@@ -323,20 +322,20 @@ function cnss_social_icon_option_fn() {
|
|
323 |
|
324 |
<tr class="wrap-icon-bg-color" valign="top" style="<?php echo $cnss_original_icon_color==1?'display: none;':''; ?>">
|
325 |
<th scope="row">Icon Background Color</th>
|
326 |
-
<td><input type="text" name="cnss-icon-bg-color" id="cnss-icon-bg-color" class="cnss-fa-icon-color" value="<?php echo $icon_bg_color ?>" /></td>
|
327 |
</tr>
|
328 |
<tr class="wrap-icon-bg-color" valign="top" style="<?php echo $cnss_original_icon_color==1?'display: none;':''; ?>">
|
329 |
<th scope="row">Icon Background Hover Color</th>
|
330 |
-
<td><input type="text" name="cnss-icon-bg-hover-color" id="cnss-icon-bg-hover-color" class="cnss-fa-icon-color" value="<?php echo $icon_bg_hover_color ?>" /></td>
|
331 |
</tr>
|
332 |
|
333 |
<tr valign="top">
|
334 |
<th scope="row">Icon Color</th>
|
335 |
-
<td><input type="text" name="cnss-icon-color" id="cnss-icon-color" class="cnss-fa-icon-color" value="<?php echo $icon_color ?>" /></td>
|
336 |
</tr>
|
337 |
<tr valign="top">
|
338 |
<th scope="row">Icon Hover Color</th>
|
339 |
-
<td><input type="text" name="cnss-icon-hover-color" id="cnss-icon-hover-color" class="cnss-fa-icon-color" value="<?php echo $icon_hover_color ?>" /></td>
|
340 |
</tr>
|
341 |
|
342 |
<tr valign="top">
|
@@ -480,7 +479,7 @@ function cnss_social_icon_option_fn() {
|
|
480 |
</tr>
|
481 |
</table>
|
482 |
<p></p>
|
483 |
-
<?php echo
|
484 |
<p><label><?php _e( 'Select Social Icons:' ); ?></label> <em>(If select none all icons will be displayed)</em></p>
|
485 |
<p>
|
486 |
<input type="submit" class="button-primary" value="<?php _e('Generate Shortcode') ?>" />
|
@@ -565,7 +564,7 @@ function cnss_db_install () {
|
|
565 |
}
|
566 |
}
|
567 |
|
568 |
-
function
|
569 |
global $wpdb,$err,$msg,$cnssBaseDir;
|
570 |
if ( isset($_POST['submit_button']) && check_admin_referer('cn_insert_icon') ) {
|
571 |
|
@@ -640,8 +639,6 @@ function cn_process_post() {
|
|
640 |
$err = "";
|
641 |
$msg = "";
|
642 |
|
643 |
-
$url = $_POST['url'];
|
644 |
-
$target = $_POST['target'];
|
645 |
$image_file_path = $cnssBaseDir;
|
646 |
|
647 |
$update = "";
|
@@ -1140,7 +1137,7 @@ function cnss_social_icon_page_fn() {
|
|
1140 |
<?php
|
1141 |
}
|
1142 |
|
1143 |
-
function
|
1144 |
|
1145 |
$cnss_width = get_option('cnss-width');
|
1146 |
$cnss_height = get_option('cnss-height');
|
@@ -1227,11 +1224,11 @@ function cn_social_icon($attr = array(), $call_from_widget = NULL) {
|
|
1227 |
$text_align = isset($attr['alignment'])?$attr['alignment']:get_option('cnss-text-align');
|
1228 |
|
1229 |
// settings for font-awesome icons
|
1230 |
-
$icon_bg_color =
|
1231 |
-
$icon_color =
|
1232 |
-
$icon_hover_color =
|
1233 |
-
$icon_shape =
|
1234 |
-
$cnss_original_icon_color =
|
1235 |
|
1236 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
1237 |
$sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' $where_sql ORDER BY sortorder";
|
@@ -1282,7 +1279,7 @@ function cn_social_icon($attr = array(), $call_from_widget = NULL) {
|
|
1282 |
return $out;
|
1283 |
}
|
1284 |
|
1285 |
-
function
|
1286 |
|
1287 |
global $wpdb,$cnssBaseURL;
|
1288 |
|
@@ -1406,7 +1403,7 @@ class Cnss_Widget extends WP_Widget {
|
|
1406 |
|
1407 |
<p>
|
1408 |
<label><?php _e( 'Select Social Icons:' ); ?></label> <em>(If select none all icons will be displayed)</em><br />
|
1409 |
-
<?php echo $this->
|
1410 |
</p>
|
1411 |
|
1412 |
<table style="margin-bottom:15px;" width="100%" border="0">
|
@@ -1421,7 +1418,7 @@ class Cnss_Widget extends WP_Widget {
|
|
1421 |
<?php
|
1422 |
}
|
1423 |
|
1424 |
-
public function
|
1425 |
|
1426 |
global $wpdb,$cnssBaseURL;
|
1427 |
|
3 |
Plugin Name: Easy Social Icons
|
4 |
Plugin URI: http://www.cybernetikz.com
|
5 |
Description: You can upload your own social icon, set your social URL, choose weather you want to display vertical or horizontal. You can use the shortcode <strong>[cn-social-icon]</strong> in page/post, template tag for php file <strong><?php if ( function_exists('cn_social_icon') ) echo cn_social_icon(); ?></strong> also you can use the widget <strong>"Easy Social Icons"</strong> for sidebar.
|
6 |
+
Version: 3.1.1
|
7 |
Author: cybernetikz
|
8 |
Author URI: http://www.cybernetikz.com
|
9 |
License: GPL2
|
17 |
$cnssPluginsURI = plugins_url('/', __FILE__);
|
18 |
|
19 |
add_action('init', 'cnss_init_script');
|
20 |
+
add_action('init', 'cnss_process_post');
|
21 |
add_action('wp_ajax_update-social-icon-order', 'cnss_save_ajax_order' );
|
22 |
add_action('admin_menu', 'cnss_add_menu_pages');
|
23 |
+
add_action('wp_head', 'cnss_social_profile_links_fn');
|
24 |
add_action('admin_enqueue_scripts', 'cnss_admin_style');
|
25 |
if( isset($_GET['page']) ) {
|
26 |
if( $_GET['page']=='cnss_social_icon_add' ) {
|
121 |
}
|
122 |
}
|
123 |
|
124 |
+
function cnss_get_option($key='') {
|
125 |
if ($key == '') {
|
126 |
return;
|
127 |
}
|
149 |
}
|
150 |
}
|
151 |
|
152 |
+
function cnss_social_profile_links_fn() {
|
153 |
|
154 |
+
$social_profile_links = cnss_get_option('cnss-social-profile-links');
|
155 |
+
$cnss_original_icon_color = cnss_get_option('cnss-original-icon-color');
|
156 |
+
$icon_bg_color = cnss_get_option('cnss-icon-bg-color');
|
157 |
+
$icon_bg_hover_color = cnss_get_option('cnss-icon-bg-hover-color');
|
158 |
+
$icon_hover_color = cnss_get_option('cnss-icon-hover-color');
|
159 |
|
160 |
$icons = cnss_get_all_icons();
|
161 |
if ( !empty($icons) && $social_profile_links == 1 ) {
|
191 |
|
192 |
function cnss_add_menu_pages() {
|
193 |
add_menu_page('Easy Social Icons', 'Easy Social Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn', 'dashicons-share');
|
|
|
194 |
|
195 |
add_submenu_page('cnss_social_icon_page', 'All Icons', 'All Icons', 'manage_options', 'cnss_social_icon_page', 'cnss_social_icon_page_fn');
|
196 |
|
200 |
|
201 |
add_submenu_page('cnss_social_icon_page', 'Settings & Instructions', 'Settings & Instructions', 'manage_options', 'cnss_social_icon_option', 'cnss_social_icon_option_fn');
|
202 |
|
203 |
+
add_action( 'admin_init', 'cnss_register_settings' );
|
204 |
|
205 |
}
|
206 |
|
207 |
+
function cnss_register_settings() {
|
208 |
register_setting( 'cnss-settings-group', 'cnss-width' );
|
209 |
register_setting( 'cnss-settings-group', 'cnss-height' );
|
210 |
register_setting( 'cnss-settings-group', 'cnss-margin' );
|
265 |
<table class="form-table">
|
266 |
<tr valign="top">
|
267 |
<th scope="row">Icon Width</th>
|
268 |
+
<td><input type="number" name="cnss-width" id="cnss-width" class="small-text" value="<?php echo esc_attr($cnss_width) ?>" />px</td>
|
269 |
</tr>
|
270 |
<tr valign="top">
|
271 |
<th scope="row">Icon Height</th>
|
272 |
+
<td><input type="number" name="cnss-height" id="cnss-height" class="small-text" value="<?php echo esc_attr($cnss_height) ?>" />px</td>
|
273 |
</tr>
|
274 |
<tr valign="top">
|
275 |
<th scope="row">Icon Margin</th>
|
276 |
+
<td><input type="number" name="cnss-margin" id="cnss-margin" class="small-text" value="<?php echo esc_attr($cnss_margin) ?>" />px <em><small>(Gap between each icon)</small></em></td>
|
277 |
</tr>
|
278 |
|
279 |
<tr valign="top">
|
322 |
|
323 |
<tr class="wrap-icon-bg-color" valign="top" style="<?php echo $cnss_original_icon_color==1?'display: none;':''; ?>">
|
324 |
<th scope="row">Icon Background Color</th>
|
325 |
+
<td><input type="text" name="cnss-icon-bg-color" id="cnss-icon-bg-color" class="cnss-fa-icon-color" value="<?php echo esc_attr($icon_bg_color) ?>" /></td>
|
326 |
</tr>
|
327 |
<tr class="wrap-icon-bg-color" valign="top" style="<?php echo $cnss_original_icon_color==1?'display: none;':''; ?>">
|
328 |
<th scope="row">Icon Background Hover Color</th>
|
329 |
+
<td><input type="text" name="cnss-icon-bg-hover-color" id="cnss-icon-bg-hover-color" class="cnss-fa-icon-color" value="<?php echo esc_attr($icon_bg_hover_color) ?>" /></td>
|
330 |
</tr>
|
331 |
|
332 |
<tr valign="top">
|
333 |
<th scope="row">Icon Color</th>
|
334 |
+
<td><input type="text" name="cnss-icon-color" id="cnss-icon-color" class="cnss-fa-icon-color" value="<?php echo esc_attr($icon_color) ?>" /></td>
|
335 |
</tr>
|
336 |
<tr valign="top">
|
337 |
<th scope="row">Icon Hover Color</th>
|
338 |
+
<td><input type="text" name="cnss-icon-hover-color" id="cnss-icon-hover-color" class="cnss-fa-icon-color" value="<?php echo esc_attr($icon_hover_color) ?>" /></td>
|
339 |
</tr>
|
340 |
|
341 |
<tr valign="top">
|
479 |
</tr>
|
480 |
</table>
|
481 |
<p></p>
|
482 |
+
<?php echo cnss_social_icon_sc( isset($_POST['_selected_icons']) ? $_POST['_selected_icons'] : array() ); ?>
|
483 |
<p><label><?php _e( 'Select Social Icons:' ); ?></label> <em>(If select none all icons will be displayed)</em></p>
|
484 |
<p>
|
485 |
<input type="submit" class="button-primary" value="<?php _e('Generate Shortcode') ?>" />
|
564 |
}
|
565 |
}
|
566 |
|
567 |
+
function cnss_process_post() {
|
568 |
global $wpdb,$err,$msg,$cnssBaseDir;
|
569 |
if ( isset($_POST['submit_button']) && check_admin_referer('cn_insert_icon') ) {
|
570 |
|
639 |
$err = "";
|
640 |
$msg = "";
|
641 |
|
|
|
|
|
642 |
$image_file_path = $cnssBaseDir;
|
643 |
|
644 |
$update = "";
|
1137 |
<?php
|
1138 |
}
|
1139 |
|
1140 |
+
function cnss_social_icon_table() {
|
1141 |
|
1142 |
$cnss_width = get_option('cnss-width');
|
1143 |
$cnss_height = get_option('cnss-height');
|
1224 |
$text_align = isset($attr['alignment'])?$attr['alignment']:get_option('cnss-text-align');
|
1225 |
|
1226 |
// settings for font-awesome icons
|
1227 |
+
$icon_bg_color = cnss_get_option('cnss-icon-bg-color');
|
1228 |
+
$icon_color = cnss_get_option('cnss-icon-color');
|
1229 |
+
$icon_hover_color = cnss_get_option('cnss-icon-hover-color');
|
1230 |
+
$icon_shape = cnss_get_option('cnss-icon-shape');
|
1231 |
+
$cnss_original_icon_color = cnss_get_option('cnss-original-icon-color');
|
1232 |
|
1233 |
$table_name = $wpdb->prefix . "cn_social_icon";
|
1234 |
$sql = "SELECT * FROM ".$table_name." WHERE image_url<>'' AND url<>'' $where_sql ORDER BY sortorder";
|
1279 |
return $out;
|
1280 |
}
|
1281 |
|
1282 |
+
function cnss_social_icon_sc( $selected_icons_array = array() ) {
|
1283 |
|
1284 |
global $wpdb,$cnssBaseURL;
|
1285 |
|
1403 |
|
1404 |
<p>
|
1405 |
<label><?php _e( 'Select Social Icons:' ); ?></label> <em>(If select none all icons will be displayed)</em><br />
|
1406 |
+
<?php echo $this->cnss_social_icon_widget( isset($instance['selected_icons'])?$instance['selected_icons']:array() ); ?>
|
1407 |
</p>
|
1408 |
|
1409 |
<table style="margin-bottom:15px;" width="100%" border="0">
|
1418 |
<?php
|
1419 |
}
|
1420 |
|
1421 |
+
public function cnss_social_icon_widget( $selected_icons_array = array() ) {
|
1422 |
|
1423 |
global $wpdb,$cnssBaseURL;
|
1424 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: easy social icon,easy social icons,social icon,social icons,social,social share,follow,followus,follow us,share,icon,custom social icons, social media icons
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 5.8
|
7 |
-
Stable tag: 3.1.
|
8 |
|
9 |
Upload your own social media icons or choose from font-awesome. Use widget|shortcode to place icons anywhere(sidebar, header, footer, page) in theme.
|
10 |
|
@@ -76,6 +76,9 @@ If you are using wordpress version lower than 3.5 please use Easy social Icon ve
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
79 |
= 3.1.0 =
|
80 |
* fix/update security issue
|
81 |
|
4 |
Tags: easy social icon,easy social icons,social icon,social icons,social,social share,follow,followus,follow us,share,icon,custom social icons, social media icons
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 5.8
|
7 |
+
Stable tag: 3.1.1
|
8 |
|
9 |
Upload your own social media icons or choose from font-awesome. Use widget|shortcode to place icons anywhere(sidebar, header, footer, page) in theme.
|
10 |
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 3.1.1 =
|
80 |
+
* fix/update security issue
|
81 |
+
|
82 |
= 3.1.0 =
|
83 |
* fix/update security issue
|
84 |
|