WD Instagram Feed – Instagram Gallery - Version 1.4.28

Version Description

Fixed: Security issue.

Download this release

Release Info

Developer 10web
Plugin Icon 128x128 WD Instagram Feed – Instagram Gallery
Version 1.4.28
Comparing to
See all releases

Code changes from version 1.4.27 to 1.4.28

admin/views/WDIViewThemes_wdi.php CHANGED
@@ -24,21 +24,21 @@ class WDIViewThemes_wdi
24
 
25
  public function buildFreeThemeDemo(){
26
  ?>
27
- <div class="wdi_demo_img" demo-tab="general"><img src="<?php echo WDI_URL . '/demo_images/1.png'; ?>" alt=""></div>
28
- <div class="wdi_demo_img" demo-tab="header"><img src="<?php echo WDI_URL . '/demo_images/2.png'; ?>" alt=""></div>
29
- <div class="wdi_demo_img" demo-tab="load_more"><img src="<?php echo WDI_URL . '/demo_images/3.png'; ?>" alt=""></div>
30
- <div class="wdi_demo_img" demo-tab="thumbnails"><img src="<?php echo WDI_URL . '/demo_images/4.png'; ?>" alt=""></div>
31
- <div class="wdi_demo_img" demo-tab="masonry"><img src="<?php echo WDI_URL . '/demo_images/5.png'; ?>" alt=""></div>
32
- <div class="wdi_demo_img" demo-tab="blog_style"><img src="<?php echo WDI_URL . '/demo_images/6.png'; ?>" alt=""></div>
33
- <div class="wdi_demo_img" demo-tab="image_browser"><img src="<?php echo WDI_URL . '/demo_images/7.png'; ?>" alt=""></div>
34
- <div class="wdi_demo_img" demo-tab="image_browser"><img src="<?php echo WDI_URL . '/demo_images/8.png'; ?>" alt=""></div>
35
- <div class="wdi_demo_img" demo-tab="lb_general"><img src="<?php echo WDI_URL . '/demo_images/l1.png'; ?>" alt=""></div>
36
- <div class="wdi_demo_img" demo-tab="lb_ctrl_btns"><img src="<?php echo WDI_URL . '/demo_images/l2.png'; ?>" alt=""></div>
37
- <div class="wdi_demo_img" demo-tab="lb_close_btn"><img src="<?php echo WDI_URL . '/demo_images/l3.png'; ?>" alt=""></div>
38
- <div class="wdi_demo_img" demo-tab="lb_nav_btns"><img src="<?php echo WDI_URL . '/demo_images/l4.png'; ?>" alt=""></div>
39
- <div class="wdi_demo_img" demo-tab="lb_filmstrip"><img src="<?php echo WDI_URL . '/demo_images/l5.png'; ?>" alt=""></div>
40
- <div class="wdi_demo_img" demo-tab="lb_info"><img src="<?php echo WDI_URL . '/demo_images/l6.png'; ?>" alt=""></div>
41
- <div class="wdi_demo_img" demo-tab="lb_comments"><img src="<?php echo WDI_URL . '/demo_images/l7.png'; ?>" alt=""></div>
42
  <?php
43
  }
44
  }
24
 
25
  public function buildFreeThemeDemo(){
26
  ?>
27
+ <div class="wdi_demo_img" demo-tab="general"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/1.png'; ?>" alt=""></div>
28
+ <div class="wdi_demo_img" demo-tab="header"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/2.png'; ?>" alt=""></div>
29
+ <div class="wdi_demo_img" demo-tab="load_more"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/3.png'; ?>" alt=""></div>
30
+ <div class="wdi_demo_img" demo-tab="thumbnails"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/4.png'; ?>" alt=""></div>
31
+ <div class="wdi_demo_img" demo-tab="masonry"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/5.png'; ?>" alt=""></div>
32
+ <div class="wdi_demo_img" demo-tab="blog_style"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/6.png'; ?>" alt=""></div>
33
+ <div class="wdi_demo_img" demo-tab="image_browser"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/7.png'; ?>" alt=""></div>
34
+ <div class="wdi_demo_img" demo-tab="image_browser"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/8.png'; ?>" alt=""></div>
35
+ <div class="wdi_demo_img" demo-tab="lb_general"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l1.png'; ?>" alt=""></div>
36
+ <div class="wdi_demo_img" demo-tab="lb_ctrl_btns"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l2.png'; ?>" alt=""></div>
37
+ <div class="wdi_demo_img" demo-tab="lb_close_btn"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l3.png'; ?>" alt=""></div>
38
+ <div class="wdi_demo_img" demo-tab="lb_nav_btns"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l4.png'; ?>" alt=""></div>
39
+ <div class="wdi_demo_img" demo-tab="lb_filmstrip"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l5.png'; ?>" alt=""></div>
40
+ <div class="wdi_demo_img" demo-tab="lb_info"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l6.png'; ?>" alt=""></div>
41
+ <div class="wdi_demo_img" demo-tab="lb_comments"><img src="<?php echo esc_url(WDI_URL) . '/demo_images/l7.png'; ?>" alt=""></div>
42
  <?php
43
  }
44
  }
admin/views/WDIViewWidget.php CHANGED
@@ -67,11 +67,11 @@ class WDIViewWidget {
67
 
68
  <p>
69
  <label for="<?php echo esc_attr($id_title); ?>"><?php _e("Title", 'wd-instagram-feed'); ?></label>
70
- <input class="widefat" id="<?php echo sanitize_html_class($id_title); ?>" name="<?php echo esc_attr($name_title); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>"/>
71
  </p>
72
  <p>
73
  <label for="<?php echo esc_attr($id_feed_id); ?>"><?php _e("Feed", 'wd-instagram-feed'); ?></label>
74
- <select onchange="wdi_toggle(jQuery(this));" class="widefat" id="<?php echo sanitize_html_class($id_feed_id); ?>" name="<?php echo esc_attr($name_feed_id); ?>" >
75
  <?php foreach ($feeds as $feed) {
76
  ?>
77
  <option <?php if($instance['feed_id'] == $feed['id']) echo 'selected'?> value="<?php echo esc_attr($feed['id']);?>"><?php echo esc_html($feed['feed_name']);?></option>
@@ -82,7 +82,7 @@ class WDIViewWidget {
82
 
83
  <p class="wdi_number_of_columns">
84
  <label for="<?php echo esc_attr($id_number_of_columns); ?>"><?php _e("Number of columns", 'wd-instagram-feed'); ?></label>
85
- <select class="widefat" id="<?php echo sanitize_html_class($id_number_of_columns); ?>" name="<?php echo esc_attr($name_number_of_columns); ?>" >
86
  <?php for ($k = 1 ;$k <= 10; $k++) {
87
  ?>
88
  <option <?php if($instance['number_of_columns'] == $k) echo 'selected'?> value="<?php echo esc_attr($k) ?>"><?php echo esc_html($k); ?></option>
@@ -94,23 +94,23 @@ class WDIViewWidget {
94
 
95
  <p>
96
  <label for="<?php echo esc_attr($id_img_number); ?>"><?php _e("Number of images to show", 'wd-instagram-feed'); ?></label>
97
- <input class="widefat" id="<?php echo sanitize_html_class($id_img_number); ?>" name="<?php echo esc_attr($name_img_number); ?>" type="text" value="<?php echo esc_attr($instance['img_number']); ?>"/>
98
  </p>
99
  <p>
100
- <input <?php if($instance['show_description']=='1') echo "checked"?> class="widefat" id="<?php echo sanitize_html_class($id_show_description); ?>" name="<?php echo esc_attr($name_show_description); ?>" type="checkbox" value="<?php echo esc_attr($instance['show_description']); ?>"/>
101
  <label for="<?php echo esc_attr($id_show_description); ?>"><?php _e("Show Description", 'wd-instagram-feed'); ?></label>
102
  </p>
103
  <p>
104
- <input <?php if($instance['show_likes_comments']=='1') echo "checked"?> class="widefat" id="<?php echo sanitize_html_class($id_show_likes_comments); ?>" name="<?php echo esc_attr($name_show_likes_comments); ?>" type="checkbox" value="<?php echo esc_attr($instance['show_likes_comments']); ?>"/>
105
  <label for="<?php echo esc_attr($id_show_likes_comments); ?>"><?php _e("Show likes and comments", 'wd-instagram-feed'); ?></label>
106
  </p>
107
  <p>
108
- <input <?php if($instance['enable_loading_buttons']=='1') echo "checked"?> class="widefat" id="<?php echo sanitize_html_class($id_enable_loading_buttons); ?>" name="<?php echo esc_attr($name_enable_loading_buttons); ?>" type="checkbox" value="<?php echo esc_attr($instance['enable_loading_buttons']); ?>"/>
109
  <label for="<?php echo esc_attr($id_enable_loading_buttons); ?>"><?php _e("Enable loading new images", 'wd-instagram-feed'); ?></label>
110
  </p>
111
  <script>
112
  jQuery(document).ready(function(){
113
- wdi_toggle(jQuery('#<?php echo $id_feed_id; ?>'));
114
  });
115
 
116
  function wdi_toggle(select){
67
 
68
  <p>
69
  <label for="<?php echo esc_attr($id_title); ?>"><?php _e("Title", 'wd-instagram-feed'); ?></label>
70
+ <input class="widefat" id="<?php echo esc_attr($id_title); ?>" name="<?php echo esc_attr($name_title); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>"/>
71
  </p>
72
  <p>
73
  <label for="<?php echo esc_attr($id_feed_id); ?>"><?php _e("Feed", 'wd-instagram-feed'); ?></label>
74
+ <select onchange="wdi_toggle(jQuery(this));" class="widefat" id="<?php echo esc_attr($id_feed_id); ?>" name="<?php echo esc_attr($name_feed_id); ?>" >
75
  <?php foreach ($feeds as $feed) {
76
  ?>
77
  <option <?php if($instance['feed_id'] == $feed['id']) echo 'selected'?> value="<?php echo esc_attr($feed['id']);?>"><?php echo esc_html($feed['feed_name']);?></option>
82
 
83
  <p class="wdi_number_of_columns">
84
  <label for="<?php echo esc_attr($id_number_of_columns); ?>"><?php _e("Number of columns", 'wd-instagram-feed'); ?></label>
85
+ <select class="widefat" id="<?php echo esc_attr($id_number_of_columns); ?>" name="<?php echo esc_attr($name_number_of_columns); ?>" >
86
  <?php for ($k = 1 ;$k <= 10; $k++) {
87
  ?>
88
  <option <?php if($instance['number_of_columns'] == $k) echo 'selected'?> value="<?php echo esc_attr($k) ?>"><?php echo esc_html($k); ?></option>
94
 
95
  <p>
96
  <label for="<?php echo esc_attr($id_img_number); ?>"><?php _e("Number of images to show", 'wd-instagram-feed'); ?></label>
97
+ <input class="widefat" id="<?php echo esc_attr($id_img_number); ?>" name="<?php echo esc_attr($name_img_number); ?>" type="text" value="<?php echo esc_attr($instance['img_number']); ?>"/>
98
  </p>
99
  <p>
100
+ <input <?php if($instance['show_description']=='1') echo "checked"?> class="widefat" id="<?php echo esc_attr($id_show_description); ?>" name="<?php echo esc_attr($name_show_description); ?>" type="checkbox" value="<?php echo esc_attr($instance['show_description']); ?>"/>
101
  <label for="<?php echo esc_attr($id_show_description); ?>"><?php _e("Show Description", 'wd-instagram-feed'); ?></label>
102
  </p>
103
  <p>
104
+ <input <?php if($instance['show_likes_comments']=='1') echo "checked"?> class="widefat" id="<?php echo esc_attr($id_show_likes_comments); ?>" name="<?php echo esc_attr($name_show_likes_comments); ?>" type="checkbox" value="<?php echo esc_attr($instance['show_likes_comments']); ?>"/>
105
  <label for="<?php echo esc_attr($id_show_likes_comments); ?>"><?php _e("Show likes and comments", 'wd-instagram-feed'); ?></label>
106
  </p>
107
  <p>
108
+ <input <?php if($instance['enable_loading_buttons']=='1') echo "checked"?> class="widefat" id="<?php echo esc_attr($id_enable_loading_buttons); ?>" name="<?php echo esc_attr($name_enable_loading_buttons); ?>" type="checkbox" value="<?php echo esc_attr($instance['enable_loading_buttons']); ?>"/>
109
  <label for="<?php echo esc_attr($id_enable_loading_buttons); ?>"><?php _e("Enable loading new images", 'wd-instagram-feed'); ?></label>
110
  </p>
111
  <script>
112
  jQuery(document).ready(function(){
113
+ wdi_toggle(jQuery('#<?php echo esc_attr($id_feed_id); ?>'));
114
  });
115
 
116
  function wdi_toggle(select){
admin/views/feeds.php CHANGED
@@ -130,8 +130,8 @@ class Feeds_view_wdi {
130
  );
131
  $wdi_nonce_wd = wp_create_nonce('nonce_wd');
132
  ?>
133
- <tr id="tr_<?php echo sanitize_html_class($row_data->id); ?>" <?php echo $alternate; ?>>
134
- <th class="table_small_col check-column"><input id="check_<?php echo sanitize_html_class($row_data->id); ?>"
135
  name="check_<?php echo intval($row_data->id); ?>"
136
  onclick="wdi_spider_check_all(this)" type="checkbox"/>
137
  </th>
@@ -862,15 +862,15 @@ class Feeds_view_wdi {
862
  <div class="form-table">
863
  <?php
864
  foreach ($tabs as $key => $tab) { ?>
865
- <div id="<?php echo sanitize_html_class($key); ?>_tab" class="wdi_tab" style="<?php echo $key == "feed_settings" ? "display:block;" : ""; ?>">
866
  <?php foreach ($tab as $key => $section) {
867
  $section_class = "wdi_section_open";
868
  if(isset($section["visibility"]) && $section["visibility"]==="show"){
869
  $section_class = "wdi_section_close";
870
  }
871
  ?>
872
- <div id="<?php echo sanitize_html_class($key); ?>_section" class="wdi_section <?php echo sanitize_html_class($section["type"]); ?> <?php echo sanitize_html_class($section["column"]); ?>">
873
- <h3 data-section_name="<?php echo $section['section_name']?>" class="wdi_section_name <?php echo sanitize_html_class($section_class);?>"><?php echo esc_html($section["title"]); ?></h3>
874
  <div class="wdi_elements wdi_clear_tag">
875
  <?php foreach ($section["elements"] as $elements) { ?>
876
  <div class="section_col">
@@ -907,7 +907,7 @@ class Feeds_view_wdi {
907
  </div>
908
  <!-- END CONDITIONAL FILTERS TOP -->
909
  <?php } ?>
910
- <div class="wdi_element wdi_element_name_<?php echo sanitize_html_class($element['name']); ?>">
911
  <div class="wdi_element_title">
912
  <span class="wdi_settings_link" ><?php echo esc_html($element['title']); ?></span>
913
  </div>
@@ -923,7 +923,7 @@ class Feeds_view_wdi {
923
  <?php } ?>
924
  <!-- END FEED USERS -->
925
  <?php if ( $element['tooltip'] && $element['tooltip'] != '' ) {
926
- echo "<p class='wdi_about_filed'>".$element['tooltip']."</p>";
927
  }
928
  ?>
929
  </div>
@@ -941,7 +941,7 @@ class Feeds_view_wdi {
941
  <div tab="conditional_filters"></div>
942
  </div>
943
  </div>
944
- <textarea style="display:none" id="wdi_conditional_filters_textarea" name='<?php echo WDI_FSN . '[conditional_filters]' ?>'> <?php echo isset($feed_row['conditional_filters']) ? esc_html($feed_row['conditional_filters']) : ''; ?> </textarea>
945
  <div class="wdi_filter_ctrl_container">
946
  <div class="wdi_filter_input">
947
  <input id="wdi_filter_input" placeholder="<?php _e('Enter Your Condition Here...', 'wd-instagram-feed'); ?>" type="text">
@@ -993,7 +993,7 @@ class Feeds_view_wdi {
993
  </div>
994
  </div>
995
  <div id="wdi_save_loading" class="wdi_hidden">
996
- <img src="<?php echo WDI_URL . '/images/ajax_loader.png'; ?>" class="wdi_spider_ajax_loading" style="width:50px;">
997
  <span class="caching-process-message wdi_hidden">
998
  <?php
999
  _e("Please don't close this window. We are caching Instagram media.", "wdi");
@@ -1048,11 +1048,11 @@ class Feeds_view_wdi {
1048
  $tag_name = str_replace('#', '', $user->username);
1049
  ?>
1050
  <div class="wdi_user">
1051
- <a target="_blank" href="https://instagram.com/explore/tags/<?php echo $tag_name; ?>">
1052
  <img class="wdi_profile_pic" src="<?php echo WDI_URL ?>/images/hashtag.png">
1053
- <span class="wdi_hashtag"><?php echo $tag_name; ?></span><i style="display:table-cell;width:25px;"></i>
1054
  </a>
1055
- <img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="<?php echo WDI_URL ?>/images/delete_user.png">
1056
  </div>
1057
  <?php
1058
  }
@@ -1080,7 +1080,7 @@ class Feeds_view_wdi {
1080
  wdi_controller.usersnames = usersnames;
1081
  wdi_controller.instagram = new WDIInstagram();
1082
  wdi_controller.feed_users = [];
1083
- wdi_controller.instagram.addToken(<?php echo '"' . $token . '"'; ?>);
1084
  });
1085
  </script>
1086
  <?php
130
  );
131
  $wdi_nonce_wd = wp_create_nonce('nonce_wd');
132
  ?>
133
+ <tr id="tr_<?php echo esc_attr($row_data->id); ?>" <?php echo $alternate; ?>>
134
+ <th class="table_small_col check-column"><input id="check_<?php echo esc_attr($row_data->id); ?>"
135
  name="check_<?php echo intval($row_data->id); ?>"
136
  onclick="wdi_spider_check_all(this)" type="checkbox"/>
137
  </th>
862
  <div class="form-table">
863
  <?php
864
  foreach ($tabs as $key => $tab) { ?>
865
+ <div id="<?php echo esc_attr($key); ?>_tab" class="wdi_tab" style="<?php echo $key == "feed_settings" ? "display:block;" : ""; ?>">
866
  <?php foreach ($tab as $key => $section) {
867
  $section_class = "wdi_section_open";
868
  if(isset($section["visibility"]) && $section["visibility"]==="show"){
869
  $section_class = "wdi_section_close";
870
  }
871
  ?>
872
+ <div id="<?php echo esc_attr($key); ?>_section" class="wdi_section <?php echo esc_attr($section["type"]); ?> <?php echo esc_attr($section["column"]); ?>">
873
+ <h3 data-section_name="<?php echo $section['section_name']?>" class="wdi_section_name <?php echo esc_attr($section_class);?>"><?php echo esc_html($section["title"]); ?></h3>
874
  <div class="wdi_elements wdi_clear_tag">
875
  <?php foreach ($section["elements"] as $elements) { ?>
876
  <div class="section_col">
907
  </div>
908
  <!-- END CONDITIONAL FILTERS TOP -->
909
  <?php } ?>
910
+ <div class="wdi_element wdi_element_name_<?php echo esc_attr($element['name']); ?>">
911
  <div class="wdi_element_title">
912
  <span class="wdi_settings_link" ><?php echo esc_html($element['title']); ?></span>
913
  </div>
923
  <?php } ?>
924
  <!-- END FEED USERS -->
925
  <?php if ( $element['tooltip'] && $element['tooltip'] != '' ) {
926
+ echo "<p class='wdi_about_filed'>".strip_tags($element['tooltip'],'<a>')."</p>";
927
  }
928
  ?>
929
  </div>
941
  <div tab="conditional_filters"></div>
942
  </div>
943
  </div>
944
+ <textarea style="display:none" id="wdi_conditional_filters_textarea" name='<?php echo esc_attr(WDI_FSN . '[conditional_filters]') ?>'> <?php echo isset($feed_row['conditional_filters']) ? esc_html($feed_row['conditional_filters']) : ''; ?> </textarea>
945
  <div class="wdi_filter_ctrl_container">
946
  <div class="wdi_filter_input">
947
  <input id="wdi_filter_input" placeholder="<?php _e('Enter Your Condition Here...', 'wd-instagram-feed'); ?>" type="text">
993
  </div>
994
  </div>
995
  <div id="wdi_save_loading" class="wdi_hidden">
996
+ <img src="<?php echo esc_url(WDI_URL) . '/images/ajax_loader.png'; ?>" class="wdi_spider_ajax_loading" style="width:50px;">
997
  <span class="caching-process-message wdi_hidden">
998
  <?php
999
  _e("Please don't close this window. We are caching Instagram media.", "wdi");
1048
  $tag_name = str_replace('#', '', $user->username);
1049
  ?>
1050
  <div class="wdi_user">
1051
+ <a target="_blank" href="https://instagram.com/explore/tags/<?php echo esc_attr($tag_name); ?>">
1052
  <img class="wdi_profile_pic" src="<?php echo WDI_URL ?>/images/hashtag.png">
1053
+ <span class="wdi_hashtag"><?php echo esc_html($tag_name); ?></span><i style="display:table-cell;width:25px;"></i>
1054
  </a>
1055
+ <img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="<?php echo esc_url(WDI_URL) ?>/images/delete_user.png">
1056
  </div>
1057
  <?php
1058
  }
1080
  wdi_controller.usersnames = usersnames;
1081
  wdi_controller.instagram = new WDIInstagram();
1082
  wdi_controller.feed_users = [];
1083
+ wdi_controller.instagram.addToken(<?php echo '"' . esc_attr($token) . '"'; ?>);
1084
  });
1085
  </script>
1086
  <?php
admin/views/settings.php CHANGED
@@ -55,7 +55,7 @@ class Settings_view_wdi {
55
  <h2 class="wdi-page-title"><?php _e('Accounts', 'wd-instagram-feed'); ?></h2>
56
  <ul class="wdi-accounts-list">
57
  <?php foreach ( $authenticated_users_list as $user_name => $user ) { ?>
58
- <li class="wdi-account-list-<?php echo sanitize_html_class($user['user_id']) ?>">
59
  <div class="wdi-account-block">
60
  <div>
61
  <div class="wdi-account-user-info">
@@ -67,7 +67,7 @@ class Settings_view_wdi {
67
  </div>
68
  </div>
69
  <div>
70
- <span class="button wdi-account-remove" onclick="wdi_account_remove('<?php echo $user_name; ?>','<?php echo $user['user_id']; ?>')"><?php _e('Remove', 'wd-instagram-feed'); ?></span>
71
  </div>
72
  </div>
73
  <div class="wdi-account-accesstoken">
@@ -90,7 +90,7 @@ class Settings_view_wdi {
90
  </p>
91
  </div>
92
  <span class="button wdi-account-remove"
93
- onclick="wdi_account_remove('<?php echo $user_name; ?>', '<?php echo $user['user_id']; ?>')"><?php _e('Remove', 'wd-instagram-feed'); ?></span>
94
  <div class="wdi_clear"></div>
95
  </div>
96
  </li>
@@ -106,7 +106,7 @@ class Settings_view_wdi {
106
  <div class="wdi-advanced-body">
107
  <p class="wdi-input-group">
108
  <label><?php _e('Set Maximum Count of Cache Requests', 'wd-instagram-feed'); ?></label>
109
- <input type="number" name="<?php echo WDI_OPT . '[wdi_cache_request_count]' ?>" value="<?php echo (isset($options['wdi_cache_request_count']) && $options['wdi_cache_request_count'] !== '') ? intval($options['wdi_cache_request_count']) : 10; ?>">
110
  </p>
111
  <p class="wdi-input-group">
112
  <label><?php _e('Check for new posts every (min)', 'wd-instagram-feed'); ?></label>
@@ -124,16 +124,16 @@ class Settings_view_wdi {
124
  foreach ( $min_capability as $capability_key => $capability_name ) {
125
  $selected = ( $options['wdi_feeds_min_capability'] == $capability_key ) ? 'selected' : '';
126
  ?>
127
- <option value="<?php echo esc_attr($capability_key); ?>" <?php echo $selected; ?>><?php echo esc_html($capability_name); ?></option>
128
  <?php } ?>
129
  </select>
130
  <p class="wdi-input-group">
131
  <label><?php _e('Custom CSS', 'wd-instagram-feed'); ?></label>
132
- <textarea name="<?php echo WDI_OPT . '[wdi_custom_css]' ?>"><?php echo $options['wdi_custom_css']; ?></textarea>
133
  </p>
134
  <p class="wdi-input-group">
135
  <label><?php _e('Custom JavaScript', 'wd-instagram-feed'); ?></label>
136
- <textarea name="<?php echo WDI_OPT . '[wdi_custom_js]' ?>"><?php echo $options['wdi_custom_js']; ?></textarea>
137
  </p>
138
  <div class="wdi-input-group">
139
  <label><?php _e('Uninstall', 'wd-instagram-feed'); ?></label>
@@ -154,7 +154,7 @@ class Settings_view_wdi {
154
  </form>
155
  </div>
156
  <div id="wdi_save_loading" class="wdi_hidden">
157
- <img src="<?php echo WDI_URL . '/images/ajax_loader.png'; ?>" class="wdi_spider_ajax_loading" style="width:50px;">
158
  <span class="caching-process-message">
159
  <?php
160
  _e("Please don't close this window. We are caching Instagram media.", "wdi");
55
  <h2 class="wdi-page-title"><?php _e('Accounts', 'wd-instagram-feed'); ?></h2>
56
  <ul class="wdi-accounts-list">
57
  <?php foreach ( $authenticated_users_list as $user_name => $user ) { ?>
58
+ <li class="wdi-account-list-<?php echo esc_attr($user['user_id']) ?>">
59
  <div class="wdi-account-block">
60
  <div>
61
  <div class="wdi-account-user-info">
67
  </div>
68
  </div>
69
  <div>
70
+ <span class="button wdi-account-remove" onclick="wdi_account_remove('<?php echo esc_attr($user_name); ?>','<?php echo esc_attr($user['user_id']); ?>')"><?php _e('Remove', 'wd-instagram-feed'); ?></span>
71
  </div>
72
  </div>
73
  <div class="wdi-account-accesstoken">
90
  </p>
91
  </div>
92
  <span class="button wdi-account-remove"
93
+ onclick="wdi_account_remove('<?php echo esc_attr($user_name); ?>', '<?php echo esc_attr($user['user_id']); ?>')"><?php _e('Remove', 'wd-instagram-feed'); ?></span>
94
  <div class="wdi_clear"></div>
95
  </div>
96
  </li>
106
  <div class="wdi-advanced-body">
107
  <p class="wdi-input-group">
108
  <label><?php _e('Set Maximum Count of Cache Requests', 'wd-instagram-feed'); ?></label>
109
+ <input type="number" name="<?php echo esc_attr(WDI_OPT . '[wdi_cache_request_count]') ?>" value="<?php echo (isset($options['wdi_cache_request_count']) && $options['wdi_cache_request_count'] !== '') ? intval($options['wdi_cache_request_count']) : 10; ?>">
110
  </p>
111
  <p class="wdi-input-group">
112
  <label><?php _e('Check for new posts every (min)', 'wd-instagram-feed'); ?></label>
124
  foreach ( $min_capability as $capability_key => $capability_name ) {
125
  $selected = ( $options['wdi_feeds_min_capability'] == $capability_key ) ? 'selected' : '';
126
  ?>
127
+ <option value="<?php echo esc_attr($capability_key); ?>" <?php echo esc_attr($selected); ?>><?php echo esc_html($capability_name); ?></option>
128
  <?php } ?>
129
  </select>
130
  <p class="wdi-input-group">
131
  <label><?php _e('Custom CSS', 'wd-instagram-feed'); ?></label>
132
+ <textarea name="<?php echo esc_attr(WDI_OPT . '[wdi_custom_css]') ?>"><?php echo esc_html($options['wdi_custom_css']); ?></textarea>
133
  </p>
134
  <p class="wdi-input-group">
135
  <label><?php _e('Custom JavaScript', 'wd-instagram-feed'); ?></label>
136
+ <textarea name="<?php echo esc_attr(WDI_OPT . '[wdi_custom_js]') ?>"><?php echo esc_js($options['wdi_custom_js']); ?></textarea>
137
  </p>
138
  <div class="wdi-input-group">
139
  <label><?php _e('Uninstall', 'wd-instagram-feed'); ?></label>
154
  </form>
155
  </div>
156
  <div id="wdi_save_loading" class="wdi_hidden">
157
+ <img src="<?php echo esc_url(WDI_URL) . '/images/ajax_loader.png'; ?>" class="wdi_spider_ajax_loading" style="width:50px;">
158
  <span class="caching-process-message">
159
  <?php
160
  _e("Please don't close this window. We are caching Instagram media.", "wdi");
admin/views/uninstall.php CHANGED
@@ -17,9 +17,9 @@ class Uninstall_view_wdi {
17
  <ul style="background-color:white;margin:0">
18
  <p style="background-color:#F3EFEF;margin: 0;border-bottom: 1px solid #888888;padding:2px;font-size:20px;"><?php _e('Database Tables', 'wd-instagram-feed') ?></p>
19
  <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">
20
- 1) <?php echo $wpdb->prefix . WDI_FEED_TABLE ?></li>
21
  <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">
22
- 2) <?php echo $wpdb->prefix . WDI_THEME_TABLE ?></li>
23
  <p style="background-color:#F3EFEF;margin: 0;border-top: 1px solid #888888;border-bottom: 1px solid #888888;padding:2px;font-size:20px;">
24
  <?php _e('Options From', 'wd-instagram-feed') ?> <?php echo $wpdb->prefix, 'options' ?></p>
25
  <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">3) wdi_version</li>
17
  <ul style="background-color:white;margin:0">
18
  <p style="background-color:#F3EFEF;margin: 0;border-bottom: 1px solid #888888;padding:2px;font-size:20px;"><?php _e('Database Tables', 'wd-instagram-feed') ?></p>
19
  <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">
20
+ 1) <?php echo esc_attr($wpdb->prefix . WDI_FEED_TABLE) ?></li>
21
  <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">
22
+ 2) <?php echo esc_attr($wpdb->prefix . WDI_THEME_TABLE) ?></li>
23
  <p style="background-color:#F3EFEF;margin: 0;border-top: 1px solid #888888;border-bottom: 1px solid #888888;padding:2px;font-size:20px;">
24
  <?php _e('Options From', 'wd-instagram-feed') ?> <?php echo $wpdb->prefix, 'options' ?></p>
25
  <li style="padding-bottom:5px;padding-left:5px;font-weight: bold;margin:0;">3) wdi_version</li>
config.php CHANGED
@@ -3,7 +3,7 @@ if ( !defined('ABSPATH') ) {
3
  exit;
4
  }
5
 
6
- define('WDI_VERSION', '1.4.27');
7
  define('WDI_IS_FREE', TRUE);
8
  define('WDI_PREFIX', 'wdi');
9
  define('WDI_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
3
  exit;
4
  }
5
 
6
+ define('WDI_VERSION', '1.4.28');
7
  define('WDI_IS_FREE', TRUE);
8
  define('WDI_PREFIX', 'wdi');
9
  define('WDI_DIR', WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__)));
framework/WDILibrary.php CHANGED
@@ -257,7 +257,7 @@ class WDILibrary {
257
  // temporary
258
  if ( !empty($message) && !is_numeric($message) ) {
259
  ob_start();
260
- ?><div style="width:99%" class="<?php echo sanitize_html_class($type); ?> inline">
261
  <p>
262
  <strong><?php echo esc_html($message); ?></strong>
263
  </p>
@@ -278,7 +278,7 @@ class WDILibrary {
278
  ?>
279
  <script>
280
  function wdi_spider_search() {
281
- var wdi_form = jQuery('#<?php echo $form_id; ?>');
282
  var wdi_search_text = jQuery("#search_value").val();
283
  var wdi_new_url = wdiChangeParamByName(window.location.href, "search", wdi_search_text);
284
  wdi_form.attr("action", wdi_new_url);
@@ -291,7 +291,7 @@ class WDILibrary {
291
  if (document.getElementById("search_select_value")) {
292
  document.getElementById("search_select_value").value = 0;
293
  }
294
- document.getElementById("<?php echo $form_id; ?>").submit();
295
  }
296
  function check_search_key(e, that) {
297
  var key_code = (e.keyCode ? e.keyCode : e.which);
@@ -324,7 +324,7 @@ class WDILibrary {
324
  }
325
  ?>
326
  <script type="text/javascript">
327
- var items_county = <?php echo $items_county; ?>;
328
  function wdi_spider_page(x, y) {
329
  switch (y) {
330
  case 1:
@@ -352,12 +352,12 @@ class WDILibrary {
352
  default:
353
  document.getElementById('page_number').value = 1;
354
  }
355
- document.getElementById('<?php echo $form_id; ?>').submit();
356
  }
357
  function check_enter_key(e , _this) {
358
  var key_code = (e.keyCode ? e.keyCode : e.which);
359
  if (key_code == 13) {
360
- var wdi_form = jQuery('#<?php echo $form_id; ?>');
361
  /*Enter keycode*/
362
  var to_page = jQuery(_this).val();
363
  var wdi_new_url = wdiChangeParamByName(window.location.href, "paged", to_page);
@@ -386,7 +386,7 @@ class WDILibrary {
386
  <span class="displaying-num">
387
  <?php
388
  if ($count_items != 0) {
389
- echo $count_items; ?> item<?php echo (($count_items == 1) ? '' : 's');
390
  }
391
  ?>
392
  </span>
@@ -415,8 +415,8 @@ class WDILibrary {
415
  ?>
416
  <span class="pagination-links">
417
  <?php if($first_prev_page):?>
418
- <a class="<?php echo $first_page; ?>" title="Go to the first page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,-2);?>">«</a>
419
- <a class="<?php echo $prev_page; ?>" title="Go to the previous page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,-1);?>">‹</a>
420
  <?php else:?>
421
  <span class="tablenav-pages-navspan" aria-hidden="true">«</span>
422
  <span class="tablenav-pages-navspan" aria-hidden="true">‹</span>
@@ -430,8 +430,8 @@ class WDILibrary {
430
  </span>
431
  </span>
432
  <?php if($next_last_page):?>
433
- <a class="<?php echo $next_page ?>" title="Go to the next page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,1);?>">›</a>
434
- <a class="<?php echo $last_page ?>" title="Go to the last page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,2);?>">»</a>
435
  <?php else:?>
436
  <span class="tablenav-pages-navspan" aria-hidden="true">›</span>
437
  <span class="tablenav-pages-navspan" aria-hidden="true">»</span>
@@ -501,13 +501,13 @@ class WDILibrary {
501
  function wdi_spider_search() {
502
  document.getElementById("page_number").value = "1";
503
  document.getElementById("search_or_not").value = "search";
504
- wdi_spider_ajax_save('<?php echo $form_id; ?>');
505
  }
506
  function wdi_spider_reset() {
507
  if (document.getElementById("search_value")) {
508
  document.getElementById("search_value").value = "";
509
  }
510
- wdi_spider_ajax_save('<?php echo $form_id; ?>');
511
  }
512
  function check_search_key(e, that) {
513
  var key_code = (e.keyCode ? e.keyCode : e.which);
@@ -547,7 +547,7 @@ class WDILibrary {
547
  if (!$pager) {
548
  ?>
549
  <script type="text/javascript">
550
- var items_county = <?php echo $items_county; ?>;
551
  function wdi_spider_page(x, y) {
552
  switch (y) {
553
  case 1:
@@ -575,7 +575,7 @@ class WDILibrary {
575
  default:
576
  document.getElementById('page_number').value = 1;
577
  }
578
- wdi_spider_ajax_save('<?php echo $form_id; ?>');
579
  }
580
  function check_enter_key(e, that) {
581
  var key_code = (e.keyCode ? e.keyCode : e.which);
@@ -586,7 +586,7 @@ class WDILibrary {
586
  else {
587
  document.getElementById('page_number').value = jQuery(that).val();
588
  }
589
- wdi_spider_ajax_save('<?php echo $form_id; ?>');
590
  return false;
591
  }
592
  return true;
@@ -597,7 +597,7 @@ class WDILibrary {
597
  <span class="displaying-num">
598
  <?php
599
  if ($count_items != 0) {
600
- echo $count_items; ?> item<?php echo (($count_items == 1) ? '' : 's');
601
  }
602
  ?>
603
  </span>
@@ -621,18 +621,18 @@ class WDILibrary {
621
  }
622
  ?>
623
  <span class="pagination-links">
624
- <a class="<?php echo $first_page; ?>" title="Go to the first page" onclick="wdi_spider_page(<?php echo $page_number; ?>,-2)">«</a>
625
- <a class="<?php echo $prev_page; ?>" title="Go to the previous page" onclick="wdi_spider_page(<?php echo $page_number; ?>,-1)">‹</a>
626
  <span class="paging-input">
627
  <span class="total-pages">
628
- <input class="current_page" id="current_page" name="current_page" value="<?php echo $page_number; ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
629
  </span> of
630
  <span class="total-pages">
631
- <?php echo $items_county; ?>
632
  </span>
633
  </span>
634
- <a class="<?php echo $next_page ?>" title="Go to the next page" onclick="wdi_spider_page(<?php echo $page_number; ?>,1)">›</a>
635
- <a class="<?php echo $last_page ?>" title="Go to the last page" onclick="wdi_spider_page(<?php echo $page_number; ?>,2)">»</a>
636
  <?php
637
  }
638
  ?>
@@ -665,35 +665,35 @@ class WDILibrary {
665
  box-shadow: 0 0 3px 1px #CCCCCC;
666
  background-color: #FFFFFF;
667
  border: 1px solid #CCCCCC;
668
- width: <?php echo $search_box_width; ?>px;
669
  max-width: 100%;
670
  }
671
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_search_input_container {
672
  display: block;
673
  margin-right: 45px;
674
  }
675
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_search_loupe_container {
676
  display: inline-block;
677
  margin-right: 1px;
678
  vertical-align: middle;
679
  float: right;
680
  padding-top: 3px;
681
  }
682
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_search_reset_container {
683
  display: inline-block;
684
  margin-right: 5px;
685
  vertical-align: middle;
686
  float: right;
687
  padding-top: 3px;
688
  }
689
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_search,
690
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_reset {
691
  font-size: 18px;
692
  color: #CCCCCC;
693
  cursor: pointer;
694
  }
695
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_search_input_<?php echo $current_view; ?>,
696
- #wdi_search_container_1_<?php echo $current_view; ?> #wdi_search_container_2_<?php echo $current_view; ?> .wdi_search_input_<?php echo $current_view; ?>:focus {
697
  color: hsl(0, 1%, 3%);
698
  outline: none;
699
  border: none;
@@ -705,29 +705,29 @@ class WDILibrary {
705
  }
706
  </style>
707
  <script type="text/javascript">
708
- function clear_input_<?php echo $current_view; ?> (current_view) {
709
  jQuery("#wdi_search_input_" + current_view).val('');
710
  }
711
  function check_enter_key(e) {
712
  var key_code = e.which || e.keyCode;
713
  if (key_code == 13) {
714
- wdi_spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1);
715
  return false;
716
  }
717
  return true;
718
  }
719
  </script>
720
- <div class="wdi_search_container_1" id="wdi_search_container_1_<?php echo $current_view; ?>">
721
- <div class="wdi_search_container_2" id="wdi_search_container_2_<?php echo $current_view; ?>">
722
  <span class="wdi_search_reset_container" >
723
- <i title="<?php echo __('Reset', 'wd-instagram-feed'); ?>" class="wdi_reset tenweb-i tenweb-i-times" onclick="clear_input_<?php echo $current_view; ?>('<?php echo $current_view; ?>'),wdi_spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1)"></i>
724
  </span>
725
  <span class="wdi_search_loupe_container" >
726
- <i title="<?php echo __('Search', 'wd-instagram-feed'); ?>" class="wdi_search tenweb-i tenweb-i-search" onclick="wdi_spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1)"></i>
727
  </span>
728
  <span class="wdi_search_input_container">
729
- <input id="wdi_search_input_<?php echo sanitize_html_class($current_view); ?>" class="wdi_search_input_<?php echo sanitize_html_class($current_view); ?>" type="text" onkeypress="return check_enter_key(event ,this)" name="wdi_search_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($wdi_search); ?>" >
730
- <input id="wdi_images_count_<?php echo sanitize_html_class($current_view); ?>" class="wdi_search_input" type="hidden" name="wdi_images_count_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($images_count); ?>" >
731
  </span>
732
  </div>
733
  </div>
@@ -741,14 +741,14 @@ class WDILibrary {
741
 
742
  ?>
743
  <style>
744
- .wdi_order_cont_<?php echo $current_view; ?> {
745
  background-color: rgba(0,0,0,0);
746
  display: block;
747
  margin: 0 5px 20px 5px;
748
  text-align: right;
749
  width: 100%;
750
  }
751
- .wdi_order_label_<?php echo $current_view; ?> {
752
  border: none;
753
  box-shadow: none;
754
  color: #BBBBBB;
@@ -756,18 +756,18 @@ class WDILibrary {
756
  font-weight: bold;
757
  outline: none;
758
  }
759
- .wdi_order_<?php echo $current_view; ?> {
760
  background-color: #FFFFFF;
761
  border: 1px solid #CCCCCC;
762
  box-shadow: 0 0 3px 1px #CCCCCC;
763
  border-radius: 4px;
764
  max-width: 100%;
765
- width: <?php echo $search_box_width; ?>px;
766
  }
767
  </style>
768
- <div class="wdi_order_cont_<?php echo sanitize_html_class($current_view); ?>">
769
- <span class="wdi_order_label_<?php echo sanitize_html_class($current_view); ?>"><?php echo __('Order by: ', 'wd-instagram-feed'); ?></span>
770
- <select class="wdi_order_<?php echo sanitize_html_class($current_view); ?>" onchange="wdi_spider_frontend_ajax('<?php echo $form_id; ?>', '<?php echo $current_view; ?>', '<?php echo $cur_gal_id; ?>', <?php echo $album_gallery_id; ?>, '', '<?php echo $type; ?>', 1, '', this.value)">
771
  <option <?php if ($sort_by == 'default') echo 'selected'; ?> value="default"><?php echo __('Default', 'wd-instagram-feed'); ?></option>
772
  <option <?php if ($sort_by == 'filename') echo 'selected'; ?> value="filename"><?php echo __('Filename', 'wd-instagram-feed'); ?></option>
773
  <option <?php if ($sort_by == 'size') echo 'selected'; ?> value="size"><?php echo __('Size', 'wd-instagram-feed'); ?></option>
@@ -799,7 +799,7 @@ class WDILibrary {
799
  public static function wdi_spider_redirect( $url = '' ) {
800
  ?>
801
  <script>
802
- window.location = "<?php echo $url; ?>";
803
  </script>
804
  <?php
805
  exit();
@@ -813,7 +813,7 @@ class WDILibrary {
813
  public static function redirect( $url = array() ) {
814
  $url = html_entity_decode($url);
815
  ?>
816
- <script>window.location = "<?php echo $url; ?>";</script>
817
  <?php
818
  exit();
819
  }
@@ -1075,7 +1075,7 @@ class WDILibrary {
1075
  $app_config = WDILibrary::instagram_app_config();
1076
  $href = $app_config['basic_authorize_url'] . '?app_id=' . $app_config['basic_app_id'] . '&redirect_uri=' . $app_config['basic_redirect_uri'] . '&response_type=code&scope=user_profile,user_media&state=' . admin_url('admin.php?wdi_settings');
1077
  ?>
1078
- <a href="<?php echo $href; ?>" onclick="document.cookie='wdi_autofill=true'" class="wdi_sign_in_button"><i class="wdi-instagram-icon"></i><?php echo $text; ?></a>
1079
  <?php
1080
  }
1081
 
@@ -1274,12 +1274,12 @@ class WDILibrary {
1274
  <img src="<?php echo esc_url($user['profile_picture_url']); ?>" alt="<?php echo esc_attr($user['user_name']); ?>">
1275
  </div>
1276
  <?php } ?>
1277
- <h3 onclick="window.open('//instagram.com/<?php echo $user['user_name']; ?>','_blank')"><?php echo esc_html($user['user_name']); ?></h3>
1278
  <?php } ?>
1279
  <?php if ( !empty($settings['show_follow']) && $settings['show_follow'] == 1 ) { ?>
1280
  <div class="wdi_user_controls">
1281
  <div class="wdi_follow_btn"
1282
- onclick="window.open('//instagram.com/<?php echo $user['user_name']; ?>','_blank')">
1283
  <span><?php _e('Follow', 'wd-instagram-feed'); ?></span>
1284
  </div>
1285
  </div>
@@ -1296,7 +1296,7 @@ class WDILibrary {
1296
  <?php } ?>
1297
  <?php if ( $business && !empty($settings['show_usernames']) && !empty($settings['biography_website']) && $settings['biography_website'] == 1 ) { ?>
1298
  <div class="wdi_clear"></div>
1299
- <div class="wdi_bio"><?php echo $user['biography']; ?></div>
1300
  <div class="wdi_website">
1301
  <a target="_blank" href="<?php echo esc_url($user['website']); ?>"><?php echo esc_html($user['website']); ?></a>
1302
  </div>
@@ -1359,11 +1359,11 @@ class WDILibrary {
1359
  <?php _e('Instagram Feed by 10Web Premium', WDI_PREFIX); ?>
1360
  </div>
1361
  <div class="topbar-content-body">
1362
- <?php echo $description; ?>
1363
  </div>
1364
  </div>
1365
  <div class="topbar-content-button-container">
1366
- <a href="<?php echo $premium_link; ?>" target="_blank" class="topbar-upgrade-button"><?php _e( 'Upgrade',WDI_PREFIX ); ?></a>
1367
  </div>
1368
  </div>
1369
  <?php
@@ -1375,7 +1375,7 @@ class WDILibrary {
1375
  ?>
1376
  <div class="topbar topbar-links">
1377
  <div class="topbar-links-container">
1378
- <a href="<?php echo $user_guide_link; ?>" target="_blank" class="topbar_user_guid">
1379
  <div class="topbar-links-item">
1380
  <?php _e('User guide', WDI_PREFIX); ?>
1381
  </div>
@@ -1388,9 +1388,9 @@ class WDILibrary {
1388
  ?>
1389
  <div class="topbar topbar-links topbar_support_forum">
1390
  <div class="topbar-links-container">
1391
- <a href="<?php echo $support_forum_link; ?>" target="_blank" class="topbar_support_forum">
1392
  <div class="topbar-links-item">
1393
- <img src="<?php echo WDI_URL . '/images/help.svg'; ?>" class="help_icon" />
1394
  <?php _e('Ask a question', WDI_PREFIX); ?>
1395
  </div>
1396
  </a>
257
  // temporary
258
  if ( !empty($message) && !is_numeric($message) ) {
259
  ob_start();
260
+ ?><div style="width:99%" class="<?php echo esc_attr($type); ?> inline">
261
  <p>
262
  <strong><?php echo esc_html($message); ?></strong>
263
  </p>
278
  ?>
279
  <script>
280
  function wdi_spider_search() {
281
+ var wdi_form = jQuery('#<?php echo esc_attr($form_id); ?>');
282
  var wdi_search_text = jQuery("#search_value").val();
283
  var wdi_new_url = wdiChangeParamByName(window.location.href, "search", wdi_search_text);
284
  wdi_form.attr("action", wdi_new_url);
291
  if (document.getElementById("search_select_value")) {
292
  document.getElementById("search_select_value").value = 0;
293
  }
294
+ document.getElementById("<?php echo esc_attr($form_id); ?>").submit();
295
  }
296
  function check_search_key(e, that) {
297
  var key_code = (e.keyCode ? e.keyCode : e.which);
324
  }
325
  ?>
326
  <script type="text/javascript">
327
+ var items_county = <?php echo esc_attr($items_county); ?>;
328
  function wdi_spider_page(x, y) {
329
  switch (y) {
330
  case 1:
352
  default:
353
  document.getElementById('page_number').value = 1;
354
  }
355
+ document.getElementById('<?php echo esc_attr($form_id); ?>').submit();
356
  }
357
  function check_enter_key(e , _this) {
358
  var key_code = (e.keyCode ? e.keyCode : e.which);
359
  if (key_code == 13) {
360
+ var wdi_form = jQuery('#<?php echo esc_attr($form_id); ?>');
361
  /*Enter keycode*/
362
  var to_page = jQuery(_this).val();
363
  var wdi_new_url = wdiChangeParamByName(window.location.href, "paged", to_page);
386
  <span class="displaying-num">
387
  <?php
388
  if ($count_items != 0) {
389
+ echo esc_attr($count_items); ?> item<?php echo (($count_items == 1) ? '' : 's');
390
  }
391
  ?>
392
  </span>
415
  ?>
416
  <span class="pagination-links">
417
  <?php if($first_prev_page):?>
418
+ <a class="<?php echo esc_attr($first_page); ?>" title="Go to the first page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,-2);?>">«</a>
419
+ <a class="<?php echo esc_attr($prev_page); ?>" title="Go to the previous page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,-1);?>">‹</a>
420
  <?php else:?>
421
  <span class="tablenav-pages-navspan" aria-hidden="true">«</span>
422
  <span class="tablenav-pages-navspan" aria-hidden="true">‹</span>
430
  </span>
431
  </span>
432
  <?php if($next_last_page):?>
433
+ <a class="<?php echo esc_attr($next_page) ?>" title="Go to the next page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,1);?>">›</a>
434
+ <a class="<?php echo esc_attr($last_page) ?>" title="Go to the last page" href="<?php echo WDILibrary::get_pagination_page($items_county , $page_number,2);?>">»</a>
435
  <?php else:?>
436
  <span class="tablenav-pages-navspan" aria-hidden="true">›</span>
437
  <span class="tablenav-pages-navspan" aria-hidden="true">»</span>
501
  function wdi_spider_search() {
502
  document.getElementById("page_number").value = "1";
503
  document.getElementById("search_or_not").value = "search";
504
+ wdi_spider_ajax_save('<?php echo esc_attr($form_id); ?>');
505
  }
506
  function wdi_spider_reset() {
507
  if (document.getElementById("search_value")) {
508
  document.getElementById("search_value").value = "";
509
  }
510
+ wdi_spider_ajax_save('<?php echo esc_attr($form_id); ?>');
511
  }
512
  function check_search_key(e, that) {
513
  var key_code = (e.keyCode ? e.keyCode : e.which);
547
  if (!$pager) {
548
  ?>
549
  <script type="text/javascript">
550
+ var items_county = <?php echo esc_attr($items_county); ?>;
551
  function wdi_spider_page(x, y) {
552
  switch (y) {
553
  case 1:
575
  default:
576
  document.getElementById('page_number').value = 1;
577
  }
578
+ wdi_spider_ajax_save('<?php echo esc_attr($form_id); ?>');
579
  }
580
  function check_enter_key(e, that) {
581
  var key_code = (e.keyCode ? e.keyCode : e.which);
586
  else {
587
  document.getElementById('page_number').value = jQuery(that).val();
588
  }
589
+ wdi_spider_ajax_save('<?php echo esc_attr($form_id); ?>');
590
  return false;
591
  }
592
  return true;
597
  <span class="displaying-num">
598
  <?php
599
  if ($count_items != 0) {
600
+ echo esc_attr($count_items); ?> item<?php echo (($count_items == 1) ? '' : 's');
601
  }
602
  ?>
603
  </span>
621
  }
622
  ?>
623
  <span class="pagination-links">
624
+ <a class="<?php echo esc_attr($first_page); ?>" title="Go to the first page" onclick="wdi_spider_page(<?php echo esc_attr($page_number); ?>,-2)">«</a>
625
+ <a class="<?php echo esc_attr($prev_page); ?>" title="Go to the previous page" onclick="wdi_spider_page(<?php echo esc_attr($page_number); ?>,-1)">‹</a>
626
  <span class="paging-input">
627
  <span class="total-pages">
628
+ <input class="current_page" id="current_page" name="current_page" value="<?php echo esc_attr($page_number); ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
629
  </span> of
630
  <span class="total-pages">
631
+ <?php echo esc_attr($items_county); ?>
632
  </span>
633
  </span>
634
+ <a class="<?php echo esc_attr($next_page) ?>" title="Go to the next page" onclick="wdi_spider_page(<?php echo esc_attr($page_number); ?>,1)">›</a>
635
+ <a class="<?php echo esc_attr($last_page) ?>" title="Go to the last page" onclick="wdi_spider_page(<?php echo esc_attr($page_number); ?>,2)">»</a>
636
  <?php
637
  }
638
  ?>
665
  box-shadow: 0 0 3px 1px #CCCCCC;
666
  background-color: #FFFFFF;
667
  border: 1px solid #CCCCCC;
668
+ width: <?php echo esc_attr($search_box_width); ?>px;
669
  max-width: 100%;
670
  }
671
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_search_input_container {
672
  display: block;
673
  margin-right: 45px;
674
  }
675
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_search_loupe_container {
676
  display: inline-block;
677
  margin-right: 1px;
678
  vertical-align: middle;
679
  float: right;
680
  padding-top: 3px;
681
  }
682
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_search_reset_container {
683
  display: inline-block;
684
  margin-right: 5px;
685
  vertical-align: middle;
686
  float: right;
687
  padding-top: 3px;
688
  }
689
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_search,
690
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_reset {
691
  font-size: 18px;
692
  color: #CCCCCC;
693
  cursor: pointer;
694
  }
695
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_search_input_<?php echo esc_attr($current_view); ?>,
696
+ #wdi_search_container_1_<?php echo esc_attr($current_view); ?> #wdi_search_container_2_<?php echo esc_attr($current_view); ?> .wdi_search_input_<?php echo esc_attr($current_view); ?>:focus {
697
  color: hsl(0, 1%, 3%);
698
  outline: none;
699
  border: none;
705
  }
706
  </style>
707
  <script type="text/javascript">
708
+ function clear_input_<?php echo esc_attr($current_view); ?> (current_view) {
709
  jQuery("#wdi_search_input_" + current_view).val('');
710
  }
711
  function check_enter_key(e) {
712
  var key_code = e.which || e.keyCode;
713
  if (key_code == 13) {
714
+ wdi_spider_frontend_ajax('<?php echo esc_attr($form_id); ?>', '<?php echo esc_attr($current_view); ?>', '<?php echo esc_attr($cur_gal_id); ?>', <?php echo esc_attr($album_gallery_id); ?>, '', '<?php echo esc_attr($type); ?>', 1);
715
  return false;
716
  }
717
  return true;
718
  }
719
  </script>
720
+ <div class="wdi_search_container_1" id="wdi_search_container_1_<?php echo esc_attr($current_view); ?>">
721
+ <div class="wdi_search_container_2" id="wdi_search_container_2_<?php echo esc_attr($current_view); ?>">
722
  <span class="wdi_search_reset_container" >
723
+ <i title="<?php echo __('Reset', 'wd-instagram-feed'); ?>" class="wdi_reset tenweb-i tenweb-i-times" onclick="clear_input_<?php echo esc_attr($current_view); ?>('<?php echo esc_attr($current_view); ?>'),wdi_spider_frontend_ajax('<?php echo esc_attr($form_id); ?>', '<?php echo esc_attr($current_view); ?>', '<?php echo esc_attr($cur_gal_id); ?>', <?php echo esc_attr($album_gallery_id); ?>, '', '<?php echo esc_attr($type); ?>', 1)"></i>
724
  </span>
725
  <span class="wdi_search_loupe_container" >
726
+ <i title="<?php echo __('Search', 'wd-instagram-feed'); ?>" class="wdi_search tenweb-i tenweb-i-search" onclick="wdi_spider_frontend_ajax('<?php echo esc_attr($form_id); ?>', '<?php echo esc_attr($current_view); ?>', '<?php echo esc_attr($cur_gal_id); ?>', <?php echo esc_attr($album_gallery_id); ?>, '', '<?php echo esc_attr($type); ?>', 1)"></i>
727
  </span>
728
  <span class="wdi_search_input_container">
729
+ <input id="wdi_search_input_<?php echo esc_attr($current_view); ?>" class="wdi_search_input_<?php echo esc_attr($current_view); ?>" type="text" onkeypress="return check_enter_key(event ,this)" name="wdi_search_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($wdi_search); ?>" >
730
+ <input id="wdi_images_count_<?php echo esc_attr($current_view); ?>" class="wdi_search_input" type="hidden" name="wdi_images_count_<?php echo esc_attr($current_view); ?>" value="<?php echo esc_attr($images_count); ?>" >
731
  </span>
732
  </div>
733
  </div>
741
 
742
  ?>
743
  <style>
744
+ .wdi_order_cont_<?php echo esc_attr($current_view); ?> {
745
  background-color: rgba(0,0,0,0);
746
  display: block;
747
  margin: 0 5px 20px 5px;
748
  text-align: right;
749
  width: 100%;
750
  }
751
+ .wdi_order_label_<?php echo esc_attr($current_view); ?> {
752
  border: none;
753
  box-shadow: none;
754
  color: #BBBBBB;
756
  font-weight: bold;
757
  outline: none;
758
  }
759
+ .wdi_order_<?php echo esc_attr($current_view); ?> {
760
  background-color: #FFFFFF;
761
  border: 1px solid #CCCCCC;
762
  box-shadow: 0 0 3px 1px #CCCCCC;
763
  border-radius: 4px;
764
  max-width: 100%;
765
+ width: <?php echo esc_attr($search_box_width); ?>px;
766
  }
767
  </style>
768
+ <div class="wdi_order_cont_<?php echo esc_attr($current_view); ?>">
769
+ <span class="wdi_order_label_<?php echo esc_attr($current_view); ?>"><?php echo __('Order by: ', 'wd-instagram-feed'); ?></span>
770
+ <select class="wdi_order_<?php echo esc_attr($current_view); ?>" onchange="wdi_spider_frontend_ajax('<?php echo esc_attr($form_id); ?>', '<?php echo esc_attr($current_view); ?>', '<?php echo esc_attr($cur_gal_id); ?>', <?php echo esc_attr($album_gallery_id); ?>, '', '<?php echo esc_attr($type); ?>', 1, '', this.value)">
771
  <option <?php if ($sort_by == 'default') echo 'selected'; ?> value="default"><?php echo __('Default', 'wd-instagram-feed'); ?></option>
772
  <option <?php if ($sort_by == 'filename') echo 'selected'; ?> value="filename"><?php echo __('Filename', 'wd-instagram-feed'); ?></option>
773
  <option <?php if ($sort_by == 'size') echo 'selected'; ?> value="size"><?php echo __('Size', 'wd-instagram-feed'); ?></option>
799
  public static function wdi_spider_redirect( $url = '' ) {
800
  ?>
801
  <script>
802
+ window.location = "<?php echo esc_url($url); ?>";
803
  </script>
804
  <?php
805
  exit();
813
  public static function redirect( $url = array() ) {
814
  $url = html_entity_decode($url);
815
  ?>
816
+ <script>window.location = "<?php echo esc_url($url); ?>";</script>
817
  <?php
818
  exit();
819
  }
1075
  $app_config = WDILibrary::instagram_app_config();
1076
  $href = $app_config['basic_authorize_url'] . '?app_id=' . $app_config['basic_app_id'] . '&redirect_uri=' . $app_config['basic_redirect_uri'] . '&response_type=code&scope=user_profile,user_media&state=' . admin_url('admin.php?wdi_settings');
1077
  ?>
1078
+ <a href="<?php echo esc_url($href); ?>" onclick="document.cookie='wdi_autofill=true'" class="wdi_sign_in_button"><i class="wdi-instagram-icon"></i><?php echo esc_html($text); ?></a>
1079
  <?php
1080
  }
1081
 
1274
  <img src="<?php echo esc_url($user['profile_picture_url']); ?>" alt="<?php echo esc_attr($user['user_name']); ?>">
1275
  </div>
1276
  <?php } ?>
1277
+ <h3 onclick="window.open('//instagram.com/<?php echo esc_attr($user['user_name']); ?>','_blank')"><?php echo esc_html($user['user_name']); ?></h3>
1278
  <?php } ?>
1279
  <?php if ( !empty($settings['show_follow']) && $settings['show_follow'] == 1 ) { ?>
1280
  <div class="wdi_user_controls">
1281
  <div class="wdi_follow_btn"
1282
+ onclick="window.open('//instagram.com/<?php echo esc_attr($user['user_name']); ?>','_blank')">
1283
  <span><?php _e('Follow', 'wd-instagram-feed'); ?></span>
1284
  </div>
1285
  </div>
1296
  <?php } ?>
1297
  <?php if ( $business && !empty($settings['show_usernames']) && !empty($settings['biography_website']) && $settings['biography_website'] == 1 ) { ?>
1298
  <div class="wdi_clear"></div>
1299
+ <div class="wdi_bio"><?php echo esc_html($user['biography']); ?></div>
1300
  <div class="wdi_website">
1301
  <a target="_blank" href="<?php echo esc_url($user['website']); ?>"><?php echo esc_html($user['website']); ?></a>
1302
  </div>
1359
  <?php _e('Instagram Feed by 10Web Premium', WDI_PREFIX); ?>
1360
  </div>
1361
  <div class="topbar-content-body">
1362
+ <?php echo esc_html($description); ?>
1363
  </div>
1364
  </div>
1365
  <div class="topbar-content-button-container">
1366
+ <a href="<?php echo esc_url($premium_link); ?>" target="_blank" class="topbar-upgrade-button"><?php _e( 'Upgrade',WDI_PREFIX ); ?></a>
1367
  </div>
1368
  </div>
1369
  <?php
1375
  ?>
1376
  <div class="topbar topbar-links">
1377
  <div class="topbar-links-container">
1378
+ <a href="<?php echo esc_url($user_guide_link); ?>" target="_blank" class="topbar_user_guid">
1379
  <div class="topbar-links-item">
1380
  <?php _e('User guide', WDI_PREFIX); ?>
1381
  </div>
1388
  ?>
1389
  <div class="topbar topbar-links topbar_support_forum">
1390
  <div class="topbar-links-container">
1391
+ <a href="<?php echo esc_url($support_forum_link); ?>" target="_blank" class="topbar_support_forum">
1392
  <div class="topbar-links-item">
1393
+ <img src="<?php echo esc_url(WDI_URL) . '/images/help.svg'; ?>" class="help_icon" />
1394
  <?php _e('Ask a question', WDI_PREFIX); ?>
1395
  </div>
1396
  </a>
framework/WDI_admin_view.php CHANGED
@@ -25,9 +25,9 @@ class WDI_admin_view {
25
  public function link_button($element, $context = 'option', $opt_val = '', $meta=array()){
26
  global $wdi_options;
27
  ?>
28
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
29
  <div class="block margin">
30
- <a href="<?php echo esc_url($element['href']); ?>" id="<?php echo $element['name']; ?>" class="button" style="text-decoration:none;"><?php echo (isset($element['value']))?esc_html($element['value']):esc_html($element['title']); ?></a>
31
  </div>
32
  <?php if(isset($element['description'])){ ?>
33
  <p style="font-style: italic;"><?php echo $element['description']; ?></p>
@@ -45,17 +45,17 @@ class WDI_admin_view {
45
  public function button($element, $context = 'option', $opt_val = '', $meta=array()){
46
  global $wdi_options;
47
  ?>
48
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
49
  <div class="block margin">
50
  <div class="optioninput checkbox">
51
- <span id="<?php echo sanitize_html_class($element['name']); ?>" class="button" style="text-decoration:none;"><?php echo esc_html($element['title']); ?></span>
52
  </div>
53
  </div>
54
  <script>
55
  jQuery(document).ready(function () {
56
  /*init*/
57
- var element_<?php echo $element['name']; ?> = {
58
- id : "<?php echo $element['name']; ?>",
59
  show : [
60
  <?php
61
  foreach ($element['show'] as $element_to_show) :
@@ -72,10 +72,10 @@ class WDI_admin_view {
72
  ]
73
  };
74
 
75
- wdwt_elements.button_toggle(element_<?php echo $element['name']; ?>);
76
  /*change on click*/
77
- jQuery('#<?php echo $element['name']; ?>').on( "click", function() {
78
- wdwt_elements.button_toggle(element_<?php echo $element['name']; ?>);
79
  });
80
 
81
  });
@@ -105,10 +105,10 @@ class WDI_admin_view {
105
  }
106
  $opt_val = trim($opt_val);
107
  ?>
108
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
109
  <div class="block margin">
110
  <div class="optioninput checkbox">
111
- <input type="checkbox" class="checkbox" name="<?php echo esc_attr($optionname); ?>" id="<?php echo sanitize_html_class($element['name']); ?>" <?php checked($opt_val || $opt_val =='on'); ?> <?php $this->custom_attrs($element); ?> value="1">
112
  </div>
113
  </div>
114
  </div>
@@ -138,10 +138,10 @@ class WDI_admin_view {
138
  $opt_val = trim($opt_val);
139
 
140
  ?>
141
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
142
  <div class="block margin">
143
  <div class="optioninput checkbox">
144
- <input type="checkbox" class="checkbox" name="<?php echo esc_attr($optionname); ?>" id="<?php echo sanitize_html_class($element['name']); ?>" <?php checked($opt_val || $opt_val =='on'); ?> <?php $this->custom_attrs($element); ?> value="<?php echo esc_attr($opt_val); ?>">
145
  </div>
146
  </div>
147
  </div>
@@ -149,8 +149,8 @@ class WDI_admin_view {
149
  jQuery(document).ready(function () {
150
  /*init*/
151
 
152
- var element_<?php echo $element["name"]; ?> = {
153
- id : "<?php echo $element["name"]; ?>",
154
  show : [
155
  <?php
156
  foreach ($element['show'] as $element_to_show) :
@@ -167,10 +167,10 @@ class WDI_admin_view {
167
  ]
168
  };
169
 
170
- wdwt_elements.checkbox_open(element_<?php echo $element["name"]; ?>);
171
  /*change on click*/
172
- jQuery('#<?php echo $element["name"]; ?>').on( "click", function() {
173
- wdwt_elements.checkbox_open(element_<?php echo $element["name"]; ?>);
174
  });
175
 
176
  });
@@ -193,10 +193,10 @@ class WDI_admin_view {
193
  $opt_val = $wdi_options[$element['name']];
194
  }
195
  ?>
196
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
197
  <div class='wdwt_float'>
198
  <div>
199
- <input type="text" class='color_input' id="<?php echo sanitize_html_class($element['name']); ?>" name="<?php echo esc_attr($optionname); ?>" value="<?php echo esc_attr($opt_val); ?>" data-default-color="<?php echo esc_attr($element['default']); ?>" <?php $this->custom_attrs($element); ?> style="background-color:<?php echo esc_attr($opt_val); ?>;">
200
  </div>
201
  </div>
202
  </div>
@@ -214,7 +214,7 @@ class WDI_admin_view {
214
  $input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
215
  $optionname = WDI_OPT . '[' . $element['name'] . ']';
216
  ?>
217
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
218
  <div class="block">
219
  <?php WDILibrary::add_auth_button(''); ?>
220
  <div class="wdi_more_token_template" style="display: none;">
@@ -258,10 +258,10 @@ class WDI_admin_view {
258
  $input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
259
 
260
  ?>
261
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
262
  <div class="block">
263
  <div class="optioninput">
264
- <input <?php echo $readonly;?> type=<?php echo isset($element['input_type']) ? esc_attr($element['input_type']) : 'text'?> name="<?php echo esc_attr($optionname); ?>" id="<?php echo sanitize_html_class($element['name']);?>"
265
  <?php echo isset($element['required'])? 'required' : ''; $this->custom_attrs($element); ?>
266
  value="<?php echo esc_attr($opt_val); ?>" size="<?php echo esc_attr($input_size); ?>"
267
  <?php if(isset($element['attr'])) {echo $element['attr']['name'] . '="' .$element["attr"]["value"].'"';} ?>>
@@ -296,7 +296,7 @@ class WDI_admin_view {
296
  }
297
 
298
  ?>
299
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
300
  <?php
301
  foreach ( $element['valid_options'] as $key => $option ) {
302
  ?>
@@ -328,7 +328,7 @@ class WDI_admin_view {
328
  }
329
 
330
  ?>
331
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
332
  <?php
333
  foreach ( $element['valid_options'] as $key => $option ) {
334
  ?>
@@ -340,7 +340,7 @@ class WDI_admin_view {
340
  <script>
341
  jQuery(document).ready(function () {
342
  /*init*/
343
- var element_<?php echo $element["name"]; ?> = {
344
  name : "<?php echo $optionname; ?>",
345
  show : [
346
  <?php
@@ -376,10 +376,10 @@ class WDI_admin_view {
376
  ]
377
  };
378
 
379
- wdwt_elements.radio_open(element_<?php echo $element["name"]; ?>);
380
  /*shor or hide on change*/
381
  jQuery('input[type=radio][name="<?php echo $optionname; ?>"]').on( "change", function() {
382
- wdwt_elements.radio_open(element_<?php echo $element["name"]; ?>);
383
  });
384
 
385
  });
@@ -411,7 +411,7 @@ class WDI_admin_view {
411
  }
412
  ?>
413
 
414
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
415
  <?php
416
  $img_h = intval($element['img_height']) / sizeof($element['valid_options']);
417
  foreach($element['valid_options'] as $option) { ?>
@@ -451,7 +451,7 @@ class WDI_admin_view {
451
  }
452
  ?>
453
 
454
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
455
  <?php
456
  $img_h = intval($element['img_height']) / sizeof($element['valid_options']);
457
  foreach($element['valid_options'] as $option) { ?>
@@ -466,19 +466,19 @@ class WDI_admin_view {
466
  <script>
467
  jQuery(document).ready(function () {
468
  /*init*/
469
- var element_<?php echo $element["name"]; ?> = {
470
- name : "<?php echo $optionname; ?>",
471
  show : [
472
  <?php
473
  foreach ($element['show'] as $key => $value) :
474
- echo "{key: '" . $key ."', val: [" ;
475
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
476
  foreach ($value as $item){
477
- echo "'".$item."',";
478
  }
479
  }
480
  else{/*single item name string */
481
- echo "'".$value."',";
482
  }
483
  echo "]},";
484
  endforeach;
@@ -487,14 +487,14 @@ class WDI_admin_view {
487
  hide : [
488
  <?php
489
  foreach ($element['hide'] as $key => $value) :
490
- echo "{key: '" . $key ."', val: [" ;
491
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
492
  foreach ($value as $item){
493
- echo "'".$item."',";
494
  }
495
  }
496
  else{/*single item name string */
497
- echo "'".$value."',";
498
  }
499
  echo "]},";
500
  endforeach;
@@ -502,10 +502,10 @@ class WDI_admin_view {
502
  ]
503
  };
504
 
505
- wdwt_elements.radio_open(element_<?php echo $element["name"]; ?>);
506
  /*shor or hide on change*/
507
- jQuery('input[type=radio][name="<?php echo $optionname; ?>"]').on( "change", function() {
508
- wdwt_elements.radio_open(element_<?php echo $element["name"]; ?>);
509
  });
510
 
511
  });
@@ -539,10 +539,10 @@ class WDI_admin_view {
539
  $width = isset($element["width"]) ? intval($element["width"]) : $this->params["select_width"];
540
  $disabled = isset($element["disabled"]) ? $element["disabled"] : array();
541
  ?>
542
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
543
  <div class="block">
544
  <div class="optioninput">
545
- <select name="<?php echo esc_attr($optionname); ?>" id="<?php echo sanitize_html_class($element['name']) ?>" <?php echo $multiple ? 'multiple="multiple"' : ''; ?> <?php $this->custom_attrs($element); ?> style="width:<?php echo $width; ?>px; resize:vertical;">
546
  <?php foreach($element['valid_options'] as $key => $value){ ?>
547
  <option value="<?php echo esc_attr($key) ?>" <?php selected(true, in_array($key, $opt_val)); ?> <?php echo in_array($key, $disabled) ? 'disabled="disabled"' : ''; ?>>
548
  <?php echo esc_html($value); ?>
@@ -577,9 +577,9 @@ class WDI_admin_view {
577
  $width = isset($element["width"]) ? intval($element["width"]) : $this->params["select_width"];
578
 
579
  ?>
580
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
581
 
582
- <select name="<?php echo $optionname; ?>" id="<?php echo sanitize_html_class($element['name']) ?>" <?php echo $multiple ? 'multiple="multiple"' : ''; ?> <?php $this->custom_attrs($element); ?> style="width:<?php echo $width; ?>px; resize:vertical;">
583
  <?php
584
  foreach($element['valid_options'] as $key => $value){ ?>
585
  <option value="<?php echo esc_attr($key); ?>" <?php selected(true, in_array($key, $opt_val)); ?>><?php echo esc_html($value); ?></option>
@@ -590,19 +590,19 @@ class WDI_admin_view {
590
  jQuery(document).ready(function () {
591
  /*init*/
592
 
593
- var element_<?php echo $element["name"]; ?> = {
594
- id : "<?php echo $element['name']; ?>",
595
  show : [
596
  <?php
597
  foreach ($element['show'] as $key => $value) :
598
- echo "{key: '" . $key ."', val: [" ;
599
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
600
  foreach ($value as $item){
601
- echo "'".$item."',";
602
  }
603
  }
604
  else{/*single item name string */
605
- echo "'".$value."',";
606
  }
607
  echo "]},";
608
  endforeach;
@@ -611,14 +611,14 @@ class WDI_admin_view {
611
  hide : [
612
  <?php
613
  foreach ($element['hide'] as $key => $value) :
614
- echo "{key: '" . $key ."', val: [" ;
615
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
616
  foreach ($value as $item){
617
- echo "'".$item."',";
618
  }
619
  }
620
  else{/*single item name string */
621
- echo "'".$value."',";
622
  }
623
  echo "]},";
624
  endforeach;
@@ -628,10 +628,10 @@ class WDI_admin_view {
628
 
629
 
630
 
631
- wdwt_elements.select_open(element_<?php echo $element["name"]; ?>);
632
  /*change on click*/
633
- jQuery('#<?php echo $element["name"]; ?>').on( "change", function() {
634
- wdwt_elements.select_open(element_<?php echo $element["name"]; ?>);
635
  });
636
 
637
  });
@@ -660,8 +660,8 @@ class WDI_admin_view {
660
  $width = isset($element["width"]) ? $element["width"] : $this->params["select_width"];
661
 
662
  ?>
663
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
664
- <select name="<?php echo esc_attr($optionname); ?>" id="<?php echo sanitize_html_class($element['name']); ?>" <?php $this->custom_attrs($element); ?> style="width:<?php echo $width;?>px;">
665
  <?php
666
  foreach($element['valid_options'] as $key => $value){ ?>
667
  <option value="<?php echo esc_attr($key); ?>" <?php selected(true, in_array($key, $opt_val)); ?>><?php echo esc_html($value); ?></option>
@@ -675,16 +675,16 @@ class WDI_admin_view {
675
  jQuery(document).ready(function () {
676
  /*init*/
677
 
678
- var element_<?php echo $element["name"]; ?> = {
679
- id : "<?php echo $element["name"]; ?>",
680
- text_preview : "<?php echo $element['text_preview']; ?>",
681
- style_param : "<?php echo $element['style_param']; ?>",
682
  };
683
 
684
- wdwt_elements.select_style(element_<?php echo $element["name"]; ?>);
685
  /*change preview text*/
686
- jQuery('#<?php echo $element["name"]; ?>').on( "change", function() {
687
- wdwt_elements.select_style(element_<?php echo $element["name"]; ?>);
688
  });
689
 
690
  });
@@ -716,10 +716,10 @@ class WDI_admin_view {
716
  $textarea_w = isset($element["width"]) ? $element["width"] : $this->params["textarea_width"];
717
  $textarea_h = isset($element["height"]) ? $element["height"] : $this->params["textarea_height"];
718
  ?>
719
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
720
  <div class="block">
721
  <div class="optioninput">
722
- <textarea name="<?php echo esc_attr($optionname); ?>" id="<?php echo sanitize_html_class($element['name']); ?>" <?php $this->custom_attrs($element); ?> style="width:<?php echo $textarea_w; ?>px; height:<?php echo $textarea_h; ?>px;"><?php echo esc_html($opt_val); ?></textarea>
723
  </div>
724
  </div>
725
  </div>
@@ -740,10 +740,10 @@ class WDI_admin_view {
740
  global $wdi_options;
741
  ?>
742
 
743
- <div class="font_preview_wrap" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
744
  <label class="typagrphy_label" for="" style="font-size:18px;font-size: 20px;font-family: Segoe UI;"><?php echo __('Preview', WDWT_LANG ); ?></label>
745
  <div class="font_preview">
746
- <div class="optioninput-preview" id="<?php echo sanitize_html_class($element['name']); ?>" style="margin-top: 14px; margin-bottom: 23px;" ><?php
747
  $theme = wp_get_theme();
748
  echo esc_html($theme->description);
749
  ?></div>
@@ -802,12 +802,12 @@ class WDI_admin_view {
802
  };
803
 
804
  /*setup the var*/
805
- jQuery('#uploader_<?php echo $element['name']; ?>').on('click', function () {
806
 
807
- window.parent.uploadID = jQuery(this).prev('#<?php echo $element['name']; ?>');
808
  /*grab the specific input*/
809
  /*formfield = jQuery('.upload').attr('name');*/
810
- tb_show('', 'media-upload.php?type=<?php echo $filetype;?>&amp;TB_iframe=true');
811
  return false;
812
  });
813
  window.send_to_editor = function (html) {
@@ -822,10 +822,10 @@ class WDI_admin_view {
822
  /*jQuery(".slide_tab").prev().parent().prev().css("display","none");*/
823
  });
824
  </script>
825
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
826
  <div class="optioninput" id="upload_images">
827
- <input type="text" class="upload" id="<?php echo sanitize_html_class($element["name"]); ?>" name="<?php echo esc_attr($optionname); ?>" size="<?php echo esc_attr($upload_size); ?>" <?php $this->custom_attrs($element); ?> value="<?php echo esc_url($opt_val); ?>"/>
828
- <input class="upload-button button" type="button" id="uploader_<?php echo sanitize_html_class($element['name']); ?>" value="<?php esc_attr_e('Upload Image', WDWT_LANG); ?>"/>
829
  </div>
830
  </div>
831
  <?php
@@ -869,35 +869,35 @@ class WDI_admin_view {
869
  $filetype = (isset($element["filetype"]) && $element_filetype != '') ? $element["filetype"] : $this->params["upload_filetype"];
870
  ?>
871
 
872
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
873
 
874
- <div class="wdwt_slide wdwt_slide_<?php echo sanitize_html_class($element['name']); ?> last_slide" id="wdwt_slide_<?php echo sanitize_html_class($element['name']); ?>_0">
875
  <!-- Image URL -->
876
  <div class="slide-from-base_url" style="margin-bottom:3%;">
877
  <div valign="middle"><h2><?php esc_html_e("Image URL",WDWT_LANG); ?></h2></div>
878
  <div>
879
- <input type="text" id="<?php echo sanitize_html_class($element['name']); ?>_url_0" size="50" value="" class="upload image_links_group" >
880
 
881
- <input type="button" class="<?php echo sanitize_html_class($element['name']); ?>_update-image slide_but_up" id="<?php echo $element['name']; ?>_update-button_0" value="<?php esc_attr_e("Update image", WDWT_LANG); ?>">
882
 
883
- <input type="button" class="<?php echo sanitize_html_class($element['name']); ?>_remove-image slide_but_rem wdwt_btn_red" id="<?php echo $element['name']; ?>_remove-button_0" value="<?php esc_attr_e("Remove this slide", WDWT_LANG); ?>" />
884
  </div>
885
  </div>
886
  <!-- Image -->
887
  <div class="slide-from-base_image">
888
- <div><img style="width:82%;" id="<?php echo sanitize_html_class($element['name']); ?>_img_0" src="" /></div>
889
  </div>
890
  <!-- Image HREF -->
891
  <div class="slide-from-base_href">
892
  <div valign="middle"><h2><?php esc_html_e("Image Href", WDWT_LANG); ?></h2></div>
893
- <div><input type="text" id="<?php echo sanitize_html_class($element['name']); ?>_href_0" class="image_href_group" value="" /></div>
894
  </div>
895
  <!-- Image TITLE -->
896
  <div class="slide-from-base_title">
897
  <div valign="middle">
898
  <h2><?php esc_html_e("Image Title", WDWT_LANG); ?></h2>
899
  </div>
900
- <div><input type="text" id="<?php echo sanitize_html_class($element['name']); ?>_title_0" class="image_title_group" value="" /></div>
901
  </div>
902
  <!-- Image DESCRIPTION -->
903
  <div class="slide-from-base_desc" style="margin-bottom:3%;">
@@ -905,7 +905,7 @@ class WDI_admin_view {
905
  <h2><?php esc_html_e("Image Description", WDWT_LANG); ?></h2>
906
  </div>
907
  <div>
908
- <textarea class="image_descr_group" id="<?php echo sanitize_html_class($element['name']); ?>_descr_0" style="width:236px; height:120px;"></textarea>
909
  </div>
910
  </div>
911
  </div>
@@ -918,79 +918,79 @@ class WDI_admin_view {
918
  </h2>
919
  </div>
920
  <div>
921
- <input type="hidden" name="<?php echo esc_attr($optionname_url); ?>" id="<?php echo sanitize_html_class($element['name']); ?>_urls" data-customize-setting-link="<?php echo $optionname_url; ?>" value="<?php echo esc_attr($imgs_url); ?>" >
922
- <input type="hidden" name="<?php echo esc_attr($optionname_href); ?>" id="<?php echo sanitize_html_class($element['name']); ?>_hrefs" data-customize-setting-link="<?php echo $optionname_href; ?>" value="<?php echo esc_attr($imgs_href); ?>" >
923
- <input type="hidden" name="<?php echo esc_attr($optionname_title); ?>" id="<?php echo sanitize_html_class($element['name']); ?>_titles" data-customize-setting-link="<?php echo $optionname_title; ?>" value="<?php echo esc_attr($imgs_title); ?>" >
924
- <input type="hidden" name="<?php echo esc_attr($optionname_desc); ?>" id="<?php echo sanitize_html_class($element['name']); ?>_descrs" data-customize-setting-link="<?php echo $optionname_desc; ?>" value="<?php echo esc_attr($imgs_desc); ?>" >
925
- <input class="upload_button_slide" type="button" id="<?php echo sanitize_html_class($element['name']); ?>_add-button" value="<?php esc_attr_e('Add new slide', WDWT_LANG); ?>" />
926
  </div>
927
  </div>
928
  </div>
929
  <script type="text/javascript">
930
  jQuery(document).ready(function(){
931
 
932
- var element_<?php echo $element["name"]; ?> = {
933
- id : "<?php echo $element['name']; ?>",
934
- urls : jQuery('#<?php echo $element['name']; ?>_urls').val(),
935
- hrefs : jQuery('#<?php echo $element['name']; ?>_hrefs').val(),
936
- titles : jQuery('#<?php echo $element['name']; ?>_titles').val(),
937
- descrs : jQuery('#<?php echo $element['name']; ?>_descrs').val(),
938
  active : 0,
939
- number_slides : wdwt_elements.slider.len(jQuery('#<?php echo $element['name']; ?>_urls').val()),
940
  };
941
  /*init show*/
942
- wdwt_elements.slider.init(element_<?php echo $element["name"]; ?>);
943
- wdwt_elements.slider.show(element_<?php echo $element["name"]; ?>);
944
  /*firefox bug!*/
945
  jQuery('#customize-control-theme_portfolio_gallery_options-slider_head').find("*").on("focus",function(e){
946
  console.log(e);
947
  });
948
  /*watch for changes in values*/
949
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on("change", ".image_links_group" , function (){
950
- var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo $element['name']; ?>_url_");
951
- wdwt_elements.slider.edit(element_<?php echo $element["name"]; ?>, index, "url");
952
  });
953
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on("change", ".image_href_group", function (){
954
- var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo $element['name']; ?>_href_");
955
- wdwt_elements.slider.edit(element_<?php echo $element["name"]; ?>, index, "href");
956
  });
957
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on("change", ".image_title_group", function (){
958
- var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo $element['name']; ?>_title_");
959
- wdwt_elements.slider.edit(element_<?php echo $element["name"]; ?>, index, "title");
960
  });
961
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on("change", ".image_descr_group", function (){
962
- var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo $element['name']; ?>_descr_");
963
- wdwt_elements.slider.edit(element_<?php echo $element["name"]; ?>, index, "descr");
964
  });
965
  /*add new slide*/
966
- jQuery("#<?php echo $element['name']; ?>_add-button").on('click', function(){
967
  tb_show("", "media-upload.php?type=image&amp;TB_iframe=true");
968
  add_image=send_to_editor ;
969
  window.send_to_editor = function(html) {
970
  imgurl = jQuery("img",html).attr("src");
971
- after = element_<?php echo $element["name"]; ?>.number_slides-1;
972
- wdwt_elements.slider.insert(element_<?php echo $element["name"]; ?>, after, imgurl);
973
  tb_remove();
974
  };
975
  return false;
976
  });
977
  /*update image*/
978
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on('click', ".<?php echo $element['name']; ?>_update-image", function(){
979
- var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo $element['name']; ?>_update-button_");
980
  tb_show("", "media-upload.php?type=image&amp;TB_iframe=true");
981
  window.send_to_editor = function(html) {
982
  imgurl = jQuery("img",html).attr("src");
983
- jQuery("#<?php echo $element['name']; ?>_url_"+index).val(imgurl);
984
- jQuery("#<?php echo $element['name']; ?>_url_"+index).change();
985
  tb_remove();
986
  };
987
  return false;
988
  });
989
  /*remove slide*/
990
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on('click', ".<?php echo $element['name']; ?>_remove-image", function(){
991
- var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo $element['name']; ?>_remove-button_");
992
- element_<?php echo $element["name"]; ?>.active = index;
993
- wdwt_elements.slider.remove(element_<?php echo $element["name"]; ?>);
994
  });
995
  });
996
  </script>
@@ -1029,8 +1029,8 @@ class WDI_admin_view {
1029
  $current = $opt_val['active'];
1030
  $width = isset($element["width"]) ? $element["width"] : $this->params["select_width"];
1031
  ?>
1032
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
1033
- <select name="<?php echo $optionname; ?>[active]" id="<?php echo sanitize_html_class($element['name']); ?>" <?php $this->custom_attrs($element); ?> style="width:<?php echo $width; ?>px;">
1034
  <?php
1035
  for($i=0; $i<sizeof($element['default']['themes']); $i++){ ?>
1036
  <option value="<?php echo esc_attr($i) ?>" <?php selected( $current, $i); ?>> <?php echo esc_html($element['default']['themes'][$i]['title']); ?></option>
@@ -1041,9 +1041,9 @@ class WDI_admin_view {
1041
  jQuery(document).ready(function () {
1042
 
1043
  /*create var storing all parameters*/
1044
- var element_<?php echo $element['name'] ?> = {
1045
- id : "<?php echo $element["name"]; ?>",
1046
- cpanel:"<?php echo $element['color_panel']; ?>",
1047
  themes:[],
1048
  colors:[]
1049
  };
@@ -1052,23 +1052,23 @@ class WDI_admin_view {
1052
  /*add themes to variable*/
1053
  for($i=0; $i<sizeof($opt_val['themes']); $i++):
1054
  ?>
1055
- element_<?php echo $element['name']; ?>.themes.push({name: "<?php echo $opt_val['themes'][$i]['name']; ?>", title: "<?php echo esc_attr($opt_val['themes'][$i]['title']); ?>"});
1056
  var theme_colors = {};
1057
  <?php
1058
  foreach ($opt_val['colors'][$i] as $color_name => $color){
1059
  ?>
1060
- theme_colors["<?php echo $color_name; ?>"] = { name: "<?php echo $color_name; ?>", val: "<?php echo $color['value']; ?>", def: "<?php echo $color['default']; ?>"};
1061
  <?php
1062
  }
1063
  /*add colors of every theme to variable */
1064
  ?>
1065
- element_<?php echo $element['name']; ?>.colors.push(theme_colors);
1066
  <?php
1067
  endfor;
1068
  ?>
1069
  /*refresh color panel on theme select change*/
1070
- jQuery('#<?php echo $element["name"]; ?>').on( "change", function() {
1071
- wdwt_elements.refresh_colorpanel(element_<?php echo $element['name'] ?>);
1072
  });
1073
 
1074
  });
@@ -1098,15 +1098,15 @@ class WDI_admin_view {
1098
 
1099
  $select_theme = $opt_val['select_theme'];
1100
  ?>
1101
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
1102
- <input type="text" class="hidden_field" id="theme_<?php echo sanitize_html_class($element['name']); ?>" hidden='hidden' name="<?php echo esc_attr($optionname.'[select_theme]'); ?>" value="<?php echo esc_attr($opt_val['select_theme']); ?>">
1103
- <input type="text" class="hidden_field" id="active_<?php echo sanitize_html_class($element['name']); ?>" hidden='hidden' name="<?php echo esc_attr($optionname.'[active]'); ?>" value="<?php echo esc_attr($opt_val['active']); ?>">
1104
  <?php foreach($opt_val['colors'] as $color_name => $color): ?>
1105
  <div class='wdwt_float'>
1106
  <span class="wdwt_color_title"><?php echo esc_html($element['color_names'][$color_name]); ?></span>
1107
  <div>
1108
- <input type="text" class="hidden_field" id="default_<?php echo sanitize_html_class($element['name'].'_'.$color_name); ?>" hidden='hidden' name="<?php echo esc_attr($optionname.'[colors]['.$color_name.']'.'[default]'); ?>" value="<?php echo esc_attr($color['default']); ?>">
1109
- <input type="text" class='color_input' id="value_<?php echo sanitize_html_class($element['name'].'_'.$color_name); ?>" name="<?php echo esc_attr($optionname.'[colors]['.$color_name.']'.'[value]'); ?>" value="<?php echo esc_attr($color['value']); ?>" data-default-color="<?php echo esc_attr($color['default']); ?>" style="background-color:<?php echo $color['value']; ?>;">
1110
  </div>
1111
  </div>
1112
  <?php endforeach; ?>
@@ -1147,15 +1147,15 @@ class WDI_admin_view {
1147
  }
1148
  ?>
1149
 
1150
- <div class="wdwt_param" id="wdwt_wrap_<?php echo sanitize_html_class($element['name']); ?>">
1151
 
1152
- <div class="wdwt_diagram wdwt_diagram_<?php echo sanitize_html_class($element['name']); ?> last_percent" id="wdwt_diagram_<?php echo sanitize_html_class($element['name']); ?>_0">
1153
  <!-- Percent TITLE -->
1154
  <div class="diagram-from-base_title">
1155
  <div valign="middle">
1156
  <h2><?php esc_html_e("Title", WDWT_LANG); ?></h2>
1157
  </div>
1158
- <div><input type="text" id="<?php echo sanitize_html_class($element['name']); ?>_title_0" class="diagram_title_group" value="" /></div>
1159
  </div>
1160
  <!-- percent DESCRIPTION -->
1161
  <div class="diagram-from-base_desc" style="margin-bottom:3%;">
@@ -1163,52 +1163,52 @@ class WDI_admin_view {
1163
  <h2><?php esc_html_e("Percent", WDWT_LANG); ?></h2>
1164
  </div>
1165
  <div>
1166
- <input type="text" class="diagram_percent_group" id="<?php echo sanitize_html_class($element['name']); ?>_percent_0" value="" />%
1167
- <input type="button" class="<?php echo sanitize_html_class($element['name']); ?>_remove-percent wdwt_btn_red" id="<?php echo sanitize_html_class($element['name']); ?>_remove-button_0" value="<?php esc_attr_e("Remove this percent", WDWT_LANG); ?>" />
1168
  </div>
1169
  </div>
1170
  </div>
1171
 
1172
  <div class="diagram-controls">
1173
  <div>
1174
- <input type="hidden" name="<?php echo esc_attr($optionname_title); ?>" id="<?php echo sanitize_html_class($element['name']); ?>_titles" data-customize-setting-link="<?php echo esc_attr($optionname_title); ?>" value="<?php echo esc_attr($diagram_title); ?>" >
1175
- <input type="hidden" name="<?php echo esc_attr($optionname_percent); ?>" id="<?php echo sanitize_html_class($element['name']); ?>_percents" data-customize-setting-link="<?php echo esc_attr($optionname_percent); ?>" value="<?php echo esc_attr($diagram_percent); ?>" >
1176
- <input class="add_percent wdwt_btn_blue" type="button" id="<?php echo sanitize_html_class($element['name']); ?>_add-button" value="<?php esc_attr_e('Add new percent value', WDWT_LANG); ?>" />
1177
  </div>
1178
  </div>
1179
  </div>
1180
  <script type="text/javascript">
1181
  jQuery(document).ready(function(){
1182
 
1183
- var element_<?php echo $element["name"]; ?> = {
1184
- id : "<?php echo $element['name']; ?>",
1185
- titles : jQuery('#<?php echo $element['name']; ?>_titles').val(),
1186
- percents : jQuery('#<?php echo $element['name']; ?>_percents').val(),
1187
  active : 0,
1188
- number_percents : wdwt_elements.diagram.len(jQuery('#<?php echo $element['name']; ?>_titles').val()),
1189
  };
1190
  /*init show*/
1191
- wdwt_elements.diagram.init(element_<?php echo $element["name"]; ?>);
1192
- wdwt_elements.diagram.show(element_<?php echo $element["name"]; ?>);
1193
  /*watch for changes in values*/
1194
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on("change", ".diagram_title_group", function (){
1195
- var index = wdwt_elements.diagram.find_index(jQuery(this), "<?php echo $element['name']; ?>_title_");
1196
- wdwt_elements.diagram.edit(element_<?php echo $element["name"]; ?>, index, "title");
1197
  });
1198
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on("change", ".diagram_percent_group", function (){
1199
- var index = wdwt_elements.diagram.find_index(jQuery(this), "<?php echo $element['name']; ?>_percent_");
1200
- wdwt_elements.diagram.edit(element_<?php echo $element["name"]; ?>, index, "percent");
1201
  });
1202
  /*add new percent*/
1203
- jQuery("#<?php echo $element['name']; ?>_add-button").on('click', function(){
1204
- after = element_<?php echo $element["name"]; ?>.number_percents-1;
1205
- wdwt_elements.diagram.insert(element_<?php echo $element["name"]; ?>, after, '');
1206
  });
1207
  /*remove percent*/
1208
- jQuery("#wdwt_wrap_<?php echo $element['name']; ?>").on('click', ".<?php echo $element['name']; ?>_remove-percent", function(){
1209
- var index = wdwt_elements.diagram.find_index(jQuery(this), "<?php echo $element['name']; ?>_remove-button_");
1210
- element_<?php echo $element["name"]; ?>.active = index;
1211
- wdwt_elements.diagram.remove(element_<?php echo $element["name"]; ?>);
1212
  });
1213
  });
1214
  </script>
@@ -1303,8 +1303,8 @@ class WDI_admin_view {
1303
  }
1304
  ?>
1305
  <span class="pagination-links">
1306
- <a class="<?php echo sanitize_html_class($first_page); ?>" title="Go to the first page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,-2);">«</a>
1307
- <a class="<?php echo sanitize_html_class($prev_page); ?>" title="Go to the previous page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,-1);">‹</a>
1308
  <span class="paging-input">
1309
  <span class="total-pages">
1310
  <input class="current_page" id="current_page" name="current_page" value="<?php echo esc_attr($page_number); ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
@@ -1313,8 +1313,8 @@ class WDI_admin_view {
1313
  <?php echo esc_html($items_county); ?>
1314
  </span>
1315
  </span>
1316
- <a class="<?php echo sanitize_html_class($next_page); ?>" title="Go to the next page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,1);">›</a>
1317
- <a class="<?php echo sanitize_html_class($last_page); ?>" title="Go to the last page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,2);">»</a>
1318
  <?php
1319
  }
1320
  ?>
25
  public function link_button($element, $context = 'option', $opt_val = '', $meta=array()){
26
  global $wdi_options;
27
  ?>
28
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
29
  <div class="block margin">
30
+ <a href="<?php echo esc_url($element['href']); ?>" id="<?php echo esc_attr($element['name']); ?>" class="button" style="text-decoration:none;"><?php echo (isset($element['value']))?esc_html($element['value']):esc_html($element['title']); ?></a>
31
  </div>
32
  <?php if(isset($element['description'])){ ?>
33
  <p style="font-style: italic;"><?php echo $element['description']; ?></p>
45
  public function button($element, $context = 'option', $opt_val = '', $meta=array()){
46
  global $wdi_options;
47
  ?>
48
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
49
  <div class="block margin">
50
  <div class="optioninput checkbox">
51
+ <span id="<?php echo esc_attr($element['name']); ?>" class="button" style="text-decoration:none;"><?php echo esc_html($element['title']); ?></span>
52
  </div>
53
  </div>
54
  <script>
55
  jQuery(document).ready(function () {
56
  /*init*/
57
+ var element_<?php echo esc_attr($element['name']); ?> = {
58
+ id : "<?php echo esc_attr($element['name']); ?>",
59
  show : [
60
  <?php
61
  foreach ($element['show'] as $element_to_show) :
72
  ]
73
  };
74
 
75
+ wdwt_elements.button_toggle(element_<?php echo esc_attr($element['name']); ?>);
76
  /*change on click*/
77
+ jQuery('#<?php echo esc_attr($element['name']); ?>').on( "click", function() {
78
+ wdwt_elements.button_toggle(element_<?php echo esc_attr($element['name']); ?>);
79
  });
80
 
81
  });
105
  }
106
  $opt_val = trim($opt_val);
107
  ?>
108
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
109
  <div class="block margin">
110
  <div class="optioninput checkbox">
111
+ <input type="checkbox" class="checkbox" name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']); ?>" <?php checked($opt_val || $opt_val =='on'); ?> <?php $this->custom_attrs($element); ?> value="1">
112
  </div>
113
  </div>
114
  </div>
138
  $opt_val = trim($opt_val);
139
 
140
  ?>
141
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
142
  <div class="block margin">
143
  <div class="optioninput checkbox">
144
+ <input type="checkbox" class="checkbox" name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']); ?>" <?php checked($opt_val || $opt_val =='on'); ?> <?php $this->custom_attrs($element); ?> value="<?php echo esc_attr($opt_val); ?>">
145
  </div>
146
  </div>
147
  </div>
149
  jQuery(document).ready(function () {
150
  /*init*/
151
 
152
+ var element_<?php echo esc_attr($element['name']); ?> = {
153
+ id : "<?php echo esc_attr($element['name']); ?>",
154
  show : [
155
  <?php
156
  foreach ($element['show'] as $element_to_show) :
167
  ]
168
  };
169
 
170
+ wdwt_elements.checkbox_open(element_<?php echo esc_attr($element['name']); ?>);
171
  /*change on click*/
172
+ jQuery('#<?php echo esc_attr($element['name']); ?>').on( "click", function() {
173
+ wdwt_elements.checkbox_open(element_<?php echo esc_attr($element['name']); ?>);
174
  });
175
 
176
  });
193
  $opt_val = $wdi_options[$element['name']];
194
  }
195
  ?>
196
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
197
  <div class='wdwt_float'>
198
  <div>
199
+ <input type="text" class='color_input' id="<?php echo esc_attr($element['name']); ?>" name="<?php echo esc_attr($optionname); ?>" value="<?php echo esc_attr($opt_val); ?>" data-default-color="<?php echo esc_attr($element['default']); ?>" <?php $this->custom_attrs($element); ?> style="background-color:<?php echo esc_attr($opt_val); ?>;">
200
  </div>
201
  </div>
202
  </div>
214
  $input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
215
  $optionname = WDI_OPT . '[' . $element['name'] . ']';
216
  ?>
217
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
218
  <div class="block">
219
  <?php WDILibrary::add_auth_button(''); ?>
220
  <div class="wdi_more_token_template" style="display: none;">
258
  $input_size = isset($element["input_size"]) ? $element["input_size"] : $this->params["input_size"];
259
 
260
  ?>
261
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
262
  <div class="block">
263
  <div class="optioninput">
264
+ <input <?php echo $readonly;?> type=<?php echo isset($element['input_type']) ? esc_attr($element['input_type']) : 'text'?> name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']);?>"
265
  <?php echo isset($element['required'])? 'required' : ''; $this->custom_attrs($element); ?>
266
  value="<?php echo esc_attr($opt_val); ?>" size="<?php echo esc_attr($input_size); ?>"
267
  <?php if(isset($element['attr'])) {echo $element['attr']['name'] . '="' .$element["attr"]["value"].'"';} ?>>
296
  }
297
 
298
  ?>
299
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
300
  <?php
301
  foreach ( $element['valid_options'] as $key => $option ) {
302
  ?>
328
  }
329
 
330
  ?>
331
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
332
  <?php
333
  foreach ( $element['valid_options'] as $key => $option ) {
334
  ?>
340
  <script>
341
  jQuery(document).ready(function () {
342
  /*init*/
343
+ var element_<?php echo esc_attr($element['name']); ?> = {
344
  name : "<?php echo $optionname; ?>",
345
  show : [
346
  <?php
376
  ]
377
  };
378
 
379
+ wdwt_elements.radio_open(element_<?php echo esc_attr($element['name']); ?>);
380
  /*shor or hide on change*/
381
  jQuery('input[type=radio][name="<?php echo $optionname; ?>"]').on( "change", function() {
382
+ wdwt_elements.radio_open(element_<?php echo esc_attr($element['name']); ?>);
383
  });
384
 
385
  });
411
  }
412
  ?>
413
 
414
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
415
  <?php
416
  $img_h = intval($element['img_height']) / sizeof($element['valid_options']);
417
  foreach($element['valid_options'] as $option) { ?>
451
  }
452
  ?>
453
 
454
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
455
  <?php
456
  $img_h = intval($element['img_height']) / sizeof($element['valid_options']);
457
  foreach($element['valid_options'] as $option) { ?>
466
  <script>
467
  jQuery(document).ready(function () {
468
  /*init*/
469
+ var element_<?php echo esc_html($element["name"]); ?> = {
470
+ name : "<?php echo esc_attr($optionname); ?>",
471
  show : [
472
  <?php
473
  foreach ($element['show'] as $key => $value) :
474
+ echo "{key: '" . esc_attr($key) ."', val: [" ;
475
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
476
  foreach ($value as $item){
477
+ echo "'".esc_attr($item)."',";
478
  }
479
  }
480
  else{/*single item name string */
481
+ echo "'".esc_attr($value)."',";
482
  }
483
  echo "]},";
484
  endforeach;
487
  hide : [
488
  <?php
489
  foreach ($element['hide'] as $key => $value) :
490
+ echo "{key: '" . esc_attr($key) ."', val: [" ;
491
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
492
  foreach ($value as $item){
493
+ echo "'".esc_attr($item)."',";
494
  }
495
  }
496
  else{/*single item name string */
497
+ echo "'".esc_attr($value)."',";
498
  }
499
  echo "]},";
500
  endforeach;
502
  ]
503
  };
504
 
505
+ wdwt_elements.radio_open(element_<?php echo esc_attr($element["name"]); ?>);
506
  /*shor or hide on change*/
507
+ jQuery('input[type=radio][name="<?php echo esc_attr($optionname); ?>"]').on( "change", function() {
508
+ wdwt_elements.radio_open(element_<?php echo esc_attr($element["name"]); ?>);
509
  });
510
 
511
  });
539
  $width = isset($element["width"]) ? intval($element["width"]) : $this->params["select_width"];
540
  $disabled = isset($element["disabled"]) ? $element["disabled"] : array();
541
  ?>
542
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
543
  <div class="block">
544
  <div class="optioninput">
545
+ <select name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']) ?>" <?php echo $multiple ? 'multiple="multiple"' : ''; ?> <?php $this->custom_attrs($element); ?> style="width:<?php echo $width; ?>px; resize:vertical;">
546
  <?php foreach($element['valid_options'] as $key => $value){ ?>
547
  <option value="<?php echo esc_attr($key) ?>" <?php selected(true, in_array($key, $opt_val)); ?> <?php echo in_array($key, $disabled) ? 'disabled="disabled"' : ''; ?>>
548
  <?php echo esc_html($value); ?>
577
  $width = isset($element["width"]) ? intval($element["width"]) : $this->params["select_width"];
578
 
579
  ?>
580
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
581
 
582
+ <select name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']) ?>" <?php echo $multiple ? 'multiple="multiple"' : ''; ?> <?php $this->custom_attrs($element); ?> style="width:<?php echo $width; ?>px; resize:vertical;">
583
  <?php
584
  foreach($element['valid_options'] as $key => $value){ ?>
585
  <option value="<?php echo esc_attr($key); ?>" <?php selected(true, in_array($key, $opt_val)); ?>><?php echo esc_html($value); ?></option>
590
  jQuery(document).ready(function () {
591
  /*init*/
592
 
593
+ var element_<?php echo esc_attr($element["name"]); ?> = {
594
+ id : "<?php echo esc_attr($element['name']); ?>",
595
  show : [
596
  <?php
597
  foreach ($element['show'] as $key => $value) :
598
+ echo "{key: '" . esc_attr($key) ."', val: [" ;
599
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
600
  foreach ($value as $item){
601
+ echo "'".esc_attr($item)."',";
602
  }
603
  }
604
  else{/*single item name string */
605
+ echo "'".esc_attr($value)."',";
606
  }
607
  echo "]},";
608
  endforeach;
611
  hide : [
612
  <?php
613
  foreach ($element['hide'] as $key => $value) :
614
+ echo "{key: '" . esc_attr($key) ."', val: [" ;
615
  if(gettype ($value)=='array'){ /*many items. array of strings of names*/
616
  foreach ($value as $item){
617
+ echo "'".esc_attr($item)."',";
618
  }
619
  }
620
  else{/*single item name string */
621
+ echo "'".esc_attr($value)."',";
622
  }
623
  echo "]},";
624
  endforeach;
628
 
629
 
630
 
631
+ wdwt_elements.select_open(element_<?php echo esc_attr($element["name"]); ?>);
632
  /*change on click*/
633
+ jQuery('#<?php echo esc_attr($element["name"]); ?>').on( "change", function() {
634
+ wdwt_elements.select_open(element_<?php echo esc_attr($element["name"]); ?>);
635
  });
636
 
637
  });
660
  $width = isset($element["width"]) ? $element["width"] : $this->params["select_width"];
661
 
662
  ?>
663
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
664
+ <select name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']); ?>" <?php $this->custom_attrs($element); ?> style="width:<?php echo esc_attr($width);?>px;">
665
  <?php
666
  foreach($element['valid_options'] as $key => $value){ ?>
667
  <option value="<?php echo esc_attr($key); ?>" <?php selected(true, in_array($key, $opt_val)); ?>><?php echo esc_html($value); ?></option>
675
  jQuery(document).ready(function () {
676
  /*init*/
677
 
678
+ var element_<?php echo esc_attr($element["name"]); ?> = {
679
+ id : "<?php echo esc_attr($element["name"]); ?>",
680
+ text_preview : "<?php echo esc_attr($element['text_preview']); ?>",
681
+ style_param : "<?php echo esc_attr($element['style_param']); ?>",
682
  };
683
 
684
+ wdwt_elements.select_style(element_<?php echo esc_attr($element["name"]); ?>);
685
  /*change preview text*/
686
+ jQuery('#<?php echo esc_attr($element["name"]); ?>').on( "change", function() {
687
+ wdwt_elements.select_style(element_<?php echo esc_attr($element["name"]); ?>);
688
  });
689
 
690
  });
716
  $textarea_w = isset($element["width"]) ? $element["width"] : $this->params["textarea_width"];
717
  $textarea_h = isset($element["height"]) ? $element["height"] : $this->params["textarea_height"];
718
  ?>
719
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
720
  <div class="block">
721
  <div class="optioninput">
722
+ <textarea name="<?php echo esc_attr($optionname); ?>" id="<?php echo esc_attr($element['name']); ?>" <?php $this->custom_attrs($element); ?> style="width:<?php echo esc_attr($textarea_w); ?>px; height:<?php echo esc_attr($textarea_h); ?>px;"><?php echo esc_html($opt_val); ?></textarea>
723
  </div>
724
  </div>
725
  </div>
740
  global $wdi_options;
741
  ?>
742
 
743
+ <div class="font_preview_wrap" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
744
  <label class="typagrphy_label" for="" style="font-size:18px;font-size: 20px;font-family: Segoe UI;"><?php echo __('Preview', WDWT_LANG ); ?></label>
745
  <div class="font_preview">
746
+ <div class="optioninput-preview" id="<?php echo esc_attr($element['name']); ?>" style="margin-top: 14px; margin-bottom: 23px;" ><?php
747
  $theme = wp_get_theme();
748
  echo esc_html($theme->description);
749
  ?></div>
802
  };
803
 
804
  /*setup the var*/
805
+ jQuery('#uploader_<?php echo esc_attr($element['name']); ?>').on('click', function () {
806
 
807
+ window.parent.uploadID = jQuery(this).prev('#<?php echo esc_attr($element['name']); ?>');
808
  /*grab the specific input*/
809
  /*formfield = jQuery('.upload').attr('name');*/
810
+ tb_show('', 'media-upload.php?type=<?php echo esc_attr($filetype);?>&amp;TB_iframe=true');
811
  return false;
812
  });
813
  window.send_to_editor = function (html) {
822
  /*jQuery(".slide_tab").prev().parent().prev().css("display","none");*/
823
  });
824
  </script>
825
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
826
  <div class="optioninput" id="upload_images">
827
+ <input type="text" class="upload" id="<?php echo esc_attr($element["name"]); ?>" name="<?php echo esc_attr($optionname); ?>" size="<?php echo esc_attr($upload_size); ?>" <?php $this->custom_attrs($element); ?> value="<?php echo esc_url($opt_val); ?>"/>
828
+ <input class="upload-button button" type="button" id="uploader_<?php echo esc_attr($element['name']); ?>" value="<?php esc_attr_e('Upload Image', WDWT_LANG); ?>"/>
829
  </div>
830
  </div>
831
  <?php
869
  $filetype = (isset($element["filetype"]) && $element_filetype != '') ? $element["filetype"] : $this->params["upload_filetype"];
870
  ?>
871
 
872
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
873
 
874
+ <div class="wdwt_slide wdwt_slide_<?php echo esc_attr($element['name']); ?> last_slide" id="wdwt_slide_<?php echo esc_attr($element['name']); ?>_0">
875
  <!-- Image URL -->
876
  <div class="slide-from-base_url" style="margin-bottom:3%;">
877
  <div valign="middle"><h2><?php esc_html_e("Image URL",WDWT_LANG); ?></h2></div>
878
  <div>
879
+ <input type="text" id="<?php echo esc_attr($element['name']); ?>_url_0" size="50" value="" class="upload image_links_group" >
880
 
881
+ <input type="button" class="<?php echo esc_attr($element['name']); ?>_update-image slide_but_up" id="<?php echo esc_attr($element['name']); ?>_update-button_0" value="<?php esc_attr_e("Update image", WDWT_LANG); ?>">
882
 
883
+ <input type="button" class="<?php echo esc_attr($element['name']); ?>_remove-image slide_but_rem wdwt_btn_red" id="<?php echo esc_attr($element['name']); ?>_remove-button_0" value="<?php esc_attr_e("Remove this slide", WDWT_LANG); ?>" />
884
  </div>
885
  </div>
886
  <!-- Image -->
887
  <div class="slide-from-base_image">
888
+ <div><img style="width:82%;" id="<?php echo esc_attr($element['name']); ?>_img_0" src="" /></div>
889
  </div>
890
  <!-- Image HREF -->
891
  <div class="slide-from-base_href">
892
  <div valign="middle"><h2><?php esc_html_e("Image Href", WDWT_LANG); ?></h2></div>
893
+ <div><input type="text" id="<?php echo esc_attr($element['name']); ?>_href_0" class="image_href_group" value="" /></div>
894
  </div>
895
  <!-- Image TITLE -->
896
  <div class="slide-from-base_title">
897
  <div valign="middle">
898
  <h2><?php esc_html_e("Image Title", WDWT_LANG); ?></h2>
899
  </div>
900
+ <div><input type="text" id="<?php echo esc_attr($element['name']); ?>_title_0" class="image_title_group" value="" /></div>
901
  </div>
902
  <!-- Image DESCRIPTION -->
903
  <div class="slide-from-base_desc" style="margin-bottom:3%;">
905
  <h2><?php esc_html_e("Image Description", WDWT_LANG); ?></h2>
906
  </div>
907
  <div>
908
+ <textarea class="image_descr_group" id="<?php echo esc_attr($element['name']); ?>_descr_0" style="width:236px; height:120px;"></textarea>
909
  </div>
910
  </div>
911
  </div>
918
  </h2>
919
  </div>
920
  <div>
921
+ <input type="hidden" name="<?php echo esc_attr($optionname_url); ?>" id="<?php echo esc_attr($element['name']); ?>_urls" data-customize-setting-link="<?php echo esc_url($optionname_url); ?>" value="<?php echo esc_attr($imgs_url); ?>" >
922
+ <input type="hidden" name="<?php echo esc_attr($optionname_href); ?>" id="<?php echo esc_attr($element['name']); ?>_hrefs" data-customize-setting-link="<?php echo esc_url($optionname_href); ?>" value="<?php echo esc_attr($imgs_href); ?>" >
923
+ <input type="hidden" name="<?php echo esc_attr($optionname_title); ?>" id="<?php echo esc_attr($element['name']); ?>_titles" data-customize-setting-link="<?php echo esc_attr($optionname_title); ?>" value="<?php echo esc_attr($imgs_title); ?>" >
924
+ <input type="hidden" name="<?php echo esc_attr($optionname_desc); ?>" id="<?php echo esc_attr($element['name']); ?>_descrs" data-customize-setting-link="<?php echo esc_attr($optionname_desc); ?>" value="<?php echo esc_attr($imgs_desc); ?>" >
925
+ <input class="upload_button_slide" type="button" id="<?php echo esc_attr($element['name']); ?>_add-button" value="<?php esc_attr_e('Add new slide', WDWT_LANG); ?>" />
926
  </div>
927
  </div>
928
  </div>
929
  <script type="text/javascript">
930
  jQuery(document).ready(function(){
931
 
932
+ var element_<?php echo esc_attr($element["name"]); ?> = {
933
+ id : "<?php echo esc_attr($element['name']); ?>",
934
+ urls : jQuery('#<?php echo esc_attr($element['name']); ?>_urls').val(),
935
+ hrefs : jQuery('#<?php echo esc_attr($element['name']); ?>_hrefs').val(),
936
+ titles : jQuery('#<?php echo esc_attr($element['name']); ?>_titles').val(),
937
+ descrs : jQuery('#<?php echo esc_attr($element['name']); ?>_descrs').val(),
938
  active : 0,
939
+ number_slides : wdwt_elements.slider.len(jQuery('#<?php echo esc_attr($element['name']); ?>_urls').val()),
940
  };
941
  /*init show*/
942
+ wdwt_elements.slider.init(element_<?php echo esc_attr($element["name"]); ?>);
943
+ wdwt_elements.slider.show(element_<?php echo esc_attr($element["name"]); ?>);
944
  /*firefox bug!*/
945
  jQuery('#customize-control-theme_portfolio_gallery_options-slider_head').find("*").on("focus",function(e){
946
  console.log(e);
947
  });
948
  /*watch for changes in values*/
949
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on("change", ".image_links_group" , function (){
950
+ var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_url_");
951
+ wdwt_elements.slider.edit(element_<?php echo esc_attr($element["name"]); ?>, index, "url");
952
  });
953
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on("change", ".image_href_group", function (){
954
+ var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_href_");
955
+ wdwt_elements.slider.edit(element_<?php echo esc_attr($element["name"]); ?>, index, "href");
956
  });
957
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on("change", ".image_title_group", function (){
958
+ var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_title_");
959
+ wdwt_elements.slider.edit(element_<?php echo esc_attr($element["name"]); ?>, index, "title");
960
  });
961
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on("change", ".image_descr_group", function (){
962
+ var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_descr_");
963
+ wdwt_elements.slider.edit(element_<?php echo esc_attr($element["name"]); ?>, index, "descr");
964
  });
965
  /*add new slide*/
966
+ jQuery("#<?php echo esc_attr($element['name']); ?>_add-button").on('click', function(){
967
  tb_show("", "media-upload.php?type=image&amp;TB_iframe=true");
968
  add_image=send_to_editor ;
969
  window.send_to_editor = function(html) {
970
  imgurl = jQuery("img",html).attr("src");
971
+ after = element_<?php echo esc_attr($element["name"]); ?>.number_slides-1;
972
+ wdwt_elements.slider.insert(element_<?php echo esc_attr($element["name"]); ?>, after, imgurl);
973
  tb_remove();
974
  };
975
  return false;
976
  });
977
  /*update image*/
978
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on('click', ".<?php echo esc_attr($element['name']); ?>_update-image", function(){
979
+ var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_update-button_");
980
  tb_show("", "media-upload.php?type=image&amp;TB_iframe=true");
981
  window.send_to_editor = function(html) {
982
  imgurl = jQuery("img",html).attr("src");
983
+ jQuery("#<?php echo esc_attr($element['name']); ?>_url_"+index).val(imgurl);
984
+ jQuery("#<?php echo esc_attr($element['name']); ?>_url_"+index).change();
985
  tb_remove();
986
  };
987
  return false;
988
  });
989
  /*remove slide*/
990
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on('click', ".<?php echo esc_attr($element['name']); ?>_remove-image", function(){
991
+ var index = wdwt_elements.slider.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_remove-button_");
992
+ element_<?php echo esc_attr($element['name']); ?>.active = index;
993
+ wdwt_elements.slider.remove(element_<?php echo esc_attr($element['name']); ?>);
994
  });
995
  });
996
  </script>
1029
  $current = $opt_val['active'];
1030
  $width = isset($element["width"]) ? $element["width"] : $this->params["select_width"];
1031
  ?>
1032
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
1033
+ <select name="<?php echo esc_attr($optionname); ?>[active]" id="<?php echo esc_attr($element['name']); ?>" <?php $this->custom_attrs($element); ?> style="width:<?php echo esc_attr($width); ?>px;">
1034
  <?php
1035
  for($i=0; $i<sizeof($element['default']['themes']); $i++){ ?>
1036
  <option value="<?php echo esc_attr($i) ?>" <?php selected( $current, $i); ?>> <?php echo esc_html($element['default']['themes'][$i]['title']); ?></option>
1041
  jQuery(document).ready(function () {
1042
 
1043
  /*create var storing all parameters*/
1044
+ var element_<?php echo esc_attr($element['name']) ?> = {
1045
+ id : "<?php echo esc_attr($element["name"]); ?>",
1046
+ cpanel:"<?php echo esc_attr($element['color_panel']); ?>",
1047
  themes:[],
1048
  colors:[]
1049
  };
1052
  /*add themes to variable*/
1053
  for($i=0; $i<sizeof($opt_val['themes']); $i++):
1054
  ?>
1055
+ element_<?php echo esc_attr($element['name']); ?>.themes.push({name: "<?php echo esc_attr($opt_val['themes'][$i]['name']); ?>", title: "<?php echo esc_attr($opt_val['themes'][$i]['title']); ?>"});
1056
  var theme_colors = {};
1057
  <?php
1058
  foreach ($opt_val['colors'][$i] as $color_name => $color){
1059
  ?>
1060
+ theme_colors["<?php echo $color_name; ?>"] = { name: "<?php echo esc_attr($color_name); ?>", val: "<?php echo esc_attr($color['value']); ?>", def: "<?php echo esc_attr($color['default']); ?>"};
1061
  <?php
1062
  }
1063
  /*add colors of every theme to variable */
1064
  ?>
1065
+ element_<?php echo esc_attr($element['name']); ?>.colors.push(theme_colors);
1066
  <?php
1067
  endfor;
1068
  ?>
1069
  /*refresh color panel on theme select change*/
1070
+ jQuery('#<?php echo esc_attr($element["name"]); ?>').on( "change", function() {
1071
+ wdwt_elements.refresh_colorpanel(element_<?php echo esc_attr($element['name']) ?>);
1072
  });
1073
 
1074
  });
1098
 
1099
  $select_theme = $opt_val['select_theme'];
1100
  ?>
1101
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
1102
+ <input type="text" class="hidden_field" id="theme_<?php echo esc_attr($element['name']); ?>" hidden='hidden' name="<?php echo esc_attr($optionname.'[select_theme]'); ?>" value="<?php echo esc_attr($opt_val['select_theme']); ?>">
1103
+ <input type="text" class="hidden_field" id="active_<?php echo esc_attr($element['name']); ?>" hidden='hidden' name="<?php echo esc_attr($optionname.'[active]'); ?>" value="<?php echo esc_attr($opt_val['active']); ?>">
1104
  <?php foreach($opt_val['colors'] as $color_name => $color): ?>
1105
  <div class='wdwt_float'>
1106
  <span class="wdwt_color_title"><?php echo esc_html($element['color_names'][$color_name]); ?></span>
1107
  <div>
1108
+ <input type="text" class="hidden_field" id="default_<?php echo esc_attr($element['name'].'_'.$color_name); ?>" hidden='hidden' name="<?php echo esc_attr($optionname.'[colors]['.$color_name.']'.'[default]'); ?>" value="<?php echo esc_attr($color['default']); ?>">
1109
+ <input type="text" class='color_input' id="value_<?php echo esc_attr($element['name'].'_'.$color_name); ?>" name="<?php echo esc_attr($optionname.'[colors]['.$color_name.']'.'[value]'); ?>" value="<?php echo esc_attr($color['value']); ?>" data-default-color="<?php echo esc_attr($color['default']); ?>" style="background-color:<?php echo $color['value']; ?>;">
1110
  </div>
1111
  </div>
1112
  <?php endforeach; ?>
1147
  }
1148
  ?>
1149
 
1150
+ <div class="wdwt_param" id="wdwt_wrap_<?php echo esc_attr($element['name']); ?>">
1151
 
1152
+ <div class="wdwt_diagram wdwt_diagram_<?php echo esc_attr($element['name']); ?> last_percent" id="wdwt_diagram_<?php echo esc_attr($element['name']); ?>_0">
1153
  <!-- Percent TITLE -->
1154
  <div class="diagram-from-base_title">
1155
  <div valign="middle">
1156
  <h2><?php esc_html_e("Title", WDWT_LANG); ?></h2>
1157
  </div>
1158
+ <div><input type="text" id="<?php echo esc_attr($element['name']); ?>_title_0" class="diagram_title_group" value="" /></div>
1159
  </div>
1160
  <!-- percent DESCRIPTION -->
1161
  <div class="diagram-from-base_desc" style="margin-bottom:3%;">
1163
  <h2><?php esc_html_e("Percent", WDWT_LANG); ?></h2>
1164
  </div>
1165
  <div>
1166
+ <input type="text" class="diagram_percent_group" id="<?php echo esc_attr($element['name']); ?>_percent_0" value="" />%
1167
+ <input type="button" class="<?php echo esc_attr($element['name']); ?>_remove-percent wdwt_btn_red" id="<?php echo esc_attr($element['name']); ?>_remove-button_0" value="<?php esc_attr_e("Remove this percent", WDWT_LANG); ?>" />
1168
  </div>
1169
  </div>
1170
  </div>
1171
 
1172
  <div class="diagram-controls">
1173
  <div>
1174
+ <input type="hidden" name="<?php echo esc_attr($optionname_title); ?>" id="<?php echo esc_attr($element['name']); ?>_titles" data-customize-setting-link="<?php echo esc_attr($optionname_title); ?>" value="<?php echo esc_attr($diagram_title); ?>" >
1175
+ <input type="hidden" name="<?php echo esc_attr($optionname_percent); ?>" id="<?php echo esc_attr($element['name']); ?>_percents" data-customize-setting-link="<?php echo esc_attr($optionname_percent); ?>" value="<?php echo esc_attr($diagram_percent); ?>" >
1176
+ <input class="add_percent wdwt_btn_blue" type="button" id="<?php echo esc_attr($element['name']); ?>_add-button" value="<?php esc_attr_e('Add new percent value', WDWT_LANG); ?>" />
1177
  </div>
1178
  </div>
1179
  </div>
1180
  <script type="text/javascript">
1181
  jQuery(document).ready(function(){
1182
 
1183
+ var element_<?php echo esc_attr($element["name"]); ?> = {
1184
+ id : "<?php echo esc_attr($element['name']); ?>",
1185
+ titles : jQuery('#<?php echo esc_attr($element['name']); ?>_titles').val(),
1186
+ percents : jQuery('#<?php echo esc_attr($element['name']); ?>_percents').val(),
1187
  active : 0,
1188
+ number_percents : wdwt_elements.diagram.len(jQuery('#<?php echo esc_attr($element['name']); ?>_titles').val()),
1189
  };
1190
  /*init show*/
1191
+ wdwt_elements.diagram.init(element_<?php echo esc_attr($element["name"]); ?>);
1192
+ wdwt_elements.diagram.show(element_<?php echo esc_attr($element["name"]); ?>);
1193
  /*watch for changes in values*/
1194
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on("change", ".diagram_title_group", function (){
1195
+ var index = wdwt_elements.diagram.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_title_");
1196
+ wdwt_elements.diagram.edit(element_<?php echo esc_attr($element["name"]); ?>, index, "title");
1197
  });
1198
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on("change", ".diagram_percent_group", function (){
1199
+ var index = wdwt_elements.diagram.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_percent_");
1200
+ wdwt_elements.diagram.edit(element_<?php echo esc_attr($element["name"]); ?>, index, "percent");
1201
  });
1202
  /*add new percent*/
1203
+ jQuery("#<?php echo esc_attr($element['name']); ?>_add-button").on('click', function(){
1204
+ after = element_<?php echo esc_attr($element['name']); ?>.number_percents-1;
1205
+ wdwt_elements.diagram.insert(element_<?php echo esc_attr($element['name']); ?>, after, '');
1206
  });
1207
  /*remove percent*/
1208
+ jQuery("#wdwt_wrap_<?php echo esc_attr($element['name']); ?>").on('click', ".<?php echo esc_attr($element['name']); ?>_remove-percent", function(){
1209
+ var index = wdwt_elements.diagram.find_index(jQuery(this), "<?php echo esc_attr($element['name']); ?>_remove-button_");
1210
+ element_<?php echo esc_attr($element['name']); ?>.active = index;
1211
+ wdwt_elements.diagram.remove(element_<?php echo esc_attr($element['name']); ?>);
1212
  });
1213
  });
1214
  </script>
1303
  }
1304
  ?>
1305
  <span class="pagination-links">
1306
+ <a class="<?php echo esc_attr($first_page); ?>" title="Go to the first page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,-2);">«</a>
1307
+ <a class="<?php echo esc_attr($prev_page); ?>" title="Go to the previous page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,-1);">‹</a>
1308
  <span class="paging-input">
1309
  <span class="total-pages">
1310
  <input class="current_page" id="current_page" name="current_page" value="<?php echo esc_attr($page_number); ?>" onkeypress="return check_enter_key(event)" title="Go to the page" type="text" size="1" />
1313
  <?php echo esc_html($items_county); ?>
1314
  </span>
1315
  </span>
1316
+ <a class="<?php echo esc_attr($next_page); ?>" title="Go to the next page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,1);">›</a>
1317
+ <a class="<?php echo esc_attr($last_page); ?>" title="Go to the last page" href="javascript:wdi_spider_page(<?php echo $page_number; ?>,2);">»</a>
1318
  <?php
1319
  }
1320
  ?>
framework/WDI_form_builder.php CHANGED
@@ -36,7 +36,7 @@ public function __construct() {
36
 
37
 
38
  ?>
39
- <div class="wdwt_param" id="WDI_wrap_<?php echo sanitize_html_class($element['name']); ?>">
40
  <div class="block">
41
  <div class="optioninput">
42
 
@@ -49,7 +49,7 @@ public function __construct() {
49
  }
50
  ?>
51
 
52
- <input type="<?php echo esc_attr($type); ?>" id="<?php echo sanitize_html_class($id); ?>" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($value); ?>"
53
  <?php echo $attr; ?> size="<?php echo esc_attr($input_size); ?>">
54
  <?php
55
  if($label!='' && $label['place']=='after'){
@@ -103,7 +103,7 @@ public function __construct() {
103
  }
104
  $attr = $attrs;
105
  ?>
106
- <div class="wdwt_param" id="WDI_wrap_<?php echo sanitize_html_class($element['name']); ?>">
107
  <div class="block">
108
  <div class="optioninput">
109
  <?php
@@ -114,7 +114,7 @@ public function __construct() {
114
  <?php
115
  }
116
  ?>
117
- <select name="<?php echo esc_attr($name); ?>" id="<?php echo sanitize_html_class($id); ?>" <?php echo $switched; ?> <?php echo $type; ?> style="<?php if($width!='') echo 'width:' .$width . ';';?> resize:vertical;" <?php echo $attr; ?>>
118
 
119
  <?php foreach($options as $key => $value){ ?>
120
  <option <?php echo (in_array($key, $disabled_options)) ? 'disabled' : '' ?> value="<?php echo esc_attr($key) ?>" <?php if($key==$opt_value){echo 'selected';}?>>
@@ -128,7 +128,7 @@ public function __construct() {
128
 
129
  ?>
130
  <?php echo isset($label['br'])? '<br/>' : ''?>
131
- <label class="<?php echo isset($label['class']) ? sanitize_html_class($label['class']) : '';?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
132
  <?php
133
  }
134
  if($disabled_text != ''){ ?>
@@ -144,29 +144,29 @@ public function __construct() {
144
  if($hide_ids != ''){
145
  ?>
146
  <style>
147
- .<?php echo $id.'_hide_ids_hidden';?>{
148
  display:none !important;
149
  }
150
  </style>
151
  <script>
152
  jQuery(document).ready(function(){
153
- var <?php echo $id.'_hide_ids';?> = <?php echo json_encode($hide_ids);?>;
154
- jQuery("#WDI_wrap_<?php echo $element['name'];?> select").on('change',function(){
155
- jQuery('.<?php echo $id.'_hide_ids_hidden';?>').each(function(){
156
- jQuery(this).removeClass('<?php echo $id.'_hide_ids_hidden';?>');
157
  });
158
  var selected = jQuery(this).val();
159
- for (var opt in <?php echo $id.'_hide_ids'?>){
160
  if(opt == selected){
161
- var ids = <?php echo $id.'_hide_ids'?>[opt].split(',');
162
  for (var i in ids){
163
- jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo $id.'_hide_ids_hidden';?>");
164
  }
165
  }
166
  }
167
  });
168
- jQuery("#WDI_wrap_<?php echo $element['name'];?> select").each(function(){
169
- var currentOption = "<?php echo $opt_value?>";
170
  if(jQuery(this).val() == currentOption){
171
  jQuery(this).trigger('change');
172
  }
@@ -209,23 +209,23 @@ public function __construct() {
209
  }
210
  $attr = $attrs;
211
  ?>
212
- <div class="wdwt_param" id="WDI_wrap_<?php echo sanitize_html_class($element['name']); ?>">
213
  <div class="block">
214
  <div class="optioninput">
215
  <?php if ( !empty($label['place']) && $label['place'] == 'before' ) { ?>
216
  <label for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
217
  <?php echo isset($label['br']) ? '<br/>' : ''; ?>
218
  <?php } ?>
219
- <select name="<?php echo esc_attr($name); ?>" id="<?php echo sanitize_html_class($id); ?>" <?php echo $type; ?> style="<?php if($width!='') echo 'width:' .$width . ';';?> resize:vertical;" <?php echo $attr; ?>>
220
  <option value=""><?php _e('Select', 'wd-instagram-feed'); ?></option>
221
  <?php foreach($options as $label => $values) { ?>
222
- <optgroup label="<?php echo ucfirst($label) ?>">
223
  <?php foreach ( $values as $key => $value ) {
224
  $selected = ( $key == $opt_value ) ? 'selected' : '';
225
- $data_type = 'data-type="' . $label . '"';
226
- $data_id = !empty($value['id']) ? 'data-id="' . $value['id'] . '"': '';
227
  ?>
228
- <option value="<?php echo esc_attr($key) ?>" <?php echo $selected; ?> <?php echo $data_id; echo $data_type;?>>
229
  <?php echo esc_html($value['name']); ?>
230
  </option>
231
  <?php } ?>
@@ -244,15 +244,15 @@ public function __construct() {
244
  </div>
245
  <?php if($hide_ids != ''){ ?>
246
  <style>
247
- .<?php echo $id.'_hide_ids_hidden';?>{
248
  display: none !important;
249
  }
250
  </style>
251
  <script>
252
  jQuery(document).ready(function(){
253
- var <?php echo $id.'_hide_ids';?> = <?php echo json_encode($hide_ids);?>;
254
- var hide_ids = <?php echo json_encode($hide_ids); ?>;
255
- var hide_class = '<?php echo $id.'_hide_ids_hidden'; ?>';
256
 
257
  function iterator(show) {
258
  for ( var i=0; i < hide_ids.length; i++ ) {
@@ -280,7 +280,7 @@ public function __construct() {
280
  }
281
  }
282
 
283
- jQuery(document).on('change', '#WDI_wrap_<?php echo $element['name'];?> select', function() {
284
  var element = jQuery(this).find('option:selected');
285
  var type = element.data('type');
286
  if ( typeof type != 'undefined' ) {
@@ -299,18 +299,18 @@ public function __construct() {
299
  iterator(false);
300
  }
301
  var selected = jQuery(this).val();
302
- for ( var opt in <?php echo $id.'_hide_ids'?> ) {
303
  if(opt == selected){
304
- var ids = <?php echo $id.'_hide_ids'?>[opt].split(',');
305
  for (var i in ids){
306
- jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo $id.'_hide_ids_hidden';?>");
307
  }
308
  }
309
  }
310
  });
311
 
312
- jQuery("#WDI_wrap_<?php echo $element['name'];?> select").each(function(){
313
- var currentOption = "<?php echo $opt_value?>";
314
  if(jQuery(this).val() == currentOption){
315
  jQuery(this).trigger('change');
316
  }
@@ -356,7 +356,7 @@ public function __construct() {
356
  }
357
 
358
  ?>
359
- <div class="wdwt_param" id="WDI_wrap_<?php echo sanitize_html_class($element['name']);?>">
360
  <div class="block">
361
  <div class="optioninput">
362
  <?php
@@ -376,7 +376,7 @@ public function __construct() {
376
  }
377
  }
378
  ?>
379
- <input <?php echo $disable;?> style="margin:2px;" type="radio" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($key); ?>" <?php checked($key,$opt_value); ?> <?php echo $attr; ?> id="<?php echo $option_name . "_" . $key;?>"/> <label for="<?php echo $option_name . "_" . $key;?>"><?php echo esc_html($option); ?></label>
380
  <?php if($disable_text != '') : ?>
381
  <?php if(isset($disabled_options['br'])) : ?>
382
  <br>
@@ -384,13 +384,13 @@ public function __construct() {
384
  <span class="wdi_pro_only"><?php echo esc_html($disable_text); ?></span>
385
  <?php endif;?>
386
 
387
- <?php echo $break;?>
388
  <?php
389
  }
390
  if($label!='' && $label['place']=='after'){
391
  ?>
392
  <?php echo isset($label['br'])? '<br/>' : ''?>
393
- <label class="<?php echo isset($label['class']) ? $label['class'] : '';?>" for="<?php echo $id; ?>"><?php echo $label['text']; ?></label>
394
  <?php
395
  }
396
  echo '</div></div></div>';
@@ -398,30 +398,30 @@ public function __construct() {
398
  if($hide_ids != ''){
399
  ?>
400
  <style>
401
- .<?php echo $id.'_hide_ids_hidden';?>{
402
  display:none !important;
403
  }
404
  </style>
405
  <script>
406
  jQuery(document).ready(function(){
407
- var <?php echo $id.'_hide_ids';?> = <?php echo json_encode($hide_ids);?>;
408
- jQuery("#WDI_wrap_<?php echo $element['name'];?> input").on('click',function(){
409
- jQuery('.<?php echo $id.'_hide_ids_hidden';?>').each(function(){
410
- jQuery(this).removeClass('<?php echo $id.'_hide_ids_hidden';?>');
411
  });
412
  var selected = jQuery(this).val();
413
- for (var opt in <?php echo $id.'_hide_ids'?>){
414
  if(opt == selected){
415
- var ids = <?php echo $id.'_hide_ids'?>[opt].split(',');
416
  for ( var i in ids ) {
417
- jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo $id.'_hide_ids_hidden';?>");
418
  }
419
  }
420
 
421
  }
422
  });
423
- jQuery("#WDI_wrap_<?php echo $element['name'];?> input").each(function(){
424
- var currentOption = "<?php echo $opt_value?>";
425
  if(jQuery(this).val() == currentOption){
426
  jQuery(this).trigger('click');
427
  }
@@ -432,30 +432,30 @@ public function __construct() {
432
  if($show_ids != ''){
433
  ?>
434
  <style>
435
- .<?php echo $id.'_show_ids_show';?>{
436
  display:block !important;
437
  }
438
  </style>
439
  <script>
440
  jQuery(document).ready(function(){
441
- var <?php echo $id.'_show_ids';?> = <?php echo json_encode($show_ids);?>;
442
- jQuery("#WDI_wrap_<?php echo $element['name'];?> input").on('click',function(){
443
- jQuery('.<?php echo $id.'_show_ids_show';?>').each(function(){
444
- jQuery(this).removeClass('<?php echo $id.'_show_ids_show';?>');
445
  });
446
  var selected = jQuery(this).val();
447
- for (var opt in <?php echo $id.'_show_ids'?>){
448
  if(opt == selected){
449
- var ids = <?php echo $id.'_show_ids'?>[opt].split(',');
450
  for (var i in ids){
451
- jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo $id.'_show_ids_show';?>");
452
  }
453
  }
454
 
455
  }
456
  });
457
- jQuery("#WDI_wrap_<?php echo $element['name'];?> input").each(function(){
458
- var currentOption = "<?php echo $opt_value?>";
459
  if(jQuery(this).val() == currentOption){
460
  jQuery(this).trigger('click');
461
  }
@@ -499,23 +499,23 @@ public function __construct() {
499
 
500
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
501
  ?>
502
- <div class="wdwt_param" id="WDI_wrap_<?php echo sanitize_html_class($element['name']);?>">
503
  <div class="block margin">
504
  <div class="optioninput checkbox">
505
  <?php
506
  if($label!='' && $label['place']=='before'){
507
  ?>
508
- <label class="<?php echo isset($label['class']) ? sanitize_html_class($label['class']) : '' ?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
509
  <?php echo isset($label['br'])? '<br/>' : ''?>
510
  <?php
511
  }
512
  ?>
513
- <input <?php echo $disable; ?> type="checkbox" class="checkbox" name="<?php echo esc_attr($name); ?>" id="<?php echo sanitize_html_class($id) ?>" <?php echo $attr;?> <?php checked(1,$opt_value)?> value="1">
514
  <?php
515
  if($label!='' && $label['place']=='after'){
516
  ?>
517
  <?php echo isset($label['br'])? '<br/>' : ''?>
518
- <label class="<?php echo isset($label['class']) ? sanitize_html_class($label['class']) : '' ?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
519
  <?php
520
  }
521
  ?>
@@ -524,19 +524,19 @@ public function __construct() {
524
  </div>
525
  <style>
526
  <?php if(!empty($hide_ids)){
527
- echo '.'.$id.'_hide_ids_hidden{display:none !important;}';
528
  }
529
  ?>
530
  </style>
531
  <script>
532
  jQuery(document).ready(function(){
533
 
534
- var el = jQuery('#<?php echo ''.$id?>');
535
- var hide_ids = <?php echo json_encode($hide_ids); ?>;
536
- var hide_class = '<?php echo $id.'_hide_ids_hidden'; ?>';
537
 
538
  if(el.prop('checked') != true){
539
- el.after('<input type=\"hidden\" name=\"' + jQuery("#<?php echo ''.$id?>").attr("name") + '\" value="0">');
540
  }
541
 
542
  el.on('click',function(){
@@ -585,28 +585,28 @@ public function __construct() {
585
  <div class="wdi_howto_wrapper">
586
  <h2>Shortcode</h2>
587
  <h4>Copy and paste this shortcode into your posts or pages:</h4>
588
- <input type="text" class="wdi_howto_shortcode" value='[wdi_feed id="<?php echo $feed_id; ?>"]' onclick="wdi_select_focus_element(this)" size="11" readonly="readonly" />
589
  </div>
590
  </div>
591
  <div class="wdi_howto_content">
592
  <div class="wdi_howto_wrapper">
593
  <h2>Page or Post editor</h2>
594
  <h4>Insert it into an existing post with the button:</h4>
595
- <img src="<?php echo WDI_URL.'/images/how_to_publish_shortcode.png'; ?>">
596
  </div>
597
  </div>
598
  <div class="wdi_howto_content">
599
  <div class="wdi_howto_wrapper">
600
  <h2>PHP code</h2>
601
  <h4>Copy and paste the PHP code into your template file:</h4>
602
- <input type="text" class="wdi_howto_phpcode" value="&#60;?php echo wdi_feed(array('id'=>'<?php echo $feed_id; ?>')); ?&#62;" onclick="wdi_select_focus_element(this)" size="17" readonly="readonly" />
603
  </div>
604
  </div>
605
  <div class="wdi_howto_content">
606
  <div class="wdi_howto_wrapper">
607
  <h2>Widget</h2>
608
  <h4>Add Instagram Feed Widget to your site:</h4>
609
- <img src="<?php echo WDI_URL.'/images/how_to_publish_widget.png'; ?>">
610
  </div>
611
  </div>
612
  </div>
@@ -647,18 +647,18 @@ public function __construct() {
647
  }
648
  }
649
  ?>
650
- <div class="wdwt_param" id="WDI_wrap_<?php echo sanitize_html_class($element['name']);?>">
651
  <div class='wdwt_float' >
652
  <div>
653
- <input type="text" class='color_input' id="<?php echo sanitize_html_class($id) ?>" <?php echo $attr;?> name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($opt_value); ?>" data-default-color="<?php echo esc_attr($defaults[$element['name']]); ?>" style="background-color:<?php echo esc_attr($opt_value); ?>;">
654
  </div>
655
  </div>
656
  </div>
657
  <script type="text/javascript">
658
  jQuery(document).ready(function() {
659
  jQuery('.color_input').wpColorPicker();
660
- jQuery('#WDI_wrap_<?php echo $element['name'];?> .wp-picker-container').attr('tab','<?php echo $tab;?>');
661
- jQuery('#WDI_wrap_<?php echo $element['name'];?> .wp-picker-container').attr('section','<?php echo $section;?>');
662
  });
663
  </script>
664
  <?php
36
 
37
 
38
  ?>
39
+ <div class="wdwt_param" id="WDI_wrap_<?php echo esc_attr($element['name']); ?>">
40
  <div class="block">
41
  <div class="optioninput">
42
 
49
  }
50
  ?>
51
 
52
+ <input type="<?php echo esc_attr($type); ?>" id="<?php echo esc_attr($id); ?>" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($value); ?>"
53
  <?php echo $attr; ?> size="<?php echo esc_attr($input_size); ?>">
54
  <?php
55
  if($label!='' && $label['place']=='after'){
103
  }
104
  $attr = $attrs;
105
  ?>
106
+ <div class="wdwt_param" id="WDI_wrap_<?php echo esc_attr($element['name']); ?>">
107
  <div class="block">
108
  <div class="optioninput">
109
  <?php
114
  <?php
115
  }
116
  ?>
117
+ <select name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id); ?>" <?php echo esc_attr($switched); ?> <?php echo esc_attr($type); ?> style="<?php if($width!='') echo 'width:' .esc_attr($width) . ';';?> resize:vertical;" <?php echo $attr; ?>>
118
 
119
  <?php foreach($options as $key => $value){ ?>
120
  <option <?php echo (in_array($key, $disabled_options)) ? 'disabled' : '' ?> value="<?php echo esc_attr($key) ?>" <?php if($key==$opt_value){echo 'selected';}?>>
128
 
129
  ?>
130
  <?php echo isset($label['br'])? '<br/>' : ''?>
131
+ <label class="<?php echo isset($label['class']) ? esc_attr($label['class']) : '';?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
132
  <?php
133
  }
134
  if($disabled_text != ''){ ?>
144
  if($hide_ids != ''){
145
  ?>
146
  <style>
147
+ .<?php echo esc_attr($id).'_hide_ids_hidden';?>{
148
  display:none !important;
149
  }
150
  </style>
151
  <script>
152
  jQuery(document).ready(function(){
153
+ var <?php echo esc_attr($id).'_hide_ids';?> = <?php echo str_replace('&quot;','"', esc_attr(json_encode($hide_ids)));?>;
154
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> select").on('change',function(){
155
+ jQuery('.<?php echo esc_attr($id).'_hide_ids_hidden';?>').each(function(){
156
+ jQuery(this).removeClass('<?php echo esc_attr($id).'_hide_ids_hidden';?>');
157
  });
158
  var selected = jQuery(this).val();
159
+ for (var opt in <?php echo esc_attr($id).'_hide_ids'?>){
160
  if(opt == selected){
161
+ var ids = <?php echo esc_attr($id).'_hide_ids'?>[opt].split(',');
162
  for (var i in ids){
163
+ jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo esc_attr($id).'_hide_ids_hidden';?>");
164
  }
165
  }
166
  }
167
  });
168
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> select").each(function(){
169
+ var currentOption = "<?php echo esc_attr($opt_value)?>";
170
  if(jQuery(this).val() == currentOption){
171
  jQuery(this).trigger('change');
172
  }
209
  }
210
  $attr = $attrs;
211
  ?>
212
+ <div class="wdwt_param" id="WDI_wrap_<?php echo esc_attr($element['name']); ?>">
213
  <div class="block">
214
  <div class="optioninput">
215
  <?php if ( !empty($label['place']) && $label['place'] == 'before' ) { ?>
216
  <label for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
217
  <?php echo isset($label['br']) ? '<br/>' : ''; ?>
218
  <?php } ?>
219
+ <select name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id); ?>" <?php echo esc_attr($type); ?> style="<?php if($width!='') echo 'width:' .esc_attr($width) . ';';?> resize:vertical;" <?php echo $attr; ?>>
220
  <option value=""><?php _e('Select', 'wd-instagram-feed'); ?></option>
221
  <?php foreach($options as $label => $values) { ?>
222
+ <optgroup label="<?php echo ucfirst(esc_attr($label)) ?>">
223
  <?php foreach ( $values as $key => $value ) {
224
  $selected = ( $key == $opt_value ) ? 'selected' : '';
225
+ $data_type = 'data-type="' . esc_attr($label) . '"';
226
+ $data_id = !empty($value['id']) ? 'data-id="' . esc_attr($value['id']) . '"': '';
227
  ?>
228
+ <option value="<?php echo esc_attr($key) ?>" <?php echo esc_attr($selected); ?> <?php echo esc_attr($data_id); echo esc_attr($data_type);?>>
229
  <?php echo esc_html($value['name']); ?>
230
  </option>
231
  <?php } ?>
244
  </div>
245
  <?php if($hide_ids != ''){ ?>
246
  <style>
247
+ .<?php echo esc_attr($id).'_hide_ids_hidden';?>{
248
  display: none !important;
249
  }
250
  </style>
251
  <script>
252
  jQuery(document).ready(function(){
253
+ var <?php echo esc_attr($id).'_hide_ids';?> = <?php echo str_replace('&quot;','"', esc_attr(json_encode($hide_ids)));?>;
254
+ var hide_ids = <?php echo str_replace('&quot;','"', esc_attr(json_encode($hide_ids))); ?>;
255
+ var hide_class = '<?php echo esc_attr($id).'_hide_ids_hidden'; ?>';
256
 
257
  function iterator(show) {
258
  for ( var i=0; i < hide_ids.length; i++ ) {
280
  }
281
  }
282
 
283
+ jQuery(document).on('change', '#WDI_wrap_<?php echo esc_attr($element['name']);?> select', function() {
284
  var element = jQuery(this).find('option:selected');
285
  var type = element.data('type');
286
  if ( typeof type != 'undefined' ) {
299
  iterator(false);
300
  }
301
  var selected = jQuery(this).val();
302
+ for ( var opt in <?php echo esc_attr($id).'_hide_ids'?> ) {
303
  if(opt == selected){
304
+ var ids = <?php echo esc_attr($id).'_hide_ids'?>[opt].split(',');
305
  for (var i in ids){
306
+ jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo esc_attr($id).'_hide_ids_hidden';?>");
307
  }
308
  }
309
  }
310
  });
311
 
312
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> select").each(function(){
313
+ var currentOption = "<?php echo esc_attr($opt_value)?>";
314
  if(jQuery(this).val() == currentOption){
315
  jQuery(this).trigger('change');
316
  }
356
  }
357
 
358
  ?>
359
+ <div class="wdwt_param" id="WDI_wrap_<?php echo esc_attr($element['name']);?>">
360
  <div class="block">
361
  <div class="optioninput">
362
  <?php
376
  }
377
  }
378
  ?>
379
+ <input <?php echo esc_attr($disable);?> style="margin:2px;" type="radio" name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($key); ?>" <?php checked($key,$opt_value); ?> <?php echo esc_attr($attr); ?> id="<?php echo esc_attr($option_name) . "_" . esc_attr($key);?>"/> <label for="<?php echo esc_attr($option_name) . "_" . esc_attr($key);?>"><?php echo esc_html($option); ?></label>
380
  <?php if($disable_text != '') : ?>
381
  <?php if(isset($disabled_options['br'])) : ?>
382
  <br>
384
  <span class="wdi_pro_only"><?php echo esc_html($disable_text); ?></span>
385
  <?php endif;?>
386
 
387
+ <?php echo esc_attr($break);?>
388
  <?php
389
  }
390
  if($label!='' && $label['place']=='after'){
391
  ?>
392
  <?php echo isset($label['br'])? '<br/>' : ''?>
393
+ <label class="<?php echo isset($label['class']) ? esc_attr($label['class']) : '';?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
394
  <?php
395
  }
396
  echo '</div></div></div>';
398
  if($hide_ids != ''){
399
  ?>
400
  <style>
401
+ .<?php echo esc_attr($id).'_hide_ids_hidden';?>{
402
  display:none !important;
403
  }
404
  </style>
405
  <script>
406
  jQuery(document).ready(function(){
407
+ var <?php echo esc_attr($id).'_hide_ids';?> = <?php echo str_replace('&quot;','"', esc_attr(json_encode($hide_ids)));?>;
408
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> input").on('click',function(){
409
+ jQuery('.<?php echo esc_attr($id).'_hide_ids_hidden';?>').each(function(){
410
+ jQuery(this).removeClass('<?php echo esc_attr($id).'_hide_ids_hidden';?>');
411
  });
412
  var selected = jQuery(this).val();
413
+ for (var opt in <?php echo esc_attr($id).'_hide_ids'?>){
414
  if(opt == selected){
415
+ var ids = <?php echo esc_attr($id).'_hide_ids'?>[opt].split(',');
416
  for ( var i in ids ) {
417
+ jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo esc_attr($id).'_hide_ids_hidden';?>");
418
  }
419
  }
420
 
421
  }
422
  });
423
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> input").each(function(){
424
+ var currentOption = "<?php echo esc_attr($opt_value)?>";
425
  if(jQuery(this).val() == currentOption){
426
  jQuery(this).trigger('click');
427
  }
432
  if($show_ids != ''){
433
  ?>
434
  <style>
435
+ .<?php echo esc_attr($id).'_show_ids_show';?>{
436
  display:block !important;
437
  }
438
  </style>
439
  <script>
440
  jQuery(document).ready(function(){
441
+ var <?php echo esc_attr($id).'_show_ids';?> = <?php echo str_replace('&quot;','"', esc_attr(json_encode($show_ids)));?>;
442
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> input").on('click',function(){
443
+ jQuery('.<?php echo esc_attr($id).'_show_ids_show';?>').each(function(){
444
+ jQuery(this).removeClass('<?php echo esc_attr($id).'_show_ids_show';?>');
445
  });
446
  var selected = jQuery(this).val();
447
+ for (var opt in <?php echo esc_attr($id.'_show_ids') ?>){
448
  if(opt == selected){
449
+ var ids = <?php echo esc_attr($id.'_show_ids')?>[opt].split(',');
450
  for (var i in ids){
451
+ jQuery('#WDI_wrap_'+ids[i]).parent().parent().addClass("<?php echo esc_attr($id.'_show_ids_show');?>");
452
  }
453
  }
454
 
455
  }
456
  });
457
+ jQuery("#WDI_wrap_<?php echo esc_attr($element['name']);?> input").each(function(){
458
+ var currentOption = "<?php echo esc_attr($opt_value)?>";
459
  if(jQuery(this).val() == currentOption){
460
  jQuery(this).trigger('click');
461
  }
499
 
500
  $hide_ids = isset($element['hide_ids']) ? $element['hide_ids'] : '';
501
  ?>
502
+ <div class="wdwt_param" id="WDI_wrap_<?php echo esc_attr($element['name']);?>">
503
  <div class="block margin">
504
  <div class="optioninput checkbox">
505
  <?php
506
  if($label!='' && $label['place']=='before'){
507
  ?>
508
+ <label class="<?php echo isset($label['class']) ? esc_attr($label['class']) : '' ?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
509
  <?php echo isset($label['br'])? '<br/>' : ''?>
510
  <?php
511
  }
512
  ?>
513
+ <input <?php echo esc_attr($disable); ?> type="checkbox" class="checkbox" name="<?php echo esc_attr($name); ?>" id="<?php echo esc_attr($id) ?>" <?php echo $attr;?> <?php checked(1,$opt_value)?> value="1">
514
  <?php
515
  if($label!='' && $label['place']=='after'){
516
  ?>
517
  <?php echo isset($label['br'])? '<br/>' : ''?>
518
+ <label class="<?php echo isset($label['class']) ? esc_attr($label['class']) : '' ?>" for="<?php echo esc_attr($id); ?>"><?php echo esc_html($label['text']); ?></label>
519
  <?php
520
  }
521
  ?>
524
  </div>
525
  <style>
526
  <?php if(!empty($hide_ids)){
527
+ echo '.'.esc_attr($id).'_hide_ids_hidden{display:none !important;}';
528
  }
529
  ?>
530
  </style>
531
  <script>
532
  jQuery(document).ready(function(){
533
 
534
+ var el = jQuery('#<?php echo ''.esc_attr($id)?>');
535
+ var hide_ids = <?php echo str_replace('&quot;','"', esc_attr(json_encode($hide_ids))); ?>;
536
+ var hide_class = '<?php echo esc_attr($id).'_hide_ids_hidden'; ?>';
537
 
538
  if(el.prop('checked') != true){
539
+ el.after('<input type=\"hidden\" name=\"' + jQuery("#<?php echo ''.esc_attr($id)?>").attr("name") + '\" value="0">');
540
  }
541
 
542
  el.on('click',function(){
585
  <div class="wdi_howto_wrapper">
586
  <h2>Shortcode</h2>
587
  <h4>Copy and paste this shortcode into your posts or pages:</h4>
588
+ <input type="text" class="wdi_howto_shortcode" value='[wdi_feed id="<?php echo esc_attr($feed_id); ?>"]' onclick="wdi_select_focus_element(this)" size="11" readonly="readonly" />
589
  </div>
590
  </div>
591
  <div class="wdi_howto_content">
592
  <div class="wdi_howto_wrapper">
593
  <h2>Page or Post editor</h2>
594
  <h4>Insert it into an existing post with the button:</h4>
595
+ <img src="<?php echo esc_url(WDI_URL).'/images/how_to_publish_shortcode.png'; ?>">
596
  </div>
597
  </div>
598
  <div class="wdi_howto_content">
599
  <div class="wdi_howto_wrapper">
600
  <h2>PHP code</h2>
601
  <h4>Copy and paste the PHP code into your template file:</h4>
602
+ <input type="text" class="wdi_howto_phpcode" value="&#60;?php echo wdi_feed(array('id'=>'<?php echo esc_attr($feed_id); ?>')); ?&#62;" onclick="wdi_select_focus_element(this)" size="17" readonly="readonly" />
603
  </div>
604
  </div>
605
  <div class="wdi_howto_content">
606
  <div class="wdi_howto_wrapper">
607
  <h2>Widget</h2>
608
  <h4>Add Instagram Feed Widget to your site:</h4>
609
+ <img src="<?php echo esc_url(WDI_URL).'/images/how_to_publish_widget.png'; ?>">
610
  </div>
611
  </div>
612
  </div>
647
  }
648
  }
649
  ?>
650
+ <div class="wdwt_param" id="WDI_wrap_<?php echo esc_attr($element['name']);?>">
651
  <div class='wdwt_float' >
652
  <div>
653
+ <input type="text" class='color_input' id="<?php echo esc_attr($id) ?>" <?php echo esc_attr($attr);?> name="<?php echo esc_attr($name); ?>" value="<?php echo esc_attr($opt_value); ?>" data-default-color="<?php echo esc_attr($defaults[$element['name']]); ?>" style="background-color:<?php echo esc_attr($opt_value); ?>;">
654
  </div>
655
  </div>
656
  </div>
657
  <script type="text/javascript">
658
  jQuery(document).ready(function() {
659
  jQuery('.color_input').wpColorPicker();
660
+ jQuery('#WDI_wrap_<?php echo esc_attr($element['name']);?> .wp-picker-container').attr('tab','<?php echo esc_attr($tab);?>');
661
+ jQuery('#WDI_wrap_<?php echo esc_attr($element['name']);?> .wp-picker-container').attr('section','<?php echo esc_attr($section);?>');
662
  });
663
  </script>
664
  <?php
frontend/views/imagebrowser.php CHANGED
@@ -16,18 +16,18 @@ class WDI_ImageBrowser_view {
16
  $this->generate_feed_styles($feed_row);
17
  $style = $this->model->theme_row;
18
  $wdi_feed_counter = $this->model->wdi_feed_counter;
19
- $container_class = 'wdi_feed_theme_' . sanitize_html_class($style['id']) . ' wdi_feed_browser_' . sanitize_html_class($style['id']);
20
  $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
21
  ?>
22
- <div id="wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?>" class="wdi_feed_main_container wdi_layout_ib <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
23
  <?php wdi_feed_frontend_messages();?>
24
- <div id="wdi_spider_popup_loading_<?php echo sanitize_html_class($wdi_feed_counter) ?>" class="wdi_spider_popup_loading"></div>
25
- <div id="wdi_spider_popup_overlay_<?php echo sanitize_html_class($wdi_feed_counter) ?>" class="wdi_spider_popup_overlay"
26
  onclick="wdi_spider_destroypopup(1000)"></div>
27
  <div class="wdi_feed_container">
28
  <div class="wdi_feed_info">
29
- <div id="wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?>_header" class='wdi_feed_header'></div>
30
- <div id="wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?>_users" class='wdi_feed_users'>
31
  <?php
32
  if ( !empty($user_feed_header_args) ) {
33
  echo WDILibrary::user_feed_header_info( $user_feed_header_args );
@@ -49,7 +49,7 @@ class WDI_ImageBrowser_view {
49
  <?php
50
  }
51
  ?>
52
- <div class="wdi_feed_wrapper <?php echo 'wdi_col_' . sanitize_html_class($feed_row['number_of_columns']) ?>" wdi-res='<?php echo 'wdi_col_' . esc_attr($feed_row['number_of_columns']) ?>'></div>
53
  <div class="wdi_clear"></div>
54
  <?php
55
  switch ($feed_row['feed_display_view']) {
@@ -167,7 +167,7 @@ class WDI_ImageBrowser_view {
167
 
168
  ob_start();
169
  ?>
170
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?> .wdi_feed_header {
171
  display: <?php echo (esc_html($feed_row['display_header'])=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
172
  }
173
 
@@ -179,26 +179,26 @@ class WDI_ImageBrowser_view {
179
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/2;
180
  }
181
  ?>
182
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_header_user_text {
183
  padding-top: <?php echo esc_html($header_text_padding); ?>px;
184
 
185
  }
186
 
187
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?> .wdi_header_user_text h3 {
188
  margin-top: <?php echo esc_html($header_text_padding) ?>px;
189
  }
190
 
191
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_media_info {
192
  display: <?php echo (esc_html($feed_row['display_user_post_follow_number']) == '1') ? 'block' : 'none'; ?>
193
  }
194
 
195
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?> .wdi_feed_item {
196
  width: <?php echo $colNum.'%'?>; /*thumbnail_size*/
197
  }
198
 
199
  <?php if($feed_row['disable_mobile_layout']=="0") { ?>
200
  @media screen and (min-width: 800px) and (max-width: 1024px) {
201
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
202
  width: <?php echo (esc_html($colNum)<33.33) ? '33.333333333333%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
203
  margin: 0;
204
  display: inline-block;
@@ -206,7 +206,7 @@ class WDI_ImageBrowser_view {
206
  overflow: hidden;
207
  }
208
 
209
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_container {
210
  width: 100%;
211
  margin: 0 auto;
212
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
@@ -214,14 +214,14 @@ class WDI_ImageBrowser_view {
214
  }
215
 
216
  @media screen and (min-width: 480px) and (max-width: 800px) {
217
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
218
  width: <?php echo (esc_html($colNum)<50) ? '50%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
219
  margin: 0;
220
  display: inline-block;
221
  overflow: hidden;
222
  }
223
 
224
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_container {
225
  width: 100%;
226
  margin: 0 auto;
227
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
@@ -229,14 +229,14 @@ class WDI_ImageBrowser_view {
229
  }
230
 
231
  @media screen and (max-width: 480px) {
232
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
233
  width: <?php echo (esc_html($colNum<100)) ? '100%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
234
  margin: 0;
235
  display: inline-block;
236
  overflow: hidden;
237
  }
238
 
239
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_container {
240
  width: 100%;
241
  margin: 0 auto;
242
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
16
  $this->generate_feed_styles($feed_row);
17
  $style = $this->model->theme_row;
18
  $wdi_feed_counter = $this->model->wdi_feed_counter;
19
+ $container_class = 'wdi_feed_theme_' . esc_attr($style['id']) . ' wdi_feed_browser_' . esc_attr($style['id']);
20
  $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
21
  ?>
22
+ <div id="wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?>" class="wdi_feed_main_container wdi_layout_ib <?php echo esc_attr($container_class); ?>" <?php echo esc_attr($wdi_data_ajax); ?> >
23
  <?php wdi_feed_frontend_messages();?>
24
+ <div id="wdi_spider_popup_loading_<?php echo esc_attr($wdi_feed_counter) ?>" class="wdi_spider_popup_loading"></div>
25
+ <div id="wdi_spider_popup_overlay_<?php echo esc_attr($wdi_feed_counter) ?>" class="wdi_spider_popup_overlay"
26
  onclick="wdi_spider_destroypopup(1000)"></div>
27
  <div class="wdi_feed_container">
28
  <div class="wdi_feed_info">
29
+ <div id="wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?>_header" class='wdi_feed_header'></div>
30
+ <div id="wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?>_users" class='wdi_feed_users'>
31
  <?php
32
  if ( !empty($user_feed_header_args) ) {
33
  echo WDILibrary::user_feed_header_info( $user_feed_header_args );
49
  <?php
50
  }
51
  ?>
52
+ <div class="wdi_feed_wrapper <?php echo 'wdi_col_' . esc_attr($feed_row['number_of_columns']) ?>" wdi-res='<?php echo 'wdi_col_' . esc_attr($feed_row['number_of_columns']) ?>'></div>
53
  <div class="wdi_clear"></div>
54
  <?php
55
  switch ($feed_row['feed_display_view']) {
167
 
168
  ob_start();
169
  ?>
170
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?> .wdi_feed_header {
171
  display: <?php echo (esc_html($feed_row['display_header'])=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
172
  }
173
 
179
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/2;
180
  }
181
  ?>
182
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_header_user_text {
183
  padding-top: <?php echo esc_html($header_text_padding); ?>px;
184
 
185
  }
186
 
187
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?> .wdi_header_user_text h3 {
188
  margin-top: <?php echo esc_html($header_text_padding) ?>px;
189
  }
190
 
191
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_media_info {
192
  display: <?php echo (esc_html($feed_row['display_user_post_follow_number']) == '1') ? 'block' : 'none'; ?>
193
  }
194
 
195
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?> .wdi_feed_item {
196
  width: <?php echo $colNum.'%'?>; /*thumbnail_size*/
197
  }
198
 
199
  <?php if($feed_row['disable_mobile_layout']=="0") { ?>
200
  @media screen and (min-width: 800px) and (max-width: 1024px) {
201
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
202
  width: <?php echo (esc_html($colNum)<33.33) ? '33.333333333333%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
203
  margin: 0;
204
  display: inline-block;
206
  overflow: hidden;
207
  }
208
 
209
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_container {
210
  width: 100%;
211
  margin: 0 auto;
212
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
214
  }
215
 
216
  @media screen and (min-width: 480px) and (max-width: 800px) {
217
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
218
  width: <?php echo (esc_html($colNum)<50) ? '50%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
219
  margin: 0;
220
  display: inline-block;
221
  overflow: hidden;
222
  }
223
 
224
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_container {
225
  width: 100%;
226
  margin: 0 auto;
227
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
229
  }
230
 
231
  @media screen and (max-width: 480px) {
232
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
233
  width: <?php echo (esc_html($colNum<100)) ? '100%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
234
  margin: 0;
235
  display: inline-block;
236
  overflow: hidden;
237
  }
238
 
239
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_container {
240
  width: 100%;
241
  margin: 0 auto;
242
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
frontend/views/thumbnails.php CHANGED
@@ -16,17 +16,17 @@ class WDI_Thumbnails_view {
16
  $this->generate_feed_styles($feed_row); // @TODO. should be moved to shortcode.php
17
  $style = $this->model->theme_row;
18
  $wdi_feed_counter = $this->model->wdi_feed_counter;
19
- $container_class = 'wdi_feed_theme_' . sanitize_html_class($style['id']) . ' wdi_feed_thumbnail_' . sanitize_html_class($style['id']);
20
  $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
21
  ?>
22
- <div id="wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?>" class="wdi_feed_main_container wdi_layout_th <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
23
  <?php wdi_feed_frontend_messages();?>
24
- <div id="wdi_spider_popup_loading_<?php echo sanitize_html_class($wdi_feed_counter) ?>" class="wdi_spider_popup_loading"></div>
25
- <div id="wdi_spider_popup_overlay_<?php echo sanitize_html_class($wdi_feed_counter) ?>" class="wdi_spider_popup_overlay" onclick="wdi_spider_destroypopup(1000)"></div>
26
  <div class="wdi_feed_container">
27
  <div class="wdi_feed_info">
28
- <div id="wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?>_header" class='wdi_feed_header'></div>
29
- <div id="wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter) ?>_users" class='wdi_feed_users'>
30
  <?php
31
  if ( !empty($user_feed_header_args) ) {
32
  echo WDILibrary::user_feed_header_info( $user_feed_header_args );
@@ -44,7 +44,7 @@ class WDI_Thumbnails_view {
44
  </div>
45
  </div>
46
  <?php } ?>
47
- <div class="wdi_feed_wrapper <?php echo sanitize_html_class('wdi_col_' . $feed_row['number_of_columns']) ?>" wdi-res='<?php echo 'wdi_col_' . esc_attr($feed_row['number_of_columns'])?>'></div>
48
  <div class="wdi_clear"></div>
49
  <?php
50
  switch ($feed_row['feed_display_view']) {
@@ -170,7 +170,7 @@ class WDI_Thumbnails_view {
170
  $colNum = (100 / $feed_row['number_of_columns']);
171
  ob_start();
172
  ?>
173
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_header {
174
  display: <?php echo (esc_html($feed_row['display_header'])=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
175
  }
176
  <?php
@@ -180,26 +180,26 @@ class WDI_Thumbnails_view {
180
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/2;
181
  }
182
  ?>
183
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_header_user_text {
184
  padding-top: <?php echo esc_html($header_text_padding); ?>px;
185
  }
186
 
187
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_header_user_text h3 {
188
  margin-top: <?php echo esc_html($header_text_padding) ?>px;
189
  }
190
 
191
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_media_info {
192
  display: <?php echo (esc_html($feed_row['display_user_post_follow_number']) == '1') ? 'block' : 'none'; ?>
193
  }
194
 
195
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
196
  width: <?php echo esc_html($colNum).'%'?>; /*thumbnail_size*/
197
  line-height: 0;
198
  }
199
 
200
  <?php if($feed_row['disable_mobile_layout']=="0") { ?>
201
  @media screen and (min-width: 800px) and (max-width: 1024px) {
202
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
203
  width: <?php echo (esc_html($colNum)<33.33) ? '33.333333333333%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
204
  margin: 0;
205
  display: inline-block;
@@ -207,7 +207,7 @@ class WDI_Thumbnails_view {
207
  overflow: hidden;
208
  }
209
 
210
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_container {
211
  width: 100%;
212
  margin: 0 auto;
213
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
@@ -216,7 +216,7 @@ class WDI_Thumbnails_view {
216
  }
217
 
218
  @media screen and (min-width: 480px) and (max-width: 800px) {
219
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
220
  width: <?php echo (esc_html($colNum)<50) ? '50%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
221
  margin: 0;
222
  display: inline-block;
@@ -224,7 +224,7 @@ class WDI_Thumbnails_view {
224
  overflow: hidden;
225
  }
226
 
227
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_container {
228
  width: 100%;
229
  margin: 0 auto;
230
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
@@ -232,7 +232,7 @@ class WDI_Thumbnails_view {
232
  }
233
 
234
  @media screen and (max-width: 480px) {
235
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_item {
236
  width: <?php echo (esc_html($colNum)<100) ? '100%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
237
  margin: 0;
238
  display: inline-block;
@@ -240,7 +240,7 @@ class WDI_Thumbnails_view {
240
  overflow: hidden;
241
  }
242
 
243
- #wdi_feed_<?php echo sanitize_html_class($wdi_feed_counter)?> .wdi_feed_container {
244
  width: 100%;
245
  margin: 0 auto;
246
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
16
  $this->generate_feed_styles($feed_row); // @TODO. should be moved to shortcode.php
17
  $style = $this->model->theme_row;
18
  $wdi_feed_counter = $this->model->wdi_feed_counter;
19
+ $container_class = 'wdi_feed_theme_' . esc_attr($style['id']) . ' wdi_feed_thumbnail_' . esc_attr($style['id']);
20
  $wdi_data_ajax = defined('DOING_AJAX') && DOING_AJAX ? 'data-wdi_ajax=1' : '';
21
  ?>
22
+ <div id="wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?>" class="wdi_feed_main_container wdi_layout_th <?php echo $container_class; ?>" <?php echo $wdi_data_ajax; ?> >
23
  <?php wdi_feed_frontend_messages();?>
24
+ <div id="wdi_spider_popup_loading_<?php echo esc_attr($wdi_feed_counter) ?>" class="wdi_spider_popup_loading"></div>
25
+ <div id="wdi_spider_popup_overlay_<?php echo esc_attr($wdi_feed_counter) ?>" class="wdi_spider_popup_overlay" onclick="wdi_spider_destroypopup(1000)"></div>
26
  <div class="wdi_feed_container">
27
  <div class="wdi_feed_info">
28
+ <div id="wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?>_header" class='wdi_feed_header'></div>
29
+ <div id="wdi_feed_<?php echo esc_attr($wdi_feed_counter) ?>_users" class='wdi_feed_users'>
30
  <?php
31
  if ( !empty($user_feed_header_args) ) {
32
  echo WDILibrary::user_feed_header_info( $user_feed_header_args );
44
  </div>
45
  </div>
46
  <?php } ?>
47
+ <div class="wdi_feed_wrapper <?php echo esc_attr('wdi_col_' . $feed_row['number_of_columns']) ?>" wdi-res='<?php echo 'wdi_col_' . esc_attr($feed_row['number_of_columns'])?>'></div>
48
  <div class="wdi_clear"></div>
49
  <?php
50
  switch ($feed_row['feed_display_view']) {
170
  $colNum = (100 / $feed_row['number_of_columns']);
171
  ob_start();
172
  ?>
173
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_header {
174
  display: <?php echo (esc_html($feed_row['display_header'])=='1')? 'block' : 'none'?>; /*if display-header is true display:block*/
175
  }
176
  <?php
180
  $header_text_padding =(intval($style['user_img_width']) - intval($style['users_text_font_size']))/2;
181
  }
182
  ?>
183
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_header_user_text {
184
  padding-top: <?php echo esc_html($header_text_padding); ?>px;
185
  }
186
 
187
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_header_user_text h3 {
188
  margin-top: <?php echo esc_html($header_text_padding) ?>px;
189
  }
190
 
191
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_media_info {
192
  display: <?php echo (esc_html($feed_row['display_user_post_follow_number']) == '1') ? 'block' : 'none'; ?>
193
  }
194
 
195
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
196
  width: <?php echo esc_html($colNum).'%'?>; /*thumbnail_size*/
197
  line-height: 0;
198
  }
199
 
200
  <?php if($feed_row['disable_mobile_layout']=="0") { ?>
201
  @media screen and (min-width: 800px) and (max-width: 1024px) {
202
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
203
  width: <?php echo (esc_html($colNum)<33.33) ? '33.333333333333%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
204
  margin: 0;
205
  display: inline-block;
207
  overflow: hidden;
208
  }
209
 
210
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_container {
211
  width: 100%;
212
  margin: 0 auto;
213
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
216
  }
217
 
218
  @media screen and (min-width: 480px) and (max-width: 800px) {
219
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
220
  width: <?php echo (esc_html($colNum)<50) ? '50%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
221
  margin: 0;
222
  display: inline-block;
224
  overflow: hidden;
225
  }
226
 
227
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_container {
228
  width: 100%;
229
  margin: 0 auto;
230
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
232
  }
233
 
234
  @media screen and (max-width: 480px) {
235
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_item {
236
  width: <?php echo (esc_html($colNum)<100) ? '100%' : esc_html($colNum).'%'?>; /*thumbnail_size*/
237
  margin: 0;
238
  display: inline-block;
240
  overflow: hidden;
241
  }
242
 
243
+ #wdi_feed_<?php echo esc_attr($wdi_feed_counter)?> .wdi_feed_container {
244
  width: 100%;
245
  margin: 0 auto;
246
  background-color: <?php echo esc_html($style['feed_container_bg_color'])?>; /*feed_container_bg_color*/
js/wdi_admin.js CHANGED
@@ -565,7 +565,7 @@ var comlete_redirect_url = '';
565
 
566
  function submit_ajax() {
567
  var data = jQuery("#wdi_save_feed").serialize();
568
- data = data + '&action=wdi_apply_changes&page=wdi_feeds';
569
  jQuery("#wdi_save_loading").removeClass("wdi_hidden");
570
  jQuery.ajax({
571
  url: wdi_ajax.ajax_url,
565
 
566
  function submit_ajax() {
567
  var data = jQuery("#wdi_save_feed").serialize();
568
+ data = data + '&action=wdi_apply_changes&page=wdi_feeds&wdi_nonce='+wdi_ajax.wdi_nonce;
569
  jQuery("#wdi_save_loading").removeClass("wdi_hidden");
570
  jQuery.ajax({
571
  url: wdi_ajax.ajax_url,
js/wdi_admin.min.js CHANGED
@@ -1 +1 @@
1
- function wdi_multiple_accounts_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_multiple_accounts_section");var t="";if(wdi_options.wdi_authenticated_users_list){var i,r=JSON.parse(wdi_options.wdi_authenticated_users_list),a=0;for(i in r)t+="<tr data-multiple-account='"+a+"'>",t+="<th>Access Token</th>",t+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+r[i].access_token+'"></td>',t+="</tr>",t+="<tr data-multiple-account='"+a+"' class='wdi_username_tr'>",t+="<th>Username</th>",t+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+r[i].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>',t+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+r[i].user_id+'">',t+="</tr>",a++;e.append(t)}jQuery(".wdi_remove_auth_user").on("click",function(e){e.preventDefault();e=jQuery(this).closest(".wdi_username_tr").data("multiple-account");return jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+e+'"]').remove(),!1})}function wdi_advanced_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_advanced_option wdi_advanced_option_close");$tr=jQuery("<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>"),e.prepend($tr),$tr.on("click",function(){e.hasClass("wdi_advanced_option_open")?(e.removeClass("wdi_advanced_option_open"),e.addClass("wdi_advanced_option_close")):(e.removeClass("wdi_advanced_option_close"),e.addClass("wdi_advanced_option_open"))})}function wdi_controller(){}jQuery(document).ready(function(){function e(e){if(!1===e){var t=JSON.parse(localStorage.getItem("wdi_sections"));for(i in null!==t&&!1!==t||(t={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"},localStorage.setItem("wdi_sections",JSON.stringify(t))),t){var r=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");n(t[i],r)}}else{var a=jQuery(e).data("section_name"),s=null;e.hasClass("wdi_section_open")?(n("show",e),s="show"):e.hasClass("wdi_section_close")&&(n("hide",e),s="hide"),null!=s&&((e=JSON.parse(localStorage.getItem("wdi_sections"))||{})[a]=s,localStorage.setItem("wdi_sections",JSON.stringify(e)))}}function n(e,t){"show"===e?("table"===(e=t.closest(".wdi_section").find(".wdi_elements")).data("display")?e.css({display:"table"}):e.css({display:"block"}),t.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"}),t.removeClass("wdi_section_open"),t.addClass("wdi_section_close")):(t.closest(".wdi_section").find(".wdi_elements").css({display:"none"}),t.css({"border-bottom":"0px",margin:"0 auto 0px"}),t.removeClass("wdi_section_close"),t.addClass("wdi_section_open"))}jQuery("#wdi_reset_cache").click(function(e){jQuery(".wdi_reset_cache_success").remove(),jQuery("#wdi_save_loading").removeClass("wdi_hidden"),e.preventDefault(),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,task:"reset",action:"wdi_cache"},success:function(e){!1===e.success?jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>"):(wdi_controller.instagram=new WDIInstagram,jQuery.each(e.data,function(e,t){var i=JSON.parse(t.users),r="",a="",s="",n=t.endpoint;jQuery.each(i,function(e,t){""!==t.tag_id?(a=(a=(a=t.username).substr(1,a.length)).replace(" ",""),s=t.tag_id):r=(r=wdi_controller.getUserObj(t.username))&&r.user_name});t=t.feed_id;wdi_controller.instagram.set_cache_data("",r,t,"",0,0,a,s,n,"")}),jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>"))}})}),jQuery(".wdi_account_refresh").click(function(){var t=jQuery(this),e=t.data("wdi_account");jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_refresh",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(e){t.closest("div").find(".wdi_reset_cache_success").remove(),!0===e.success?(t.after("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>"),t.closest("div").find(".wdi_user_token").val(e.token)):t.after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>")}})}),wdi_controller.bindSaveFeedEvent(),wdi_controller.bindAddNewUserOrHashtagEvent(),jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))}),wdi_controller.conditionalFiltersTabInit(),wdi_controller.bindSaveThemeEvent(),jQuery("body").hasClass("instagram-feed_page_wdi_settings")&&wdi_advanced_option_controller(),jQuery(".wdi_section_name").click(function(){e(jQuery(this))}),e(!1),jQuery(document).on("click",".wdi-account-show-token",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents("li").find(".wdi-account-accesstoken").slideToggle(300)}),jQuery(document).on("click",".wdi-advanced-options .wdi-advanced-headline",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents(".wdi-advanced-options").find(".wdi-advanced-body").slideToggle(500)}),jQuery(document).on("click","#wdi_verify",function(){jQuery("#wdi_submit").prop("disabled",!0),jQuery(this).is(":checked")&&jQuery("#wdi_submit").prop("disabled",!1)}),jQuery(document).on("click","#wdi_submit",function(){return confirm(wdi_messages.uninstall_plugin)&&jQuery("#wdi_uninstall_form").submit(),!1}),jQuery("#WDI_feed_name").on("keypress",function(){jQuery(this).removeAttr("style")})}),wdi_controller.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");e=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},wdi_controller.apiRedirected=function(){var e=this.getParameterByName("access_token").split("."),t=/^[^\\\/&?><"']*$/;for(i=0;i<e.length;i++)if(null===e[i].match(t))return;var r=e.join(".");jQuery(document).ready(function(){""===wdi_options.wdi_access_token?jQuery("#wdi_access_token").attr("value",r):(jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",r))}),wdi_controller.instagram.addToken(r),wdi_controller.getUserInfo(r)},wdi_controller.getUserInfo=function(e){this.instagram.getSelfInfo({success:function(e){""===wdi_options.wdi_access_token?(jQuery("#wdi_user_name").attr("value",e.data.username),jQuery("#wdi_user_id").attr("value",e.data.id)):(jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",e.data.username),jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",e.data.id)),jQuery(document).trigger("wdi_settings_filled")}})},wdi_controller.oldDisplayType={},wdi_controller.displayTypeMemory={},wdi_controller.switchFeedTabs=function(e,t){jQuery("#wdi_refresh_tab").attr("value",e),jQuery(".wdi_tab").hide(),jQuery("#"+e+"_tab").show(),jQuery(".wdi_element_name_popup_enable_comment").hide(),"business"===jQuery("#WDI_user_name option:selected").data("type")&&jQuery(".wdi_element_name_popup_enable_comment").show(),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery('.display_type[tab="'+e+'"]').length?jQuery(".display_type_content").show():jQuery(".display_type_content").hide(),jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active");var i=jQuery(),r=!1;null!=t&&""!=t&&(i=jQuery(".display_type #"+t).prop("checked",!0),jQuery("#wdi_feed_type").attr("value",t)),r||0!=(i=jQuery('.display_type[tab="'+e+'"] input[name="feed_type"]:checked')).length&&(r=!0),r||0!=(i=jQuery('.display_type[tab="'+e+'"] #thumbnails')).length&&(r=!0,i.prop("checked",!0),jQuery("#wdi_feed_type").attr("value","thumbnails")),r&&wdi_controller.displaySettingsSection(i),"conditional_filters"==e&&wdi_controller.updateConditionalFiltersUi()},wdi_controller.displaySettingsSection=function(e){var i=e.attr("id").toLowerCase().trim(),t=e.parent().parent().attr("tab"),e=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:i,tab:t},wdi_controller.displayTypeMemory[t]=wdi_controller.oldDisplayType,null!=e&&e.attr("value",i);e=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",i);var r=0,a=!1;e.find(".wdi_element").each(function(){0;var e=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(void 0!==e){a=!1;var t=e.toLowerCase().trim().split(",");for(r=0;r<t.length;r++)t[r]===i&&(jQuery(this).css("display","block"),a=!0);!1===a&&jQuery(this).css("display","none")}})},wdi_controller.switchThemeTabs=function(e,t){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active"),jQuery("[tab]").each(function(){jQuery(this).attr("tab")!=e?jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none"):jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery("#wdi_refresh_tab").attr("value",e),null!=t&&""!=t&&jQuery("#wdi_refresh_section").attr("value",t),(null==t&&""!=t?null!=wdi_controller.displayTypeMemory[e]?jQuery(".display_type #"+wdi_controller.displayTypeMemory[e].section):jQuery('.display_type[tab="'+e+'"]').first().find("input"):jQuery(".display_type #"+t)).trigger("click")},wdi_controller.bindSaveFeedEvent=function(){var e=this;jQuery("#wdi_save_feed_submit").on("click",function(){e.save_feed("save_feed")}),jQuery("#wdi_save_feed_apply").on("click",function(){e.save_feed("apply_changes")}),jQuery("#wdi_cancel_changes").on("click",function(){e.save_feed("cancel")})},wdi_controller.save_feed=function(e){var t,i,r,a=[],s={};"cancel"==e&&(window.location=window.location.href),t=jQuery("#WDI_user_name option:selected").data("type"),n=jQuery("#WDI_user_name option:selected").val(),i=jQuery("#WDI_feed_name");var n=wdi_controller.getUserObj(n);if(""==i.val())return alert(wdi_messages.feed_title_field_required),i.focus().attr("style","border-color: #FF0000;"),!1;if(!n)return alert(wdi_messages.user_field_required),!1;if(r={id:n.user_id,username:n.user_name},wdi_controller.checkIfUserNotSaved(e),0==wdi_controller.waitingAjaxRequestEnd.button){if(s=jQuery("#WDI_feed_users").val(),this.isJsonString(s)){for(var d in s=JSON.parse(s))"business"==t&&"#"===s[d].username.charAt(0)&&a.push(s[d]);a.push(r)}else a.push(r);users=this.stringifyUserData(a),jQuery("#WDI_feed_users").val(users),jQuery("#wdi_feed_thumb").val(""),"business"==t&&jQuery("#wdi_feed_thumb").val(n.profile_picture_url),"apply_changes"!=e&&"save_feed"!=e||(n=jQuery("#wdi_add_or_edit").val(),jQuery("#wdi_current_id").val(n)),jQuery("#task").attr("value",e),submit_ajax()}};var comlete_redirect_url="";function submit_ajax(){var e=jQuery("#wdi_save_feed").serialize();e+="&action=wdi_apply_changes&page=wdi_feeds",jQuery("#wdi_save_loading").removeClass("wdi_hidden"),jQuery.ajax({url:wdi_ajax.ajax_url,type:"POST",dataType:"json",data:e,success:function(e){comlete_redirect_url=e.url;var t=e.feed_id;1==e.need_cache?(jQuery(".caching-process-message").removeClass("wdi_hidden"),setTimeout(function(){wdi_controller.instagram.set_cache_data(comlete_redirect_url,"",t,"",0,0,"","","","")},1e3)):(jQuery("#wdi_save_loading").addClass("wdi_hidden"),window.location=comlete_redirect_url)},error:function(e,t,i){window.location=comlete_redirect_url}})}function wdi_spider_select_value(e){e.focus(),e.select()}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_bulk_actions(e){e=jQuery(e).val();return""!=e&&(!("delete_all"==e&&!confirm(wdi_messages.do_you_want_to_delete_selected_items))&&(wdi_spider_set_input_value("task",e),jQuery("#wdi_feed_form").submit(),!0))}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox(),jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){var e;jQuery("#check_all_items").prop("checked")?(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide()):(e=parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0,e=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0)+e,jQuery("#check_all_items").prop("checked",!0),e&&(jQuery("#draganddrop").html("<strong><p>Selected "+e+" item"+(1<e?"s":"")+".</p></strong>"),jQuery("#draganddrop").show()))}function wdi_spider_check_all(e){jQuery(e).prop("checked")||(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide())}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_account_remove(e,t){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_disconnect",nonce:wdi_ajax.wdi_nonce,user_name:e,user_id:t},success:function(e){e.success&&(1==jQuery('[class*="wdi-account-list"]').length?((e=jQuery(".wdi-account-list-"+t).parent()).prev().remove(),e.remove(),jQuery("#toplevel_page_wdi_feeds ul").remove(),jQuery("#toplevel_page_wdi_feeds a").attr("href","admin.php?page=wdi_settings")):jQuery(".wdi-account-list-"+t).remove())}})}function wdi_popup_open(){jQuery(".wdi-popup").show()}function wdi_popup_close(){jQuery(".wdi-popup").hide()}wdi_controller.makeInstagramUserRequest=function(e,t){var i,r=this,a=this.getInputType(e),s="hashtag"===a,n=jQuery("#wdi_add_or_edit").val();if(""==e)return alert(wdi_messages.please_write_hashtag),!1;if(""!=e&&!s)return alert(wdi_messages.invalid_hashtag),!1;if(r.checkForDuplicateUser(e))return alert(e+" "+wdi_messages.already_added),!1;switch(i=jQuery("#WDI_user_name option:selected").val(),(s=wdi_controller.getUserObj(i))&&(this.instagram.user=s),a){case"user":break;case"hashtag":var d=(d=e.substr(1,e.length)).replace(" ",""),l=(jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val(),{tagname:d,action:"wdi_getHashtagId",wdi_nonce:wdi_ajax.wdi_nonce,user_name:i,feed_id:n});jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:l,success:function(e){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var t=r.isValidResponse(e);t.valid?r.addHashtag(d,e):alert(t.msg)},error:function(e,t,i){}})}},wdi_controller.checkForDuplicateUser=function(e){var t=jQuery("#WDI_feed_users").val();if(this.isJsonString(t)){t=JSON.parse(t);for(var i=0;i<t.length;i++)if(e==t[i].username)return!0}return!1},wdi_controller.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_controller.stringifyUserData=function(e){for(var t=[],i=0;i<e.length;i++)t.push({id:e[i].id,username:e[i].username,tag_id:void 0!==e[i].tag_id?e[i].tag_id:""});return JSON.stringify(t)},wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){void 0!==jQuery(this).prop("disabled")||jQuery(this).prop("disabled",!0);var e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery(this).removeAttr("disabled","disabled")}),jQuery("#wdi_add_user_ajax_input").on("keypress",function(e){if(13==e.keyCode){void 0!==jQuery("#wdi_add_user_ajax").prop("disabled")||jQuery("#wdi_add_user_ajax").prop("disabled",!0);e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled"),!1}})},wdi_controller.removeFeedUser=function(e){var t,i=e.parent().find("a span").text();e.parent().find("a span").hasClass("wdi_hashtag")&&(i="#"+i),0!=this.feed_users.length||void 0!==(t=jQuery("#WDI_feed_users").val())&&this.isJsonString(t)&&(this.feed_users=JSON.parse(t));for(var r=0;r<this.feed_users.length;r++)if(this.feed_users[r].username==i){this.feed_users.splice(r,1);break}for(r=0;r<this.feed_users.length;r++)"#"!==this.feed_users[r].username.charAt(0)&&this.feed_users.splice(r,1);jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users)),e.parent().remove(),wdi_controller.changed_users()},wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed"),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()})},wdi_controller.checkIfUserNotSaved=function(e){switch(e){case"save_feed":e="submit";break;case"apply_changes":e="apply";break;case"reset_changes":e="reset"}if(""==jQuery("#wdi_add_user_ajax_input").val().trim())return wdi_controller.waitingAjaxRequestEnd={button:0},0;var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return wdi_controller.waitingAjaxRequestEnd={button:e},wdi_controller.makeInstagramUserRequest(t),1},wdi_controller.saveFeedAfterAjaxWait=function(e){var t;null!=wdi_controller.waitingAjaxRequestEnd&&(t=wdi_controller.waitingAjaxRequestEnd.button,e&&0!=t&&jQuery("#wdi_save_feed_"+t).trigger("click"),wdi_controller.waitingAjaxRequestEnd=void 0)},wdi_controller.getCookie=function(e){e=("; "+document.cookie).split("; "+e+"=");if(2==e.length)return e.pop().split(";").shift()},wdi_controller.isValidResponse=function(e){var t={};return void 0===e||void 0===e.meta.code||200!=e.meta.code?(t.valid=!1,void 0===e?t.msg=wdi_messages.instagram_server_error:200!==e.meta.code?t.msg=e.meta.message:t.msg=""):(t.valid=!0,t.msg="success"),t},wdi_controller.hasData=function(e){return void 0!==e&&void 0!==e.data&&0!=e.data.length},wdi_controller.thumbUser=function(e){return 0<this.feed_users.length&&this.feed_users[0].username===e},wdi_controller.findUser=function(e,t){var i=[];void 0!==t&&void 0!==t.data&&(i=t.data);for(var r=0;r<i.length;r++)if(i[r].username==e)return i[r];return!1},wdi_controller.addHashtag=function(e,t){if(null==e.match(/[~!@$%&*#^()<>?]/)){var i=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users_ajax").append(i),jQuery("#wdi_add_user_ajax_input").val("");var r=jQuery("#WDI_feed_users").val();if(this.isJsonString(r)){r=JSON.parse(r);for(var a=0;a<r.length;a++)"#"!==r[a].username.charAt(0)&&r.splice(a,1)}else r=[];t={id:"#"+e,username:"#"+e,profile_picture:"",tag_id:t.tag_id};r.push(t),this.feed_users=r,jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users))}else alert(wdi_messages.invalid_hashtag);this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0),wdi_controller.changed_users()},wdi_controller.changed_users=function(){for(var e=!1,t=0;t<this.feed_users.length;t++)if("#"===this.feed_users[t].username[0]){e=!0;break}e?(jQuery(".wdi_element_name_hashtag_top_recent").show(),jQuery(".wdi_element_name_show_username_on_thumb").hide()):(jQuery(".wdi_element_name_hashtag_top_recent").hide(),jQuery(".wdi_element_name_show_username_on_thumb").show())},wdi_controller.addUser=function(e){e.username=e.user_name,0==this.checkForDuplicateUser(e.username)?(newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+e.username+'"><span class="wdi_username">'+e.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'images/delete_user.png"></div>'),jQuery("#wdi_feed_users_ajax").append(newUser),jQuery("#wdi_add_user_ajax_input").val(""),this.feed_users.push({id:e.id,username:e.username,profile_picture:""})):alert(e.username+" "+wdi_messages.already_added),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0)},wdi_controller.getUserProfilePic=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return this.feed_users[t].profile_picture;return"false"},wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters(),this.updateFiltersUi();var t=this;function e(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden"),jQuery("#wdi_final_condition").addClass("wdi_hidden"),jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden"),jQuery("#wdi_final_condition").removeClass("wdi_hidden"),jQuery("#WDI_filter_source").removeClass("wdi_hidden")}}jQuery("#wdi_add_filter").on("click",function(){t.addConditionalFilter()&&jQuery("#wdi_filter_input").val("")}),jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")}),jQuery("#wdi_filter_input").on("keypress",function(e){if(13==e.keyCode)return t.addConditionalFilter()&&jQuery(this).val(""),!1}),e(),jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){e()}),jQuery("#WDI_conditional_filter_type").on("change",function(){switch("none"==jQuery(this).val()||jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").css({display:"inline-block"}),jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.nor_descr)}wdi_controller.updateFiltersUi()}),jQuery("#WDI_conditional_filter_type").trigger("change")},wdi_controller.addConditionalFilter=function(){var e=jQuery("#wdi_filter_input").val(),t=jQuery("#wdi_filter_type").val();if(filter={},""==e)return!1;switch(e=e.trim(),null==t&&("@"==e[0]?t="mention":"#"==e[0]?t="hashtag":"http"!=e.split("://")[0]&&"https"!=e.split("://")[0]||(t="url")),t){case"username":case"mention":"@"==e[0]&&(e=e.substr(1,e.length));break;case"hashtag":"#"==e[0]&&(e=e.substr(1,e.length));break;case"url":if(!/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e))return alert(wdi_messages.invalid_url),!1}return filter={filter_type:t,filter_by:e,id:this.randomId()},null!=t?this.filterExists(filter)?(alert(e+" "+wdi_messages.already_added),!1):(this.conditionalFilters.push(filter),this.updateFiltersUi(),!0):(alert(wdi_messages.selectConditionType),!1)},wdi_controller.filterExists=function(e){for(var t=0;t<this.conditionalFilters.length;t++)if(this.conditionalFilters[t].filter_type==e.filter_type&&this.conditionalFilters[t].filter_by==e.filter_by)return!0;return!1},wdi_controller.updateFiltersUi=function(){for(var e,t=jQuery("#wdi_filters_ui").html(""),i=0;i<this.conditionalFilters.length;i++){if(0==i)if(1!=this.conditionalFilters.length)switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"))}else switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":case"OR":break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"))}switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":e=wdi_messages.and;break;case"OR":e=wdi_messages.or;break;case"NOR":e=wdi_messages.nor}1<=i&&t.append(jQuery('<span class="wdi_logic">'+e+"</span>")),t.append(this.createUiElement(this.conditionalFilters[i]))}this.updateFilterTextarea()},wdi_controller.createUiElement=function(e){var t;switch(e.filter_type){case"mention":t="@";break;case"hashtag":t="#";break;case"location":t="%";break;default:t=""}return jQuery('<span data-id="'+e.id+'" class="wdi_filter_item wdi_filter_by_'+e.filter_type+'"></span>').html(t+e.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>')},wdi_controller.randomId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},wdi_controller.removeConditionalFilter=function(e){for(var t=e.parent().attr("data-id"),i=0;i<this.conditionalFilters.length;i++)this.conditionalFilters[i].id==t&&this.conditionalFilters.splice(i,1);this.updateFiltersUi()},wdi_controller.updateFilterTextarea=function(){var e=this.conditionalFilters,e=JSON.stringify(e);jQuery("#wdi_conditional_filters_textarea").val(e)},wdi_controller.setInitialFilters=function(){var e=[],t=jQuery("#wdi_conditional_filters_textarea").val();this.isJsonString(t)&&(e=JSON.parse(t)),this.conditionalFilters=e},wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()},wdi_controller.updateFilterSource=function(){if("liked"!=jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()){var e,t,i=[];jQuery(".wdi_user").each(function(){e=(0!=jQuery(this).find(".wdi_username").length?jQuery(this).find(".wdi_username"):jQuery(this).find(".wdi_hashtag")).text(),t=jQuery(this).find("img").attr("src"),i.push({username:e,image:t})});for(var r=jQuery("#wdi_filter_source").html(""),a=0;a<i.length;a++){s="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+i[a].image+"'></span><span class='wdi_source_username'>"+i[a].username+"</span></div>";r.html(r.html()+s)}}else{var r,s="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";(r=jQuery("#wdi_filter_source").html("")).html(r.html()+s)}},wdi_controller.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_controller.getUserObj=function(e){var t=JSON.parse(wdi_options.wdi_authenticated_users_list);if("object"==typeof t){if("object"==typeof t[e]&&""!=t[e])return t[e];console.log("Error: User not exist on Users object")}else console.log("Error: Wrong response when parsed on users (JSON.parse)");return!1};
1
+ function wdi_multiple_accounts_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_multiple_accounts_section");var t="";if(wdi_options.wdi_authenticated_users_list){var i,r=JSON.parse(wdi_options.wdi_authenticated_users_list),a=0;for(i in r)t+="<tr data-multiple-account='"+a+"'>",t+="<th>Access Token</th>",t+='<td><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][access_token][]" size="53" required="" value="'+r[i].access_token+'"></td>',t+="</tr>",t+="<tr data-multiple-account='"+a+"' class='wdi_username_tr'>",t+="<th>Username</th>",t+='<td><div class="wdi_input_wrapper"><input type="text" name="wdi_instagram_options[wdi_authenticated_users_list][user_name][]" size="53" required="" value="'+r[i].user_name+'"></div><div class="wdi_remove_auth_user">Delete</div></td>',t+='<input type="hidden" name="wdi_instagram_options[wdi_authenticated_users_list][user_id][]" size="53" required="" value="'+r[i].user_id+'">',t+="</tr>",a++;e.append(t)}jQuery(".wdi_remove_auth_user").on("click",function(e){e.preventDefault();e=jQuery(this).closest(".wdi_username_tr").data("multiple-account");return jQuery(this).closest(".wdi_multiple_accounts_section").find('tr[data-multiple-account="'+e+'"]').remove(),!1})}function wdi_advanced_option_controller(){var e=jQuery(jQuery("#wdi_user_id").closest("form").find(".form-table").get(1));e.addClass("wdi_advanced_option wdi_advanced_option_close");$tr=jQuery("<tr class='wdi_advanced_option_head'><th style='width: 100%;'>ADVANCED OPTIONS AND MULTIPLE INSTAGRAM ACCOUNTS</th><td><div class='wdi_advanced_option_icon'></div></td></tr>"),e.prepend($tr),$tr.on("click",function(){e.hasClass("wdi_advanced_option_open")?(e.removeClass("wdi_advanced_option_open"),e.addClass("wdi_advanced_option_close")):(e.removeClass("wdi_advanced_option_close"),e.addClass("wdi_advanced_option_open"))})}function wdi_controller(){}jQuery(document).ready(function(){function e(e){if(!1===e){var t=JSON.parse(localStorage.getItem("wdi_sections"));for(i in null!==t&&!1!==t||(t={wdi_layout_section:"show",wdi_media:"show",wdi_layout:"hide",wdi_advanced:"hide",wdi_lightbox_general:"show",wdi_lightbox_advanced:"hide",wdi_conditional_filters:"show",wdi_how_to_publish:"show"},localStorage.setItem("wdi_sections",JSON.stringify(t))),t){var r=jQuery("#wdi_save_feed").find("[data-section_name='"+i+"']");n(t[i],r)}}else{var a=jQuery(e).data("section_name"),s=null;e.hasClass("wdi_section_open")?(n("show",e),s="show"):e.hasClass("wdi_section_close")&&(n("hide",e),s="hide"),null!=s&&((e=JSON.parse(localStorage.getItem("wdi_sections"))||{})[a]=s,localStorage.setItem("wdi_sections",JSON.stringify(e)))}}function n(e,t){"show"===e?("table"===(e=t.closest(".wdi_section").find(".wdi_elements")).data("display")?e.css({display:"table"}):e.css({display:"block"}),t.css({"border-bottom":"1px solid #f1f1f1",margin:"0 auto 15px"}),t.removeClass("wdi_section_open"),t.addClass("wdi_section_close")):(t.closest(".wdi_section").find(".wdi_elements").css({display:"none"}),t.css({"border-bottom":"0px",margin:"0 auto 0px"}),t.removeClass("wdi_section_close"),t.addClass("wdi_section_open"))}jQuery("#wdi_reset_cache").click(function(e){jQuery(".wdi_reset_cache_success").remove(),jQuery("#wdi_save_loading").removeClass("wdi_hidden"),e.preventDefault(),jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{wdi_nonce:wdi_ajax.wdi_nonce,task:"reset",action:"wdi_cache"},success:function(e){!1===e.success?jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>"):(wdi_controller.instagram=new WDIInstagram,jQuery.each(e.data,function(e,t){var i=JSON.parse(t.users),r="",a="",s="",n=t.endpoint;jQuery.each(i,function(e,t){""!==t.tag_id?(a=(a=(a=t.username).substr(1,a.length)).replace(" ",""),s=t.tag_id):r=(r=wdi_controller.getUserObj(t.username))&&r.user_name});t=t.feed_id;wdi_controller.instagram.set_cache_data("",r,t,"",0,0,a,s,n,"")}),jQuery("#wdi_reset_cache").after("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>"))}})}),jQuery(".wdi_account_refresh").click(function(){var t=jQuery(this),e=t.data("wdi_account");jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_refresh",nonce:wdi_ajax.wdi_nonce,user_name:e},success:function(e){t.closest("div").find(".wdi_reset_cache_success").remove(),!0===e.success?(t.after("<span class='wdi_reset_cache_success' style='color: #029117; margin-left: 15px; line-height: 2;'>Success</span>"),t.closest("div").find(".wdi_user_token").val(e.token)):t.after("<span class='wdi_reset_cache_success' style='color: #fc0000; margin-left: 15px; line-height: 2;'>Failed</span>")}})}),wdi_controller.bindSaveFeedEvent(),wdi_controller.bindAddNewUserOrHashtagEvent(),jQuery(".display_type input").on("click",function(){wdi_controller.displaySettingsSection(jQuery(this))}),wdi_controller.conditionalFiltersTabInit(),wdi_controller.bindSaveThemeEvent(),jQuery("body").hasClass("instagram-feed_page_wdi_settings")&&wdi_advanced_option_controller(),jQuery(".wdi_section_name").click(function(){e(jQuery(this))}),e(!1),jQuery(document).on("click",".wdi-account-show-token",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents("li").find(".wdi-account-accesstoken").slideToggle(300)}),jQuery(document).on("click",".wdi-advanced-options .wdi-advanced-headline",function(){jQuery(this).find("i").toggleClass("dashicons-arrow-up-alt2 dashicons-arrow-down-alt2"),jQuery(this).parents(".wdi-advanced-options").find(".wdi-advanced-body").slideToggle(500)}),jQuery(document).on("click","#wdi_verify",function(){jQuery("#wdi_submit").prop("disabled",!0),jQuery(this).is(":checked")&&jQuery("#wdi_submit").prop("disabled",!1)}),jQuery(document).on("click","#wdi_submit",function(){return confirm(wdi_messages.uninstall_plugin)&&jQuery("#wdi_uninstall_form").submit(),!1}),jQuery("#WDI_feed_name").on("keypress",function(){jQuery(this).removeAttr("style")})}),wdi_controller.getParameterByName=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");e=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},wdi_controller.apiRedirected=function(){var e=this.getParameterByName("access_token").split("."),t=/^[^\\\/&?><"']*$/;for(i=0;i<e.length;i++)if(null===e[i].match(t))return;var r=e.join(".");jQuery(document).ready(function(){""===wdi_options.wdi_access_token?jQuery("#wdi_access_token").attr("value",r):(jQuery(".wdi_more_token_template .wdi_more_access_token").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_access_token").attr("value",r))}),wdi_controller.instagram.addToken(r),wdi_controller.getUserInfo(r)},wdi_controller.getUserInfo=function(e){this.instagram.getSelfInfo({success:function(e){""===wdi_options.wdi_access_token?(jQuery("#wdi_user_name").attr("value",e.data.username),jQuery("#wdi_user_id").attr("value",e.data.id)):(jQuery(".wdi_more_token_template .wdi_more_user_name").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_id").prop("disabled",!1),jQuery(".wdi_more_token_template .wdi_more_user_name").attr("value",e.data.username),jQuery(".wdi_more_token_template .wdi_more_user_id").attr("value",e.data.id)),jQuery(document).trigger("wdi_settings_filled")}})},wdi_controller.oldDisplayType={},wdi_controller.displayTypeMemory={},wdi_controller.switchFeedTabs=function(e,t){jQuery("#wdi_refresh_tab").attr("value",e),jQuery(".wdi_tab").hide(),jQuery("#"+e+"_tab").show(),jQuery(".wdi_element_name_popup_enable_comment").hide(),"business"===jQuery("#WDI_user_name option:selected").data("type")&&jQuery(".wdi_element_name_popup_enable_comment").show(),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery('.display_type[tab="'+e+'"]').length?jQuery(".display_type_content").show():jQuery(".display_type_content").hide(),jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active");var i=jQuery(),r=!1;null!=t&&""!=t&&(i=jQuery(".display_type #"+t).prop("checked",!0),jQuery("#wdi_feed_type").attr("value",t)),r||0!=(i=jQuery('.display_type[tab="'+e+'"] input[name="feed_type"]:checked')).length&&(r=!0),r||0!=(i=jQuery('.display_type[tab="'+e+'"] #thumbnails')).length&&(r=!0,i.prop("checked",!0),jQuery("#wdi_feed_type").attr("value","thumbnails")),r&&wdi_controller.displaySettingsSection(i),"conditional_filters"==e&&wdi_controller.updateConditionalFiltersUi()},wdi_controller.displaySettingsSection=function(e){var i=e.attr("id").toLowerCase().trim(),t=e.parent().parent().attr("tab"),e=jQuery("#wdi_refresh_section");wdi_controller.oldDisplayType={section:i,tab:t},wdi_controller.displayTypeMemory[t]=wdi_controller.oldDisplayType,null!=e&&e.attr("value",i);e=jQuery(".wdi_border_wrapper .form-table");jQuery("#wdi_feed_type").attr("value",i);var r=0,a=!1;e.find(".wdi_element").each(function(){0;var e=jQuery(this).find(".wdwt_param").children().children().children().attr("section");if(void 0!==e){a=!1;var t=e.toLowerCase().trim().split(",");for(r=0;r<t.length;r++)t[r]===i&&(jQuery(this).css("display","block"),a=!0);!1===a&&jQuery(this).css("display","none")}})},wdi_controller.switchThemeTabs=function(e,t){jQuery(".wdi_feed_tabs").filter(".wdi_feed_tab_active").each(function(){jQuery(this).removeClass("wdi_feed_tab_active")}),jQuery("#wdi_"+e).addClass("wdi_feed_tab_active"),jQuery("[tab]").each(function(){jQuery(this).attr("tab")!=e?jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","none"):jQuery(this).parent().parent().parent().parent().parent().filter("tr").css("display","block")}),jQuery(".display_type").css("display","none"),jQuery('.display_type[tab="'+e+'"]').css("display","block"),jQuery("#wdi_refresh_tab").attr("value",e),null!=t&&""!=t&&jQuery("#wdi_refresh_section").attr("value",t),(null==t&&""!=t?null!=wdi_controller.displayTypeMemory[e]?jQuery(".display_type #"+wdi_controller.displayTypeMemory[e].section):jQuery('.display_type[tab="'+e+'"]').first().find("input"):jQuery(".display_type #"+t)).trigger("click")},wdi_controller.bindSaveFeedEvent=function(){var e=this;jQuery("#wdi_save_feed_submit").on("click",function(){e.save_feed("save_feed")}),jQuery("#wdi_save_feed_apply").on("click",function(){e.save_feed("apply_changes")}),jQuery("#wdi_cancel_changes").on("click",function(){e.save_feed("cancel")})},wdi_controller.save_feed=function(e){var t,i,r,a=[],s={};"cancel"==e&&(window.location=window.location.href),t=jQuery("#WDI_user_name option:selected").data("type"),n=jQuery("#WDI_user_name option:selected").val(),i=jQuery("#WDI_feed_name");var n=wdi_controller.getUserObj(n);if(""==i.val())return alert(wdi_messages.feed_title_field_required),i.focus().attr("style","border-color: #FF0000;"),!1;if(!n)return alert(wdi_messages.user_field_required),!1;if(r={id:n.user_id,username:n.user_name},wdi_controller.checkIfUserNotSaved(e),0==wdi_controller.waitingAjaxRequestEnd.button){if(s=jQuery("#WDI_feed_users").val(),this.isJsonString(s)){for(var d in s=JSON.parse(s))"business"==t&&"#"===s[d].username.charAt(0)&&a.push(s[d]);a.push(r)}else a.push(r);users=this.stringifyUserData(a),jQuery("#WDI_feed_users").val(users),jQuery("#wdi_feed_thumb").val(""),"business"==t&&jQuery("#wdi_feed_thumb").val(n.profile_picture_url),"apply_changes"!=e&&"save_feed"!=e||(n=jQuery("#wdi_add_or_edit").val(),jQuery("#wdi_current_id").val(n)),jQuery("#task").attr("value",e),submit_ajax()}};var comlete_redirect_url="";function submit_ajax(){var e=(e=jQuery("#wdi_save_feed").serialize())+"&action=wdi_apply_changes&page=wdi_feeds&wdi_nonce="+wdi_ajax.wdi_nonce;jQuery("#wdi_save_loading").removeClass("wdi_hidden"),jQuery.ajax({url:wdi_ajax.ajax_url,type:"POST",dataType:"json",data:e,success:function(e){comlete_redirect_url=e.url;var t=e.feed_id;1==e.need_cache?(jQuery(".caching-process-message").removeClass("wdi_hidden"),setTimeout(function(){wdi_controller.instagram.set_cache_data(comlete_redirect_url,"",t,"",0,0,"","","","")},1e3)):(jQuery("#wdi_save_loading").addClass("wdi_hidden"),window.location=comlete_redirect_url)},error:function(e,t,i){window.location=comlete_redirect_url}})}function wdi_spider_select_value(e){e.focus(),e.select()}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_spider_form_submit(e,t){document.getElementById(t)&&document.getElementById(t).submit(),e.preventDefault?e.preventDefault():e.returnValue=!1}function wdi_bulk_actions(e){e=jQuery(e).val();return""!=e&&(!("delete_all"==e&&!confirm(wdi_messages.do_you_want_to_delete_selected_items))&&(wdi_spider_set_input_value("task",e),jQuery("#wdi_feed_form").submit(),!0))}function wdi_spider_check_all_items(){wdi_spider_check_all_items_checkbox(),jQuery("#check_all").trigger("click")}function wdi_spider_check_all_items_checkbox(){var e;jQuery("#check_all_items").prop("checked")?(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide()):(e=parseInt(jQuery(".displaying-num").html())?parseInt(jQuery(".displaying-num").html()):0,e=(jQuery('input[id^="check_pr_"]').length?parseInt(jQuery('input[id^="check_pr_"]').length):0)+e,jQuery("#check_all_items").prop("checked",!0),e&&(jQuery("#draganddrop").html("<strong><p>Selected "+e+" item"+(1<e?"s":"")+".</p></strong>"),jQuery("#draganddrop").show()))}function wdi_spider_check_all(e){jQuery(e).prop("checked")||(jQuery("#check_all_items").prop("checked",!1),jQuery("#draganddrop").hide())}function wdi_spider_set_input_value(e,t){"add"===t&&""==jQuery("#wdi_access_token").attr("value")&&alert("Please get your access token"),document.getElementById(e)&&(document.getElementById(e).value=t)}function wdi_account_remove(e,t){jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:{page:"wdi_settings",action:"wdi_account_disconnect",nonce:wdi_ajax.wdi_nonce,user_name:e,user_id:t},success:function(e){e.success&&(1==jQuery('[class*="wdi-account-list"]').length?((e=jQuery(".wdi-account-list-"+t).parent()).prev().remove(),e.remove(),jQuery("#toplevel_page_wdi_feeds ul").remove(),jQuery("#toplevel_page_wdi_feeds a").attr("href","admin.php?page=wdi_settings")):jQuery(".wdi-account-list-"+t).remove())}})}function wdi_popup_open(){jQuery(".wdi-popup").show()}function wdi_popup_close(){jQuery(".wdi-popup").hide()}wdi_controller.makeInstagramUserRequest=function(e,t){var i,r=this,a=this.getInputType(e),s="hashtag"===a,n=jQuery("#wdi_add_or_edit").val();if(""==e)return alert(wdi_messages.please_write_hashtag),!1;if(""!=e&&!s)return alert(wdi_messages.invalid_hashtag),!1;if(r.checkForDuplicateUser(e))return alert(e+" "+wdi_messages.already_added),!1;switch(i=jQuery("#WDI_user_name option:selected").val(),(s=wdi_controller.getUserObj(i))&&(this.instagram.user=s),a){case"user":break;case"hashtag":var d=(d=e.substr(1,e.length)).replace(" ",""),l=(jQuery("input[name='wdi_feed_settings[hashtag_top_recent]']:checked").val(),{tagname:d,action:"wdi_getHashtagId",wdi_nonce:wdi_ajax.wdi_nonce,user_name:i,feed_id:n});jQuery.ajax({type:"POST",url:wdi_ajax.ajax_url,dataType:"json",data:l,success:function(e){jQuery("#wdi_add_user_ajax").removeAttr("disabled");var t=r.isValidResponse(e);t.valid?r.addHashtag(d,e):alert(t.msg)},error:function(e,t,i){}})}},wdi_controller.checkForDuplicateUser=function(e){var t=jQuery("#WDI_feed_users").val();if(this.isJsonString(t)){t=JSON.parse(t);for(var i=0;i<t.length;i++)if(e==t[i].username)return!0}return!1},wdi_controller.getInputType=function(e){switch(e[0]){case"#":return"hashtag";case"%":return"location";default:return"user"}},wdi_controller.stringifyUserData=function(e){for(var t=[],i=0;i<e.length;i++)t.push({id:e[i].id,username:e[i].username,tag_id:void 0!==e[i].tag_id?e[i].tag_id:""});return JSON.stringify(t)},wdi_controller.bindAddNewUserOrHashtagEvent=function(){jQuery("#wdi_add_user_ajax").on("click",function(){void 0!==jQuery(this).prop("disabled")||jQuery(this).prop("disabled",!0);var e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery(this).removeAttr("disabled","disabled")}),jQuery("#wdi_add_user_ajax_input").on("keypress",function(e){if(13==e.keyCode){void 0!==jQuery("#wdi_add_user_ajax").prop("disabled")||jQuery("#wdi_add_user_ajax").prop("disabled",!0);e=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return!1===wdi_controller.makeInstagramUserRequest(e)&&jQuery("#wdi_add_user_ajax").removeAttr("disabled","disabled"),!1}})},wdi_controller.removeFeedUser=function(e){var t,i=e.parent().find("a span").text();e.parent().find("a span").hasClass("wdi_hashtag")&&(i="#"+i),0!=this.feed_users.length||void 0!==(t=jQuery("#WDI_feed_users").val())&&this.isJsonString(t)&&(this.feed_users=JSON.parse(t));for(var r=0;r<this.feed_users.length;r++)if(this.feed_users[r].username==i){this.feed_users.splice(r,1);break}for(r=0;r<this.feed_users.length;r++)"#"!==this.feed_users[r].username.charAt(0)&&this.feed_users.splice(r,1);jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users)),e.parent().remove(),wdi_controller.changed_users()},wdi_controller.bindSaveThemeEvent=function(){jQuery("#wdi_save_theme_submit").on("click",function(){jQuery("#task").attr("value","save_feed"),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_apply").on("click",function(){jQuery("#task").attr("value","apply_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()}),jQuery("#wdi_save_theme_reset").on("click",function(){jQuery("#task").attr("value","reset_changes");var e=jQuery("#wdi_add_or_edit").attr("value");jQuery("#wdi_current_id").attr("value",e),jQuery("#wdi_save_feed").submit()})},wdi_controller.checkIfUserNotSaved=function(e){switch(e){case"save_feed":e="submit";break;case"apply_changes":e="apply";break;case"reset_changes":e="reset"}if(""==jQuery("#wdi_add_user_ajax_input").val().trim())return wdi_controller.waitingAjaxRequestEnd={button:0},0;var t=jQuery("#wdi_add_user_ajax_input").val().trim().toLowerCase();return wdi_controller.waitingAjaxRequestEnd={button:e},wdi_controller.makeInstagramUserRequest(t),1},wdi_controller.saveFeedAfterAjaxWait=function(e){var t;null!=wdi_controller.waitingAjaxRequestEnd&&(t=wdi_controller.waitingAjaxRequestEnd.button,e&&0!=t&&jQuery("#wdi_save_feed_"+t).trigger("click"),wdi_controller.waitingAjaxRequestEnd=void 0)},wdi_controller.getCookie=function(e){e=("; "+document.cookie).split("; "+e+"=");if(2==e.length)return e.pop().split(";").shift()},wdi_controller.isValidResponse=function(e){var t={};return void 0===e||void 0===e.meta.code||200!=e.meta.code?(t.valid=!1,void 0===e?t.msg=wdi_messages.instagram_server_error:200!==e.meta.code?t.msg=e.meta.message:t.msg=""):(t.valid=!0,t.msg="success"),t},wdi_controller.hasData=function(e){return void 0!==e&&void 0!==e.data&&0!=e.data.length},wdi_controller.thumbUser=function(e){return 0<this.feed_users.length&&this.feed_users[0].username===e},wdi_controller.findUser=function(e,t){var i=[];void 0!==t&&void 0!==t.data&&(i=t.data);for(var r=0;r<i.length;r++)if(i[r].username==e)return i[r];return!1},wdi_controller.addHashtag=function(e,t){if(null==e.match(/[~!@$%&*#^()<>?]/)){var i=jQuery('<div class="wdi_user"><a target="_blank" href="https://instagram.com/explore/tags/'+e+'"><img class="wdi_profile_pic" src="'+wdi_url.plugin_url+'images/hashtag.png"><span class="wdi_hashtag">'+e+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'/images/delete_user.png"></div>');jQuery("#wdi_feed_users_ajax").append(i),jQuery("#wdi_add_user_ajax_input").val("");var r=jQuery("#WDI_feed_users").val();if(this.isJsonString(r)){r=JSON.parse(r);for(var a=0;a<r.length;a++)"#"!==r[a].username.charAt(0)&&r.splice(a,1)}else r=[];t={id:"#"+e,username:"#"+e,profile_picture:"",tag_id:t.tag_id};r.push(t),this.feed_users=r,jQuery("#WDI_feed_users").val(this.stringifyUserData(this.feed_users))}else alert(wdi_messages.invalid_hashtag);this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0),wdi_controller.changed_users()},wdi_controller.changed_users=function(){for(var e=!1,t=0;t<this.feed_users.length;t++)if("#"===this.feed_users[t].username[0]){e=!0;break}e?(jQuery(".wdi_element_name_hashtag_top_recent").show(),jQuery(".wdi_element_name_show_username_on_thumb").hide()):(jQuery(".wdi_element_name_hashtag_top_recent").hide(),jQuery(".wdi_element_name_show_username_on_thumb").show())},wdi_controller.addUser=function(e){e.username=e.user_name,0==this.checkForDuplicateUser(e.username)?(newUser=jQuery('<div class="wdi_user"><a target="_blank" href="http://www.instagram.com/'+e.username+'"><span class="wdi_username">'+e.username+'</span><i style="display:table-cell;width:25px;"></i></a><img class="wdi_remove_user" onclick="wdi_controller.removeFeedUser(jQuery(this))" src="'+wdi_url.plugin_url+'images/delete_user.png"></div>'),jQuery("#wdi_feed_users_ajax").append(newUser),jQuery("#wdi_add_user_ajax_input").val(""),this.feed_users.push({id:e.id,username:e.username,profile_picture:""})):alert(e.username+" "+wdi_messages.already_added),this.updateConditionalFiltersUi(),wdi_controller.saveFeedAfterAjaxWait(!0)},wdi_controller.getUserProfilePic=function(e){for(var t=0;t<this.feed_users.length;t++)if(e==this.feed_users[t].username)return this.feed_users[t].profile_picture;return"false"},wdi_controller.conditionalFiltersTabInit=function(){this.setInitialFilters(),this.updateFiltersUi();var t=this;function e(){switch(jQuery("#WDI_wrap_conditional_filter_enable input:checked").val()){case"0":jQuery("#WDI_conditional_filters").parent().parent().addClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().addClass("wdi_hidden"),jQuery("#wdi_final_condition").addClass("wdi_hidden"),jQuery("#WDI_filter_source").addClass("wdi_hidden");break;case"1":jQuery("#WDI_conditional_filters").parent().parent().removeClass("wdi_hidden"),jQuery("#WDI_conditional_filter_type").parent().parent().parent().parent().parent().removeClass("wdi_hidden"),jQuery("#wdi_final_condition").removeClass("wdi_hidden"),jQuery("#WDI_filter_source").removeClass("wdi_hidden")}}jQuery("#wdi_add_filter").on("click",function(){t.addConditionalFilter()&&jQuery("#wdi_filter_input").val("")}),jQuery(".wdi_filter_radio").on("click",function(){jQuery("#wdi_filter_input").trigger("focus")}),jQuery("#wdi_filter_input").on("keypress",function(e){if(13==e.keyCode)return t.addConditionalFilter()&&jQuery(this).val(""),!1}),e(),jQuery("#WDI_wrap_conditional_filter_enable input").on("change",function(){e()}),jQuery("#WDI_conditional_filter_type").on("change",function(){switch("none"==jQuery(this).val()||jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").css({display:"inline-block"}),jQuery(this).val()){case"AND":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.and_descr);break;case"OR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.or_descr);break;case"NOR":jQuery("#WDI_conditional_filters").css("display","block"),jQuery(this).parent().find("label").html(wdi_messages.nor_descr)}wdi_controller.updateFiltersUi()}),jQuery("#WDI_conditional_filter_type").trigger("change")},wdi_controller.addConditionalFilter=function(){var e=jQuery("#wdi_filter_input").val(),t=jQuery("#wdi_filter_type").val();if(filter={},""==e)return!1;switch(e=e.trim(),null==t&&("@"==e[0]?t="mention":"#"==e[0]?t="hashtag":"http"!=e.split("://")[0]&&"https"!=e.split("://")[0]||(t="url")),t){case"username":case"mention":"@"==e[0]&&(e=e.substr(1,e.length));break;case"hashtag":"#"==e[0]&&(e=e.substr(1,e.length));break;case"url":if(!/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e))return alert(wdi_messages.invalid_url),!1}return filter={filter_type:t,filter_by:e,id:this.randomId()},null!=t?this.filterExists(filter)?(alert(e+" "+wdi_messages.already_added),!1):(this.conditionalFilters.push(filter),this.updateFiltersUi(),!0):(alert(wdi_messages.selectConditionType),!1)},wdi_controller.filterExists=function(e){for(var t=0;t<this.conditionalFilters.length;t++)if(this.conditionalFilters[t].filter_type==e.filter_type&&this.conditionalFilters[t].filter_by==e.filter_by)return!0;return!1},wdi_controller.updateFiltersUi=function(){for(var e,t=jQuery("#wdi_filters_ui").html(""),i=0;i<this.conditionalFilters.length;i++){if(0==i)if(1!=this.conditionalFilters.length)switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":break;case"OR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.either+"</span>"));break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.neither+"</span>"))}else switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":case"OR":break;case"NOR":t.append(jQuery('<span class="wdi_logic">'+wdi_messages.not+"</span>"))}switch(jQuery("#WDI_conditional_filter_type").val()){case"AND":e=wdi_messages.and;break;case"OR":e=wdi_messages.or;break;case"NOR":e=wdi_messages.nor}1<=i&&t.append(jQuery('<span class="wdi_logic">'+e+"</span>")),t.append(this.createUiElement(this.conditionalFilters[i]))}this.updateFilterTextarea()},wdi_controller.createUiElement=function(e){var t;switch(e.filter_type){case"mention":t="@";break;case"hashtag":t="#";break;case"location":t="%";break;default:t=""}return jQuery('<span data-id="'+e.id+'" class="wdi_filter_item wdi_filter_by_'+e.filter_type+'"></span>').html(t+e.filter_by+'<span onclick="wdi_controller.removeConditionalFilter(jQuery(this));" class="wdi_remove_filter">X</span>')},wdi_controller.randomId=function(){for(var e="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<5;i++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},wdi_controller.removeConditionalFilter=function(e){for(var t=e.parent().attr("data-id"),i=0;i<this.conditionalFilters.length;i++)this.conditionalFilters[i].id==t&&this.conditionalFilters.splice(i,1);this.updateFiltersUi()},wdi_controller.updateFilterTextarea=function(){var e=this.conditionalFilters,e=JSON.stringify(e);jQuery("#wdi_conditional_filters_textarea").val(e)},wdi_controller.setInitialFilters=function(){var e=[],t=jQuery("#wdi_conditional_filters_textarea").val();this.isJsonString(t)&&(e=JSON.parse(t)),this.conditionalFilters=e},wdi_controller.updateConditionalFiltersUi=function(){wdi_controller.updateFilterSource()},wdi_controller.updateFilterSource=function(){if("liked"!=jQuery('input[name="wdi_feed_settings[liked_feed]"]:checked').val()){var e,t,i=[];jQuery(".wdi_user").each(function(){e=(0!=jQuery(this).find(".wdi_username").length?jQuery(this).find(".wdi_username"):jQuery(this).find(".wdi_hashtag")).text(),t=jQuery(this).find("img").attr("src"),i.push({username:e,image:t})});for(var r=jQuery("#wdi_filter_source").html(""),a=0;a<i.length;a++){s="<div class='wdi_source_user'><span class='wdi_source_img'><img src='"+i[a].image+"'></span><span class='wdi_source_username'>"+i[a].username+"</span></div>";r.html(r.html()+s)}}else{var r,s="<div class='wdi_source_user'><span class='wdi_source_username'>Media I liked</span></div>";(r=jQuery("#wdi_filter_source").html("")).html(r.html()+s)}},wdi_controller.isJsonString=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},wdi_controller.getUserObj=function(e){var t=JSON.parse(wdi_options.wdi_authenticated_users_list);if("object"==typeof t){if("object"==typeof t[e]&&""!=t[e])return t[e];console.log("Error: User not exist on Users object")}else console.log("Error: Wrong response when parsed on users (JSON.parse)");return!1};
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: custom instagram feed, feed, instagram, hashtag, Instagram feed, instagram
4
  Requires at least: 3.9
5
  Requires PHP: 5.2
6
  Tested up to: 5.8
7
- Stable tag: 1.4.27
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -505,6 +505,9 @@ Please make sure you don't have any important information before you proceed.
505
  10Web Social Photo Feed for Instagram plugin uses Instagram API on website front end. You have to authorize the plugin via sign in to get data from Instagram on your behalf. The plugin does not send any user’s data to Instagram. All the data received from Instagram via API is cached in WordPress database for some short customizable period to provide front end optimization. You can delete or update cached data. Instagram saves some cookies in browsers of website visitors via API data. These cookies are mostly used for security purposes. They are regulated under terms of Instagram’s privacy policy https://instagram.com/legal/privacy. The plugin asks for your consent to collect site administrator’s email address and site URL to offer customer support, deals and discounts on premium products and more.
506
 
507
  == Changelog ==
 
 
 
508
  = 1.4.27 =
509
  Fixed: Security issue.
510
 
4
  Requires at least: 3.9
5
  Requires PHP: 5.2
6
  Tested up to: 5.8
7
+ Stable tag: 1.4.28
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
505
  10Web Social Photo Feed for Instagram plugin uses Instagram API on website front end. You have to authorize the plugin via sign in to get data from Instagram on your behalf. The plugin does not send any user’s data to Instagram. All the data received from Instagram via API is cached in WordPress database for some short customizable period to provide front end optimization. You can delete or update cached data. Instagram saves some cookies in browsers of website visitors via API data. These cookies are mostly used for security purposes. They are regulated under terms of Instagram’s privacy policy https://instagram.com/legal/privacy. The plugin asks for your consent to collect site administrator’s email address and site URL to offer customer support, deals and discounts on premium products and more.
506
 
507
  == Changelog ==
508
+ = 1.4.28 =
509
+ Fixed: Security issue.
510
+
511
  = 1.4.27 =
512
  Fixed: Security issue.
513
 
wd-instagram-feed.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: 10Web Social Photo Feed
4
  * Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
5
  * Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
6
- * Version: 1.4.27
7
  * Author: 10Web
8
  * Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
9
  * License: GPLv2 or later
@@ -453,6 +453,12 @@ function WDI_instagram_settings_page(){
453
  // Feeds page callback
454
  function WDI_instagram_feeds_page(){
455
  require_once(WDI_DIR . '/framework/WDILibrary.php');
 
 
 
 
 
 
456
  require_once(WDI_DIR . '/admin/controllers/feeds.php');
457
  $controller = new Feeds_controller_wdi();
458
  $controller->execute();
3
  * Plugin Name: 10Web Social Photo Feed
4
  * Plugin URI: https://10web.io/plugins/wordpress-instagram-feed/?utm_source=instagram_feed&utm_medium=free_plugin
5
  * Description: 10Web Social Photo Feed is a user-friendly tool for displaying user or hashtag-based feeds on your website. You can create feeds with one of the available layouts. It allows displaying image metadata, open up images in lightbox, download them and even share in social networking websites.
6
+ * Version: 1.4.28
7
  * Author: 10Web
8
  * Author URI: https://10Web.io/plugins/?utm_source=instagram_feed&utm_medium=free_plugin
9
  * License: GPLv2 or later
453
  // Feeds page callback
454
  function WDI_instagram_feeds_page(){
455
  require_once(WDI_DIR . '/framework/WDILibrary.php');
456
+ $ajax_nonce = WDILibrary::get('wdi_nonce');
457
+ $action = WDILibrary::get('action');
458
+ if ( $action == 'wdi_apply_changes' && wp_verify_nonce($ajax_nonce, 'wdi_cache') == FALSE ) {
459
+ die ( 'Invalid nonce.' );
460
+ }
461
+
462
  require_once(WDI_DIR . '/admin/controllers/feeds.php');
463
  $controller = new Feeds_controller_wdi();
464
  $controller->execute();
wd/includes/notices.php CHANGED
@@ -133,7 +133,7 @@ class TenWebLibNotices {
133
  // If user clicks to ignore the notice, update the option to not show it again
134
  if ( isset( $_GET[$wd_options->prefix . '_admin_notice_ignore'] ) ) {
135
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
136
- $admin_notice_ignore = esc_html($_GET[$wd_options->prefix . '_admin_notice_ignore']);
137
  $admin_notices_option[$admin_notice_ignore]['dismissed'] = 1;
138
  update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
139
  $query_str = remove_query_arg( $wd_options->prefix . '_admin_notice_ignore' );
@@ -154,12 +154,14 @@ class TenWebLibNotices {
154
  $date_array[1] += $interval;
155
  $new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
156
 
157
- $admin_notice_temp_ignore = esc_html($_GET[$wd_options->prefix . '_admin_notice_temp_ignore']);
158
- $admin_notices_option[$admin_notice_temp_ignore]['start'] = $new_start;
159
- $admin_notices_option[$admin_notice_temp_ignore]['dismissed'] = 0;
160
- update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
161
- $query_str = remove_query_arg( array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ) );
162
- wp_redirect( $query_str );
 
 
163
  exit;
164
  }
165
  }
@@ -168,7 +170,7 @@ class TenWebLibNotices {
168
  $wd_options = $this->config;
169
  foreach ( $pages as $key => $page ) {
170
  if (is_array($page)) {
171
- if ( isset( $_GET['page'] ) && esc_html($_GET['page']) == $page[0] && isset($_GET['tab']) && esc_html($_GET['tab']) == $page[1] ) {
172
  return true;
173
  }
174
  }
@@ -179,7 +181,7 @@ class TenWebLibNotices {
179
  if ( get_current_screen()->id === $page ) {
180
  return true;
181
  }
182
- if ( isset($_GET['page']) && esc_html($_GET['page']) == $page ) {
183
  return true;
184
  }
185
  }
133
  // If user clicks to ignore the notice, update the option to not show it again
134
  if ( isset( $_GET[$wd_options->prefix . '_admin_notice_ignore'] ) ) {
135
  $admin_notices_option = get_option( $wd_options->prefix . '_admin_notice', array() );
136
+ $admin_notice_ignore = sanitize_text_field($_GET[$wd_options->prefix . '_admin_notice_ignore']);
137
  $admin_notices_option[$admin_notice_ignore]['dismissed'] = 1;
138
  update_option( $wd_options->prefix . '_admin_notice', $admin_notices_option );
139
  $query_str = remove_query_arg( $wd_options->prefix . '_admin_notice_ignore' );
154
  $date_array[1] += $interval;
155
  $new_start = date( "n/j/Y", mktime( 0, 0, 0, $date_array[0], $date_array[1], $date_array[2] ) );
156
 
157
+ $admin_notice_temp_ignore = isset($_GET[$wd_options->prefix . '_admin_notice_temp_ignore']) ? sanitize_text_field($_GET[$wd_options->prefix . '_admin_notice_temp_ignore']) : '';
158
+ if( $admin_notice_temp_ignore != '' ) {
159
+ $admin_notices_option[$admin_notice_temp_ignore]['start'] = $new_start;
160
+ $admin_notices_option[$admin_notice_temp_ignore]['dismissed'] = 0;
161
+ update_option($wd_options->prefix . '_admin_notice', $admin_notices_option);
162
+ $query_str = remove_query_arg(array( $wd_options->prefix . '_admin_notice_temp_ignore', 'wd_int' ));
163
+ wp_redirect($query_str);
164
+ }
165
  exit;
166
  }
167
  }
170
  $wd_options = $this->config;
171
  foreach ( $pages as $key => $page ) {
172
  if (is_array($page)) {
173
+ if ( isset( $_GET['page'] ) && sanitize_text_field($_GET['page']) == $page[0] && isset($_GET['tab']) && sanitize_text_field($_GET['tab']) == $page[1] ) {
174
  return true;
175
  }
176
  }
181
  if ( get_current_screen()->id === $page ) {
182
  return true;
183
  }
184
+ if ( isset($_GET['page']) && sanitize_text_field($_GET['page']) == $page ) {
185
  return true;
186
  }
187
  }
wd/includes/subscribe.php CHANGED
@@ -53,7 +53,7 @@ class TenWebLibSubscribe
53
  $wd_options = $this->config;
54
  if (isset($_GET[$wd_options->prefix . "_sub_action"])) {
55
 
56
- if ( esc_html($_GET[$wd_options->prefix . "_sub_action"]) == "allow" ) {
57
  //$api = new TenWebLibApi($wd_options);
58
  $all_plugins = array();
59
  $plugins = get_plugins();
53
  $wd_options = $this->config;
54
  if (isset($_GET[$wd_options->prefix . "_sub_action"])) {
55
 
56
+ if ( sanitize_text_field($_GET[$wd_options->prefix . "_sub_action"]) == "allow" ) {
57
  //$api = new TenWebLibApi($wd_options);
58
  $all_plugins = array();
59
  $plugins = get_plugins();