User Profile Picture - Version 1.3.1

Version Description

  • Released 2016-04-02
  • Fixing thumbnail calls that could potential be inadvertently filtered and cause the profile picture to provide an erroneous callback. Props @Monter.
Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 User Profile Picture
Version 1.3.1
Comparing to
See all releases

Code changes from version 1.3.0 to 1.3.1

languages/metronet-profile-picture-pl_PL.mo ADDED
Binary file
languages/metronet-profile-picture-pl_PL.po ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Metronet Profile Picture\n"
4
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/simple-comment-editing\n"
5
+ "POT-Creation-Date: 2015-03-09 23:35-0600\n"
6
+ "PO-Revision-Date: 2016-03-31 14:35+0200\n"
7
+ "Last-Translator: Marek eM <monter@techlog.pl>\n"
8
+ "Language-Team: \n"
9
+ "Language: pl_PL\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.7\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: _e;__;esc_html__;esc_html_e;esc_attr__;esc_attr_e\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
+ "X-Poedit-SearchPath-0: ..\n"
19
+
20
+ #: ../metronet-profile-picture.php:85 ../metronet-profile-picture.php:108
21
+ #: ../metronet-profile-picture.php:359 ../metronet-profile-picture.php:407
22
+ msgid "Remove profile image"
23
+ msgstr "Usuń zdjęcie profilowe"
24
+
25
+ #: ../metronet-profile-picture.php:116 ../metronet-profile-picture.php:135
26
+ #: ../metronet-profile-picture.php:350
27
+ msgid "Upload or Change Profile Picture"
28
+ msgstr "Dodaj nowe lub zmień swoje zdjęcie profilowe"
29
+
30
+ #: ../metronet-profile-picture.php:271 ../metronet-profile-picture.php:408
31
+ msgid "Crop Thumbnail"
32
+ msgstr "Przytnij miniaturę"
33
+
34
+ #: ../metronet-profile-picture.php:335
35
+ msgid "Profile Image"
36
+ msgstr "Zdjęcie profilowe"
37
+
38
+ #: ../metronet-profile-picture.php:381
39
+ msgid "Override Avatar?"
40
+ msgstr "Zastąpić Avatar?"
41
+
42
+ #: ../metronet-profile-picture.php:406
43
+ msgid "Set profile image"
44
+ msgstr "Ustaw zdjęcie profilowe"
metronet-profile-picture.php CHANGED
@@ -3,10 +3,10 @@
3
  Plugin Name: User Profile Picture
4
  Plugin URI: http://wordpress.org/extend/plugins/metronet-profile-picture/
5
  Description: Use the native WP uploader on your user profile page.
6
- Author: ronalfy
7
- Version: 1.3.0
8
  Requires at least: 3.5
9
- Author URI: http://www.ronalfy.com
10
  Contributors: ronalfy
11
  Text Domain: metronet-profile-picture
12
  Domain Path: /languages
@@ -85,7 +85,8 @@ class Metronet_Profile_Picture {
85
  set_post_thumbnail( $post_id, $thumbnail_id );
86
 
87
  if ( has_post_thumbnail( $post_id ) ) {
88
- $post_thumbnail = get_the_post_thumbnail( $post_id, 'thumbnail' );
 
89
  $crop_html = $this->get_post_thumbnail_editor_link( $post_id );
90
  $thumb_html = sprintf( '<a href="#" class="mpp_add_media">%s</a>', $post_thumbnail );
91
  $thumb_html .= sprintf( '<a id="metronet-remove" class="dashicons dashicons-trash" href="#" title="%s">%s</a>', esc_attr__( 'Remove profile image', 'metronet-profile-picture' ), esc_html__( "Remove profile image", "metronet-profile-picture" ) );
@@ -109,7 +110,8 @@ class Metronet_Profile_Picture {
109
  $post_id = isset( $_POST[ 'post_id' ] ) ? absint( $_POST[ 'post_id' ] ) : 0;
110
 
111
  if ( has_post_thumbnail( $post_id ) ) {
112
- $post_thumbnail = get_the_post_thumbnail( $post_id, 'thumbnail' );
 
113
  $crop_html = $this->get_post_thumbnail_editor_link( $post_id );
114
  $thumb_html = sprintf( '<a href="#" class="mpp_add_media">%s</a>', $post_thumbnail );
115
  $thumb_html .= sprintf( '<a id="metronet-remove" class="dashicons dashicons-trash" href="#" title="%s">%s</a>', esc_attr__( 'Remove profile image', 'metronet-profile-picture' ), esc_html__( "Remove profile image", "metronet-profile-picture" ) );
@@ -367,7 +369,8 @@ class Metronet_Profile_Picture {
367
  if ( has_post_thumbnail( $post_id ) ) {
368
  $has_profile_image = true;
369
  echo '<a href="#" class="mpp_add_media">';
370
- $post_thumbnail = get_the_post_thumbnail( $post_id, 'thumbnail' );
 
371
  echo $post_thumbnail;
372
  echo '</a>';
373
  } else {
@@ -619,4 +622,4 @@ function mt_profile_img( $user_id, $args = array() ) {
619
  return $post_thumbnail;
620
  }
621
  } //end mt_profile_img
622
- ?>
3
  Plugin Name: User Profile Picture
4
  Plugin URI: http://wordpress.org/extend/plugins/metronet-profile-picture/
5
  Description: Use the native WP uploader on your user profile page.
6
+ Author: Ronald Huereca
7
+ Version: 1.3.1
8
  Requires at least: 3.5
9
+ Author URI: https://www.mediaron.com
10
  Contributors: ronalfy
11
  Text Domain: metronet-profile-picture
12
  Domain Path: /languages
85
  set_post_thumbnail( $post_id, $thumbnail_id );
86
 
87
  if ( has_post_thumbnail( $post_id ) ) {
88
+ $thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'thumbnail' , false, '' );
89
+ $post_thumbnail = sprintf( '<img src="%s" width="150" height="150" title="%s" />', esc_url( $thumb_src[0] ), esc_attr__( "Upload or Change Profile Picture", 'metronet-profile-picture' ) );
90
  $crop_html = $this->get_post_thumbnail_editor_link( $post_id );
91
  $thumb_html = sprintf( '<a href="#" class="mpp_add_media">%s</a>', $post_thumbnail );
92
  $thumb_html .= sprintf( '<a id="metronet-remove" class="dashicons dashicons-trash" href="#" title="%s">%s</a>', esc_attr__( 'Remove profile image', 'metronet-profile-picture' ), esc_html__( "Remove profile image", "metronet-profile-picture" ) );
110
  $post_id = isset( $_POST[ 'post_id' ] ) ? absint( $_POST[ 'post_id' ] ) : 0;
111
 
112
  if ( has_post_thumbnail( $post_id ) ) {
113
+ $thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'thumbnail' , false, '' );
114
+ $post_thumbnail = sprintf( '<img src="%s" width="150" height="150" title="%s" />', esc_url( $thumb_src[0] ), esc_attr__( "Upload or Change Profile Picture", 'metronet-profile-picture' ) );
115
  $crop_html = $this->get_post_thumbnail_editor_link( $post_id );
116
  $thumb_html = sprintf( '<a href="#" class="mpp_add_media">%s</a>', $post_thumbnail );
117
  $thumb_html .= sprintf( '<a id="metronet-remove" class="dashicons dashicons-trash" href="#" title="%s">%s</a>', esc_attr__( 'Remove profile image', 'metronet-profile-picture' ), esc_html__( "Remove profile image", "metronet-profile-picture" ) );
369
  if ( has_post_thumbnail( $post_id ) ) {
370
  $has_profile_image = true;
371
  echo '<a href="#" class="mpp_add_media">';
372
+ $thumb_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'thumbnail' , false, '' );
373
+ $post_thumbnail = sprintf( '<img src="%s" width="150" height="150" title="%s" />', esc_url( $thumb_src[0] ), esc_attr__( "Upload or Change Profile Picture", 'metronet-profile-picture' ) );
374
  echo $post_thumbnail;
375
  echo '</a>';
376
  } else {
622
  return $post_thumbnail;
623
  }
624
  } //end mt_profile_img
625
+ ?>
readme.txt CHANGED
@@ -2,10 +2,11 @@
2
  Contributors: ronalfy
3
  Tags: users, user, user profile
4
  Requires at least: 3.5
5
- Tested up to: 4.5
6
- Stable tag: 1.3.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
9
 
10
  Set a custom profile image for a user using the standard WordPress media upload tool.
11
  == Description ==
@@ -16,14 +17,6 @@ A template tag is supplied for outputting to a theme and the option to override
16
 
17
  If you like this plugin, please leave a rating/review and mark the plugin as working.
18
 
19
- <h3>Translations</h3>
20
-
21
- <ul>
22
- <li>Spanish - Thanks Eva F.</li>
23
- </ul>
24
-
25
- If you would like to contribute a translation, please leave a support request with a link to your translation or <a href="http://www.ronalfy.com/contact/">get in touch</a>.
26
-
27
  == Installation ==
28
 
29
  1. Upload `metronet-profile-picture` folder to the `/wp-content/plugins/` directory
@@ -115,61 +108,66 @@ Yes, but you'll have to set a new profile image per site. This is currently a l
115
 
116
  == Changelog ==
117
 
 
 
 
 
118
  = 1.3.0 =
 
119
  * Adding REST API endpoint
120
 
121
  = 1.2.7 =
122
- * Updated 20 August 2015 for WP 4.3 compatibility
123
- * Released 10 June 2015
124
  * Bug fix: warning message saying missing argument for avatar_override
125
 
126
  = 1.2.5 =
127
- * Released 06 June 2015
128
  * Bug fix: get_avatar override now accepts custom classes.
129
  * Added `mpp_avatar_classes` filter to get_avatar override to allow global class overrides/additions.
130
 
131
  = 1.2.3 =
132
- * Released 20 May 2015
133
  * Revised post type initialization to make sure post type is completely hidden.
134
  * Refactored function mt_profile_img to use a different API call so that output isn't inadvertently filtered.
135
  * Added new filter, mpp_thumbnail_html, to filter output.
136
 
137
  = 1.2.2 =
138
- * Released 16 April 2015
139
  * Added compatibility to Advanced Custom Fields.
140
  * Added increased capabilities check to Ajax calls.
141
  * Ensuring WordPress 4.2 compatibility.
142
 
143
  = 1.2.1 =
144
- * Released 03 March 2015
145
  * Fixed internationalization errors.
146
  * Added Spanish translation.
147
 
148
  = 1.2.0 =
149
- * Released 07 December 2014
150
  * Reducing clutter in the interface. Removed text option to upload. Added default image if no profile image is available. Added option to remove the profile image.
151
  * Fixed internationalization bug in the JavaScript.
152
 
153
  = 1.1.0 =
154
- * Released 11 November 2014
155
  * Added the ability to remove profile images (aside from deleting the image).
156
  * Added better internationalization capabilities.
157
  * Added compatibility with <a href="https://wordpress.org/plugins/theme-my-login/">Theme My Login</a>.
158
 
159
  = 1.0.23 =
160
- * Released 20 October 2014
161
  * Added a new filter to allow the "Override Avatar" interface to be hidden (and turned on my default).
162
 
163
  = 1.0.22 =
164
- * Released 02 September 2014
165
  * Added minor update to additional user meta for easier querying (props Solinx)
166
 
167
  = 1.0.21 =
168
- * Released 09 September 2013
169
  * Fixed avatar override on options discussion page.
170
 
171
  = 1.0.20 =
172
- * Released 13 May 2013.
173
  * Added a filter for turning on "Override Avatar" by default.
174
 
175
  = 1.0.19 =
@@ -209,6 +207,9 @@ Yes, but you'll have to set a new profile image per site. This is currently a l
209
 
210
  == Upgrade Notice ==
211
 
 
 
 
212
  = 1.3.0 =
213
  Adding REST API endpoint.
214
 
2
  Contributors: ronalfy
3
  Tags: users, user, user profile
4
  Requires at least: 3.5
5
+ Tested up to: 4.6
6
+ Stable tag: 1.3.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+ Donate link: https://mediaron.com/contribute/
10
 
11
  Set a custom profile image for a user using the standard WordPress media upload tool.
12
  == Description ==
17
 
18
  If you like this plugin, please leave a rating/review and mark the plugin as working.
19
 
 
 
 
 
 
 
 
 
20
  == Installation ==
21
 
22
  1. Upload `metronet-profile-picture` folder to the `/wp-content/plugins/` directory
108
 
109
  == Changelog ==
110
 
111
+ = 1.3.1 =
112
+ * Released 2016-04-02
113
+ * Fixing thumbnail calls that could potential be inadvertently filtered and cause the profile picture to provide an erroneous callback. Props @Monter.
114
+
115
  = 1.3.0 =
116
+ * Released 2016-03-28
117
  * Adding REST API endpoint
118
 
119
  = 1.2.7 =
120
+ * Updated 2015-08-20 for WP 4.3 compatibility
121
+ * Released 2015-06-10
122
  * Bug fix: warning message saying missing argument for avatar_override
123
 
124
  = 1.2.5 =
125
+ * Released 2015-06-06
126
  * Bug fix: get_avatar override now accepts custom classes.
127
  * Added `mpp_avatar_classes` filter to get_avatar override to allow global class overrides/additions.
128
 
129
  = 1.2.3 =
130
+ * Released 2015-05-20
131
  * Revised post type initialization to make sure post type is completely hidden.
132
  * Refactored function mt_profile_img to use a different API call so that output isn't inadvertently filtered.
133
  * Added new filter, mpp_thumbnail_html, to filter output.
134
 
135
  = 1.2.2 =
136
+ * Released 2015-04-16
137
  * Added compatibility to Advanced Custom Fields.
138
  * Added increased capabilities check to Ajax calls.
139
  * Ensuring WordPress 4.2 compatibility.
140
 
141
  = 1.2.1 =
142
+ * Released 2015-03-03
143
  * Fixed internationalization errors.
144
  * Added Spanish translation.
145
 
146
  = 1.2.0 =
147
+ * Released 2014-12-07
148
  * Reducing clutter in the interface. Removed text option to upload. Added default image if no profile image is available. Added option to remove the profile image.
149
  * Fixed internationalization bug in the JavaScript.
150
 
151
  = 1.1.0 =
152
+ * Released 2014-11-11
153
  * Added the ability to remove profile images (aside from deleting the image).
154
  * Added better internationalization capabilities.
155
  * Added compatibility with <a href="https://wordpress.org/plugins/theme-my-login/">Theme My Login</a>.
156
 
157
  = 1.0.23 =
158
+ * Released 2014-10-20
159
  * Added a new filter to allow the "Override Avatar" interface to be hidden (and turned on my default).
160
 
161
  = 1.0.22 =
162
+ * Released 2014-09-02
163
  * Added minor update to additional user meta for easier querying (props Solinx)
164
 
165
  = 1.0.21 =
166
+ * Released 2013-09-09
167
  * Fixed avatar override on options discussion page.
168
 
169
  = 1.0.20 =
170
+ * Released 2013-05-13
171
  * Added a filter for turning on "Override Avatar" by default.
172
 
173
  = 1.0.19 =
207
 
208
  == Upgrade Notice ==
209
 
210
+ = 1.3.1 =
211
+ Fixing thumbnail calls that could potential be inadvertently filtered and cause the profile picture to provide an erroneous callback.
212
+
213
  = 1.3.0 =
214
  Adding REST API endpoint.
215