WP User Avatar - Version 2.1.9

Version Description

  • New: New filter 'wpua_default_alt_tag' added to modify default image alt tag And warning error resolved on stagging environment.
Download this release

Release Info

Developer flippercode
Plugin Icon 128x128 WP User Avatar
Version 2.1.9
Comparing to
See all releases

Code changes from version 1.9.13 to 2.1.9

css/wp-user-avatar.css CHANGED
@@ -1,11 +1,11 @@
1
  #wpua-errors, #wpua-readable-size-error, .wpua-error { color: #c00 !important; font-weight: 700 !important; }
2
  #wpua-readable-size-error, #wpua-undo-button { display: none; }
3
- #wpua-preview { margin-right: 10px; }
4
- #wpua-preview, #wpua-thumbnail { display: inline-block; text-align: center; vertical-align: top; }
5
- #wpua-preview img, #wpua-thumbnail img { max-height: 96px; border: 1px solid #dfdfdf; display: block; }
6
- .widget_wp_user_avatar #wpua-preview img, .widget_wp_user_avatar #wpua-thumbnail img { max-height: 64px; }
7
- .defaultavatarpicker #wpua-preview { width: 32px; height: 32px; margin-right: 0; display: inline-block; overflow: hidden; vertical-align: middle; }
8
- .defaultavatarpicker #wpua-preview img { width: 32px; height: auto; border: 0; }
9
  #wpua-edit #wpua-remove, #wpua-edit #wpua-undo, #wpua-edit-attachment { margin-left: 10px !important; }
10
  #wpua-slider { width: 22.75em; }
11
  #wpua-upload-messages span { display: block; }
1
  #wpua-errors, #wpua-readable-size-error, .wpua-error { color: #c00 !important; font-weight: 700 !important; }
2
  #wpua-readable-size-error, #wpua-undo-button { display: none; }
3
+ #wpua-preview, #wpua-preview-existing { margin-right: 10px; }
4
+ #wpua-preview, #wpua-preview-existing, #wpua-thumbnail, #wpua-thumbnail-existing { display: inline-block; text-align: center; vertical-align: top; }
5
+ #wpua-preview img, #wpua-thumbnail img, #wpua-preview-existing img, #wpua-thumbnail-existing img { max-height: 96px; border: 1px solid #dfdfdf; display: block; }
6
+ .widget_wp_user_avatar #wpua-preview img, .widget_wp_user_avatar #wpua-thumbnail img, .widget_wp_user_avatar #wpua-preview-existing img, .widget_wp_user_avatar #wpua-thumbnail-existing img { max-height: 64px; }
7
+ .defaultavatarpicker #wpua-preview, .defaultavatarpicker #wpua-preview-existing { width: 32px; height: 32px; margin-right: 0; display: inline-block; overflow: hidden; vertical-align: middle; }
8
+ .defaultavatarpicker #wpua-preview img , .defaultavatarpicker #wpua-preview-existing img { width: 32px; height: auto; border: 0; }
9
  #wpua-edit #wpua-remove, #wpua-edit #wpua-undo, #wpua-edit-attachment { margin-left: 10px !important; }
10
  #wpua-slider { width: 22.75em; }
11
  #wpua-upload-messages span { display: block; }
images/mailoptin-banner.png ADDED
Binary file
images/wp-user-avatar-banner.png ADDED
Binary file
includes/class-wp-user-avatar-admin.php CHANGED
@@ -24,7 +24,6 @@ class WP_User_Avatar_Admin {
24
  // Settings saved to wp_options
25
  add_action('admin_init', array($this, 'wpua_options'));
26
  // Remove subscribers edit_posts capability
27
- register_deactivation_hook(WPUA_DIR.'wp-user-avatar.php', array($this, 'wpua_deactivate'));
28
  // Translations
29
  load_plugin_textdomain('wp-user-avatar', "", WPUA_FOLDER.'/lang');
30
  // Admin menu settings
@@ -43,6 +42,7 @@ class WP_User_Avatar_Admin {
43
  }
44
  // Media states
45
  add_filter('display_media_states', array($this, 'wpua_add_media_state'), 10, 1);
 
46
  }
47
 
48
  /**
@@ -51,6 +51,7 @@ class WP_User_Avatar_Admin {
51
  * @uses add_option()
52
  */
53
  public function wpua_options() {
 
54
  add_option('avatar_default_wp_user_avatar', "");
55
  add_option('wp_user_avatar_allow_upload', '0');
56
  add_option('wp_user_avatar_disable_gravatar', '0');
@@ -60,7 +61,24 @@ class WP_User_Avatar_Admin {
60
  add_option('wp_user_avatar_resize_upload', '0');
61
  add_option('wp_user_avatar_resize_w', '96');
62
  add_option('wp_user_avatar_tinymce', '1');
63
- add_option('wp_user_avatar_upload_size_limit', '0');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
65
 
66
  /**
@@ -82,6 +100,7 @@ class WP_User_Avatar_Admin {
82
  update_option($wp_user_roles, $user_roles);
83
  // Reset all default avatars to Mystery Man
84
  update_option('avatar_default', 'mystery');
 
85
  }
86
 
87
  /**
@@ -91,9 +110,9 @@ class WP_User_Avatar_Admin {
91
  * @uses add_submenu_page()
92
  */
93
  public function wpua_admin() {
94
- add_menu_page(__('WP User Avatar', 'wp-user-avatar'), __('Avatars'), 'manage_options', 'wp-user-avatar', array($this, 'wpua_options_page'), WPUA_URL.'images/wpua-icon.png');
95
- add_submenu_page('wp-user-avatar', __('Settings'), __('Settings'), 'manage_options', 'wp-user-avatar', array($this, 'wpua_options_page'));
96
- $hook = add_submenu_page('wp-user-avatar', __('Library'), __('Library'), 'manage_options', 'wp-user-avatar-library', array($this, 'wpua_media_page'));
97
  add_action("load-$hook", array($this, 'wpua_media_screen_option'));
98
  add_filter('set-screen-option', array($this, 'wpua_set_media_screen_option'), 10, 3);
99
  }
@@ -126,7 +145,7 @@ class WP_User_Avatar_Admin {
126
  public function wpua_media_screen_option() {
127
  $option = 'per_page';
128
  $args = array(
129
- 'label' => __('Avatars'),
130
  'default' => 10,
131
  'option' => 'upload_per_page'
132
  );
@@ -207,13 +226,13 @@ class WP_User_Avatar_Admin {
207
  $avatar_list = "";
208
  // Set avatar defaults
209
  $avatar_defaults = array(
210
- 'mystery' => __('Mystery Man'),
211
- 'blank' => __('Blank'),
212
- 'gravatar_default' => __('Gravatar Logo'),
213
- 'identicon' => __('Identicon (Generated)'),
214
- 'wavatar' => __('Wavatar (Generated)'),
215
- 'monsterid' => __('MonsterID (Generated)'),
216
- 'retro' => __('Retro (Generated)')
217
  );
218
  // No Default Avatar, set to Mystery Man
219
  if(empty($avatar_default)) {
@@ -245,14 +264,14 @@ class WP_User_Avatar_Admin {
245
  $wpua_list = "\n\t<label><input type='radio' name='avatar_default' id='wp_user_avatar_radio' value='wp_user_avatar'$selected_avatar /> ";
246
  $wpua_list .= preg_replace("/src='(.+?)'/", "src='\$1'", $avatar_thumb_img);
247
  $wpua_list .= ' '.__('WP User Avatar', 'wp-user-avatar').'</label>';
248
- $wpua_list .= '<p id="wpua-edit"><button type="button" class="button" id="wpua-add" name="wpua-add" data-avatar_default="true" data-title="'._('Choose Image').': '._('Default Avatar').'">'.__('Choose Image').'</button>';
249
- $wpua_list .= '<span id="wpua-remove-button"'.$hide_remove.'><a href="#" id="wpua-remove">'.__('Remove').'</a></span><span id="wpua-undo-button"><a href="#" id="wpua-undo">'.__('Undo').'</a></span></p>';
250
  $wpua_list .= '<input type="hidden" id="wp-user-avatar" name="avatar_default_wp_user_avatar" value="'.$wpua_avatar_default.'">';
251
  $wpua_list .= '<div id="wpua-modal"></div>';
252
  if((bool) $wpua_disable_gravatar != 1) {
253
  return $wpua_list.'<div id="wp-avatars">'.$avatar_list.'</div>';
254
  } else {
255
- return $wpua_list;
256
  }
257
  }
258
 
@@ -276,7 +295,7 @@ class WP_User_Avatar_Admin {
276
  */
277
  public function wpua_action_links($links, $file) {
278
  if(basename(dirname($file)) == 'wp-user-avatar') {
279
- $links[] = '<a href="'.add_query_arg(array('page' => 'wp-user-avatar'), admin_url('admin.php')).'">'.__('Settings').'</a>';
280
  }
281
  return $links;
282
  }
@@ -290,8 +309,7 @@ class WP_User_Avatar_Admin {
290
  */
291
  public function wpua_row_meta($links, $file) {
292
  if(basename(dirname($file)) == 'wp-user-avatar') {
293
- $links[] = '<a href="http://wordpress.org/support/plugin/wp-user-avatar" target="_blank">'.__('Support Forums').'</a>';
294
- $links[] = '<a href="http://siboliban.org/donate" target="_blank">'.__('Donate', 'wp-user-avatar').'</a>';
295
  }
296
  return $links;
297
  }
@@ -303,7 +321,7 @@ class WP_User_Avatar_Admin {
303
  * @return array
304
  */
305
  public function wpua_add_column($columns) {
306
- return $columns + array('wp-user-avatar' => __('Avatar'));
307
  }
308
 
309
  /**
@@ -357,10 +375,10 @@ class WP_User_Avatar_Admin {
357
  global $post, $wpua_avatar_default;
358
  $is_wpua = get_post_custom_values('_wp_attachment_wp_user_avatar', $post->ID);
359
  if(!empty($is_wpua)) {
360
- $states[] = __('Avatar');
361
  }
362
  if(!empty($wpua_avatar_default) && ($wpua_avatar_default == $post->ID)) {
363
- $states[] = __('Default Avatar');
364
  }
365
  /**
366
  * Filter media states
@@ -369,6 +387,7 @@ class WP_User_Avatar_Admin {
369
  */
370
  return apply_filters('wpua_add_media_state', $states);
371
  }
 
372
  }
373
 
374
  /**
24
  // Settings saved to wp_options
25
  add_action('admin_init', array($this, 'wpua_options'));
26
  // Remove subscribers edit_posts capability
 
27
  // Translations
28
  load_plugin_textdomain('wp-user-avatar', "", WPUA_FOLDER.'/lang');
29
  // Admin menu settings
42
  }
43
  // Media states
44
  add_filter('display_media_states', array($this, 'wpua_add_media_state'), 10, 1);
45
+
46
  }
47
 
48
  /**
51
  * @uses add_option()
52
  */
53
  public function wpua_options() {
54
+
55
  add_option('avatar_default_wp_user_avatar', "");
56
  add_option('wp_user_avatar_allow_upload', '0');
57
  add_option('wp_user_avatar_disable_gravatar', '0');
61
  add_option('wp_user_avatar_resize_upload', '0');
62
  add_option('wp_user_avatar_resize_w', '96');
63
  add_option('wp_user_avatar_tinymce', '1');
64
+ add_option('wp_user_avatar_upload_size_limit', '0');
65
+
66
+ if(wp_next_scheduled( 'wpua_has_gravatar_cron_hook' )){
67
+ $cron=get_option('cron');
68
+ $new_cron='';
69
+ foreach($cron as $key=>$value)
70
+ {
71
+ if(is_array($value))
72
+ {
73
+ if(array_key_exists('wpua_has_gravatar_cron_hook',$value))
74
+ unset($cron[$key]);
75
+ }
76
+ }
77
+ update_option('cron',$cron);
78
+ }
79
+
80
+
81
+
82
  }
83
 
84
  /**
100
  update_option($wp_user_roles, $user_roles);
101
  // Reset all default avatars to Mystery Man
102
  update_option('avatar_default', 'mystery');
103
+
104
  }
105
 
106
  /**
110
  * @uses add_submenu_page()
111
  */
112
  public function wpua_admin() {
113
+ add_menu_page(__('WP User Avatar', 'wp-user-avatar'), __('Avatars', 'wp-user-avatar'), 'manage_options', 'wp-user-avatar', array($this, 'wpua_options_page'), WPUA_URL.'images/wpua-icon.png');
114
+ add_submenu_page('wp-user-avatar', __('Settings' , 'wp-user-avatar'), __('Settings' , 'wp-user-avatar'), 'manage_options', 'wp-user-avatar', array($this, 'wpua_options_page'));
115
+ $hook = add_submenu_page('wp-user-avatar', __('Library','wp-user-avatar'), __('Library', 'wp-user-avatar'), 'manage_options', 'wp-user-avatar-library', array($this, 'wpua_media_page'));
116
  add_action("load-$hook", array($this, 'wpua_media_screen_option'));
117
  add_filter('set-screen-option', array($this, 'wpua_set_media_screen_option'), 10, 3);
118
  }
145
  public function wpua_media_screen_option() {
146
  $option = 'per_page';
147
  $args = array(
148
+ 'label' => __('Avatars','wp-user-avatar'),
149
  'default' => 10,
150
  'option' => 'upload_per_page'
151
  );
226
  $avatar_list = "";
227
  // Set avatar defaults
228
  $avatar_defaults = array(
229
+ 'mystery' => __('Mystery Man','wp-user-avatar'),
230
+ 'blank' => __('Blank','wp-user-avatar'),
231
+ 'gravatar_default' => __('Gravatar Logo','wp-user-avatar'),
232
+ 'identicon' => __('Identicon (Generated)','wp-user-avatar'),
233
+ 'wavatar' => __('Wavatar (Generated)','wp-user-avatar'),
234
+ 'monsterid' => __('MonsterID (Generated)','wp-user-avatar'),
235
+ 'retro' => __('Retro (Generated)','wp-user-avatar')
236
  );
237
  // No Default Avatar, set to Mystery Man
238
  if(empty($avatar_default)) {
264
  $wpua_list = "\n\t<label><input type='radio' name='avatar_default' id='wp_user_avatar_radio' value='wp_user_avatar'$selected_avatar /> ";
265
  $wpua_list .= preg_replace("/src='(.+?)'/", "src='\$1'", $avatar_thumb_img);
266
  $wpua_list .= ' '.__('WP User Avatar', 'wp-user-avatar').'</label>';
267
+ $wpua_list .= '<p id="wpua-edit"><button type="button" class="button" id="wpua-add" name="wpua-add" data-avatar_default="true" data-title="'.__('Choose Image').': '.__('Default Avatar').'">'.__('Choose Image','wp-user-avatar').'</button>';
268
+ $wpua_list .= '<span id="wpua-remove-button"'.$hide_remove.'><a href="#" id="wpua-remove">'.__('Remove','wp-user-avatar').'</a></span><span id="wpua-undo-button"><a href="#" id="wpua-undo">'.__('Undo','wp-user-avatar').'</a></span></p>';
269
  $wpua_list .= '<input type="hidden" id="wp-user-avatar" name="avatar_default_wp_user_avatar" value="'.$wpua_avatar_default.'">';
270
  $wpua_list .= '<div id="wpua-modal"></div>';
271
  if((bool) $wpua_disable_gravatar != 1) {
272
  return $wpua_list.'<div id="wp-avatars">'.$avatar_list.'</div>';
273
  } else {
274
+ return $wpua_list.'<div id="wp-avatars" style="display:none;">'.$avatar_list.'</div>';
275
  }
276
  }
277
 
295
  */
296
  public function wpua_action_links($links, $file) {
297
  if(basename(dirname($file)) == 'wp-user-avatar') {
298
+ $links[] = '<a href="'.esc_url(add_query_arg(array('page' => 'wp-user-avatar'), admin_url('admin.php'))).'">'.__('Settings','wp-user-avatar').'</a>';
299
  }
300
  return $links;
301
  }
309
  */
310
  public function wpua_row_meta($links, $file) {
311
  if(basename(dirname($file)) == 'wp-user-avatar') {
312
+ $links[] = '<a href="http://wordpress.org/support/plugin/wp-user-avatar" target="_blank">'.__('Support Forums','wp-user-avatar').'</a>';
 
313
  }
314
  return $links;
315
  }
321
  * @return array
322
  */
323
  public function wpua_add_column($columns) {
324
+ return $columns + array('wp-user-avatar' => __('Avatar','wp-user-avatar'));
325
  }
326
 
327
  /**
375
  global $post, $wpua_avatar_default;
376
  $is_wpua = get_post_custom_values('_wp_attachment_wp_user_avatar', $post->ID);
377
  if(!empty($is_wpua)) {
378
+ $states[] = __('Avatar','wp-user-avatar');
379
  }
380
  if(!empty($wpua_avatar_default) && ($wpua_avatar_default == $post->ID)) {
381
+ $states[] = __('Default Avatar','wp-user-avatar');
382
  }
383
  /**
384
  * Filter media states
387
  */
388
  return apply_filters('wpua_add_media_state', $states);
389
  }
390
+
391
  }
392
 
393
  /**
includes/class-wp-user-avatar-functions.php CHANGED
@@ -11,11 +11,59 @@ class WP_User_Avatar_Functions {
11
  * Constructor
12
  * @since 1.8
13
  * @uses add_filter()
 
 
14
  */
15
  public function __construct() {
16
  add_filter('get_avatar', array($this, 'wpua_get_avatar_filter'), 10, 5);
 
 
 
 
 
17
  }
18
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  /**
20
  * Returns true if user has Gravatar-hosted image
21
  * @since 1.4
@@ -31,25 +79,93 @@ class WP_User_Avatar_Functions {
31
  * @return bool $has_gravatar
32
  */
33
  public function wpua_has_gravatar($id_or_email="", $has_gravatar=0, $user="", $email="") {
 
 
 
 
 
 
34
  if(!is_object($id_or_email) && !empty($id_or_email)) {
35
  // Find user by ID or e-mail address
36
  $user = is_numeric($id_or_email) ? get_user_by('id', $id_or_email) : get_user_by('email', $id_or_email);
37
  // Get registered user e-mail address
38
  $email = !empty($user) ? $user->user_email : "";
39
  }
40
- // Check if Gravatar image returns 200 (OK) or 404 (Not Found)
41
- $hash = md5(strtolower(trim($email)));
42
- $gravatar = 'http://www.gravatar.com/avatar/'.$hash.'?d=404';
43
- $data = wp_cache_get($hash);
44
- if(false === $data) {
45
- $response = wp_remote_head($gravatar);
46
- $data = is_wp_error($response) ? 'not200' : $response['response']['code'];
47
- wp_cache_set($hash, $data, $group="", $expire=60*5);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
- $has_gravatar = ($data == '200') ? true : false;
 
 
 
50
  return (bool) $has_gravatar;
51
  }
52
 
 
53
  /**
54
  * Check if local image
55
  * @since 1.9.2
@@ -136,19 +252,58 @@ class WP_User_Avatar_Functions {
136
  * @return bool
137
  */
138
  public function has_wp_user_avatar($id_or_email="", $has_wpua=0, $user="", $user_id="") {
139
- global $blog_id, $wpdb, $wpua_avatar_default, $wpua_functions;
140
  if(!is_object($id_or_email) && !empty($id_or_email)) {
141
  // Find user by ID or e-mail address
 
142
  $user = is_numeric($id_or_email) ? get_user_by('id', $id_or_email) : get_user_by('email', $id_or_email);
143
  // Get registered user ID
144
- $user_id = !empty($user) ? $user->ID : "";
145
  }
146
  $wpua = get_user_meta($user_id, $wpdb->get_blog_prefix($blog_id).'user_avatar', true);
147
  // Check if avatar is same as default avatar or on excluded list
148
- $has_wpua = !empty($wpua) && ($wpua != $wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua) ? true : false;
149
  return (bool) $has_wpua;
150
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
 
152
  /**
153
  * Replace get_avatar only in get_wp_user_avatar
154
  * @since 1.4
@@ -177,12 +332,21 @@ class WP_User_Avatar_Functions {
177
  * @return string $avatar
178
  */
179
  public function wpua_get_avatar_filter($avatar, $id_or_email="", $size="", $default="", $alt="") {
 
180
  global $avatar_default, $mustache_admin, $mustache_avatar, $mustache_medium, $mustache_original, $mustache_thumbnail, $post, $wpua_avatar_default, $wpua_disable_gravatar, $wpua_functions;
181
  // User has WPUA
 
 
 
 
 
 
 
182
  if(is_object($id_or_email)) {
183
  if(!empty($id_or_email->comment_author_email)) {
184
  $avatar = get_wp_user_avatar($id_or_email, $size, $default, $alt);
185
  } else {
 
186
  $avatar = get_wp_user_avatar('unknown@gravatar.com', $size, $default, $alt);
187
  }
188
  } else {
@@ -190,36 +354,27 @@ class WP_User_Avatar_Functions {
190
  $avatar = get_wp_user_avatar($id_or_email, $size, $default, $alt);
191
  // User has Gravatar and Gravatar is not disabled
192
  } elseif((bool) $wpua_disable_gravatar != 1 && $wpua_functions->wpua_has_gravatar($id_or_email)) {
193
- $avatar = $avatar;
 
 
 
 
 
 
 
 
 
 
 
194
  // User doesn't have WPUA or Gravatar and Default Avatar is wp_user_avatar, show custom Default Avatar
195
  } elseif($avatar_default == 'wp_user_avatar') {
196
- // Show custom Default Avatar
197
- if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
198
- // Get image
199
- $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
200
- // Image src
201
- $default = $wpua_avatar_default_image[0];
202
- // Add dimensions if numeric size
203
- $dimensions = ' width="'.$wpua_avatar_default_image[1].'" height="'.$wpua_avatar_default_image[2].'"';
204
- } else {
205
- // Get mustache image based on numeric size comparison
206
- if($size > get_option('medium_size_w')) {
207
- $default = $mustache_original;
208
- } elseif($size <= get_option('medium_size_w') && $size > get_option('thumbnail_size_w')) {
209
- $default = $mustache_medium;
210
- } elseif($size <= get_option('thumbnail_size_w') && $size > 96) {
211
- $default = $mustache_thumbnail;
212
- } elseif($size <= 96 && $size > 32) {
213
- $default = $mustache_avatar;
214
- } elseif($size <= 32) {
215
- $default = $mustache_admin;
216
- }
217
- // Add dimensions if numeric size
218
- $dimensions = ' width="'.$size.'" height="'.$size.'"';
219
- }
220
- // Construct the img tag
221
- $avatar = '<img src="'.$default.'"'.$dimensions.' alt="'.$alt.'" class="avatar avatar-'.$size.' wp-user-avatar wp-user-avatar-'.$size.' photo avatar-default" />';
222
- }
223
  }
224
  /**
225
  * Filter get_avatar filter
@@ -263,7 +418,10 @@ class WP_User_Avatar_Functions {
263
  if(!$wpua_functions->wpua_has_gravatar($id_or_email) && $avatar_default == 'wp_user_avatar') {
264
  // Show custom Default Avatar
265
  if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
266
- $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
 
 
 
267
  $default = $wpua_avatar_default_image[0];
268
  } else {
269
  $default = $mustache_avatar;
@@ -277,7 +435,10 @@ class WP_User_Avatar_Functions {
277
  }
278
  } else {
279
  if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
280
- $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
 
 
 
281
  $default = $wpua_avatar_default_image[0];
282
  } else {
283
  $default = $mustache_avatar;
@@ -293,6 +454,7 @@ class WP_User_Avatar_Functions {
293
  return apply_filters('wpua_get_avatar_original', $default);
294
  }
295
 
 
296
  /**
297
  * Find WPUA, show get_avatar if empty
298
  * @since 1.0
@@ -323,7 +485,12 @@ class WP_User_Avatar_Functions {
323
  public function get_wp_user_avatar($id_or_email="", $size='96', $align="", $alt="") {
324
  global $all_sizes, $avatar_default, $blog_id, $post, $wpdb, $wpua_avatar_default, $wpua_functions, $_wp_additional_image_sizes;
325
  $email='unknown@gravatar.com';
326
- // Checks if comment
 
 
 
 
 
327
  if(is_object($id_or_email)) {
328
  // Checks if comment author is registered user by user ID
329
  if($id_or_email->user_id != 0) {
@@ -391,7 +558,7 @@ class WP_User_Avatar_Functions {
391
  $avatar = preg_replace('/(width|height)=\"\d*\"\s/', "", $avatar);
392
  $avatar = preg_replace("/(width|height)=\'\d*\'\s/", "", $avatar);
393
  }
394
- $replace = array('wp-user-avatar ', 'wp-user-avatar-'.$get_size.' ', 'wp-user-avatar-'.$size.' ', 'avatar-'.$get_size, 'photo');
395
  $replacements = array("", "", "", 'avatar-'.$size, 'wp-user-avatar wp-user-avatar-'.$size.$alignclass.' photo');
396
  $avatar = str_replace($replace, $replacements, $avatar);
397
  }
11
  * Constructor
12
  * @since 1.8
13
  * @uses add_filter()
14
+ * @uses register_activation_hook()
15
+ * @uses register_deactivation_hook()
16
  */
17
  public function __construct() {
18
  add_filter('get_avatar', array($this, 'wpua_get_avatar_filter'), 10, 5);
19
+ // Filter to display WP User Avatar at Buddypress
20
+ add_filter('bp_core_fetch_avatar', array($this, 'wpua_bp_core_fetch_avatar_filter'), 10, 5);
21
+ // Filter to display WP User Avatar by URL at Buddypress
22
+ add_filter('bp_core_fetch_avatar_url', array($this, 'wpua_bp_core_fetch_avatar_url_filter'), 10, 5);
23
+
24
  }
25
+
26
+ /**
27
+ * Returns WP User Avatar or Gravatar-hosted image if user doesn't have Buddypress-uploaded image
28
+ * @param string $avatar
29
+ * @param array $params
30
+ * @param int $item_id
31
+ * @param string $avatar_dir
32
+ * @param string $css_id
33
+ * @param int $html_width
34
+ * @param int $html_height
35
+ * @param string $avatar_folder_url
36
+ * @param string $avatar_folder_dir
37
+ * @uses object $wpua_functions
38
+ * @uses wpua_get_avatar_filter()
39
+ */
40
+ public function wpua_bp_core_fetch_avatar_filter($gravatar,$params,$item_id='', $avatar_dir='', $css_id='', $html_width='', $html_height='', $avatar_folder_url='', $avatar_folder_dir=''){
41
+ global $wpua_functions;
42
+ if(strpos($gravatar,'gravatar.com',0)>-1){
43
+ $avatar = $wpua_functions->wpua_get_avatar_filter($gravatar, ($params['object']=='user') ? $params['item_id'] : '', ($params['object']=='user') ? (($params['type']=='thumb') ? 50 :150) : 50, '', '');
44
+ return $avatar;
45
+ }
46
+ else
47
+ return $gravatar;
48
+ }
49
+
50
+ /**
51
+ * Returns WP user default local avatar URL or Gravatar-hosted image URL if user doesn't have Buddypress-uploaded image
52
+ * @param string $avatar
53
+ * @param array $params
54
+ * @uses object $wpua_functions
55
+ * @uses wpua_get_avatar_filter()
56
+ */
57
+ public function wpua_bp_core_fetch_avatar_url_filter($gravatar,$params){
58
+ global $wpua_functions;
59
+ if(strpos($gravatar,'gravatar.com',0)>-1){
60
+ $avatar = $wpua_functions->wpua_get_avatar_filter($gravatar, ($params['object']=='user') ? $params['item_id'] : '', ($params['object']=='user') ? (($params['type']=='thumb') ? 50 :150) : 50, '', '');
61
+ return $avatar;
62
+ }
63
+ else
64
+ return $gravatar;
65
+ }
66
+
67
  /**
68
  * Returns true if user has Gravatar-hosted image
69
  * @since 1.4
79
  * @return bool $has_gravatar
80
  */
81
  public function wpua_has_gravatar($id_or_email="", $has_gravatar=0, $user="", $email="") {
82
+ global $wpua_hash_gravatar,$avatar_default, $mustache_admin, $mustache_avatar, $mustache_medium, $mustache_original, $mustache_thumbnail, $post, $wpua_avatar_default, $wpua_disable_gravatar, $wpua_functions;
83
+ // User has WPUA
84
+ //Decide if check gravatar required or not.
85
+ if(trim($avatar_default)!='wp_user_avatar')
86
+ return true;
87
+
88
  if(!is_object($id_or_email) && !empty($id_or_email)) {
89
  // Find user by ID or e-mail address
90
  $user = is_numeric($id_or_email) ? get_user_by('id', $id_or_email) : get_user_by('email', $id_or_email);
91
  // Get registered user e-mail address
92
  $email = !empty($user) ? $user->user_email : "";
93
  }
94
+
95
+ if($email == ""){
96
+
97
+ if(!is_numeric($id_or_email) and !is_object($id_or_email))
98
+ $email = $id_or_email;
99
+ elseif(!is_numeric($id_or_email) and is_object($id_or_email))
100
+ $email = $id_or_email->comment_author_email;
101
+ }
102
+ if($email!="")
103
+ {
104
+ $hash = md5(strtolower(trim($email)));
105
+ //check if gravatar exists for hashtag using options
106
+
107
+ if(is_array($wpua_hash_gravatar)){
108
+
109
+
110
+ if ( array_key_exists($hash, $wpua_hash_gravatar) and is_array($wpua_hash_gravatar[$hash]) and array_key_exists(date('m-d-Y'), $wpua_hash_gravatar[$hash]) )
111
+ {
112
+ return (bool) $wpua_hash_gravatar[$hash][date('m-d-Y')];
113
+ }
114
+
115
+ }
116
+
117
+ //end
118
+ if ( isset( $_SERVER['HTTPS'] ) && ( 'on' == $_SERVER['HTTPS'] || 1 == $_SERVER['HTTPS'] ) || isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
119
+ $http='https';
120
+ }else{
121
+ $http='http';
122
+ }
123
+ $gravatar = $http.'://www.gravatar.com/avatar/'.$hash.'?d=404';
124
+
125
+ $data = wp_cache_get($hash);
126
+
127
+ if(false === $data) {
128
+ $response = wp_remote_head($gravatar);
129
+ $data = is_wp_error($response) ? 'not200' : $response['response']['code'];
130
+
131
+ wp_cache_set($hash, $data, $group="", $expire=60*5);
132
+ //here set if hashtag has avatar
133
+ $has_gravatar = ($data == '200') ? true : false;
134
+ if($wpua_hash_gravatar == false){
135
+ $wpua_hash_gravatar[$hash][date('m-d-Y')] = (bool)$has_gravatar;
136
+ add_option('wpua_hash_gravatar',serialize($wpua_hash_gravatar));
137
+ }
138
+ else{
139
+
140
+ if (array_key_exists($hash, $wpua_hash_gravatar)){
141
+
142
+ unset($wpua_hash_gravatar[$hash]);
143
+ $wpua_hash_gravatar[$hash][date('m-d-Y')] = (bool)$has_gravatar;
144
+ update_option('wpua_hash_gravatar',serialize($wpua_hash_gravatar));
145
+
146
+
147
+ }
148
+ else
149
+ {
150
+ $wpua_hash_gravatar[$hash][date('m-d-Y')] = (bool)$has_gravatar;
151
+ update_option('wpua_hash_gravatar',serialize($wpua_hash_gravatar));
152
+
153
+ }
154
+
155
+ }
156
+ //end
157
+ }
158
+ $has_gravatar = ($data == '200') ? true : false;
159
+
160
  }
161
+ else
162
+ $has_gravatar = false;
163
+
164
+ // Check if Gravatar image returns 200 (OK) or 404 (Not Found)
165
  return (bool) $has_gravatar;
166
  }
167
 
168
+
169
  /**
170
  * Check if local image
171
  * @since 1.9.2
252
  * @return bool
253
  */
254
  public function has_wp_user_avatar($id_or_email="", $has_wpua=0, $user="", $user_id="") {
255
+ global $blog_id, $wpdb, $wpua_avatar_default, $wpua_functions, $avatar_default;
256
  if(!is_object($id_or_email) && !empty($id_or_email)) {
257
  // Find user by ID or e-mail address
258
+
259
  $user = is_numeric($id_or_email) ? get_user_by('id', $id_or_email) : get_user_by('email', $id_or_email);
260
  // Get registered user ID
261
+ $user_id = !empty($user) ? $user->ID : "";
262
  }
263
  $wpua = get_user_meta($user_id, $wpdb->get_blog_prefix($blog_id).'user_avatar', true);
264
  // Check if avatar is same as default avatar or on excluded list
265
+ $has_wpua = !empty($wpua) && ($avatar_default!='wp_user_avatar' or $wpua != $wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua) ? true : false;
266
  return (bool) $has_wpua;
267
  }
268
+ /**
269
+ Retrive default image url set by admin.
270
+ */
271
+ public function wpua_default_image($size)
272
+ {
273
+ global $avatar_default, $mustache_admin, $mustache_avatar, $mustache_medium, $mustache_original, $mustache_thumbnail, $post, $wpua_avatar_default, $wpua_disable_gravatar, $wpua_functions;
274
+
275
+ $default_image_details = array();
276
+ // Show custom Default Avatar
277
+ if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
278
+ // Get image
279
+ $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
280
+ // Image src
281
+ $default = $wpua_avatar_default_image[0];
282
+ // Add dimensions if numeric size
283
+ $default_image_details['dimensions'] = ' width="'.$wpua_avatar_default_image[1].'" height="'.$wpua_avatar_default_image[2].'"';
284
+
285
+ } else {
286
+ // Get mustache image based on numeric size comparison
287
+ if($size > get_option('medium_size_w')) {
288
+ $default = $mustache_original;
289
+ } elseif($size <= get_option('medium_size_w') && $size > get_option('thumbnail_size_w')) {
290
+ $default = $mustache_medium;
291
+ } elseif($size <= get_option('thumbnail_size_w') && $size > 96) {
292
+ $default = $mustache_thumbnail;
293
+ } elseif($size <= 96 && $size > 32) {
294
+ $default = $mustache_avatar;
295
+ } elseif($size <= 32) {
296
+ $default = $mustache_admin;
297
+ }
298
+ // Add dimensions if numeric size
299
+ $default_image_details['dimensions'] = ' width="'.$size.'" height="'.$size.'"';
300
+ }
301
+ // Construct the img tag
302
+ $default_image_details['size'] = $size;
303
+ $default_image_details['src'] = $default;
304
+ return $default_image_details;
305
 
306
+ }
307
  /**
308
  * Replace get_avatar only in get_wp_user_avatar
309
  * @since 1.4
332
  * @return string $avatar
333
  */
334
  public function wpua_get_avatar_filter($avatar, $id_or_email="", $size="", $default="", $alt="") {
335
+
336
  global $avatar_default, $mustache_admin, $mustache_avatar, $mustache_medium, $mustache_original, $mustache_thumbnail, $post, $wpua_avatar_default, $wpua_disable_gravatar, $wpua_functions;
337
  // User has WPUA
338
+
339
+ if( $alt == '' ) {
340
+ $alt = apply_filters('wpua_default_alt_tag',__("Avatar",'wp-user-avatar'));
341
+ }
342
+
343
+
344
+ $avatar = str_replace('gravatar_default','',$avatar);
345
  if(is_object($id_or_email)) {
346
  if(!empty($id_or_email->comment_author_email)) {
347
  $avatar = get_wp_user_avatar($id_or_email, $size, $default, $alt);
348
  } else {
349
+
350
  $avatar = get_wp_user_avatar('unknown@gravatar.com', $size, $default, $alt);
351
  }
352
  } else {
354
  $avatar = get_wp_user_avatar($id_or_email, $size, $default, $alt);
355
  // User has Gravatar and Gravatar is not disabled
356
  } elseif((bool) $wpua_disable_gravatar != 1 && $wpua_functions->wpua_has_gravatar($id_or_email)) {
357
+ // find our src
358
+ if(!empty($avatar)) {
359
+ $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $avatar, $matches, PREG_SET_ORDER);
360
+ $wpua_avatar_image_src = !empty($matches) ? $matches [0] [1] : "";
361
+ $default_image_details = $this->wpua_default_image($size);
362
+ $wpua_default_avatar_image_src = $default_image_details['src'];
363
+ $wpua_final_avatar_image_src = str_replace('d=wp_user_avatar', 'd='.urlencode($wpua_default_avatar_image_src), $wpua_avatar_image_src);
364
+ }
365
+
366
+ //$avatar = $avatar;
367
+ $avatar = '<img src="'.$wpua_final_avatar_image_src.'"'.$default_image_details['dimensions'].' alt="'.$alt.'" class="avatar avatar-'.$size.' wp-user-avatar wp-user-avatar-'.$size.' photo avatar-default" />';
368
+
369
  // User doesn't have WPUA or Gravatar and Default Avatar is wp_user_avatar, show custom Default Avatar
370
  } elseif($avatar_default == 'wp_user_avatar') {
371
+
372
+ $default_image_details = $this->wpua_default_image($size);
373
+ $avatar = '<img src="'.$default_image_details['src'].'"'.$default_image_details['dimensions'].' alt="'.$alt.'" class="avatar avatar-'.$size.' wp-user-avatar wp-user-avatar-'.$size.' photo avatar-default" />';
374
+
375
+ return $avatar;
376
+
377
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
378
  }
379
  /**
380
  * Filter get_avatar filter
418
  if(!$wpua_functions->wpua_has_gravatar($id_or_email) && $avatar_default == 'wp_user_avatar') {
419
  // Show custom Default Avatar
420
  if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
421
+ // $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
422
+ $size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );
423
+ $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, $size_numeric_w_x_h);
424
+
425
  $default = $wpua_avatar_default_image[0];
426
  } else {
427
  $default = $mustache_avatar;
435
  }
436
  } else {
437
  if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
438
+ // $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
439
+ $size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );
440
+ $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, $size_numeric_w_x_h);
441
+
442
  $default = $wpua_avatar_default_image[0];
443
  } else {
444
  $default = $mustache_avatar;
454
  return apply_filters('wpua_get_avatar_original', $default);
455
  }
456
 
457
+
458
  /**
459
  * Find WPUA, show get_avatar if empty
460
  * @since 1.0
485
  public function get_wp_user_avatar($id_or_email="", $size='96', $align="", $alt="") {
486
  global $all_sizes, $avatar_default, $blog_id, $post, $wpdb, $wpua_avatar_default, $wpua_functions, $_wp_additional_image_sizes;
487
  $email='unknown@gravatar.com';
488
+ // Checks if comment
489
+
490
+ if( $alt == '' ) {
491
+ $alt = apply_filters('wpua_default_alt_tag',__("Avatar",'wp-user-avatar'));
492
+ }
493
+
494
  if(is_object($id_or_email)) {
495
  // Checks if comment author is registered user by user ID
496
  if($id_or_email->user_id != 0) {
558
  $avatar = preg_replace('/(width|height)=\"\d*\"\s/', "", $avatar);
559
  $avatar = preg_replace("/(width|height)=\'\d*\'\s/", "", $avatar);
560
  }
561
+ $replace = array('wp-user-avatar ', 'wp-user-avatar-'.$get_size.' ', 'wp-user-avatar-'.$size.' ', 'avatar-'.$get_size, ' photo');
562
  $replacements = array("", "", "", 'avatar-'.$size, 'wp-user-avatar wp-user-avatar-'.$size.$alignclass.' photo');
563
  $avatar = str_replace($replace, $replacements, $avatar);
564
  }
includes/class-wp-user-avatar-list-table.php CHANGED
@@ -139,7 +139,7 @@ class WP_User_Avatar_List_Table extends WP_List_Table {
139
  */
140
  public function get_bulk_actions() {
141
  $actions = array();
142
- $actions['delete'] = __('Delete Permanently');
143
  return $actions;
144
  }
145
 
@@ -168,7 +168,7 @@ class WP_User_Avatar_List_Table extends WP_List_Table {
168
  * @since 1.8
169
  */
170
  public function no_items() {
171
- _e('No media attachments found.');
172
  }
173
 
174
  /**
@@ -181,7 +181,7 @@ class WP_User_Avatar_List_Table extends WP_List_Table {
181
  $columns['cb'] = '<input type="checkbox" />';
182
  $columns['icon'] = "";
183
  $columns['title'] = _x('File', 'column name');
184
- $columns['author'] = __('Author');
185
  $columns['parent'] = _x('Uploaded to', 'column name');
186
  $columns['date'] = _x('Date', 'column name');
187
  return $columns;
@@ -250,7 +250,7 @@ class WP_User_Avatar_List_Table extends WP_List_Table {
250
  ?>
251
  <th scope="row" class="check-column">
252
  <?php if($user_can_edit) { ?>
253
- <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php echo sprintf(__('Select %s'), $att_title);?></label>
254
  <input type="checkbox" name="media[]" id="cb-select-<?php the_ID(); ?>" value="<?php the_ID(); ?>" />
255
  <?php } ?>
256
  </th>
@@ -310,17 +310,17 @@ class WP_User_Avatar_List_Table extends WP_List_Table {
310
  break;
311
  case 'date':
312
  if('0000-00-00 00:00:00' == $post->post_date) {
313
- $h_time = __('Unpublished');
314
  } else {
315
  $m_time = $post->post_date;
316
  $time = get_post_time('G', true, $post, false);
317
  if ((abs($t_diff = time() - $time)) < DAY_IN_SECONDS) {
318
  if ($t_diff < 0)
319
- $h_time = sprintf(__('%s from now'), human_time_diff($time));
320
  else
321
- $h_time = sprintf(__('%s ago'), human_time_diff($time));
322
  } else {
323
- $h_time = mysql2date(__('Y/m/d'), $m_time);
324
  }
325
  }
326
  ?>
@@ -378,22 +378,22 @@ class WP_User_Avatar_List_Table extends WP_List_Table {
378
  public function _get_row_actions($post, $att_title) {
379
  $actions = array();
380
  if(current_user_can('edit_post', $post->ID) && !$this->is_trash) {
381
- $actions['edit'] = '<a href="'.get_edit_post_link($post->ID, true).'">'.__('Edit').'</a>';
382
  }
383
  if(current_user_can('delete_post', $post->ID)) {
384
  if($this->is_trash) {
385
- $actions['untrash'] = "<a class='submitdelete' href='".wp_nonce_url("post.php?action=untrash&amp;post=$post->ID", 'untrash-post_'.$post->ID)."'>".__('Restore')."</a>";
386
  } elseif (EMPTY_TRASH_DAYS && MEDIA_TRASH) {
387
- $actions['trash'] = "<a class='submitdelete' href='".wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_'.$post->ID)."'>".__('Trash')."</a>";
388
  }
389
  if($this->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH) {
390
  $delete_ays = (!$this->is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : "";
391
- $actions['delete'] = "<a class='submitdelete'$delete_ays href='".wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_'.$post->ID)."'>".__('Delete Permanently')."</a>";
392
  }
393
  }
394
  if(!$this->is_trash) {
395
  $title = _draft_or_post_title($post->post_parent);
396
- $actions['view'] = '<a href="'.get_permalink($post->ID).'" title="'.esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)).'" rel="permalink">'.__('View').'</a>';
397
  }
398
  return $actions;
399
  }
139
  */
140
  public function get_bulk_actions() {
141
  $actions = array();
142
+ $actions['delete'] = __('Delete Permanently','wp-user-avatar');
143
  return $actions;
144
  }
145
 
168
  * @since 1.8
169
  */
170
  public function no_items() {
171
+ _e('No media attachments found.','wp-user-avatar');
172
  }
173
 
174
  /**
181
  $columns['cb'] = '<input type="checkbox" />';
182
  $columns['icon'] = "";
183
  $columns['title'] = _x('File', 'column name');
184
+ $columns['author'] = __('Author','wp-user-avatar');
185
  $columns['parent'] = _x('Uploaded to', 'column name');
186
  $columns['date'] = _x('Date', 'column name');
187
  return $columns;
250
  ?>
251
  <th scope="row" class="check-column">
252
  <?php if($user_can_edit) { ?>
253
+ <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php echo sprintf(__('Select %s','wp-user-avatar'), $att_title);?></label>
254
  <input type="checkbox" name="media[]" id="cb-select-<?php the_ID(); ?>" value="<?php the_ID(); ?>" />
255
  <?php } ?>
256
  </th>
310
  break;
311
  case 'date':
312
  if('0000-00-00 00:00:00' == $post->post_date) {
313
+ $h_time = __('Unpublished','wp-user-avatar');
314
  } else {
315
  $m_time = $post->post_date;
316
  $time = get_post_time('G', true, $post, false);
317
  if ((abs($t_diff = time() - $time)) < DAY_IN_SECONDS) {
318
  if ($t_diff < 0)
319
+ $h_time = sprintf(__('%s from now','wp-user-avatar'), human_time_diff($time));
320
  else
321
+ $h_time = sprintf(__('%s ago','wp-user-avatar'), human_time_diff($time));
322
  } else {
323
+ $h_time = mysql2date(__('Y/m/d','wp-user-avatar'), $m_time);
324
  }
325
  }
326
  ?>
378
  public function _get_row_actions($post, $att_title) {
379
  $actions = array();
380
  if(current_user_can('edit_post', $post->ID) && !$this->is_trash) {
381
+ $actions['edit'] = '<a href="'.get_edit_post_link($post->ID, true).'">'.__('Edit','wp-user-avatar').'</a>';
382
  }
383
  if(current_user_can('delete_post', $post->ID)) {
384
  if($this->is_trash) {
385
+ $actions['untrash'] = "<a class='submitdelete' href='".wp_nonce_url("post.php?action=untrash&amp;post=$post->ID", 'untrash-post_'.$post->ID)."'>".__('Restore','wp-user-avatar')."</a>";
386
  } elseif (EMPTY_TRASH_DAYS && MEDIA_TRASH) {
387
+ $actions['trash'] = "<a class='submitdelete' href='".wp_nonce_url("post.php?action=trash&amp;post=$post->ID", 'trash-post_'.$post->ID)."'>".__('Trash','wp-user-avatar')."</a>";
388
  }
389
  if($this->is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH) {
390
  $delete_ays = (!$this->is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : "";
391
+ $actions['delete'] = "<a class='submitdelete'$delete_ays href='".wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_'.$post->ID)."'>".__('Delete Permanently','wp-user-avatar')."</a>";
392
  }
393
  }
394
  if(!$this->is_trash) {
395
  $title = _draft_or_post_title($post->post_parent);
396
+ $actions['view'] = '<a href="'.get_permalink($post->ID).'" title="'.esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)).'" rel="permalink">'.__('View','wp-user-avatar').'</a>';
397
  }
398
  return $actions;
399
  }
includes/class-wp-user-avatar-shortcode.php CHANGED
@@ -57,9 +57,13 @@ class WP_User_Avatar_Shortcode {
57
  extract(shortcode_atts(array('user' => "", 'size' => '96', 'align' => "", 'link' => "", 'target' => ""), $atts));
58
  // Find user by ID, login, slug, or e-mail address
59
  if(!empty($user)) {
60
- $user = is_numeric($user) ? get_user_by('id', $user) : get_user_by('login', $user);
61
- $user = empty($user) ? get_user_by('slug', $user) : $user;
62
- $user = empty($user) ? get_user_by('email', $user) : $user;
 
 
 
 
63
  } else {
64
  // Find author's name if id_or_email is empty
65
  $author_name = get_query_var('author_name');
@@ -146,7 +150,7 @@ class WP_User_Avatar_Shortcode {
146
  }
147
  if($update) {
148
  // Redirect with updated variable
149
- $redirect_url = add_query_arg(array('updated' => '1'), wp_get_referer());
150
  /**
151
  * Filter redirect URL
152
  * @since 1.9.12
@@ -200,7 +204,7 @@ class WP_User_Avatar_Shortcode {
200
  // Show form only for valid user
201
  if($valid_user) {
202
  // Save
203
- if(isset($_POST['submit']) && $_POST['submit'] && $_POST['action'] == 'update') {
204
  do_action('wpua_update', $valid_user->ID);
205
  // Check for errors
206
  $errors = $this->wpua_edit_user($valid_user->ID);
@@ -209,7 +213,7 @@ class WP_User_Avatar_Shortcode {
209
  if(isset($errors) && is_wp_error($errors)) {
210
  echo '<div class="error"><p>'.implode("</p>\n<p>", $errors->get_error_messages()).'</p></div>';
211
  } elseif(isset($_GET['updated']) && $_GET['updated'] == '1') {
212
- echo '<div class="updated"><p><strong>'.__('Profile updated.').'</strong></p></div>';
213
  }
214
  // Edit form
215
  return $this->wpua_edit_form($valid_user);
@@ -230,10 +234,10 @@ class WP_User_Avatar_Shortcode {
230
  ?>
231
  <form id="wpua-edit-<?php echo $user->ID; ?>" class="wpua-edit" action="" method="post" enctype="multipart/form-data">
232
  <?php do_action('wpua_show_profile', $user); ?>
233
- <input type="hidden" name="action" value="update" />
234
  <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user->ID); ?>" />
235
  <?php wp_nonce_field('update-user_'.$user->ID); ?>
236
- <?php submit_button(__('Update Profile')); ?>
237
  </form>
238
  <?php
239
  return ob_get_clean();
57
  extract(shortcode_atts(array('user' => "", 'size' => '96', 'align' => "", 'link' => "", 'target' => ""), $atts));
58
  // Find user by ID, login, slug, or e-mail address
59
  if(!empty($user)) {
60
+ if( $user == 'current' ) {
61
+ $user = wp_get_current_user();
62
+ }else{
63
+ $user = is_numeric($user) ? get_user_by('id', $user) : get_user_by('login', $user);
64
+ $user = empty($user) ? get_user_by('slug', $user) : $user;
65
+ $user = empty($user) ? get_user_by('email', $user) : $user;
66
+ }
67
  } else {
68
  // Find author's name if id_or_email is empty
69
  $author_name = get_query_var('author_name');
150
  }
151
  if($update) {
152
  // Redirect with updated variable
153
+ $redirect_url = esc_url_raw(add_query_arg(array('updated' => '1'), wp_get_referer()));
154
  /**
155
  * Filter redirect URL
156
  * @since 1.9.12
204
  // Show form only for valid user
205
  if($valid_user) {
206
  // Save
207
+ if(isset($_POST['submit']) && $_POST['submit'] && $_POST['wpua_action'] == 'update') {
208
  do_action('wpua_update', $valid_user->ID);
209
  // Check for errors
210
  $errors = $this->wpua_edit_user($valid_user->ID);
213
  if(isset($errors) && is_wp_error($errors)) {
214
  echo '<div class="error"><p>'.implode("</p>\n<p>", $errors->get_error_messages()).'</p></div>';
215
  } elseif(isset($_GET['updated']) && $_GET['updated'] == '1') {
216
+ echo '<div class="updated"><p><strong>'.__('Profile updated.','wp-user-avatar').'</strong></p></div>';
217
  }
218
  // Edit form
219
  return $this->wpua_edit_form($valid_user);
234
  ?>
235
  <form id="wpua-edit-<?php echo $user->ID; ?>" class="wpua-edit" action="" method="post" enctype="multipart/form-data">
236
  <?php do_action('wpua_show_profile', $user); ?>
237
+ <input type="hidden" name="wpua_action" value="update" />
238
  <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user->ID); ?>" />
239
  <?php wp_nonce_field('update-user_'.$user->ID); ?>
240
+ <?php submit_button(__('Update Profile','wp-user-avatar')); ?>
241
  </form>
242
  <?php
243
  return ob_get_clean();
includes/class-wp-user-avatar-subscriber.php CHANGED
@@ -96,7 +96,7 @@ class WP_User_Avatar_Subscriber {
96
  $offlimits = apply_filters('wpua_subscriber_offlimits', $offlimits);
97
  if(in_array($pagenow, $offlimits)) {
98
  do_action('admin_page_access_denied');
99
- wp_die(__('You do not have sufficient permissions to access this page.'));
100
  }
101
  }
102
 
@@ -118,7 +118,9 @@ class WP_User_Avatar_Subscriber {
118
  if((bool) $wpua_allow_upload == 1 && (bool) $wpua_edit_avatar == 1) {
119
  $user_roles['subscriber']['capabilities']['edit_posts'] = true;
120
  } else {
121
- unset($user_roles['subscriber']['capabilities']['edit_posts']);
 
 
122
  }
123
  update_option($wp_user_roles, $user_roles);
124
  }
96
  $offlimits = apply_filters('wpua_subscriber_offlimits', $offlimits);
97
  if(in_array($pagenow, $offlimits)) {
98
  do_action('admin_page_access_denied');
99
+ wp_die(__('You do not have sufficient permissions to access this page.','wp-user-avatar'));
100
  }
101
  }
102
 
118
  if((bool) $wpua_allow_upload == 1 && (bool) $wpua_edit_avatar == 1) {
119
  $user_roles['subscriber']['capabilities']['edit_posts'] = true;
120
  } else {
121
+ if(isset($user_roles['subscriber']['capabilities']['edit_posts'])){
122
+ unset($user_roles['subscriber']['capabilities']['edit_posts']);
123
+ }
124
  }
125
  update_option($wp_user_roles, $user_roles);
126
  }
includes/class-wp-user-avatar-widget.php CHANGED
@@ -69,16 +69,16 @@ class WP_User_Avatar_Profile_Widget extends WP_Widget {
69
  ?>
70
  <p>
71
  <label for="<?php echo $this->get_field_id('title'); ?>">
72
- <?php _e('Title:'); ?>
73
  </label>
74
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
75
  </p>
76
- <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Description:'); ?></label>
77
  <textarea class="widefat" rows="3" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
78
  <p>
79
  <input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> />
80
  <label for="<?php echo $this->get_field_id('filter'); ?>">
81
- <?php _e('Automatically add paragraphs'); ?>
82
  </label>
83
  </p>
84
  <?php
69
  ?>
70
  <p>
71
  <label for="<?php echo $this->get_field_id('title'); ?>">
72
+ <?php _e('Title:','wp-user-avatar'); ?>
73
  </label>
74
  <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
75
  </p>
76
+ <label for="<?php echo $this->get_field_id('filter'); ?>"><?php _e('Description:','wp-user-avatar'); ?></label>
77
  <textarea class="widefat" rows="3" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea>
78
  <p>
79
  <input id="<?php echo $this->get_field_id('filter'); ?>" name="<?php echo $this->get_field_name('filter'); ?>" type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> />
80
  <label for="<?php echo $this->get_field_id('filter'); ?>">
81
+ <?php _e('Automatically add paragraphs','wp-user-avatar'); ?>
82
  </label>
83
  </p>
84
  <?php
includes/class-wp-user-avatar.php CHANGED
@@ -152,52 +152,56 @@ class WP_User_Avatar {
152
  */
153
  public static function wpua_action_show_user_profile($user) {
154
  global $blog_id, $current_user, $show_avatars, $wpdb, $wp_user_avatar, $wpua_allow_upload, $wpua_edit_avatar, $wpua_functions, $wpua_upload_size_limit_with_units;
 
 
155
  // Get WPUA attachment ID
156
- $wpua = get_user_meta($user->ID, $wpdb->get_blog_prefix($blog_id).'user_avatar', true);
157
  // Show remove button if WPUA is set
158
- $hide_remove = !has_wp_user_avatar($user->ID) ? 'wpua-hide' : "";
159
  // Hide image tags if show avatars is off
160
- $hide_images = !has_wp_user_avatar($user->ID) && (bool) $show_avatars == 0 ? 'wpua-no-avatars' : "";
161
  // If avatars are enabled, get original avatar image or show blank
162
- $avatar_medium_src = (bool) $show_avatars == 1 ? $wpua_functions->wpua_get_avatar_original($user->user_email, 'medium') : includes_url().'images/blank.gif';
163
  // Check if user has wp_user_avatar, if not show image from above
164
- $avatar_medium = has_wp_user_avatar($user->ID) ? get_wp_user_avatar_src($user->ID, 'medium') : $avatar_medium_src;
165
  // Check if user has wp_user_avatar, if not show image from above
166
- $avatar_thumbnail = has_wp_user_avatar($user->ID) ? get_wp_user_avatar_src($user->ID, 96) : $avatar_medium_src;
167
- $edit_attachment_link = add_query_arg(array('post' => $wpua, 'action' => 'edit'), admin_url('post.php'));
168
  // Chck if admin page
169
  $is_admin = is_admin() ? '_admin' : "";
170
  ?>
171
  <?php do_action('wpua_before_avatar'.$is_admin); ?>
172
- <input type="hidden" name="wp-user-avatar" id="wp-user-avatar" value="<?php echo $wpua; ?>" />
173
  <?php if($wp_user_avatar->wpua_is_author_or_above()) : // Button to launch Media Uploader ?>
174
- <p id="wpua-add-button"><button type="button" class="button" id="wpua-add" name="wpua-add" data-title="<?php _e('Choose Image'); ?>: <?php echo $user->display_name; ?>"><?php _e('Choose Image'); ?></button></p>
 
 
175
  <?php elseif(!$wp_user_avatar->wpua_is_author_or_above()) : // Upload button ?>
176
- <p id="wpua-upload-button">
177
- <input name="wpua-file" id="wpua-file" type="file" />
178
- <button type="submit" class="button" id="wpua-upload" name="submit" value="<?php _e('Upload'); ?>"><?php _e('Upload'); ?></button>
179
  </p>
180
- <p id="wpua-upload-messages">
181
- <span id="wpua-max-upload" class="description"><?php printf(__('Maximum upload file size: %d%s.'), esc_html($wpua_upload_size_limit_with_units), esc_html('KB')); ?></span>
182
- <span id="wpua-allowed-files" class="description"><?php _e('Allowed Files'); ?>: <?php _e('<code>jpg jpeg png gif</code>'); ?></span>
183
  </p>
184
  <?php endif; ?>
185
- <div id="wpua-images" class="<?php echo $hide_images; ?>">
186
- <p id="wpua-preview">
187
  <img src="<?php echo $avatar_medium; ?>" alt="" />
188
- <span class="description"><?php _e('Original Size'); ?></span>
189
  </p>
190
- <p id="wpua-thumbnail">
191
  <img src="<?php echo $avatar_thumbnail; ?>" alt="" />
192
- <span class="description"><?php _e('Thumbnail'); ?></span>
193
  </p>
194
- <p id="wpua-remove-button" class="<?php echo $hide_remove; ?>">
195
- <button type="button" class="button" id="wpua-remove" name="wpua-remove"><?php _e('Remove Image'); ?></button>
196
  <?php if((bool) $wpua_edit_avatar == 1 && !$wp_user_avatar->wpua_is_author_or_above() && has_wp_user_avatar($current_user->ID) && $wp_user_avatar->wpua_author($wpua, $current_user->ID)) : // Edit button ?>
197
- <span id="wpua-edit-attachment"><a href="<?php echo $edit_attachment_link; ?>" class="edit-attachment" target="_blank"><?php _e('Edit Image'); ?></a></span>
198
  <?php endif; ?>
199
  </p>
200
- <p id="wpua-undo-button"><button type="button" class="button" id="wpua-undo" name="wpua-undo"><?php _e('Undo'); ?></button></p>
201
  </div>
202
  <?php do_action('wpua_after_avatar'.$is_admin); ?>
203
  <?php
@@ -221,15 +225,15 @@ class WP_User_Avatar {
221
  $upload_dir = wp_upload_dir();
222
  // Allow only JPG, GIF, PNG
223
  if(!empty($type) && !preg_match('/(jpe?g|gif|png)$/i', $type)) {
224
- $errors->add('wpua_file_type', __('This file is not an image. Please try another.'));
225
  }
226
  // Upload size limit
227
  if(!empty($size) && $size > $wpua_upload_size_limit) {
228
- $errors->add('wpua_file_size', __('Memory exceeded. Please try another smaller file.'));
229
  }
230
  // Check if directory is writeable
231
  if(!is_writeable($upload_dir['path'])) {
232
- $errors->add('wpua_file_directory', sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), $upload_dir['path']));
233
  }
234
  }
235
  }
@@ -251,7 +255,7 @@ class WP_User_Avatar {
251
  * @since 1.7
252
  */
253
  function wpua_file_size_error($errors, $update, $user) {
254
- $errors->add('wpua_file_size', __('Memory exceeded. Please try another smaller file.'));
255
  }
256
  add_action('user_profile_update_errors', 'wpua_file_size_error', 10, 3);
257
  return;
@@ -288,9 +292,11 @@ class WP_User_Avatar {
288
  * @uses wp_update_attachment_metadata()
289
  * @uses wp_upload_dir()
290
  * @uses wpua_is_author_or_above()
 
 
291
  */
292
  public static function wpua_action_process_option_update($user_id) {
293
- global $blog_id, $post, $wpdb, $wp_user_avatar, $wpua_resize_crop, $wpua_resize_h, $wpua_resize_upload, $wpua_resize_w;
294
  // Check if user has publish_posts capability
295
  if($wp_user_avatar->wpua_is_author_or_above()) {
296
  $wpua_id = isset($_POST['wp-user-avatar']) ? strip_tags($_POST['wp-user-avatar']) : "";
@@ -404,6 +410,7 @@ class WP_User_Avatar {
404
  }
405
  }
406
  }
 
407
  }
408
 
409
  /**
152
  */
153
  public static function wpua_action_show_user_profile($user) {
154
  global $blog_id, $current_user, $show_avatars, $wpdb, $wp_user_avatar, $wpua_allow_upload, $wpua_edit_avatar, $wpua_functions, $wpua_upload_size_limit_with_units;
155
+
156
+ $has_wp_user_avatar = has_wp_user_avatar(@$user->ID);
157
  // Get WPUA attachment ID
158
+ $wpua = get_user_meta(@$user->ID, $wpdb->get_blog_prefix($blog_id).'user_avatar', true);
159
  // Show remove button if WPUA is set
160
+ $hide_remove = !$has_wp_user_avatar ? 'wpua-hide' : "";
161
  // Hide image tags if show avatars is off
162
+ $hide_images = !$has_wp_user_avatar && (bool) $show_avatars == 0 ? 'wpua-no-avatars' : "";
163
  // If avatars are enabled, get original avatar image or show blank
164
+ $avatar_medium_src = (bool) $show_avatars == 1 ? $wpua_functions->wpua_get_avatar_original(@$user->user_email, 'medium') : includes_url().'images/blank.gif';
165
  // Check if user has wp_user_avatar, if not show image from above
166
+ $avatar_medium = $has_wp_user_avatar ? get_wp_user_avatar_src($user->ID, 'medium') : $avatar_medium_src;
167
  // Check if user has wp_user_avatar, if not show image from above
168
+ $avatar_thumbnail = $has_wp_user_avatar ? get_wp_user_avatar_src($user->ID, 96) : $avatar_medium_src;
169
+ $edit_attachment_link = esc_url(add_query_arg(array('post' => $wpua, 'action' => 'edit'), admin_url('post.php')));
170
  // Chck if admin page
171
  $is_admin = is_admin() ? '_admin' : "";
172
  ?>
173
  <?php do_action('wpua_before_avatar'.$is_admin); ?>
174
+ <input type="hidden" name="wp-user-avatar" id="<?php echo ($user=='add-new-user') ? 'wp-user-avatar' : 'wp-user-avatar-existing'?>" value="<?php echo $wpua; ?>" />
175
  <?php if($wp_user_avatar->wpua_is_author_or_above()) : // Button to launch Media Uploader ?>
176
+
177
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-add-button' : 'wpua-add-button-existing'?>"><button type="button" class="button" id="<?php echo ($user=='add-new-user') ? 'wpua-add' : 'wpua-add-existing'?>" name="<?php echo ($user=='add-new-user') ? 'wpua-add' : 'wpua-add-existing'?>" data-title="<?php _e('Choose Image','wp-user-avatar'); ?>: <?php echo ( ! empty( $user->display_name ) ? $user->display_name:''); ?>"><?php _e('Choose Image','wp-user-avatar'); ?></button></p>
178
+
179
  <?php elseif(!$wp_user_avatar->wpua_is_author_or_above()) : // Upload button ?>
180
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-upload-button' : 'wpua-upload-button-existing'?>">
181
+ <input name="wpua-file" id="<?php echo ($user=='add-new-user') ? 'wpua-file' : 'wpua-file-existing'?>" type="file" />
182
+ <button type="submit" class="button" id="<?php echo ($user=='add-new-user') ? 'wpua-upload' : 'wpua-upload-existing'?>" name="submit" value="<?php _e('Upload','wp-user-avatar'); ?>"><?php _e('Upload','wp-user-avatar'); ?></button>
183
  </p>
184
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-upload-messages' : 'wpua-upload-messages-existing'?>">
185
+ <span id="<?php echo ($user=='add-new-user') ? 'wpua-max-upload' : 'wpua-max-upload-existing'?>" class="description"><?php printf(__('Maximum upload file size: %d%s.','wp-user-avatar'), esc_html($wpua_upload_size_limit_with_units), esc_html('KB')); ?></span>
186
+ <span id="<?php echo ($user=='add-new-user') ? 'wpua-allowed-files' : 'wpua-allowed-files-existing'?>" class="description"><?php _e('Allowed Files','wp-user-avatar'); ?>: <?php _e('<code>jpg jpeg png gif</code>','wp-user-avatar'); ?></span>
187
  </p>
188
  <?php endif; ?>
189
+ <div id="<?php echo ($user=='add-new-user') ? 'wpua-images' : 'wpua-images-existing'?>" class="<?php echo $hide_images; ?>">
190
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-preview' : 'wpua-preview-existing'?>">
191
  <img src="<?php echo $avatar_medium; ?>" alt="" />
192
+ <span class="description"><?php _e('Original Size','wp-user-avatar'); ?></span>
193
  </p>
194
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-thumbnail' : 'wpua-thumbnail-existing'?>">
195
  <img src="<?php echo $avatar_thumbnail; ?>" alt="" />
196
+ <span class="description"><?php _e('Thumbnail','wp-user-avatar'); ?></span>
197
  </p>
198
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-remove-button' : 'wpua-remove-button-existing'?>" class="<?php echo $hide_remove; ?>">
199
+ <button type="button" class="button" id="<?php echo ($user=='add-new-user') ? 'wpua-remove' : 'wpua-remove-existing'?>" name="wpua-remove"><?php _e('Remove Image','wp-user-avatar'); ?></button>
200
  <?php if((bool) $wpua_edit_avatar == 1 && !$wp_user_avatar->wpua_is_author_or_above() && has_wp_user_avatar($current_user->ID) && $wp_user_avatar->wpua_author($wpua, $current_user->ID)) : // Edit button ?>
201
+ <span id="<?php echo ($user=='add-new-user') ? 'wpua-edit-attachment' : 'wpua-edit-attachment-existing'?>"><a href="<?php echo $edit_attachment_link; ?>" class="edit-attachment" target="_blank"><?php _e('Edit Image','wp-user-avatar'); ?></a></span>
202
  <?php endif; ?>
203
  </p>
204
+ <p id="<?php echo ($user=='add-new-user') ? 'wpua-undo-button' : 'wpua-undo-button-existing'?>"><button type="button" class="button" id="<?php echo ($user=='add-new-user') ? 'wpua-undo' : 'wpua-undo-existing'?>" name="wpua-undo"><?php _e('Undo','wp-user-avatar'); ?></button></p>
205
  </div>
206
  <?php do_action('wpua_after_avatar'.$is_admin); ?>
207
  <?php
225
  $upload_dir = wp_upload_dir();
226
  // Allow only JPG, GIF, PNG
227
  if(!empty($type) && !preg_match('/(jpe?g|gif|png)$/i', $type)) {
228
+ $errors->add('wpua_file_type', __('This file is not an image. Please try another.','wp-user-avatar'));
229
  }
230
  // Upload size limit
231
  if(!empty($size) && $size > $wpua_upload_size_limit) {
232
+ $errors->add('wpua_file_size', __('Memory exceeded. Please try another smaller file.','wp-user-avatar'));
233
  }
234
  // Check if directory is writeable
235
  if(!is_writeable($upload_dir['path'])) {
236
+ $errors->add('wpua_file_directory', sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?','wp-user-avatar'), $upload_dir['path']));
237
  }
238
  }
239
  }
255
  * @since 1.7
256
  */
257
  function wpua_file_size_error($errors, $update, $user) {
258
+ $errors->add('wpua_file_size', __('Memory exceeded. Please try another smaller file.','wp-user-avatar'));
259
  }
260
  add_action('user_profile_update_errors', 'wpua_file_size_error', 10, 3);
261
  return;
292
  * @uses wp_update_attachment_metadata()
293
  * @uses wp_upload_dir()
294
  * @uses wpua_is_author_or_above()
295
+ * @uses object $wpua_admin
296
+ * @uses wpua_has_gravatar()
297
  */
298
  public static function wpua_action_process_option_update($user_id) {
299
+ global $blog_id, $post, $wpdb, $wp_user_avatar, $wpua_resize_crop, $wpua_resize_h, $wpua_resize_upload, $wpua_resize_w, $wpua_admin;
300
  // Check if user has publish_posts capability
301
  if($wp_user_avatar->wpua_is_author_or_above()) {
302
  $wpua_id = isset($_POST['wp-user-avatar']) ? strip_tags($_POST['wp-user-avatar']) : "";
410
  }
411
  }
412
  }
413
+
414
  }
415
 
416
  /**
includes/tinymce/window.php CHANGED
@@ -1,202 +1,207 @@
1
- <?php
2
- /**
3
- * TinyMCE modal window.
4
- *
5
- * @package WP User Avatar
6
- * @version 1.9.13
7
- */
8
-
9
- /**
10
- * @since 1.2.1
11
- * @uses get_users()
12
- */
13
-
14
- if(!defined('ABSPATH')) {
15
- die('You are not allowed to call this page directly.');
16
- }
17
- ?>
18
- <!DOCTYPE html>
19
- <html>
20
- <head>
21
- <title><?php _e('WP User Avatar', 'wp-user-avatar'); ?></title>
22
- <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
23
- <base target="_self" />
24
- <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/jquery/jquery.js"></script>
25
- <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/jquery/ui/jquery.ui.core.min.js"></script>
26
- <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/jquery/ui/jquery.ui.widget.min.js"></script>
27
- <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js"></script>
28
- <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
29
- <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
30
- <script type="text/javascript">
31
- function wpuaInsertAvatar() {
32
- // Custom shortcode values
33
- var shortcode,
34
- closing_tag,
35
- user = document.getElementById('wp_user_avatar_user').value,
36
- size = document.getElementById('wp_user_avatar_size').value,
37
- size_number = document.getElementById('wp_user_avatar_size_number').value,
38
- align = document.getElementById('wp_user_avatar_align').value,
39
- link = document.getElementById('wp_user_avatar_link').value,
40
- link_external = document.getElementById('wp_user_avatar_link_external').value,
41
- target = document.getElementById('wp_user_avatar_target').value,
42
- caption = document.getElementById('wp_user_avatar_caption').value;
43
-
44
- // Add tag to shortcode only if not blank
45
- var user_tag = (user != "") ? ' user="' + user + '"' : "";
46
- var size_tag = (size != "" && size_number == "") ? ' size="' + size + '"' : "";
47
- size_tag = (size_number != "") ? ' size="' + size_number + '"' : size_tag;
48
- var align_tag = (align != "") ? ' align="' + align + '"' : "";
49
- var link_tag = (link != "" && link != 'custom-url' && link_external == "") ? ' link="' + link + '"' : "";
50
- link_tag = (link_external != "") ? ' link="' + link_external + '"' : link_tag;
51
- var target_tag = document.getElementById('wp_user_avatar_target').checked && (link_tag != "") ? ' target="' + target + '"' : "";
52
-
53
- // Assemble the shortcode
54
- closing_tag = (caption != "") ? "]" + caption + "[/avatar]" : " /]";
55
- shortcode = "<p>[avatar" + user_tag + size_tag + align_tag + link_tag + target_tag + closing_tag + "</p>";
56
-
57
- // Insert into Visual Editor
58
- if(window.tinyMCE) {
59
- var tmce_ver = window.tinyMCE.majorVersion;
60
- if(tmce_ver >= "4") {
61
- window.tinyMCE.execCommand('mceInsertContent', false, shortcode);
62
- } else {
63
- window.tinyMCE.execInstanceCommand(window.tinyMCE.activeEditor.id, 'mceInsertContent', false, shortcode);
64
- }
65
- tinyMCEPopup.editor.execCommand('mceRepaint');
66
- tinyMCEPopup.close();
67
- }
68
- return;
69
- }
70
- function wpuaInsertAvatarUpload() {
71
- // Upload shortcode
72
- var shortcode = "<p>[avatar_upload /]</p>";
73
-
74
- // Insert into Visual Editor
75
- if(window.tinyMCE) {
76
- var tmce_ver = window.tinyMCE.majorVersion;
77
- if(tmce_ver >= "4") {
78
- window.tinyMCE.execCommand('mceInsertContent', false, shortcode);
79
- } else {
80
- window.tinyMCE.execInstanceCommand(window.tinyMCE.activeEditor.id, 'mceInsertContent', false, shortcode);
81
- }
82
- tinyMCEPopup.editor.execCommand('mceRepaint');
83
- tinyMCEPopup.close();
84
- }
85
- return;
86
- }
87
-
88
- jQuery(function($) {
89
- // Show link input
90
- $('#wp_user_avatar_link').change(function() {
91
- $('#wp_user_avatar_link_external_section').toggle($('#wp_user_avatar_link').val() == 'custom-url');
92
- });
93
- // Show size input
94
- $('#wp_user_avatar_size').change(function() {
95
- $('#wp_user_avatar_size_number_section').toggle($('#wp_user_avatar_size').val() == 'custom');
96
- });
97
- // Tabs
98
- $('#wpua-tabs').tabs();
99
- });
100
- </script>
101
- <style type="text/css">
102
- ul { margin: 0; padding: 0; list-style: none; }
103
- ul li { float: left; }
104
- ul li a { float: left; padding: 2px 5px; background: #ddd; border: 1px solid #eee; border-bottom: 0; display: block; font-weight: 700; outline: none; text-decoration: none; }
105
- ul li.ui-tabs-active a { background: #fff; }
106
- form { clear: both; background: #fff; border: 1px solid #eee; }
107
- p, h4 { margin: 0; padding: 12px 0 0; }
108
- h4.center { text-align: center; }
109
- label { width: 150px; margin-right: 3px; display: inline-block; text-align: right; vertical-align: top; }
110
- .mceActionPanel { padding: 7px 0 12px; text-align: center; }
111
- .mceActionPanel #insert { float: none; width: 180px; margin: 0 auto; }
112
- #wp_user_avatar_size_number_section, #wp_user_avatar_link_external_section { display: none; }
113
- </style>
114
- </head>
115
- <body id="link" class="wp-core-ui" onload="document.body.style.display='';" style="display:none;">
116
- <div id="wpua-tabs">
117
- <ul>
118
- <li><a href="#wpua"><?php _e('Avatar'); ?></a></li>
119
- <li><a href="#wpua-upload"><?php _e('Upload'); ?></a></li>
120
- </ul>
121
- <form name="wpUserAvatar" action="#">
122
- <div id="wpua">
123
- <p>
124
- <label for="<?php esc_attr_e('wp_user_avatar_user'); ?>"><strong><?php _e('User Name'); ?>:</strong></label>
125
- <select id="<?php esc_attr_e('wp_user_avatar_user'); ?>" name="<?php esc_attr_e('wp_user_avatar_user'); ?>">
126
- <option value=""></option>
127
- <?php $users = get_users(); foreach($users as $user) : ?>
128
- <option value="<?php echo $user->user_login; ?>"><?php echo $user->display_name; ?></option>
129
- <?php endforeach; ?>
130
- </select>
131
- </p>
132
-
133
- <p>
134
- <label for="<?php esc_attr_e('wp_user_avatar_size'); ?>"><strong><?php _e('Size'); ?>:</strong></label>
135
- <select id="<?php esc_attr_e('wp_user_avatar_size'); ?>" name="<?php esc_attr_e('wp_user_avatar_size'); ?>">
136
- <option value=""></option>
137
- <option value="original"><?php _e('Original Size'); ?></option>
138
- <option value="large"><?php _e('Large'); ?></option>
139
- <option value="medium"><?php _e('Medium'); ?></option>
140
- <option value="thumbnail"><?php _e('Thumbnail'); ?></option>
141
- <option value="custom"><?php _e('Custom'); ?></option>
142
- </select>
143
- </p>
144
-
145
- <p id="<?php esc_attr_e('wp_user_avatar_size_number_section'); ?>">
146
- <label for="<?php esc_attr_e('wp_user_avatar_size_number'); ?>"><?php _e('Size'); ?>:</label>
147
- <input type="text" size="8" id="<?php esc_attr_e('wp_user_avatar_size_number'); ?>" name="<?php esc_attr_e('wp_user_avatar_size'); ?>" value="" />
148
- </p>
149
-
150
- <p>
151
- <label for="<?php esc_attr_e('wp_user_avatar_align'); ?>"><strong><?php _e('Alignment'); ?>:</strong></label>
152
- <select id="<?php esc_attr_e('wp_user_avatar_align'); ?>" name="<?php esc_attr_e('wp_user_avatar_align'); ?>">
153
- <option value=""></option>
154
- <option value="center"><?php _e('Center'); ?></option>
155
- <option value="left"><?php _e('Left'); ?></option>
156
- <option value="right"><?php _e('Right'); ?></option>
157
- </select>
158
- </p>
159
-
160
- <p>
161
- <label for="<?php esc_attr_e('wp_user_avatar_link'); ?>"><strong><?php _e('Link To'); ?>:</strong></label>
162
- <select id="<?php esc_attr_e('wp_user_avatar_link'); ?>" name="<?php esc_attr_e('wp_user_avatar_link'); ?>">
163
- <option value=""></option>
164
- <option value="file"><?php _e('Image File'); ?></option>
165
- <option value="attachment"><?php _e('Attachment Page'); ?></option>
166
- <option value="custom-url"><?php _e('Custom URL'); ?></option>
167
- </select>
168
- </p>
169
-
170
- <p id="<?php esc_attr_e('wp_user_avatar_link_external_section'); ?>">
171
- <label for="<?php esc_attr_e('wp_user_avatar_link_external'); ?>"><?php _e('URL'); ?>:</label>
172
- <input type="text" size="36" id="<?php esc_attr_e('wp_user_avatar_link_external'); ?>" name="<?php esc_attr_e('wp_user_avatar_link_external'); ?>" value="" />
173
- </p>
174
-
175
- <p>
176
- <label for="<?php esc_attr_e('wp_user_avatar_target'); ?>"></label>
177
- <input type="checkbox" id="<?php esc_attr_e('wp_user_avatar_target'); ?>" name="<?php esc_attr_e('wp_user_avatar_target'); ?>" value="_blank" /> <strong><?php _e('Open link in a new window'); ?></strong>
178
- </p>
179
-
180
- <p>
181
- <label for="<?php esc_attr_e('wp_user_avatar_caption'); ?>"><strong><?php _e('Caption'); ?>:</strong></label>
182
- <textarea cols="36" rows="2" id="<?php esc_attr_e('wp_user_avatar_caption'); ?>" name="<?php esc_attr_e('wp_user_avatar_size'); ?>"></textarea>
183
- </p>
184
-
185
- <div class="mceActionPanel">
186
- <input type="submit" id="insert" class="button-primary" name="insert" value="<?php _e('Insert into Post'); ?>" onclick="wpuaInsertAvatar();" />
187
- </div>
188
- </div>
189
- <div id="wpua-upload">
190
- <p id="<?php esc_attr_e('wp_user_avatar_upload'); ?>">
191
- <label for="<?php esc_attr_e('wp_user_avatar_upload'); ?>"><strong><?php _e('Upload'); ?>:</strong></label>
192
- <input type="text" size="36" id="<?php esc_attr_e('wp_user_avatar_upload'); ?>" name="<?php esc_attr_e('wp_user_avatar_upload'); ?>" value="<?php esc_attr_e('[avatar_upload]'); ?>" readonly="readonly" />
193
- </p>
194
-
195
- <div class="mceActionPanel">
196
- <input type="submit" id="insert" class="button-primary" name="insert" value="<?php _e('Insert into Post'); ?>" onclick="wpuaInsertAvatarUpload();" />
197
- </div>
198
- </div>
199
- </form>
200
- </div>
201
- </body>
202
- </html>
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * TinyMCE modal window.
4
+ *
5
+ * @package WP User Avatar
6
+ * @version 1.9.13
7
+ */
8
+
9
+ /**
10
+ * @since 1.2.1
11
+ * @uses get_users()
12
+ */
13
+
14
+ if(!defined('ABSPATH')) {
15
+ die('You are not allowed to call this page directly.');
16
+ }
17
+ ?>
18
+ <!DOCTYPE html>
19
+ <html>
20
+ <head>
21
+ <title><?php _e('WP User Avatar', 'wp-user-avatar'); ?></title>
22
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
23
+ <base target="_self" />
24
+ <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/jquery/jquery.js"></script>
25
+ <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/tiny_mce_popup.js"></script>
26
+ <script type="text/javascript" src="<?php echo site_url(); ?>/wp-includes/js/tinymce/utils/form_utils.js"></script>
27
+ <script type="text/javascript">
28
+ function wpuaInsertAvatar() {
29
+ // Custom shortcode values
30
+ var shortcode,
31
+ closing_tag,
32
+ user = document.getElementById('wp_user_avatar_user').value,
33
+ size = document.getElementById('wp_user_avatar_size').value,
34
+ size_number = document.getElementById('wp_user_avatar_size_number').value,
35
+ align = document.getElementById('wp_user_avatar_align').value,
36
+ link = document.getElementById('wp_user_avatar_link').value,
37
+ link_external = document.getElementById('wp_user_avatar_link_external').value,
38
+ target = document.getElementById('wp_user_avatar_target').value,
39
+ caption = document.getElementById('wp_user_avatar_caption').value;
40
+
41
+ // Add tag to shortcode only if not blank
42
+ var user_tag = (user != "") ? ' user="' + user + '"' : "";
43
+ var size_tag = (size != "" && size_number == "") ? ' size="' + size + '"' : "";
44
+ size_tag = (size_number != "") ? ' size="' + size_number + '"' : size_tag;
45
+ var align_tag = (align != "") ? ' align="' + align + '"' : "";
46
+ var link_tag = (link != "" && link != 'custom-url' && link_external == "") ? ' link="' + link + '"' : "";
47
+ link_tag = (link_external != "") ? ' link="' + link_external + '"' : link_tag;
48
+ var target_tag = document.getElementById('wp_user_avatar_target').checked && (link_tag != "") ? ' target="' + target + '"' : "";
49
+
50
+ // Assemble the shortcode
51
+ closing_tag = (caption != "") ? "]" + caption + "[/avatar]" : " /]";
52
+ shortcode = "<p>[avatar" + user_tag + size_tag + align_tag + link_tag + target_tag + closing_tag + "</p>";
53
+
54
+ // Insert into Visual Editor
55
+ if(window.tinyMCE) {
56
+ var tmce_ver = window.tinyMCE.majorVersion;
57
+ if(tmce_ver >= "4") {
58
+ window.tinyMCE.execCommand('mceInsertContent', false, shortcode);
59
+ } else {
60
+ window.tinyMCE.execInstanceCommand(window.tinyMCE.activeEditor.id, 'mceInsertContent', false, shortcode);
61
+ }
62
+ tinyMCEPopup.editor.execCommand('mceRepaint');
63
+ tinyMCEPopup.close();
64
+ }
65
+ return;
66
+ }
67
+ function wpuaInsertAvatarUpload() {
68
+ // Upload shortcode
69
+ var shortcode = "<p>[avatar_upload /]</p>";
70
+
71
+ // Insert into Visual Editor
72
+ if(window.tinyMCE) {
73
+ var tmce_ver = window.tinyMCE.majorVersion;
74
+ if(tmce_ver >= "4") {
75
+ window.tinyMCE.execCommand('mceInsertContent', false, shortcode);
76
+ } else {
77
+ window.tinyMCE.execInstanceCommand(window.tinyMCE.activeEditor.id, 'mceInsertContent', false, shortcode);
78
+ }
79
+ tinyMCEPopup.editor.execCommand('mceRepaint');
80
+ tinyMCEPopup.close();
81
+ }
82
+ return;
83
+ }
84
+
85
+ jQuery(function($) {
86
+ // Show link input
87
+ $('#wp_user_avatar_link').change(function() {
88
+ $('#wp_user_avatar_link_external_section').toggle($('#wp_user_avatar_link').val() == 'custom-url');
89
+ });
90
+ // Show size input
91
+ $('#wp_user_avatar_size').change(function() {
92
+ $('#wp_user_avatar_size_number_section').toggle($('#wp_user_avatar_size').val() == 'custom');
93
+ });
94
+
95
+ $("#wpua-tabs li a").click(function(){
96
+ tab_id = $(this).attr('href');
97
+ if( tab_id == '#wpua')
98
+ $("#wpua-upload").hide();
99
+ else
100
+ $('#wpua').hide();
101
+ $(tab_id).show();
102
+ })
103
+ // Tabs
104
+ });
105
+ </script>
106
+ <style type="text/css">
107
+ ul { margin: 0; padding: 0; list-style: none; }
108
+ ul li { float: left; }
109
+ ul li a { float: left; padding: 2px 5px; background: #ddd; border: 1px solid #eee; border-bottom: 0; display: block; font-weight: 700; outline: none; text-decoration: none; }
110
+ ul li.ui-tabs-active a { background: #fff; }
111
+ form { clear: both; background: #fff; border: 1px solid #eee; }
112
+ p, h4 { margin: 0; padding: 12px 0 0; }
113
+ h4.center { text-align: center; }
114
+ label { width: 150px; margin-right: 3px; display: inline-block; text-align: right; vertical-align: top; }
115
+ .mceActionPanel { padding: 7px 0 12px; text-align: center; }
116
+ .mceActionPanel #insert { float: none; width: 180px; margin: 0 auto; }
117
+ #wp_user_avatar_size_number_section, #wp_user_avatar_link_external_section { display: none; }
118
+ </style>
119
+ </head>
120
+ <body id="link" class="wp-core-ui" onload="document.body.style.display='';" style="display:none;">
121
+ <div id="wpua-tabs">
122
+ <ul>
123
+ <li><a href="#wpua"><?php _e('Avatar','wp-user-avatar'); ?></a></li>
124
+ <li><a href="#wpua-upload"><?php _e('Upload','wp-user-avatar'); ?></a></li>
125
+ </ul>
126
+ <form name="wpUserAvatar" action="#">
127
+ <div id="wpua">
128
+ <p>
129
+ <label for="<?php esc_attr_e('wp_user_avatar_user'); ?>"><strong><?php _e('User Name','wp-user-avatar'); ?>:</strong></label>
130
+ <select id="<?php esc_attr_e('wp_user_avatar_user'); ?>" name="<?php esc_attr_e('wp_user_avatar_user'); ?>">
131
+ <option value=""></option>
132
+ <?php $users = get_users(); foreach($users as $user) : ?>
133
+ <option value="<?php echo $user->user_login; ?>"><?php echo $user->display_name; ?></option>
134
+ <?php endforeach; ?>
135
+ </select>
136
+ </p>
137
+
138
+ <p>
139
+ <label for="<?php esc_attr_e('wp_user_avatar_size'); ?>"><strong><?php _e('Size'); ?>:</strong></label>
140
+ <select id="<?php esc_attr_e('wp_user_avatar_size'); ?>" name="<?php esc_attr_e('wp_user_avatar_size'); ?>">
141
+ <option value=""></option>
142
+ <option value="original"><?php _e('Original Size','wp-user-avatar'); ?></option>
143
+ <option value="large"><?php _e('Large','wp-user-avatar'); ?></option>
144
+ <option value="medium"><?php _e('Medium','wp-user-avatar'); ?></option>
145
+ <option value="thumbnail"><?php _e('Thumbnail','wp-user-avatar'); ?></option>
146
+ <option value="custom"><?php _e('Custom','wp-user-avatar'); ?></option>
147
+ </select>
148
+ </p>
149
+
150
+ <p id="<?php esc_attr_e('wp_user_avatar_size_number_section'); ?>">
151
+ <label for="<?php esc_attr_e('wp_user_avatar_size_number'); ?>"><?php _e('Size','wp-user-avatar'); ?>:</label>
152
+ <input type="text" size="8" id="<?php esc_attr_e('wp_user_avatar_size_number'); ?>" name="<?php esc_attr_e('wp_user_avatar_size'); ?>" value="" />
153
+ </p>
154
+
155
+ <p>
156
+ <label for="<?php esc_attr_e('wp_user_avatar_align'); ?>"><strong><?php _e('Alignment','wp-user-avatar'); ?>:</strong></label>
157
+ <select id="<?php esc_attr_e('wp_user_avatar_align'); ?>" name="<?php esc_attr_e('wp_user_avatar_align'); ?>">
158
+ <option value=""></option>
159
+ <option value="center"><?php _e('Center','wp-user-avatar'); ?></option>
160
+ <option value="left"><?php _e('Left','wp-user-avatar'); ?></option>
161
+ <option value="right"><?php _e('Right','wp-user-avatar'); ?></option>
162
+ </select>
163
+ </p>
164
+
165
+ <p>
166
+ <label for="<?php esc_attr_e('wp_user_avatar_link'); ?>"><strong><?php _e('Link To'); ?>:</strong></label>
167
+ <select id="<?php esc_attr_e('wp_user_avatar_link'); ?>" name="<?php esc_attr_e('wp_user_avatar_link'); ?>">
168
+ <option value=""></option>
169
+ <option value="file"><?php _e('Image File','wp-user-avatar'); ?></option>
170
+ <option value="attachment"><?php _e('Attachment Page','wp-user-avatar'); ?></option>
171
+ <option value="custom-url"><?php _e('Custom URL','wp-user-avatar'); ?></option>
172
+ </select>
173
+ </p>
174
+
175
+ <p id="<?php esc_attr_e('wp_user_avatar_link_external_section'); ?>">
176
+ <label for="<?php esc_attr_e('wp_user_avatar_link_external'); ?>"><?php _e('URL','wp-user-avatar'); ?>:</label>
177
+ <input type="text" size="36" id="<?php esc_attr_e('wp_user_avatar_link_external'); ?>" name="<?php esc_attr_e('wp_user_avatar_link_external'); ?>" value="" />
178
+ </p>
179
+
180
+ <p>
181
+ <label for="<?php esc_attr_e('wp_user_avatar_target'); ?>"></label>
182
+ <input type="checkbox" id="<?php esc_attr_e('wp_user_avatar_target'); ?>" name="<?php esc_attr_e('wp_user_avatar_target'); ?>" value="_blank" /> <strong><?php _e('Open link in a new window','wp-user-avatar'); ?></strong>
183
+ </p>
184
+
185
+ <p>
186
+ <label for="<?php esc_attr_e('wp_user_avatar_caption'); ?>"><strong><?php _e('Caption','wp-user-avatar'); ?>:</strong></label>
187
+ <textarea cols="36" rows="2" id="<?php esc_attr_e('wp_user_avatar_caption'); ?>" name="<?php esc_attr_e('wp_user_avatar_size'); ?>"></textarea>
188
+ </p>
189
+
190
+ <div class="mceActionPanel">
191
+ <input type="submit" id="insert" class="button-primary" name="insert" value="<?php _e('Insert into Post'); ?>" onclick="wpuaInsertAvatar();" />
192
+ </div>
193
+ </div>
194
+ <div id="wpua-upload" style="display:none;">
195
+ <p id="<?php esc_attr_e('wp_user_avatar_upload'); ?>">
196
+ <label for="<?php esc_attr_e('wp_user_avatar_upload'); ?>"><strong><?php _e('Upload','wp-user-avatar'); ?>:</strong></label>
197
+ <input type="text" size="36" id="<?php esc_attr_e('wp_user_avatar_upload'); ?>" name="<?php esc_attr_e('wp_user_avatar_upload'); ?>" value="<?php esc_attr_e('[avatar_upload]'); ?>" readonly="readonly" />
198
+ </p>
199
+
200
+ <div class="mceActionPanel">
201
+ <input type="submit" id="insert" class="button-primary" name="insert" value="<?php _e('Insert into Post','wp-user-avatar'); ?>" onclick="wpuaInsertAvatarUpload();" />
202
+ </div>
203
+ </div>
204
+ </form>
205
+ </div>
206
+ </body>
207
+ </html>
includes/wpua-functions.php CHANGED
@@ -76,7 +76,7 @@ function wpua_after_avatar() {
76
  * @uses wpuf_has_shortcode()
77
  */
78
  function wpua_do_before_avatar() {
79
- $wpua_profile_title = '<h3>'.__('Avatar').'</h3>';
80
  /**
81
  * Filter profile title
82
  * @since 1.9.4
@@ -85,15 +85,15 @@ function wpua_do_before_avatar() {
85
  $wpua_profile_title = apply_filters('wpua_profile_title', $wpua_profile_title);
86
  ?>
87
  <?php if(class_exists('bbPress') && bbp_is_edit()) : // Add to bbPress profile with same style ?>
88
- <h2 class="entry-title"><?php _e('Avatar'); ?></h2>
89
  <fieldset class="bbp-form">
90
- <legend><?php _e('Image'); ?></legend>
91
  <?php elseif(class_exists('WPUF_Main') && wpuf_has_shortcode('wpuf_editprofile')) : // Add to WP User Frontend profile with same style ?>
92
  <fieldset>
93
- <legend><?php _e('Avatar') ?></legend>
94
  <table class="wpuf-table">
95
  <tr>
96
- <th><label for="wp_user_avatar"><?php _e('Image'); ?></label></th>
97
  <td>
98
  <?php else : // Add to profile without table ?>
99
  <div class="wpua-edit-container">
@@ -152,7 +152,7 @@ function wpua_do_before_avatar_admin() {
152
  <h3><?php _e('Avatar') ?></h3>
153
  <table class="form-table">
154
  <tr>
155
- <th><label for="wp_user_avatar"><?php _e('Image'); ?></label></th>
156
  <td>
157
  <?php
158
  }
@@ -185,12 +185,9 @@ function wpua_donation_message() {
185
  * @since 1.6.6
186
  */
187
  function wpua_do_donation_message() { ?>
188
- <div class="updated">
189
- <p><?php _e('Do you like WP User Avatar?', 'wp-user-avatar'); ?> <a href="http://wordpress.org/plugins/wp-google-map-plugin/" target="_blank"><?php _e('Try our Google Maps Plugin.', 'wp-user-avatar'); ?></a></p>
190
- </div>
191
  <?php
192
  }
193
- add_action('wpua_donation_message', 'wpua_do_donation_message');
194
 
195
  /**
196
  * Register widget
76
  * @uses wpuf_has_shortcode()
77
  */
78
  function wpua_do_before_avatar() {
79
+ $wpua_profile_title = '<h3>'.__('Avatar','wp-user-avatar').'</h3>';
80
  /**
81
  * Filter profile title
82
  * @since 1.9.4
85
  $wpua_profile_title = apply_filters('wpua_profile_title', $wpua_profile_title);
86
  ?>
87
  <?php if(class_exists('bbPress') && bbp_is_edit()) : // Add to bbPress profile with same style ?>
88
+ <h2 class="entry-title"><?php _e('Avatar','wp-user-avatar'); ?></h2>
89
  <fieldset class="bbp-form">
90
+ <legend><?php _e('Image','wp-user-avatar'); ?></legend>
91
  <?php elseif(class_exists('WPUF_Main') && wpuf_has_shortcode('wpuf_editprofile')) : // Add to WP User Frontend profile with same style ?>
92
  <fieldset>
93
+ <legend><?php _e('Avatar','wp-user-avatar') ?></legend>
94
  <table class="wpuf-table">
95
  <tr>
96
+ <th><label for="wp_user_avatar"><?php _e('Image','wp-user-avatar'); ?></label></th>
97
  <td>
98
  <?php else : // Add to profile without table ?>
99
  <div class="wpua-edit-container">
152
  <h3><?php _e('Avatar') ?></h3>
153
  <table class="form-table">
154
  <tr>
155
+ <th><label for="wp_user_avatar"><?php _e('Image','wp-user-avatar'); ?></label></th>
156
  <td>
157
  <?php
158
  }
185
  * @since 1.6.6
186
  */
187
  function wpua_do_donation_message() { ?>
 
 
 
188
  <?php
189
  }
190
+ //add_action('wpua_donation_message', 'wpua_do_donation_message');
191
 
192
  /**
193
  * Register widget
includes/wpua-globals.php CHANGED
@@ -38,7 +38,13 @@ global $avatar_default,
38
  $wpua_user_upload_size_limit,
39
  $wpua_upload_size_limit,
40
  $wpua_upload_size_limit_with_units,
41
- $all_sizes;
 
 
 
 
 
 
42
 
43
  // Default avatar name
44
  $avatar_default = get_option('avatar_default');
38
  $wpua_user_upload_size_limit,
39
  $wpua_upload_size_limit,
40
  $wpua_upload_size_limit_with_units,
41
+ $all_sizes,
42
+ $wpua_hash_gravatar;
43
+
44
+ // Store if hash has gravatar
45
+ $wpua_hash_gravatar = get_option('wpua_hash_gravatar');
46
+ if( $wpua_hash_gravatar != false)
47
+ $wpua_hash_gravatar = maybe_unserialize($wpua_hash_gravatar);
48
 
49
  // Default avatar name
50
  $avatar_default = get_option('avatar_default');
includes/wpua-media-page.php CHANGED
@@ -36,7 +36,7 @@
36
  require_once(ABSPATH.'wp-admin/admin.php');
37
 
38
  if(!current_user_can('upload_files'))
39
- wp_die(__('You do not have permission to upload files.'));
40
 
41
  global $wpua_admin;
42
 
@@ -68,13 +68,13 @@
68
  }
69
  foreach((array) $post_ids as $post_id_del) {
70
  if(!current_user_can('delete_post', $post_id_del)) {
71
- wp_die(__('You are not allowed to delete this post.'));
72
  }
73
  if(!wp_delete_attachment($post_id_del)) {
74
- wp_die(__('Error in deleting.'));
75
  }
76
  }
77
- $location = add_query_arg('deleted', count($post_ids), $location);
78
  break;
79
  }
80
  wp_redirect($location);
@@ -90,9 +90,9 @@
90
  ?>
91
  <div class="wrap">
92
  <h2>
93
- <?php _e('Avatars');
94
  if(!empty($_REQUEST['s'])) {
95
- printf('<span class="subtitle">'.__('Search results for &#8220;%s&#8221;').'</span>', get_search_query());
96
  }
97
  ?>
98
  </h2>
@@ -107,7 +107,7 @@
107
  <?php endif; ?>
108
  <?php $wp_list_table->views(); ?>
109
  <form id="posts-filter" action="" method="get">
110
- <?php $wp_list_table->search_box(__('Search'), 'media'); ?>
111
  <?php $wp_list_table->display(); ?>
112
  <div id="ajax-response"></div>
113
  <?php find_posts_div(); ?>
36
  require_once(ABSPATH.'wp-admin/admin.php');
37
 
38
  if(!current_user_can('upload_files'))
39
+ wp_die(__('You do not have permission to upload files.','wp-user-avatar'));
40
 
41
  global $wpua_admin;
42
 
68
  }
69
  foreach((array) $post_ids as $post_id_del) {
70
  if(!current_user_can('delete_post', $post_id_del)) {
71
+ wp_die(__('You are not allowed to delete this post.','wp-user-avatar'));
72
  }
73
  if(!wp_delete_attachment($post_id_del)) {
74
+ wp_die(__('Error in deleting.','wp-user-avatar'));
75
  }
76
  }
77
+ $location = esc_url_raw(add_query_arg('deleted', count($post_ids), $location));
78
  break;
79
  }
80
  wp_redirect($location);
90
  ?>
91
  <div class="wrap">
92
  <h2>
93
+ <?php _e('Avatars','wp-user-avatar');
94
  if(!empty($_REQUEST['s'])) {
95
+ printf('<span class="subtitle">'.__('Search results for &#8220;%s&#8221;','wp-user-avatar').'</span>', get_search_query());
96
  }
97
  ?>
98
  </h2>
107
  <?php endif; ?>
108
  <?php $wp_list_table->views(); ?>
109
  <form id="posts-filter" action="" method="get">
110
+ <?php $wp_list_table->search_box(__('Search','wp-user-avatar'), 'media'); ?>
111
  <?php $wp_list_table->display(); ?>
112
  <div id="ajax-response"></div>
113
  <?php find_posts_div(); ?>
includes/wpua-options-page.php CHANGED
@@ -51,6 +51,8 @@ $wpua_options_page_title = apply_filters('wpua_options_page_title', $wpua_option
51
 
52
  <div class="wrap">
53
  <h2><?php echo $wpua_options_page_title; ?></h2>
 
 
54
  <form method="post" action="<?php echo admin_url('options.php'); ?>">
55
  <?php settings_fields('wpua-settings-group'); ?>
56
  <?php do_settings_fields('wpua-settings-group', ""); ?>
@@ -118,9 +120,9 @@ $wpua_options_page_title = apply_filters('wpua_options_page_title', $wpua_option
118
  <legend class="screen-reader-text"><span>'.__('Upload Size Limit', 'wp-user-avatar').' '. __('(only for Contributors & Subscribers)', 'wp-user-avatar').'</span></legend>
119
  <input name="wp_user_avatar_upload_size_limit" type="text" id="wp_user_avatar_upload_size_limit" value="'.$wpua_upload_size_limit.'" class="regular-text" />
120
  <span id="wpua-readable-size">'.$wpua_upload_size_limit_with_units.'</span>
121
- <span id="wpua-readable-size-error">'.sprintf(__('%s exceeds the maximum upload size for this site.'), "").'</span>
122
  <div id="wpua-slider"></div>
123
- <span class="description">'.sprintf(__('Maximum upload file size: %d%s.'), esc_html(wp_max_upload_size()), esc_html(' bytes ('.$upload_size_limit_with_units.')')).'</span>
124
  </fieldset>
125
  <fieldset>
126
  <label for="wp_user_avatar_edit_avatar">
@@ -135,9 +137,9 @@ $wpua_options_page_title = apply_filters('wpua_options_page_title', $wpua_option
135
  </label>
136
  </fieldset>
137
  <fieldset id="wpua-resize-sizes"'.$hide_resize.'>
138
- <label for="wp_user_avatar_resize_w">'.__('Width').'</label>
139
  <input name="wp_user_avatar_resize_w" type="number" step="1" min="0" id="wp_user_avatar_resize_w" value="'.get_option('wp_user_avatar_resize_w').'" class="small-text" />
140
- <label for="wp_user_avatar_resize_h">'.__('Height').'</label>
141
  <input name="wp_user_avatar_resize_h" type="number" step="1" min="0" id="wp_user_avatar_resize_h" value="'.get_option('wp_user_avatar_resize_h').'" class="small-text" />
142
  <br />
143
  <input name="wp_user_avatar_resize_crop" type="checkbox" id="wp_user_avatar_resize_crop" value="1" '.checked('1', $wpua_resize_crop, 0).' />
@@ -157,29 +159,28 @@ $wpua_options_page_title = apply_filters('wpua_options_page_title', $wpua_option
157
  ?>
158
  <table class="form-table">
159
  <tr valign="top">
160
- <th scope="row"><?php _e('Avatar Display'); ?></th>
161
  <td>
162
  <fieldset>
163
- <legend class="screen-reader-text"><span><?php _e('Avatar Display'); ?></span></legend>
164
  <label for="show_avatars">
165
  <input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked($show_avatars, 1); ?> />
166
- <?php _e('Show Avatars'); ?>
167
  </label>
168
  </fieldset>
169
  </td>
170
  </tr>
171
- <?php if((bool) $wpua_disable_gravatar != 1) : ?>
172
- <tr valign="top" id="avatar-rating">
173
- <th scope="row"><?php _e('Maximum Rating'); ?></th>
174
  <td>
175
  <fieldset>
176
- <legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
177
  <?php
178
  $ratings = array(
179
- 'G' => __('G &#8212; Suitable for all audiences'),
180
- 'PG' => __('PG &#8212; Possibly offensive, usually for audiences 13 and above'),
181
- 'R' => __('R &#8212; Intended for adult audiences above 17'),
182
- 'X' => __('X &#8212; Even more mature than above')
183
  );
184
  foreach ($ratings as $key => $rating) :
185
  $selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : "";
@@ -189,15 +190,12 @@ $wpua_options_page_title = apply_filters('wpua_options_page_title', $wpua_option
189
  </fieldset>
190
  </td>
191
  </tr>
192
- <?php else : ?>
193
- <input type="hidden" id="avatar_rating" name="avatar_rating" value="<?php echo get_option('avatar_rating'); ?>" />
194
- <?php endif; ?>
195
  <tr valign="top">
196
- <th scope="row"><?php _e('Default Avatar') ?></th>
197
  <td class="defaultavatarpicker">
198
  <fieldset>
199
- <legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>
200
- <?php _e('For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.'); ?><br />
201
  <?php echo $wpua_admin->wpua_add_default_avatar(); ?>
202
  </fieldset>
203
  </td>
@@ -205,4 +203,31 @@ $wpua_options_page_title = apply_filters('wpua_options_page_title', $wpua_option
205
  </table>
206
  <?php submit_button(); ?>
207
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  </div>
51
 
52
  <div class="wrap">
53
  <h2><?php echo $wpua_options_page_title; ?></h2>
54
+ <table><tr valign="top">
55
+ <td align="top">
56
  <form method="post" action="<?php echo admin_url('options.php'); ?>">
57
  <?php settings_fields('wpua-settings-group'); ?>
58
  <?php do_settings_fields('wpua-settings-group', ""); ?>
120
  <legend class="screen-reader-text"><span>'.__('Upload Size Limit', 'wp-user-avatar').' '. __('(only for Contributors & Subscribers)', 'wp-user-avatar').'</span></legend>
121
  <input name="wp_user_avatar_upload_size_limit" type="text" id="wp_user_avatar_upload_size_limit" value="'.$wpua_upload_size_limit.'" class="regular-text" />
122
  <span id="wpua-readable-size">'.$wpua_upload_size_limit_with_units.'</span>
123
+ <span id="wpua-readable-size-error">'.sprintf(__('%s exceeds the maximum upload size for this site.','wp-user-avatar'), "").'</span>
124
  <div id="wpua-slider"></div>
125
+ <span class="description">'.sprintf(__('Maximum upload file size: %d%s.','wp-user-avatar'), esc_html(wp_max_upload_size()), esc_html(' bytes ('.$upload_size_limit_with_units.')')).'</span>
126
  </fieldset>
127
  <fieldset>
128
  <label for="wp_user_avatar_edit_avatar">
137
  </label>
138
  </fieldset>
139
  <fieldset id="wpua-resize-sizes"'.$hide_resize.'>
140
+ <label for="wp_user_avatar_resize_w">'.__('Width','wp-user-avatar').'</label>
141
  <input name="wp_user_avatar_resize_w" type="number" step="1" min="0" id="wp_user_avatar_resize_w" value="'.get_option('wp_user_avatar_resize_w').'" class="small-text" />
142
+ <label for="wp_user_avatar_resize_h">'.__('Height','wp-user-avatar').'</label>
143
  <input name="wp_user_avatar_resize_h" type="number" step="1" min="0" id="wp_user_avatar_resize_h" value="'.get_option('wp_user_avatar_resize_h').'" class="small-text" />
144
  <br />
145
  <input name="wp_user_avatar_resize_crop" type="checkbox" id="wp_user_avatar_resize_crop" value="1" '.checked('1', $wpua_resize_crop, 0).' />
159
  ?>
160
  <table class="form-table">
161
  <tr valign="top">
162
+ <th scope="row"><?php _e('Avatar Display','wp-user-avatar'); ?></th>
163
  <td>
164
  <fieldset>
165
+ <legend class="screen-reader-text"><span><?php _e('Avatar Display','wp-user-avatar'); ?></span></legend>
166
  <label for="show_avatars">
167
  <input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked($show_avatars, 1); ?> />
168
+ <?php _e('Show Avatars','wp-user-avatar'); ?>
169
  </label>
170
  </fieldset>
171
  </td>
172
  </tr>
173
+ <tr valign="top" id="avatar-rating" <?php echo ((bool) $wpua_disable_gravatar == 1) ? 'style="display:none"' : ''?>>
174
+ <th scope="row"><?php _e('Maximum Rating','wp-user-avatar'); ?></th>
 
175
  <td>
176
  <fieldset>
177
+ <legend class="screen-reader-text"><span><?php _e('Maximum Rating','wp-user-avatar'); ?></span></legend>
178
  <?php
179
  $ratings = array(
180
+ 'G' => __('G &#8212; Suitable for all audiences','wp-user-avatar'),
181
+ 'PG' => __('PG &#8212; Possibly offensive, usually for audiences 13 and above','wp-user-avatar'),
182
+ 'R' => __('R &#8212; Intended for adult audiences above 17','wp-user-avatar'),
183
+ 'X' => __('X &#8212; Even more mature than above','wp-user-avatar')
184
  );
185
  foreach ($ratings as $key => $rating) :
186
  $selected = (get_option('avatar_rating') == $key) ? 'checked="checked"' : "";
190
  </fieldset>
191
  </td>
192
  </tr>
 
 
 
193
  <tr valign="top">
194
+ <th scope="row"><?php _e('Default Avatar','wp-user-avatar') ?></th>
195
  <td class="defaultavatarpicker">
196
  <fieldset>
197
+ <legend class="screen-reader-text"><span><?php _e('Default Avatar','wp-user-avatar'); ?></span></legend>
198
+ <?php _e('For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their e-mail address.','wp-user-avatar'); ?><br />
199
  <?php echo $wpua_admin->wpua_add_default_avatar(); ?>
200
  </fieldset>
201
  </td>
203
  </table>
204
  <?php submit_button(); ?>
205
  </form>
206
+
207
+ </td>
208
+ <td>
209
+ <div id="fc-sidebar">
210
+ <div class="fc-box">
211
+ <h3>WP User Avatar Pro</h3>
212
+ <p><a target="_blank" href="http://www.wpuseravatar.com"><img width="500" src="<?php echo WPUA_URL.'images/wp-user-avatar-banner.png'; ?>" /></a></p>
213
+ <p><em>Introducing awesome features to enhance user experience when they upload own avatar.</em></p>
214
+ <p>Pro features include webcam, custom folder, amazon s3 storage, dropbox storage, cropping and priority support.</p>
215
+ <p><a class="button button-primary button-large" target="_blank" href="http://www.wpuseravatar.com">View Features »</a></p>
216
+ </div>
217
+ <div class="fc-box">
218
+ <h4>Looking for support?</h4>
219
+ <p>Use the <a target="_blank" href="http://www.flippercode.com/forums">support forums</a> on flippercode.com.</p>
220
+ </div>
221
+
222
+ <div class="fc-box">
223
+ <h4>Your Appreciation</h4>
224
+ <ul class="ul-square">
225
+ <li><a target="_blank" href="http://www.wpuseravatar.com/">Upgrade to WP User Avatar Pro</a></li>
226
+ <li><a target="_blank" href="https://wordpress.org/support/view/plugin-reviews/wp-user-avatar?rate=5#postform">Leave a ★★★★★ plugin review on WordPress.org</a></li>
227
+ <li><a target="_blank" href="https://wordpress.org/plugins/wp-user-avatar/">Vote "works" on the WordPress.org plugin page</a></li>
228
+ </ul>
229
+ </div>
230
+ </div>
231
+ </td>
232
+ </tr></table>
233
  </div>
js/wp-user-avatar-user.js CHANGED
@@ -28,4 +28,32 @@ jQuery(function($) {
28
  $('#wp-user-avatar').val(wpuaID);
29
  $('#wp_user_avatar_radio').trigger('click');
30
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  });
28
  $('#wp-user-avatar').val(wpuaID);
29
  $('#wp_user_avatar_radio').trigger('click');
30
  });
31
+
32
+ // Store WP Existing User Avatar ID
33
+ var wpuaEID = $('#wp-user-avatar-existing').val();
34
+ // Store WP Existing User Avatar src
35
+ var wpuaESrc = $('#wpua-preview-existing').find('img').attr('src');
36
+ // Remove WP Existing User Avatar
37
+ $('body').on('click', '#wpua-remove-existing', function(e) {
38
+ e.preventDefault();
39
+ $('#wpua-original-existing').remove();
40
+ $('#wpua-remove-button-existing, #wpua-thumbnail-existing').hide();
41
+ $('#wpua-preview-existing').find('img:first').hide();
42
+ $('#wpua-preview-existing').prepend('<img id="wpua-original-existing" />');
43
+ $('#wpua-original-existing').attr('src', wpua_custom.avatar_thumb);
44
+ $('#wp-user-avatar-existing').val("");
45
+ $('#wpua-original-existing, #wpua-undo-button-existing').show();
46
+ $('#wp_user_avatar_radio-existing').trigger('click');
47
+ });
48
+ // Undo WP Existing User Avatar
49
+ $('body').on('click', '#wpua-undo-existing', function(e) {
50
+ e.preventDefault();
51
+ $('#wpua-original-existing').remove();
52
+ $('#wpua-images-existing').removeAttr('style');
53
+ $('#wpua-undo-button-existing').hide();
54
+ $('#wpua-remove-button-existing, #wpua-thumbnail-existing').show();
55
+ $('#wpua-preview-existing').find('img:first').attr('src', wpuaSrc).show();
56
+ $('#wp-user-avatar-existing').val(wpuaID);
57
+ $('#wp_user_avatar_radio-existing').trigger('click');
58
+ });
59
  });
js/wp-user-avatar.js CHANGED
@@ -1 +1,123 @@
1
- eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(3($){2.5.p={H:3(){E 2.5.W.P.8.v},M:3(a){q b=2.5.W.P;b.8.v=a;b.8.D=$(\'K.f-Z\').9(\'c\').d(\'k\');u(b.8.v&&b.8.D){$(\'#2-m-n\').o(b.8.v);$(\'#0-T, #0-s-h\').t();$(\'#0-r\').9(\'c\').d(\'k\',b.8.D).O(\'X\',"");$(\'#0-g-h, #0-z\').x();$(\'#C\').w(\'6\')}2.5.p.A().1j()},A:3(){u(4.7){E 4.7}4.7=2.5({S:{12:\'13\'},15:1f,U:$(\'#0-B\').J(\'U\')});4.7.l(\'L\',3(){q a=$(\'#2-m-n\').o();u(a==""){$(\'K.5-14\').9(\'a:y\').w(\'6\')}17{q b=4.N().H(\'j\');f=2.5.f(a);f.Y();b.B(f?[f]:[])}},4.7);4.7.N(\'S\').l(\'F\',4.F);E 4.7},F:3(a){j=4.H(\'j\').10();2.5.p.M(j?j.Q:-1)},R:3(){$(\'G\').l(\'6\',\'#0-B\',3(e){e.I();e.16();2.5.p.A().L()})}}})(V);V(3($){u(18(2)!=\'19\'){2.5.p.R()}$(\'#1a-1b\').d(\'1c\',\'1d/1e-J\');q a=$(\'#2-m-n\').o();q b=$(\'#0-r\').9(\'c\').d(\'k\');$(\'G\').l(\'6\',\'#0-g\',3(e){e.I();$(\'#0-i\').g();$(\'#0-g-h, #0-z\').x();$(\'#0-r\').9(\'c:y\').x();$(\'#0-r\').1g(\'<c Q="0-i" />\');$(\'#0-i\').d(\'k\',1h.1i);$(\'#2-m-n\').o("");$(\'#0-i, #0-s-h\').t();$(\'#C\').w(\'6\')});$(\'G\').l(\'6\',\'#0-s\',3(e){e.I();$(\'#0-i\').g();$(\'#0-T\').O(\'11\');$(\'#0-s-h\').x();$(\'#0-g-h, #0-z\').t();$(\'#0-r\').9(\'c:y\').d(\'k\',b).t();$(\'#2-m-n\').o(a);$(\'#C\').w(\'6\')})});',62,82,'wpua||wp|function|this|media|click|_frame|post|find|||img|attr||attachment|remove|button|original|selection|src|on|user|avatar|val|wpUserAvatar|var|preview|undo|show|if|wpUserAvatarId|trigger|hide|first|thumbnail|frame|add|wp_user_avatar_radio|wpUserAvatarSrc|return|select|body|get|preventDefault|data|div|open|set|state|removeAttr|settings|id|init|library|images|title|jQuery|view|height|fetch|info|single|style|type|image|router|multiple|stopPropagation|else|typeof|undefined|your|profile|enctype|multipart|form|false|prepend|wpua_custom|avatar_thumb|close'.split('|'),0,{}))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ var id;
3
+ wp.media.wpUserAvatar = {
4
+
5
+ get: function() {
6
+ return wp.media.view.settings.post.wpUserAvatarId
7
+ },
8
+ set: function(a) {
9
+ var b = wp.media.view.settings;
10
+ b.post.wpUserAvatarId = a;
11
+ b.post.wpUserAvatarSrc = $('div.attachment-info').find('img').attr('src');
12
+ if (b.post.wpUserAvatarId && b.post.wpUserAvatarSrc) {
13
+ $('#wp-user-avatar'+id).val(b.post.wpUserAvatarId);
14
+ $('#wpua-images'+id+', #wpua-undo-button'+id).show();
15
+ $('#wpua-preview'+id).find('img').attr('src', b.post.wpUserAvatarSrc).removeAttr('height', "");
16
+ $('#wpua-remove-button'+id+', #wpua-thumbnail'+id).hide();
17
+ $('#wp_user_avatar_radio').trigger('click')
18
+ }
19
+ wp.media.wpUserAvatar.frame().close()
20
+ },
21
+ frame: function() {
22
+ if (this._frame) {
23
+ return this._frame
24
+ }
25
+ this._frame = wp.media({
26
+ library: {
27
+ type: 'image'
28
+ },
29
+ multiple: false,
30
+ title: $('#wpua-add'+id).data('title')
31
+ });
32
+ this._frame.on('open', function() {
33
+ var a = $('#wp-user-avatar'+id).val();
34
+ if (a == "") {
35
+ $('div.media-router').find('a:first').trigger('click')
36
+ } else {
37
+ var b = this.state().get('selection');
38
+ attachment = wp.media.attachment(a);
39
+ attachment.fetch();
40
+ b.add(attachment ? [attachment] : [])
41
+ }
42
+ }, this._frame);
43
+ this._frame.state('library').on('select', this.select);
44
+ return this._frame
45
+ },
46
+ select: function(a) {
47
+ selection = this.get('selection').single();
48
+ wp.media.wpUserAvatar.set(selection ? selection.id : -1)
49
+ },
50
+ init: function() {
51
+ $('body').on('click', '#wpua-add', function(e) {
52
+ e.preventDefault();
53
+ e.stopPropagation();
54
+ id='';
55
+ wp.media.wpUserAvatar.frame().open()
56
+ })
57
+ $('body').on('click', '#wpua-add-existing', function(e) {
58
+ e.preventDefault();
59
+ e.stopPropagation();
60
+ id='-existing';
61
+ wp.media.wpUserAvatar.frame().open()
62
+ })
63
+ }
64
+ }
65
+ })(jQuery);
66
+ jQuery(function($) {
67
+ if (typeof(wp) != 'undefined') {
68
+ wp.media.wpUserAvatar.init()
69
+ }
70
+ $('#your-profile').attr('enctype', 'multipart/form-data');
71
+ var a = $('#wp-user-avatar').val();
72
+ var b = $('#wpua-preview').find('img').attr('src');
73
+ $('body').on('click', '#wpua-remove', function(e) {
74
+ e.preventDefault();
75
+ $('#wpua-original').remove();
76
+ $('#wpua-remove-button, #wpua-thumbnail').hide();
77
+ $('#wpua-preview').find('img:first').hide();
78
+ $('#wpua-preview').prepend('<img id="wpua-original" />');
79
+ $('#wpua-original').attr('src', wpua_custom.avatar_thumb);
80
+ $('#wp-user-avatar').val("");
81
+ $('#wpua-original, #wpua-undo-button').show();
82
+ $('#wp_user_avatar_radio').trigger('click')
83
+ });
84
+ $('body').on('click', '#wpua-undo', function(e) {
85
+ e.preventDefault();
86
+ $('#wpua-original').remove();
87
+ $('#wpua-images').removeAttr('style');
88
+ $('#wpua-undo-button').hide();
89
+ $('#wpua-remove-button, #wpua-thumbnail').show();
90
+ $('#wpua-preview').find('img:first').attr('src', b).show();
91
+ $('#wp-user-avatar').val(a);
92
+ $('#wp_user_avatar_radio').trigger('click')
93
+ })
94
+ });
95
+ jQuery(function($) {
96
+ if (typeof(wp) != 'undefined') {
97
+ wp.media.wpUserAvatar.init()
98
+ }
99
+ $('#your-profile').attr('enctype', 'multipart/form-data');
100
+ var a = $('#wp-user-avatar-existing').val();
101
+ var b = $('#wpua-preview-existing').find('img').attr('src');
102
+ $('body').on('click', '#wpua-remove-existing', function(e) {
103
+ e.preventDefault();
104
+ $('#wpua-original-existing').remove();
105
+ $('#wpua-remove-button-existing, #wpua-thumbnail-existing').hide();
106
+ $('#wpua-preview-existing').find('img:first').hide();
107
+ $('#wpua-preview-existing').prepend('<img id="wpua-original-existing" />');
108
+ $('#wpua-original-existing').attr('src', wpua_custom.avatar_thumb);
109
+ $('#wp-user-avatar-existing').val("");
110
+ $('#wpua-original-existing, #wpua-undo-button-existing').show();
111
+ $('#wp_user_avatar_radio').trigger('click')
112
+ });
113
+ $('body').on('click', '#wpua-undo-existing', function(e) {
114
+ e.preventDefault();
115
+ $('#wpua-original-existing').remove();
116
+ $('#wpua-images-existing').removeAttr('style');
117
+ $('#wpua-undo-button-existing').hide();
118
+ $('#wpua-remove-button-existing, #wpua-thumbnail-existing').show();
119
+ $('#wpua-preview-existing').find('img:first').attr('src', b).show();
120
+ $('#wp-user-avatar-existing').val(a);
121
+ $('#wp_user_avatar_radio').trigger('click')
122
+ })
123
+ });
lang/wp-user-avatar-de_DE.mo DELETED
Binary file
lang/wp-user-avatar-de_DE.po DELETED
@@ -1,81 +0,0 @@
1
- # German (de_DE) translation for WP User Avatar.
2
- # Copyright (C) 2014 Bangbay Siboliban.
3
- # This file is distributed under the same license as the WP User Avatar package.
4
- #
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WP User Avatar 1.9.13\n"
8
- "Report-Msgid-Bugs-To: http://wordpress.org/plugins/wp-user-avatar/\n"
9
- "PO-Revision-Date: 2014-06-03 00:00-0000\n"
10
- "Language: de_DE\n"
11
- "Last-Translator: WP User Avatar\n"
12
- "Language-Team: WP User Avatar\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
-
17
- #: includes/class-wp-user-avatar-admin.php:302
18
- msgid "Donate"
19
- msgstr "Spenden"
20
-
21
- #: includes/wpua-functions.php:189
22
- msgid "Do you like WP User Avatar?"
23
- msgstr "Bist Du mit WP-Benutzer-Avatar zufrieden?"
24
-
25
- #: includes/wpua-functions.php:189
26
- msgid "Make a donation."
27
- msgstr "Spenden"
28
-
29
- #: includes/wpua-options-page.php:83
30
- msgid "Add avatar button to Visual Editor"
31
- msgstr "Einen Avatar-Knopf zum WYSIWYG-Editor hinzufügen"
32
-
33
- #: includes/wpua-options-page.php:89
34
- msgid "Allow Contributors & Subscribers to upload avatars"
35
- msgstr "Mitarbeiter und Abonnenten erlauben, Avatare hochzuladen"
36
-
37
- #: includes/wpua-options-page.php:95
38
- msgid "Disable Gravatar and use only local avatars"
39
- msgstr "Gravatar deaktivieren und nur lokale Avatare verwenden"
40
-
41
- #: includes/wpua-options-page.php:117
42
- #: includes/wpua-options-page.php:122
43
- msgid "Upload Size Limit"
44
- msgstr "Dateigrößenbeschränkung"
45
-
46
- #: includes/wpua-options-page.php:117
47
- #: includes/wpua-options-page.php:122
48
- msgid "(only for Contributors & Subscribers)"
49
- msgstr "(nur für Mitarbeiter und Abonnenten)"
50
-
51
- #: includes/wpua-options-page.php:132
52
- msgid "Allow users to edit avatars"
53
- msgstr "Benutzer erlauben, Avatare bearbeiten"
54
-
55
- #: includes/wpua-options-page.php:138
56
- msgid "Resize avatars on upload"
57
- msgstr "Resize Avatare beim Upload"
58
-
59
- #: includes/wpua-options-page.php:148
60
- msgid "Crop avatars to exact dimensions"
61
- msgstr "Avatare auf exakte Größe beschneiden"
62
-
63
- #. Plugin Name of the plugin/theme
64
- msgid "WP User Avatar"
65
- msgstr "WP-Benutzer-Avatar"
66
-
67
- #. Plugin URI of the plugin/theme
68
- msgid "http://wordpress.org/plugins/wp-user-avatar/"
69
- msgstr "http://wordpress.org/plugins/wp-user-avatar/"
70
-
71
- #. Description of the plugin/theme
72
- msgid "Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar."
73
- msgstr "Verwenden Sie ein beliebiges Bild aus Ihrer WordPress-Mediathek als ihren Benutzer-Avatar. Fügen Sie einen eigenen Standardavatar hinzu."
74
-
75
- #. Author of the plugin/theme
76
- msgid "Bangbay Siboliban"
77
- msgstr "Bangbay Siboliban"
78
-
79
- #. Author URI of the plugin/theme
80
- msgid "http://siboliban.org/"
81
- msgstr "http://siboliban.org/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/wp-user-avatar-en_US.mo ADDED
Binary file
lang/wp-user-avatar-en_US.po ADDED
@@ -0,0 +1,417 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: WP USER AVATAR\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2019-02-25 09:44+0530\n"
6
+ "PO-Revision-Date: 2019-02-25 09:44+0530\n"
7
+ "Last-Translator: Flipper Code <hello@flippercode.com>\n"
8
+ "Language-Team: Flipper Code <hello@flippercode.com>\n"
9
+ "Language: en_US\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-SourceCharset: UTF-8\n"
16
+ "X-Generator: Poedit 1.8.7.1\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: includes/class-wp-user-avatar-admin.php:113
20
+ #: includes/class-wp-user-avatar-admin.php:266
21
+ #: includes/class-wp-user-avatar-widget.php:16 includes/tinymce/window.php:21
22
+ #: includes/wpua-options-page.php:43
23
+ msgid "WP User Avatar"
24
+ msgstr ""
25
+
26
+ #: includes/class-wp-user-avatar-admin.php:113
27
+ #: includes/class-wp-user-avatar-admin.php:148 includes/wpua-media-page.php:93
28
+ msgid "Avatars"
29
+ msgstr ""
30
+
31
+ #: includes/class-wp-user-avatar-admin.php:114
32
+ #: includes/class-wp-user-avatar-admin.php:298
33
+ #: includes/wpua-options-page.php:73
34
+ msgid "Settings"
35
+ msgstr ""
36
+
37
+ #: includes/class-wp-user-avatar-admin.php:115
38
+ msgid "Library"
39
+ msgstr ""
40
+
41
+ #: includes/class-wp-user-avatar-admin.php:229
42
+ msgid "Mystery Man"
43
+ msgstr ""
44
+
45
+ #: includes/class-wp-user-avatar-admin.php:230
46
+ msgid "Blank"
47
+ msgstr ""
48
+
49
+ #: includes/class-wp-user-avatar-admin.php:231
50
+ msgid "Gravatar Logo"
51
+ msgstr ""
52
+
53
+ #: includes/class-wp-user-avatar-admin.php:232
54
+ msgid "Identicon (Generated)"
55
+ msgstr ""
56
+
57
+ #: includes/class-wp-user-avatar-admin.php:233
58
+ msgid "Wavatar (Generated)"
59
+ msgstr ""
60
+
61
+ #: includes/class-wp-user-avatar-admin.php:234
62
+ msgid "MonsterID (Generated)"
63
+ msgstr ""
64
+
65
+ #: includes/class-wp-user-avatar-admin.php:235
66
+ msgid "Retro (Generated)"
67
+ msgstr ""
68
+
69
+ #: includes/class-wp-user-avatar-admin.php:267
70
+ #: includes/class-wp-user-avatar.php:177
71
+ msgid "Choose Image"
72
+ msgstr ""
73
+
74
+ #: includes/class-wp-user-avatar-admin.php:267
75
+ #: includes/class-wp-user-avatar-admin.php:381
76
+ #: includes/wpua-options-page.php:194 includes/wpua-options-page.php:197
77
+ msgid "Default Avatar"
78
+ msgstr ""
79
+
80
+ #: includes/class-wp-user-avatar-admin.php:268
81
+ msgid "Remove"
82
+ msgstr ""
83
+
84
+ #: includes/class-wp-user-avatar-admin.php:268
85
+ #: includes/class-wp-user-avatar.php:204
86
+ msgid "Undo"
87
+ msgstr ""
88
+
89
+ #: includes/class-wp-user-avatar-admin.php:312
90
+ msgid "Support Forums"
91
+ msgstr ""
92
+
93
+ #: includes/class-wp-user-avatar-admin.php:324
94
+ #: includes/class-wp-user-avatar-admin.php:378
95
+ #: includes/class-wp-user-avatar-functions.php:340
96
+ #: includes/tinymce/window.php:123 includes/wpua-functions.php:79
97
+ #: includes/wpua-functions.php:88 includes/wpua-functions.php:93
98
+ #: includes/wpua-functions.php:152
99
+ msgid "Avatar"
100
+ msgstr ""
101
+
102
+ #: includes/class-wp-user-avatar-list-table.php:142
103
+ #: includes/class-wp-user-avatar-list-table.php:391
104
+ msgid "Delete Permanently"
105
+ msgstr ""
106
+
107
+ #: includes/class-wp-user-avatar-list-table.php:171
108
+ msgid "No media attachments found."
109
+ msgstr ""
110
+
111
+ #: includes/class-wp-user-avatar-list-table.php:184
112
+ msgid "Author"
113
+ msgstr ""
114
+
115
+ #: includes/class-wp-user-avatar-list-table.php:253
116
+ #, php-format
117
+ msgid "Select %s"
118
+ msgstr ""
119
+
120
+ #: includes/class-wp-user-avatar-list-table.php:268
121
+ #: includes/class-wp-user-avatar-list-table.php:283
122
+ #, php-format
123
+ msgid "Edit &#8220;%s&#8221;"
124
+ msgstr ""
125
+
126
+ #: includes/class-wp-user-avatar-list-table.php:313
127
+ msgid "Unpublished"
128
+ msgstr ""
129
+
130
+ #: includes/class-wp-user-avatar-list-table.php:319
131
+ #, php-format
132
+ msgid "%s from now"
133
+ msgstr ""
134
+
135
+ #: includes/class-wp-user-avatar-list-table.php:321
136
+ #, php-format
137
+ msgid "%s ago"
138
+ msgstr ""
139
+
140
+ #: includes/class-wp-user-avatar-list-table.php:323
141
+ msgid "Y/m/d"
142
+ msgstr ""
143
+
144
+ #: includes/class-wp-user-avatar-list-table.php:381
145
+ msgid "Edit"
146
+ msgstr ""
147
+
148
+ #: includes/class-wp-user-avatar-list-table.php:385
149
+ msgid "Restore"
150
+ msgstr ""
151
+
152
+ #: includes/class-wp-user-avatar-list-table.php:387
153
+ msgid "Trash"
154
+ msgstr ""
155
+
156
+ #: includes/class-wp-user-avatar-list-table.php:396
157
+ #, php-format
158
+ msgid "View &#8220;%s&#8221;"
159
+ msgstr ""
160
+
161
+ #: includes/class-wp-user-avatar-list-table.php:396
162
+ msgid "View"
163
+ msgstr ""
164
+
165
+ #: includes/class-wp-user-avatar-shortcode.php:216
166
+ msgid "Profile updated."
167
+ msgstr ""
168
+
169
+ #: includes/class-wp-user-avatar-shortcode.php:240
170
+ msgid "Update Profile"
171
+ msgstr ""
172
+
173
+ #: includes/class-wp-user-avatar-subscriber.php:99
174
+ msgid "You do not have sufficient permissions to access this page."
175
+ msgstr ""
176
+
177
+ #: includes/class-wp-user-avatar-widget.php:15
178
+ msgid "Insert"
179
+ msgstr ""
180
+
181
+ #: includes/class-wp-user-avatar-widget.php:15
182
+ msgid "[avatar_upload]"
183
+ msgstr ""
184
+
185
+ #: includes/class-wp-user-avatar-widget.php:72
186
+ msgid "Title:"
187
+ msgstr ""
188
+
189
+ #: includes/class-wp-user-avatar-widget.php:76
190
+ msgid "Description:"
191
+ msgstr ""
192
+
193
+ #: includes/class-wp-user-avatar-widget.php:81
194
+ msgid "Automatically add paragraphs"
195
+ msgstr ""
196
+
197
+ #: includes/class-wp-user-avatar.php:182 includes/tinymce/window.php:124
198
+ #: includes/tinymce/window.php:196
199
+ msgid "Upload"
200
+ msgstr ""
201
+
202
+ #: includes/class-wp-user-avatar.php:185 includes/wpua-options-page.php:125
203
+ #, php-format
204
+ msgid "Maximum upload file size: %d%s."
205
+ msgstr ""
206
+
207
+ #: includes/class-wp-user-avatar.php:186
208
+ msgid "Allowed Files"
209
+ msgstr ""
210
+
211
+ #: includes/class-wp-user-avatar.php:186
212
+ msgid "<code>jpg jpeg png gif</code>"
213
+ msgstr ""
214
+
215
+ #: includes/class-wp-user-avatar.php:192 includes/tinymce/window.php:142
216
+ msgid "Original Size"
217
+ msgstr ""
218
+
219
+ #: includes/class-wp-user-avatar.php:196 includes/tinymce/window.php:145
220
+ msgid "Thumbnail"
221
+ msgstr ""
222
+
223
+ #: includes/class-wp-user-avatar.php:199
224
+ msgid "Remove Image"
225
+ msgstr ""
226
+
227
+ #: includes/class-wp-user-avatar.php:201
228
+ msgid "Edit Image"
229
+ msgstr ""
230
+
231
+ #: includes/class-wp-user-avatar.php:228
232
+ msgid "This file is not an image. Please try another."
233
+ msgstr ""
234
+
235
+ #: includes/class-wp-user-avatar.php:232 includes/class-wp-user-avatar.php:258
236
+ msgid "Memory exceeded. Please try another smaller file."
237
+ msgstr ""
238
+
239
+ #: includes/class-wp-user-avatar.php:236
240
+ #, php-format
241
+ msgid ""
242
+ "Unable to create directory %s. Is its parent directory writable by the "
243
+ "server?"
244
+ msgstr ""
245
+
246
+ #: includes/tinymce/window.php:129
247
+ msgid "User Name"
248
+ msgstr ""
249
+
250
+ #: includes/tinymce/window.php:139 includes/tinymce/window.php:151
251
+ msgid "Size"
252
+ msgstr ""
253
+
254
+ #: includes/tinymce/window.php:143
255
+ msgid "Large"
256
+ msgstr ""
257
+
258
+ #: includes/tinymce/window.php:144
259
+ msgid "Medium"
260
+ msgstr ""
261
+
262
+ #: includes/tinymce/window.php:146
263
+ msgid "Custom"
264
+ msgstr ""
265
+
266
+ #: includes/tinymce/window.php:156
267
+ msgid "Alignment"
268
+ msgstr ""
269
+
270
+ #: includes/tinymce/window.php:159
271
+ msgid "Center"
272
+ msgstr ""
273
+
274
+ #: includes/tinymce/window.php:160
275
+ msgid "Left"
276
+ msgstr ""
277
+
278
+ #: includes/tinymce/window.php:161
279
+ msgid "Right"
280
+ msgstr ""
281
+
282
+ #: includes/tinymce/window.php:166
283
+ msgid "Link To"
284
+ msgstr ""
285
+
286
+ #: includes/tinymce/window.php:169
287
+ msgid "Image File"
288
+ msgstr ""
289
+
290
+ #: includes/tinymce/window.php:170
291
+ msgid "Attachment Page"
292
+ msgstr ""
293
+
294
+ #: includes/tinymce/window.php:171
295
+ msgid "Custom URL"
296
+ msgstr ""
297
+
298
+ #: includes/tinymce/window.php:176
299
+ msgid "URL"
300
+ msgstr ""
301
+
302
+ #: includes/tinymce/window.php:182
303
+ msgid "Open link in a new window"
304
+ msgstr ""
305
+
306
+ #: includes/tinymce/window.php:186
307
+ msgid "Caption"
308
+ msgstr ""
309
+
310
+ #: includes/tinymce/window.php:191 includes/tinymce/window.php:201
311
+ msgid "Insert into Post"
312
+ msgstr ""
313
+
314
+ #: includes/wpua-functions.php:90 includes/wpua-functions.php:96
315
+ #: includes/wpua-functions.php:155
316
+ msgid "Image"
317
+ msgstr ""
318
+
319
+ #: includes/wpua-media-page.php:39
320
+ msgid "You do not have permission to upload files."
321
+ msgstr ""
322
+
323
+ #: includes/wpua-media-page.php:71
324
+ msgid "You are not allowed to delete this post."
325
+ msgstr ""
326
+
327
+ #: includes/wpua-media-page.php:74
328
+ msgid "Error in deleting."
329
+ msgstr ""
330
+
331
+ #: includes/wpua-media-page.php:95
332
+ #, php-format
333
+ msgid "Search results for &#8220;%s&#8221;"
334
+ msgstr ""
335
+
336
+ #: includes/wpua-media-page.php:110
337
+ msgid "Search"
338
+ msgstr ""
339
+
340
+ #: includes/wpua-options-page.php:81
341
+ msgid "Add avatar button to Visual Editor"
342
+ msgstr ""
343
+
344
+ #: includes/wpua-options-page.php:87
345
+ msgid "Allow Contributors & Subscribers to upload avatars"
346
+ msgstr ""
347
+
348
+ #: includes/wpua-options-page.php:93
349
+ msgid "Disable Gravatar and use only local avatars"
350
+ msgstr ""
351
+
352
+ #: includes/wpua-options-page.php:115 includes/wpua-options-page.php:120
353
+ msgid "Upload Size Limit"
354
+ msgstr ""
355
+
356
+ #: includes/wpua-options-page.php:115 includes/wpua-options-page.php:120
357
+ msgid "(only for Contributors & Subscribers)"
358
+ msgstr ""
359
+
360
+ #: includes/wpua-options-page.php:123
361
+ #, php-format
362
+ msgid "%s exceeds the maximum upload size for this site."
363
+ msgstr ""
364
+
365
+ #: includes/wpua-options-page.php:130
366
+ msgid "Allow users to edit avatars"
367
+ msgstr ""
368
+
369
+ #: includes/wpua-options-page.php:136
370
+ msgid "Resize avatars on upload"
371
+ msgstr ""
372
+
373
+ #: includes/wpua-options-page.php:140
374
+ msgid "Width"
375
+ msgstr ""
376
+
377
+ #: includes/wpua-options-page.php:142
378
+ msgid "Height"
379
+ msgstr ""
380
+
381
+ #: includes/wpua-options-page.php:146
382
+ msgid "Crop avatars to exact dimensions"
383
+ msgstr ""
384
+
385
+ #: includes/wpua-options-page.php:162 includes/wpua-options-page.php:165
386
+ msgid "Avatar Display"
387
+ msgstr ""
388
+
389
+ #: includes/wpua-options-page.php:168
390
+ msgid "Show Avatars"
391
+ msgstr ""
392
+
393
+ #: includes/wpua-options-page.php:174 includes/wpua-options-page.php:177
394
+ msgid "Maximum Rating"
395
+ msgstr ""
396
+
397
+ #: includes/wpua-options-page.php:180
398
+ msgid "G &#8212; Suitable for all audiences"
399
+ msgstr ""
400
+
401
+ #: includes/wpua-options-page.php:181
402
+ msgid "PG &#8212; Possibly offensive, usually for audiences 13 and above"
403
+ msgstr ""
404
+
405
+ #: includes/wpua-options-page.php:182
406
+ msgid "R &#8212; Intended for adult audiences above 17"
407
+ msgstr ""
408
+
409
+ #: includes/wpua-options-page.php:183
410
+ msgid "X &#8212; Even more mature than above"
411
+ msgstr ""
412
+
413
+ #: includes/wpua-options-page.php:198
414
+ msgid ""
415
+ "For users without a custom avatar of their own, you can either display a "
416
+ "generic logo or a generated one based on their e-mail address."
417
+ msgstr ""
lang/wp-user-avatar-es_ES.mo DELETED
Binary file
lang/wp-user-avatar-es_ES.po DELETED
@@ -1,81 +0,0 @@
1
- # Spanish (es_ES) translation for WP User Avatar.
2
- # Copyright (C) 2014 Bangbay Siboliban.
3
- # This file is distributed under the same license as the WP User Avatar package.
4
- #
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WP User Avatar 1.9.13\n"
8
- "Report-Msgid-Bugs-To: http://wordpress.org/plugins/wp-user-avatar/\n"
9
- "PO-Revision-Date: 2014-06-03 00:00-0000\n"
10
- "Language: es_ES\n"
11
- "Last-Translator: WP User Avatar\n"
12
- "Language-Team: WP User Avatar\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
-
17
- #: includes/class-wp-user-avatar-admin.php:302
18
- msgid "Donate"
19
- msgstr "Donar"
20
-
21
- #: includes/wpua-functions.php:189
22
- msgid "Do you like WP User Avatar?"
23
- msgstr "¿Está satisfecho con WP-Usuario-Avatar?"
24
-
25
- #: includes/wpua-functions.php:189
26
- msgid "Make a donation."
27
- msgstr "Donar"
28
-
29
- #: includes/wpua-options-page.php:83
30
- msgid "Add avatar button to Visual Editor"
31
- msgstr "Añadir botón avatar al editor visual"
32
-
33
- #: includes/wpua-options-page.php:89
34
- msgid "Allow Contributors & Subscribers to upload avatars"
35
- msgstr "Permitir los colaboradores y los suscriptores subir avatares"
36
-
37
- #: includes/wpua-options-page.php:95
38
- msgid "Disable Gravatar and use only local avatars"
39
- msgstr "Desactivar Gravatar y utilizar sólo los avatares locales"
40
-
41
- #: includes/wpua-options-page.php:117
42
- #: includes/wpua-options-page.php:122
43
- msgid "Upload Size Limit"
44
- msgstr "Sube límite de tamaño"
45
-
46
- #: includes/wpua-options-page.php:117
47
- #: includes/wpua-options-page.php:122
48
- msgid "(only for Contributors & Subscribers)"
49
- msgstr "(para colaboradores y suscriptores)"
50
-
51
- #: includes/wpua-options-page.php:132
52
- msgid "Allow users to edit avatars"
53
- msgstr "Permitir a los usuarios editar avatar"
54
-
55
- #: includes/wpua-options-page.php:138
56
- msgid "Resize avatars on upload"
57
- msgstr "Cambiar el tamaño de avatares en carga"
58
-
59
- #: includes/wpua-options-page.php:148
60
- msgid "Crop avatars to exact dimensions"
61
- msgstr "Recortar los avatares a sus dimensiones exactas"
62
-
63
- #. Plugin Name of the plugin/theme
64
- msgid "WP User Avatar"
65
- msgstr "WP-Usuario-Avatar"
66
-
67
- #. Plugin URI of the plugin/theme
68
- msgid "http://wordpress.org/plugins/wp-user-avatar/"
69
- msgstr "http://wordpress.org/plugins/wp-user-avatar/"
70
-
71
- #. Description of the plugin/theme
72
- msgid "Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar."
73
- msgstr "Utiliza cualquier imagen en tu Librería multimedia de WordPress como un avatar personalizado. Añade tu propia Avatar por defecto."
74
-
75
- #. Author of the plugin/theme
76
- msgid "Bangbay Siboliban"
77
- msgstr "Bangbay Siboliban"
78
-
79
- #. Author URI of the plugin/theme
80
- msgid "http://siboliban.org/"
81
- msgstr "http://siboliban.org/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/wp-user-avatar-fr_FR.mo DELETED
Binary file
lang/wp-user-avatar-fr_FR.po DELETED
@@ -1,81 +0,0 @@
1
- # French (fr_FR) translation for WP User Avatar.
2
- # Copyright (C) 2014 Bangbay Siboliban.
3
- # This file is distributed under the same license as the WP User Avatar package.
4
- #
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WP User Avatar 1.9.13\n"
8
- "Report-Msgid-Bugs-To: http://wordpress.org/plugins/wp-user-avatar/\n"
9
- "PO-Revision-Date: 2014-06-03 00:00-0000\n"
10
- "Language: fr_FR\n"
11
- "Last-Translator: WP User Avatar\n"
12
- "Language-Team: WP User Avatar\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
-
17
- #: includes/class-wp-user-avatar-admin.php:302
18
- msgid "Donate"
19
- msgstr "Faites un don"
20
-
21
- #: includes/wpua-functions.php:189
22
- msgid "Do you like WP User Avatar?"
23
- msgstr "Etes-vous satisfait avec WP-Utilisateur-Avatar?"
24
-
25
- #: includes/wpua-functions.php:189
26
- msgid "Make a donation."
27
- msgstr "Faites un don"
28
-
29
- #: includes/wpua-options-page.php:83
30
- msgid "Add avatar button to Visual Editor"
31
- msgstr "Ajouter le bouton avatar sur l'éditeur visuel"
32
-
33
- #: includes/wpua-options-page.php:89
34
- msgid "Allow Contributors & Subscribers to upload avatars"
35
- msgstr "Permettre aux contributeurs et aux abonnés d'envoyer des avatars"
36
-
37
- #: includes/wpua-options-page.php:95
38
- msgid "Disable Gravatar and use only local avatars"
39
- msgstr "Désactiver Gravatar et utiliser les avatars fournis"
40
-
41
- #: includes/wpua-options-page.php:117
42
- #: includes/wpua-options-page.php:122
43
- msgid "Upload Size Limit"
44
- msgstr "Taille limite d'envoi de fichiers"
45
-
46
- #: includes/wpua-options-page.php:117
47
- #: includes/wpua-options-page.php:122
48
- msgid "(only for Contributors & Subscribers)"
49
- msgstr "(pour contributeurs et abonnés)"
50
-
51
- #: includes/wpua-options-page.php:132
52
- msgid "Allow users to edit avatars"
53
- msgstr "Permettre aux utilisateurs de modifier avatar"
54
-
55
- #: includes/wpua-options-page.php:138
56
- msgid "Resize avatars on upload"
57
- msgstr "Redimensionner avatars lors du téléchargement"
58
-
59
- #: includes/wpua-options-page.php:148
60
- msgid "Crop avatars to exact dimensions"
61
- msgstr "Recadrer les avatars pour parvenir aux dimensions exactes"
62
-
63
- #. Plugin Name of the plugin/theme
64
- msgid "WP User Avatar"
65
- msgstr "WP-Utilisateur-Avatar"
66
-
67
- #. Plugin URI of the plugin/theme
68
- msgid "http://wordpress.org/plugins/wp-user-avatar/"
69
- msgstr "http://wordpress.org/plugins/wp-user-avatar/"
70
-
71
- #. Description of the plugin/theme
72
- msgid "Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar."
73
- msgstr "Utiliser n'importe quelle image dans votre Bibliothèque de médias de WordPress comme un avatar personnalisé. Ajouter votre propre avatar par défaut."
74
-
75
- #. Author of the plugin/theme
76
- msgid "Bangbay Siboliban"
77
- msgstr "Bangbay Siboliban"
78
-
79
- #. Author URI of the plugin/theme
80
- msgid "http://siboliban.org/"
81
- msgstr "http://siboliban.org/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/wp-user-avatar-pl_PL.mo DELETED
Binary file
lang/wp-user-avatar-pl_PL.po DELETED
@@ -1,81 +0,0 @@
1
- # Polish (pl_PL) translation for WP User Avatar.
2
- # Copyright (C) 2014 Bangbay Siboliban.
3
- # This file is distributed under the same license as the WP User Avatar package.
4
- #
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WP User Avatar 1.9.13\n"
8
- "Report-Msgid-Bugs-To: http://wordpress.org/plugins/wp-user-avatar/\n"
9
- "PO-Revision-Date: 2014-06-03 00:00-0000\n"
10
- "Language: de_DE\n"
11
- "Last-Translator: WP User Avatar\n"
12
- "Language-Team: WP User Avatar\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
-
17
- #: includes/class-wp-user-avatar-admin.php:302
18
- msgid "Donate"
19
- msgstr "Dotuj"
20
-
21
- #: includes/wpua-functions.php:189
22
- msgid "Do you like WP User Avatar?"
23
- msgstr "Jesteś zadowolony z Wp User Avatar"
24
-
25
- #: includes/wpua-functions.php:189
26
- msgid "Make a donation."
27
- msgstr "Dokonaj dotacji"
28
-
29
- #: includes/wpua-options-page.php:83
30
- msgid "Add avatar button to Visual Editor"
31
- msgstr "Dodaj przycisk avatara do edytora wizualnego"
32
-
33
- #: includes/wpua-options-page.php:89
34
- msgid "Allow Contributors & Subscribers to upload avatars"
35
- msgstr "Pozwalaj kontrybutorom oraz subskrynentom przesyłać awatary"
36
-
37
- #: includes/wpua-options-page.php:95
38
- msgid "Disable Gravatar and use only local avatars"
39
- msgstr "Wyłącz gravatary i używaj tylko lokalnych awatarów"
40
-
41
- #: includes/wpua-options-page.php:117
42
- #: includes/wpua-options-page.php:122
43
- msgid "Upload Size Limit"
44
- msgstr "Limit wielkości pliku"
45
-
46
- #: includes/wpua-options-page.php:117
47
- #: includes/wpua-options-page.php:122
48
- msgid "(only for Contributors & Subscribers)"
49
- msgstr "(tylko dla subskrynentów i kontrybutorów)"
50
-
51
- #: includes/wpua-options-page.php:132
52
- msgid "Allow users to edit avatars"
53
- msgstr "Pozwalaj użytkownikom edytować awatary"
54
-
55
- #: includes/wpua-options-page.php:138
56
- msgid "Resize avatars on upload"
57
- msgstr "Zmieniaj rozmiar po przesłaniu"
58
-
59
- #: includes/wpua-options-page.php:148
60
- msgid "Crop avatars to exact dimensions"
61
- msgstr "Przytnij awatar do dokładnych rozmiarów"
62
-
63
- #. Plugin Name of the plugin/theme
64
- msgid "WP User Avatar"
65
- msgstr "WP Awatar Użytkownika"
66
-
67
- #. Plugin URI of the plugin/theme
68
- msgid "http://wordpress.org/plugins/wp-user-avatar/"
69
- msgstr "http://wordpress.org/plugins/wp-user-avatar/"
70
-
71
- #. Description of the plugin/theme
72
- msgid "Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar."
73
- msgstr "Użyj dowolnego obrazka z biblioteki mediów jako awatar użytkownika. Dodaj swój własny domyślny awatar."
74
-
75
- #. Author of the plugin/theme
76
- msgid "Bangbay Siboliban"
77
- msgstr "Bangbay Siboliban"
78
-
79
- #. Author URI of the plugin/theme
80
- msgid "http://siboliban.org/"
81
- msgstr "http://siboliban.org/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/wp-user-avatar-sv_SE.mo DELETED
Binary file
lang/wp-user-avatar-sv_SE.po DELETED
@@ -1,81 +0,0 @@
1
- # Swedish (sv_SE) translation for WP User Avatar.
2
- # Copyright (C) 2014 Bangbay Siboliban.
3
- # This file is distributed under the same license as the WP User Avatar package.
4
- #
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: WP User Avatar 1.9.13\n"
8
- "Report-Msgid-Bugs-To: http://wordpress.org/plugins/wp-user-avatar/\n"
9
- "PO-Revision-Date: 2014-06-03 00:00-0000\n"
10
- "Language: sv_SE\n"
11
- "Last-Translator: Mattias Tengblad <mst@eyesx.com>\n"
12
- "Language-Team: WordPress Sverige <info@wpsv.se>\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
-
17
- #: includes/class-wp-user-avatar-admin.php:302
18
- msgid "Donate"
19
- msgstr "Donera"
20
-
21
- #: includes/wpua-functions.php:189
22
- msgid "Do you like WP User Avatar?"
23
- msgstr "Är du nöjd med Visningsbild (avatar)?"
24
-
25
- #: includes/wpua-functions.php:189
26
- msgid "Make a donation."
27
- msgstr "Donera"
28
-
29
- #: includes/wpua-options-page.php:83
30
- msgid "Add avatar button to Visual Editor"
31
- msgstr "Lägg till knapp för avatarer i den visuella redigeraren"
32
-
33
- #: includes/wpua-options-page.php:89
34
- msgid "Allow Contributors & Subscribers to upload avatars"
35
- msgstr "Tillåt medarbetare & prenumeranter att ladda upp avatarer"
36
-
37
- #: includes/wpua-options-page.php:95
38
- msgid "Disable Gravatar and use only local avatars"
39
- msgstr "Inaktivera Gravatar och använd endast lokala avatarer"
40
-
41
- #: includes/wpua-options-page.php:117
42
- #: includes/wpua-options-page.php:122
43
- msgid "Upload Size Limit"
44
- msgstr "Storleksgräns för uppladdningar"
45
-
46
- #: includes/wpua-options-page.php:117
47
- #: includes/wpua-options-page.php:122
48
- msgid "(only for Contributors & Subscribers)"
49
- msgstr "(endast för medarbetare & prenumeranter)"
50
-
51
- #: includes/wpua-options-page.php:132
52
- msgid "Allow users to edit avatars"
53
- msgstr "Tillåt användare att redigera avatarer"
54
-
55
- #: includes/wpua-options-page.php:138
56
- msgid "Resize avatars on upload"
57
- msgstr "Ändra storlek på avatarer på uppladdning"
58
-
59
- #: includes/wpua-options-page.php:148
60
- msgid "Crop avatars to exact dimensions"
61
- msgstr "Beskär avatarer till exakta dimensioner"
62
-
63
- #. Plugin Name of the plugin/theme
64
- msgid "WP User Avatar"
65
- msgstr "Visningsbild (avatar)"
66
-
67
- #. Plugin URI of the plugin/theme
68
- msgid "http://wordpress.org/plugins/wp-user-avatar/"
69
- msgstr "http://wordpress.org/plugins/wp-user-avatar/"
70
-
71
- #. Description of the plugin/theme
72
- msgid "Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar."
73
- msgstr "Använd valfri bild från ditt mediabibliotek i WordPress som en anpassad visningsbild (avatar). Lägg till fördefinierad standardbild."
74
-
75
- #. Author of the plugin/theme
76
- msgid "Bangbay Siboliban"
77
- msgstr "Bangbay Siboliban"
78
-
79
- #. Author URI of the plugin/theme
80
- msgid "http://siboliban.org/"
81
- msgstr "http://siboliban.org/"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: flippercode
4
  Tags: author image, author photo, author avatar, avatar, bbPress, profile avatar, profile image, user avatar, user image, user photo, widget
5
  Requires at least: 3.6
6
- Tested up to: 3.9
7
- Stable tag: 1.9.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,9 +14,6 @@ Use any image from your WordPress Media Library as a custom user avatar. Add you
14
 
15
  WordPress currently only allows you to use custom avatars that are uploaded through [Gravatar](http://gravatar.com/). **WP User Avatar** enables you to use any photo uploaded into your Media Library as an avatar. This means you use the same uploader and library as your posts. No extra folders or image editing functions are necessary.
16
 
17
- **Maintained and Supported by Flipper Code**
18
-
19
- Flipper Code has been providing WordPress Services since 2008. Flipper Code expertise in [custom plugins development](http://codecanyon.net/user/flippercode/portfolio) and [wordpress websites development](http://www.flippercode.com/our-portfolio/).
20
 
21
  **WP User Avatar** also lets you:
22
 
@@ -28,11 +25,31 @@ Flipper Code has been providing WordPress Services since 2008. Flipper Code expe
28
  * Allow Contributors and Subscribers to upload their own avatars.
29
  * Limit upload file size and image dimensions for Contributors and Subscribers.
30
 
31
- Visit [WP User Avatar](http://wpuseravatar.com/) for more information and documentation.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  == Installation ==
34
 
35
- Visit [WP User Avatar](http://wpuseravatar.com/) for more information and documentation.
36
 
37
  1. Download, install, and activate the WP User Avatar plugin.
38
  2. On your profile edit page, click "Edit Image".
@@ -140,7 +157,7 @@ Returns true if the user has a WP User Avatar image. You must specify the user I
140
 
141
  == Frequently Asked Questions ==
142
 
143
- Visit [WP User Avatar](http://wpuseravatar.com/) for more information and documentation.
144
 
145
  = How do I use WP User Avatar? =
146
 
@@ -384,6 +401,92 @@ This would output:
384
 
385
  == Changelog ==
386
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  = 1.9.13 =
388
  * Bug Fix: Load _load_wp_includes mostly only on front pages
389
  * Bug Fix: Check for edit_posts capability before enabling filters for Subscribers
3
  Contributors: flippercode
4
  Tags: author image, author photo, author avatar, avatar, bbPress, profile avatar, profile image, user avatar, user image, user photo, widget
5
  Requires at least: 3.6
6
+ Tested up to: 5.1.0
7
+ Stable tag: 2.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  WordPress currently only allows you to use custom avatars that are uploaded through [Gravatar](http://gravatar.com/). **WP User Avatar** enables you to use any photo uploaded into your Media Library as an avatar. This means you use the same uploader and library as your posts. No extra folders or image editing functions are necessary.
16
 
 
 
 
17
 
18
  **WP User Avatar** also lets you:
19
 
25
  * Allow Contributors and Subscribers to upload their own avatars.
26
  * Limit upload file size and image dimensions for Contributors and Subscribers.
27
 
28
+ **Introducing Support Desk**
29
+
30
+ We're at [FlipperCode](http://www.flippercode.com/), committed to excellent support to make every download worth for the user. Happily announcing [Support Desk](http://www.flippercode.com/forums/) for our valuable users to engaged with multiple support desk person for fast turnout.
31
+
32
+ **Introducing Pro Version of WP USER AVATAR**
33
+
34
+ We have developed a [Pro Version](http://www.wpuseravatar.com/) of WP USER AVATAR by getting valuable features request from thousands of users especially about Storage options and how user upload the avatar. Here is a quick highlight on the numerous customizable features offered by the [WP USER AVATAR PRO](http://www.wpuseravatar.com/) .
35
+
36
+ <ul>
37
+ <li>Easy Upload and Capture functionality with crop avatar options.</li>
38
+ <li>Use Webcam to get Avatar instantly.</li>
39
+ <li>Allow user to upload avatar on Registration Page.</li>
40
+ <li>Easy to adjust avatar dimensions.</li>
41
+ <li>Enable to add or edit avatar while adding existing user to the blog in multi-site network.</li>
42
+ <li>Keep Avatars in Custom Folder instead of Media Manager.</li>
43
+ <li>Keep Avatars on Amazon S3 Storage</li>
44
+ <li>Keep Avatars on Dropbox</li>
45
+ <li>Keep Avatars in Media Manager</li>
46
+ <li>Easy to use Settings to control every functionality.</li>
47
+ <li>Multi-lingual, Multi-Site, BBPRESS and Buddypress Supported.</li>
48
+ </ul>
49
 
50
  == Installation ==
51
 
52
+ Visit [WP User Avatar](http://www.wpuseravatar.com/) for more information and documentation.
53
 
54
  1. Download, install, and activate the WP User Avatar plugin.
55
  2. On your profile edit page, click "Edit Image".
157
 
158
  == Frequently Asked Questions ==
159
 
160
+ Visit [WP User Avatar](http://www.wpuseravatar.com/) for more information and documentation.
161
 
162
  = How do I use WP User Avatar? =
163
 
401
 
402
  == Changelog ==
403
 
404
+
405
+ = 2.1.9 =
406
+ * New: New filter 'wpua_default_alt_tag' added to modify default image alt tag And warning error resolved on stagging environment.
407
+
408
+ = 2.1.8 =
409
+ * Fix: Language Files are updated and warning error resolved on stagging environment.
410
+
411
+ = 2.1.7 =
412
+ * Fix: Default ALT tag added.
413
+
414
+ = 2.1.6 =
415
+ * Fix: Removed ads from the setting page.
416
+
417
+ = 2.1.5 =
418
+ * Fix: Translation bug resolved in class-wp-user-avatar-admin file in PHP 7.
419
+
420
+ = 2.1.4 =
421
+ * Fix: Remove Ads from dashboard and all other pages.
422
+
423
+ = 2.1.3 =
424
+ * Fix: Better Styling
425
+
426
+ = 2.1.2 =
427
+ * Fix: Tested up to 4.9.7
428
+
429
+ = 2.1.1 =
430
+ * Fix: Insecure content over https issue is fixed.
431
+
432
+ = 2.0.9 =
433
+ * New Shortcode: Use [avatar user=current] shortcode to show current logged in user avatar.
434
+
435
+ = 2.0.8 =
436
+ * Fix: Compatible with php 7.
437
+
438
+ = 2.0.7 =
439
+ * Improvement Fix: Removed languages files to be used from core wordpress language packs.
440
+
441
+ = 2.0.7 =
442
+ * Improvement Fix: Removed languages files to be used from core wordpress language packs.
443
+
444
+ = 2.0.6 =
445
+ * Improvement Fix: Broken Jquery files from UI is resolved.
446
+
447
+ = 2.0.5 =
448
+ * Improvement Fix: Broken JS files from UI is resolved.
449
+
450
+ = 2.0.4 =
451
+ * Improvement Fix: Activation warning in some cases is resolved.
452
+
453
+ = 2.0.3 =
454
+ * Improvement Fix: Added missing translation strings in English version of po file.
455
+
456
+
457
+ = 2.0.0 =
458
+ * Improvement Fix: Added missing translation strings in English version of po file.
459
+ * Bug Fix: Missing $user = $current_user is added in class-wp-user-avatar.php on line 156.
460
+
461
+
462
+ = 1.9.19 =
463
+ * Improvement Fix: Fixed add_query_arg() and remove_query_arg() usage to avoid XSS Vulnerability.
464
+
465
+
466
+ = 1.9.18 =
467
+ * Bug Fix: Removed cron job dependency for excellent performance.
468
+ * Bug Fix: Resolved gravatar was not showing on some special cases.
469
+ * Bug Fix: Resolved speed problem in case of large number of users for multisite, bbpress and buddy press.
470
+ * Bug Fix: Resolved display custom avatar problem when default and customer avatar is same choosen.
471
+
472
+
473
+ = 1.9.17 =
474
+ * Bug Fix: Removed the looping through all users on admin_init action.
475
+
476
+ = 1.9.16 =
477
+ * Bug Fix: lots of entries in wp_options table resolved.
478
+
479
+ = 1.9.15 =
480
+ * Bug Fix: Multiple Cron job added bug resolved.
481
+
482
+
483
+ = 1.9.14 =
484
+ * Bug Fix: Speed Issues due to check many times if gravatar exist.
485
+ * Bug Fix: Default gravatar issue for mustache and gravatar logo at front end and at buddypress pages
486
+ * Bug Fix: Avatar while adding for existing user.
487
+ * Bug Fix: UI issue when Gravatar option is enable/disable.
488
+
489
+
490
  = 1.9.13 =
491
  * Bug Fix: Load _load_wp_includes mostly only on front pages
492
  * Bug Fix: Check for edit_posts capability before enabling filters for Subscribers
uninstall.php CHANGED
@@ -52,6 +52,7 @@ if(is_multisite()) {
52
  delete_option('wp_user_avatar_default_avatar_updated');
53
  delete_option('wp_user_avatar_media_updated');
54
  delete_option('wp_user_avatar_users_updated');
 
55
  }
56
  } else {
57
  foreach($users as $user) {
@@ -71,6 +72,7 @@ if(is_multisite()) {
71
  delete_option('wp_user_avatar_default_avatar_updated');
72
  delete_option('wp_user_avatar_media_updated');
73
  delete_option('wp_user_avatar_users_updated');
 
74
  }
75
 
76
  // Delete post meta
52
  delete_option('wp_user_avatar_default_avatar_updated');
53
  delete_option('wp_user_avatar_media_updated');
54
  delete_option('wp_user_avatar_users_updated');
55
+ delete_option('wpua_has_gravatar');
56
  }
57
  } else {
58
  foreach($users as $user) {
72
  delete_option('wp_user_avatar_default_avatar_updated');
73
  delete_option('wp_user_avatar_media_updated');
74
  delete_option('wp_user_avatar_users_updated');
75
+ delete_option('wpua_has_gravatar');
76
  }
77
 
78
  // Delete post meta
wp-user-avatar.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package WP User Avatar
4
- * @version 1.9.13
5
  */
6
 
7
  /*
@@ -10,7 +10,7 @@ Plugin URI: http://wordpress.org/plugins/wp-user-avatar/
10
  Description: Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar.
11
  Author: flippercode
12
  Author URI: http://www.flippercode.com/
13
- Version: 1.9.13
14
  Text Domain: wp-user-avatar
15
  Domain Path: /lang/
16
  */
@@ -38,7 +38,7 @@ class WP_User_Avatar_Setup {
38
  * @since 1.9.2
39
  */
40
  private function _define_constants() {
41
- define('WPUA_VERSION', '1.9.13');
42
  define('WPUA_FOLDER', basename(dirname(__FILE__)));
43
  define('WPUA_DIR', plugin_dir_path(__FILE__));
44
  define('WPUA_INC', WPUA_DIR.'includes'.'/');
@@ -79,19 +79,16 @@ class WP_User_Avatar_Setup {
79
  require_once(WPUA_INC.'class-wp-user-avatar-admin.php');
80
  require_once(WPUA_INC.'class-wp-user-avatar.php');
81
  require_once(WPUA_INC.'class-wp-user-avatar-functions.php');
82
- // Only needed on front pages and if NextGEN Gallery isn't installed
83
- // if(!is_admin() && !defined('NEXTGEN_GALLERY_PLUGIN_DIR') && !defined('NGG_GALLERY_PLUGIN_DIR')) {
84
- // require_once(WPUA_INC.'class-wp-user-avatar-resource-manager.php');
85
- // WP_User_Avatar_Resource_Manager::init();
86
- // }
87
  require_once(WPUA_INC.'class-wp-user-avatar-shortcode.php');
88
  require_once(WPUA_INC.'class-wp-user-avatar-subscriber.php');
89
  require_once(WPUA_INC.'class-wp-user-avatar-update.php');
90
  require_once(WPUA_INC.'class-wp-user-avatar-widget.php');
 
91
  // Load TinyMCE only if enabled
92
  if((bool) $wpua_tinymce == 1) {
93
  require_once(WPUA_INC.'wpua-tinymce.php');
94
  }
 
95
  }
96
  }
97
 
1
  <?php
2
  /**
3
  * @package WP User Avatar
4
+ * @version 2.1.9
5
  */
6
 
7
  /*
10
  Description: Use any image from your WordPress Media Library as a custom user avatar. Add your own Default Avatar.
11
  Author: flippercode
12
  Author URI: http://www.flippercode.com/
13
+ Version: 2.1.9
14
  Text Domain: wp-user-avatar
15
  Domain Path: /lang/
16
  */
38
  * @since 1.9.2
39
  */
40
  private function _define_constants() {
41
+ define('WPUA_VERSION', '2.1.9');
42
  define('WPUA_FOLDER', basename(dirname(__FILE__)));
43
  define('WPUA_DIR', plugin_dir_path(__FILE__));
44
  define('WPUA_INC', WPUA_DIR.'includes'.'/');
79
  require_once(WPUA_INC.'class-wp-user-avatar-admin.php');
80
  require_once(WPUA_INC.'class-wp-user-avatar.php');
81
  require_once(WPUA_INC.'class-wp-user-avatar-functions.php');
 
 
 
 
 
82
  require_once(WPUA_INC.'class-wp-user-avatar-shortcode.php');
83
  require_once(WPUA_INC.'class-wp-user-avatar-subscriber.php');
84
  require_once(WPUA_INC.'class-wp-user-avatar-update.php');
85
  require_once(WPUA_INC.'class-wp-user-avatar-widget.php');
86
+
87
  // Load TinyMCE only if enabled
88
  if((bool) $wpua_tinymce == 1) {
89
  require_once(WPUA_INC.'wpua-tinymce.php');
90
  }
91
+
92
  }
93
  }
94