Simple Local Avatars - Version 2.4.0

Version Description

  • 2022-05-10 =
  • Added: Ability to set a default avatar. (props @mehulkaklotar, @jeffpaul, @dinhtungdu, @faisal-alvi via #96).
  • Fixed: Correct plugin name in changelog. (props @grappler, @jeffpaul via #117).
  • Fixed: Avatar cache not being cleared. (props @thefrosty, @jeffpaul, @faisal-alvi, @peterwilsoncc via #118 & #120).
  • Security: Dev dependency @wordpress/scripts upgraded to resolve deeper level dependency security issues. (props @jeffpaul, @faisal-alvi, @cadic via #119).
Download this release

Release Info

Developer 10up
Plugin Icon 128x128 Simple Local Avatars
Version 2.4.0
Comparing to
See all releases

Code changes from version 2.3.0 to 2.4.0

dist/simple-local-avatars.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('wp-polyfill'), 'version' => 'b38d7e6f94a7710dfed66c3983d38d30');
1
+ <?php return array('dependencies' => array(), 'version' => '743de2221cd3b95dfce2abc7e2a95842');
dist/simple-local-avatars.js CHANGED
@@ -1 +1 @@
1
- !function(){let e,a,t,r,i,o,s,l,n,c=!1;function m(e){void 0===a&&(t=document.getElementById("simple-local-avatar-ratings"),a=jQuery(document.getElementById("simple-local-avatar-spinner")),r=document.getElementById("simple-local-avatar-photo"),i=jQuery(t).closest("form").find("input[type=submit]")),"unlock"===e?(c=!1,i.removeAttr("disabled"),a.hide()):(c=!0,i.attr("disabled","disabled"),a.show())}function p(e,a){const t=a.get("control"),r=e.get("width"),i=e.get("height");let o=parseInt(t.params.width,10),s=parseInt(t.params.height,10);const l=o/s;a.set("canSkipCrop",!t.mustBeCropped(!1,!1,o,s,r,i));const n=o,c=s;r/i>l?(s=i,o=s*l):(o=r,s=o/l);const m=(r-o)/2,p=(i-s)/2;return{handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:r,imageHeight:i,minWidth:n>o?o:n,minHeight:c>s?s:c,x1:m,y1:p,x2:o+m,y2:s+p,aspectRatio:`${o}:${s}`}}function u(e,a,i,o){const s={};s.url=e,s.thumbnail_url=e,s.timestamp=_.now(),a&&(s.attachment_id=a),i&&(s.width=i),o&&(s.height=o),m("lock"),jQuery.post(ajaxurl,{action:"assign_simple_local_avatar_media",media_id:a,user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.mediaNonce}).done((function(e){""!==e&&(r.innerHTML=e,jQuery("#simple-local-avatar-remove").show(),t.disabled=!1)})).always((function(){m("unlock")}))}jQuery(document).ready((function(a){s=a("#simple-local-avatar"),o=a("#simple-local-avatar-photo img"),n=o.attr("src"),t=a("#simple-local-avatar-ratings"),r=a("#simple-local-avatar-photo"),a("#simple-local-avatar-media").on("click",(function(a){if(a.preventDefault(),c)return;const i={id:"control-id",params:{flex_width:!1,flex_height:!1,width:200,height:200},mustBeCropped:function(e,a,t,r,i,o){return i!==t||o!==r}};e=wp.media({button:{text:i10n_SimpleLocalAvatars.selectCrop,close:!1},states:[new wp.media.controller.Library({title:i10n_SimpleLocalAvatars.selectCrop,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:200,suggestedHeight:200}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:p,control:i})]}),e.on("cropped",(function(e){const{url:a}=e;u(a,e.id,e.width,e.height)})),e.on("skippedcrop",(function(e){const a=e.get("url"),t=e.get("width"),r=e.get("height");u(a,e.id,t,r)})),e.on("select",(function(){const a=e.state().get("selection").first().toJSON();var o;i.params.width!==a.width||i.params.height!==a.height||i.params.flex_width||i.params.flex_height?e.setState("cropper"):(a.dst_width=a.width,a.dst_height=a.height,o=a,m("lock"),jQuery.post(ajaxurl,{action:"assign_simple_local_avatar_media",media_id:o.id,user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.mediaNonce}).done((function(e){""!==e&&(r.innerHTML=e,jQuery("#simple-local-avatar-remove").show(),t.disabled=!1,m("unlock"))})).always((function(){m("unlock")})),e.close())})),e.open()})),a("#simple-local-avatar-remove").on("click",(function(e){e.preventDefault(),c||(m("lock"),a.get(ajaxurl,{action:"remove_simple_local_avatar",user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.deleteNonce}).done((function(e){""!==e&&(r.innerHTML=e,a("#simple-local-avatar-remove").hide(),t.disabled=!0)})).always((function(){m("unlock")})))})),s.on("change",(function(e){o.attr("srcset",""),o.attr("height","auto"),URL.revokeObjectURL(l),e.target.files.length>0?(l=URL.createObjectURL(e.target.files[0]),o.attr("src",l)):o.attr("src",n)})),a(document.getElementById("simple-local-avatars-migrate-from-wp-user-avatar")).on("click",(function(e){e.preventDefault(),jQuery.post(ajaxurl,{action:"migrate_from_wp_user_avatar",migrateFromWpUserAvatarNonce:i10n_SimpleLocalAvatars.migrateFromWpUserAvatarNonce}).always((function(){a(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty(),a(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarProgress)})).done((function(e){a(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty();const t=a.parseJSON(e).count;0===t&&a(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarFailure),t>0&&a(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarSuccess+": "+t),setTimeout((function(){a(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty()}),5e3)}))}))}))}();
1
+ !function(){let a,e,t,r,i,l,s,o,n,c=!1;function p(a){void 0===e&&(t=document.getElementById("simple-local-avatar-ratings"),e=jQuery(document.getElementById("simple-local-avatar-spinner")),r=document.getElementById("simple-local-avatar-photo"),i=jQuery(t).closest("form").find("input[type=submit]")),"unlock"===a?(c=!1,i.removeAttr("disabled"),e.hide()):(c=!0,i.attr("disabled","disabled"),e.show())}function m(a,e){const t=e.get("control"),r=a.get("width"),i=a.get("height");let l=parseInt(t.params.width,10),s=parseInt(t.params.height,10);const o=l/s;e.set("canSkipCrop",!t.mustBeCropped(!1,!1,l,s,r,i));const n=l,c=s;r/i>o?(s=i,l=s*o):(l=r,s=l/o);const p=(r-l)/2,m=(i-s)/2;return{handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:r,imageHeight:i,minWidth:n>l?l:n,minHeight:c>s?s:c,x1:p,y1:m,x2:l+p,y2:s+m,aspectRatio:`${l}:${s}`}}function d(a,e,i,l){const s={};s.url=a,s.thumbnail_url=a,s.timestamp=_.now(),e&&(s.attachment_id=e),i&&(s.width=i),l&&(s.height=l),p("lock"),jQuery.post(ajaxurl,{action:"assign_simple_local_avatar_media",media_id:e,user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.mediaNonce}).done((function(a){""!==a&&(r.innerHTML=a,jQuery("#simple-local-avatar-remove").show(),t.disabled=!1)})).always((function(){p("unlock")}))}jQuery(document).ready((function(e){s=e("#simple-local-avatar"),l=e("#simple-local-avatar-photo img"),n=l.attr("src"),t=e("#simple-local-avatar-ratings"),r=e("#simple-local-avatar-photo"),e("#simple-local-avatar-media").on("click",(function(e){if(e.preventDefault(),c)return;const i={id:"control-id",params:{flex_width:!1,flex_height:!1,width:200,height:200},mustBeCropped:function(a,e,t,r,i,l){return i!==t||l!==r}};a=wp.media({button:{text:i10n_SimpleLocalAvatars.selectCrop,close:!1},states:[new wp.media.controller.Library({title:i10n_SimpleLocalAvatars.selectCrop,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:200,suggestedHeight:200}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:m,control:i})]}),a.on("cropped",(function(a){const{url:e}=a;d(e,a.id,a.width,a.height)})),a.on("skippedcrop",(function(a){const e=a.get("url"),t=a.get("width"),r=a.get("height");d(e,a.id,t,r)})),a.on("select",(function(){const e=a.state().get("selection").first().toJSON();var l;i.params.width!==e.width||i.params.height!==e.height||i.params.flex_width||i.params.flex_height?a.setState("cropper"):(e.dst_width=e.width,e.dst_height=e.height,l=e,p("lock"),jQuery.post(ajaxurl,{action:"assign_simple_local_avatar_media",media_id:l.id,user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.mediaNonce}).done((function(a){""!==a&&(r.innerHTML=a,jQuery("#simple-local-avatar-remove").show(),t.disabled=!1,p("unlock"))})).always((function(){p("unlock")})),a.close())})),a.open()})),e("#simple-local-avatar-remove").on("click",(function(a){a.preventDefault(),c||(p("lock"),e.get(ajaxurl,{action:"remove_simple_local_avatar",user_id:i10n_SimpleLocalAvatars.user_id,_wpnonce:i10n_SimpleLocalAvatars.deleteNonce}).done((function(a){""!==a&&(r.innerHTML=a,e("#simple-local-avatar-remove").hide(),t.disabled=!0)})).always((function(){p("unlock")})))})),s.on("change",(function(a){l.attr("srcset",""),l.attr("height","auto"),URL.revokeObjectURL(o),a.target.files.length>0?(o=URL.createObjectURL(a.target.files[0]),l.attr("src",o)):l.attr("src",n)})),e(document.getElementById("simple-local-avatars-migrate-from-wp-user-avatar")).on("click",(function(a){a.preventDefault(),jQuery.post(ajaxurl,{action:"migrate_from_wp_user_avatar",migrateFromWpUserAvatarNonce:i10n_SimpleLocalAvatars.migrateFromWpUserAvatarNonce}).always((function(){e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty(),e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarProgress)})).done((function(a){e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty();const t=e.parseJSON(a).count;0===t&&e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarFailure),t>0&&e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").text(i10n_SimpleLocalAvatars.migrateFromWpUserAvatarSuccess+": "+t),setTimeout((function(){e(".simple-local-avatars-migrate-from-wp-user-avatar-progress").empty()}),5e3)}))}));const i=e("#clear_cache_btn"),u=e("#clear_cache_message"),v=e("#simple-local-avatar-default"),g=e("#simple-local-avatar-file-url"),h=e("#simple-local-avatar-file-id");function f(){i.find("span").remove(),i.removeClass("disabled")}function _(a,t){t.step=a,e.ajax({url:ajaxurl,dataType:"json",data:t,method:"POST",success:function(a){if(a.success)return"done"===a.data.step?(u.text(a.data.message),f()):(u.text(a.data.message),_(parseInt(a.data.step,10),t)),!1;u.text(i10n_SimpleLocalAvatars.clearCacheError),f()},error:function(){u.text(i10n_SimpleLocalAvatars.clearCacheError),f()}})}if(i.on("click",(function(a){a.preventDefault(),i.addClass("disabled"),i.append('<span class="spinner is-active" style="margin-left:5px;margin-right:0;"></span>'),_(1,{action:"sla_clear_user_cache",nonce:i10n_SimpleLocalAvatars.cacheNonce})})),v.click((function(a){a.preventDefault();var t=e(this),r=wp.media({title:i10n_SimpleLocalAvatars.insertMediaTitle,multiple:!1,library:{type:"image"}}).open().on("select",(function(a){var e,i,l,s=r.state().get("selection").first(),o=null===(e=s=s.toJSON())||void 0===e||null===(i=e.sizes)||void 0===i||null===(l=i.thumbnail)||void 0===l?void 0:l.url;void 0===o&&(o=s.url);var n=t.parent().find("img.avatar");n.show(),n.attr("src",o),n.attr("srcset",o),g.val(o),h.val(s.id)}))})),g.length&&""!==g.val()){var w=g.parent().find("img.avatar");w.attr("src",g.val()),w.attr("srcset",g.val())}""===h.val()&&h.parent().find("img.avatar").hide()}))}();
includes/class-simple-local-avatars.php CHANGED
@@ -126,9 +126,9 @@ class Simple_Local_Avatars {
126
  WP_CLI::add_command( 'simple-local-avatars migrate wp-user-avatar', array( $this, 'wp_cli_migrate_from_wp_user_avatar' ) );
127
  }
128
 
129
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
130
  add_action( 'wp_ajax_sla_clear_user_cache', array( $this, 'sla_clear_user_cache' ) );
131
 
 
132
  add_action( 'wpmu_new_blog', array( $this, 'set_defaults' ) );
133
  }
134
 
@@ -397,6 +397,12 @@ class Simple_Local_Avatars {
397
  $default = includes_url( 'images/blank.gif' );
398
  } elseif ( 'gravatar_default' === $default ) {
399
  $default = "$host/avatar/?s={$size}";
 
 
 
 
 
 
400
  } else {
401
  $default = "$host/avatar/?d=$default&amp;s={$size}";
402
  }
@@ -485,6 +491,9 @@ class Simple_Local_Avatars {
485
  'desc' => esc_html__( 'Clear cache of stored avatars', 'simple-local-avatars' ),
486
  )
487
  );
 
 
 
488
  }
489
 
490
  /**
@@ -641,12 +650,14 @@ class Simple_Local_Avatars {
641
  'i10n_SimpleLocalAvatars',
642
  array(
643
  'user_id' => $user_id,
644
- 'insertMediaTitle' => __( 'Choose an Avatar', 'simple-local-avatars' ),
645
  'insertIntoPost' => __( 'Set as avatar', 'simple-local-avatars' ),
646
  'selectCrop' => __( 'Select avatar and Crop', 'simple-local-avatars' ),
647
  'deleteNonce' => $this->remove_nonce,
 
648
  'mediaNonce' => wp_create_nonce( 'assign_simple_local_avatar_nonce' ),
649
  'migrateFromWpUserAvatarNonce' => wp_create_nonce( 'migrate_from_wp_user_avatar_nonce' ),
 
 
650
  'migrateFromWpUserAvatarSuccess' => __( 'Number of avatars successfully migrated from WP User Avatar', 'simple-local-avatars' ),
651
  'migrateFromWpUserAvatarFailure' => __( 'No avatars were migrated from WP User Avatar.', 'simple-local-avatars' ),
652
  'migrateFromWpUserAvatarProgress' => __( 'Migration in progress.', 'simple-local-avatars' ),
@@ -1170,28 +1181,6 @@ class Simple_Local_Avatars {
1170
  );
1171
  }
1172
 
1173
- /**
1174
- * Load script required for handling any actions.
1175
- */
1176
- public function admin_scripts() {
1177
- wp_enqueue_script(
1178
- 'sla_admin',
1179
- SLA_PLUGIN_URL . 'assets/js/admin.js',
1180
- [ 'jquery' ],
1181
- SLA_VERSION,
1182
- true
1183
- );
1184
-
1185
- wp_localize_script(
1186
- 'sla_admin',
1187
- 'slaAdmin',
1188
- [
1189
- 'nonce' => wp_create_nonce( 'sla_clear_cache_nonce' ),
1190
- 'error' => esc_html__( 'Something went wrong while clearing cache, please try again.', 'simple-local-avatars' ),
1191
- ]
1192
- );
1193
- }
1194
-
1195
  /**
1196
  * Clear user cache.
1197
  */
@@ -1278,8 +1267,49 @@ class Simple_Local_Avatars {
1278
  }
1279
 
1280
  /**
1281
- * Migrate the user's avatar data from WP User Avatar/ProfilePress
 
 
1282
  *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1283
  * This function creates a new option in the wp_options table to store the processed user IDs
1284
  * so that we can run this command multiple times without processing the same user over and over again.
1285
  *
@@ -1364,7 +1394,6 @@ class Simple_Local_Avatars {
1364
  }
1365
 
1366
  return $count;
1367
-
1368
  }
1369
 
1370
  /**
126
  WP_CLI::add_command( 'simple-local-avatars migrate wp-user-avatar', array( $this, 'wp_cli_migrate_from_wp_user_avatar' ) );
127
  }
128
 
 
129
  add_action( 'wp_ajax_sla_clear_user_cache', array( $this, 'sla_clear_user_cache' ) );
130
 
131
+ add_filter( 'avatar_defaults', array( $this, 'add_avatar_default_field' ) );
132
  add_action( 'wpmu_new_blog', array( $this, 'set_defaults' ) );
133
  }
134
 
397
  $default = includes_url( 'images/blank.gif' );
398
  } elseif ( 'gravatar_default' === $default ) {
399
  $default = "$host/avatar/?s={$size}";
400
+ } elseif ( 'simple_local_avatar' === $default ) {
401
+ $default = "$host/avatar/?d=$default&amp;s={$size}";
402
+ $default_avatar_id = get_option( 'simple_local_avatar_default', '' );
403
+ if ( ! empty( $default_avatar_id ) ) {
404
+ $default = wp_get_attachment_image_url( $default_avatar_id );
405
+ }
406
  } else {
407
  $default = "$host/avatar/?d=$default&amp;s={$size}";
408
  }
491
  'desc' => esc_html__( 'Clear cache of stored avatars', 'simple-local-avatars' ),
492
  )
493
  );
494
+
495
+ // Save default avatar file.
496
+ $this->save_default_avatar_file_id();
497
  }
498
 
499
  /**
650
  'i10n_SimpleLocalAvatars',
651
  array(
652
  'user_id' => $user_id,
 
653
  'insertIntoPost' => __( 'Set as avatar', 'simple-local-avatars' ),
654
  'selectCrop' => __( 'Select avatar and Crop', 'simple-local-avatars' ),
655
  'deleteNonce' => $this->remove_nonce,
656
+ 'cacheNonce' => wp_create_nonce( 'sla_clear_cache_nonce' ),
657
  'mediaNonce' => wp_create_nonce( 'assign_simple_local_avatar_nonce' ),
658
  'migrateFromWpUserAvatarNonce' => wp_create_nonce( 'migrate_from_wp_user_avatar_nonce' ),
659
+ 'clearCacheError' => esc_html__( 'Something went wrong while clearing cache, please try again.', 'simple-local-avatars' ),
660
+ 'insertMediaTitle' => esc_html__( 'Choose default avatar', 'simple-local-avatars' ),
661
  'migrateFromWpUserAvatarSuccess' => __( 'Number of avatars successfully migrated from WP User Avatar', 'simple-local-avatars' ),
662
  'migrateFromWpUserAvatarFailure' => __( 'No avatars were migrated from WP User Avatar.', 'simple-local-avatars' ),
663
  'migrateFromWpUserAvatarProgress' => __( 'Migration in progress.', 'simple-local-avatars' ),
1181
  );
1182
  }
1183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1184
  /**
1185
  * Clear user cache.
1186
  */
1267
  }
1268
 
1269
  /**
1270
+ * Add default avatar upload file field.
1271
+ *
1272
+ * @param array $defaults Default options for avatar.
1273
  *
1274
+ * @return array Default options of avatar.
1275
+ */
1276
+ public function add_avatar_default_field( $defaults ) {
1277
+ if ( ! did_action( 'wp_enqueue_media' ) ) {
1278
+ wp_enqueue_media();
1279
+ }
1280
+ $default_avatar_file_url = '';
1281
+ $default_avatar_file_id = get_option( 'simple_local_avatar_default', '' );
1282
+ if ( ! empty( $default_avatar_file_id ) ) {
1283
+ $default_avatar_file_url = wp_get_attachment_image_url( $default_avatar_file_id );
1284
+ }
1285
+ ob_start();
1286
+ ?>
1287
+ <input type="hidden" name="simple-local-avatar-file-id" id="simple-local-avatar-file-id" value="<?php echo ! empty( $default_avatar_file_id ) ? esc_attr( $default_avatar_file_id ) : ''; ?>"/>
1288
+ <input type="hidden" name="simple-local-avatar-file-url" id="simple-local-avatar-file-url" value="<?php echo ! empty( $default_avatar_file_url ) ? esc_url( $default_avatar_file_url ) : ''; ?>"/>
1289
+ <input type="button" name="simple-local-avatar" id="simple-local-avatar-default" class="button-secondary" value="<?php esc_attr_e( 'Choose Default Avatar', 'simple-local-avatar' ); ?>"/>
1290
+ <?php
1291
+ $defaults['simple_local_avatar'] = ob_get_clean();
1292
+
1293
+ return $defaults;
1294
+ }
1295
+
1296
+ /**
1297
+ * Save default avatar attachment id in option.
1298
+ */
1299
+ private function save_default_avatar_file_id() {
1300
+ global $pagenow;
1301
+
1302
+ $file_id = filter_input( INPUT_POST, 'simple-local-avatar-file-id', FILTER_SANITIZE_NUMBER_INT );
1303
+
1304
+ // check for uploaded files
1305
+ if ( 'options.php' === $pagenow && ! empty( $file_id ) ) {
1306
+ update_option( 'simple_local_avatar_default', $file_id );
1307
+ }
1308
+ }
1309
+
1310
+ /**
1311
+ * Migrate the user's avatar data from WP User Avatar/ProfilePress
1312
+ *
1313
  * This function creates a new option in the wp_options table to store the processed user IDs
1314
  * so that we can run this command multiple times without processing the same user over and over again.
1315
  *
1394
  }
1395
 
1396
  return $count;
 
1397
  }
1398
 
1399
  /**
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: avatar, gravatar, user photos, users, profile
5
  Requires at least: 4.6
6
  Tested up to: 6.0
7
  Requires PHP: 5.6
8
- Stable tag: 2.3.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -41,20 +41,26 @@ You can also use `get_simple_local_avatar()` (with the same arguments) to retrei
41
 
42
  == Changelog ==
43
 
44
- = 2.3.0 =
 
 
 
 
 
 
45
  * **Added:** Crop screen (props [@jeffpaul](https://github.com/jeffpaul), [@helen](https://github.com/helen), [@ajmaurya99](https://github.com/ajmaurya99), [@Antonio-Lagun](https://github.com/Antonio-Lagun), [@faisal-alvi](https://github.com/faisal-alvi)).
46
  * **Added:** Avatar preview for Subscribers (props [@ankitguptaindia](https://github.com/ankitguptaindia), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter)).
47
  * **Added:** More robust multisite support and shared avatar setting (props [@adamsilverstein](https://github.com/adamsilverstein), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi), [@holle75](https://github.com/holle75)).
48
  * **Added:** Settings link to plugin action links (props [@rahulsprajapati](https://github.com/rahulsprajapati), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh)).
49
- * **Added:** Dashboard setting and WP-CLI command to migrate avatars from WP User Avatars (props [@jeffpaul](https://github.com/jeffpaul), [@claytoncollie](https://github.com/claytoncollie), [@helen](https://github.com/helen), [@faisal-alvi](https://github.com/faisal-alvi)).
50
  * **Added:** Option to clear cache of user meta to remove image sizes that do not exist (props [@jeffpaul](https://github.com/jeffpaul), [@ituk](https://github.com/ituk), [@dinhtungdu](https://github.com/dinhtungdu), [@sparkbold](https://github.com/sparkbold), [@thrijith](https://github.com/thrijith)).
51
  * **Added:** Package file (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@claytoncollie](https://github.com/claytoncollie), [@cadic](https://github.com/cadic)).
52
  * **Added:** PHP Unit Tests (props [@faisal-alvi](https://github.com/faisal-alvi), [@iamdharmesh](https://github.com/iamdharmesh)).
53
  * **Added:** "No Response" GitHub Action (props [@jeffpaul](https://github.com/jeffpaul)).
54
  * **Changed:** Bump WordPress "tested up to" version to 5.9 (props [@jeffpaul](https://github.com/jeffpaul), [@ankitguptaindia](https://github.com/ankitguptaindia), [@dinhtungdu](https://github.com/dinhtungdu), [@phpbits](https://github.com/phpbits)).
55
- * **Changed:** - Bump WordPress "tested up to" version to 6.0 (props [@ajmaurya99](https://github.com/ajmaurya99) via [#110](https://github.com/10up/simple-local-avatars/pull/110)).
56
  * **Changed:** Format admin script (props [@thrijith](https://github.com/thrijith), [@dinhtungdu](https://github.com/dinhtungdu)).
57
- * **Fixed:** Media ID as string in REST API (props [@diodoe](https://github.com/), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter)).
58
  * **Fixed:** Avatar rating text is not translated properly if a user has a custom language Set (props [@ActuallyConnor](https://github.com/ActuallyConnor), [@faisal-alvi](https://github.com/faisal-alvi)).
59
  * **Security:** PHP 8 compatibility (props [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9)).
60
  * **Security:** Bump `rmccue/requests` from 1.7.0 to 1.8.0 (props [dependabot@](https://github.com/dependabot)).
5
  Requires at least: 4.6
6
  Tested up to: 6.0
7
  Requires PHP: 5.6
8
+ Stable tag: 2.4.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
41
 
42
  == Changelog ==
43
 
44
+ = 2.4.0 - 2022-05-10 =
45
+ * **Added:** Ability to set a default avatar. (props [@mehulkaklotar](https://github.com/mehulkaklotar), [@jeffpaul](https://github.com/jeffpaul), [@dinhtungdu](https://github.com/dinhtungdu), [@faisal-alvi](https://github.com/faisal-alvi) via [#96](https://github.com/10up/simple-local-avatars/pull/96)).
46
+ * **Fixed:** Correct plugin name in changelog. (props [@grappler](https://github.com/grappler), [@jeffpaul](https://github.com/jeffpaul) via [#117](https://github.com/10up/simple-local-avatars/pull/117)).
47
+ * **Fixed:** Avatar cache not being cleared. (props [@thefrosty](https://github.com/thefrosty), [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi), [@peterwilsoncc](https://github.com/peterwilsoncc) via [#118](https://github.com/10up/simple-local-avatars/pull/118) & [#120](https://github.com/10up/simple-local-avatars/pull/120)).
48
+ * **Security:** Dev dependency `@wordpress/scripts` upgraded to resolve deeper level dependency security issues. (props [@jeffpaul](https://github.com/jeffpaul), [@faisal-alvi](https://github.com/faisal-alvi), [@cadic](https://github.com/cadic) via [#119](https://github.com/10up/simple-local-avatars/pull/119)).
49
+
50
+ = 2.3.0 - 2022-04-25 =
51
  * **Added:** Crop screen (props [@jeffpaul](https://github.com/jeffpaul), [@helen](https://github.com/helen), [@ajmaurya99](https://github.com/ajmaurya99), [@Antonio-Lagun](https://github.com/Antonio-Lagun), [@faisal-alvi](https://github.com/faisal-alvi)).
52
  * **Added:** Avatar preview for Subscribers (props [@ankitguptaindia](https://github.com/ankitguptaindia), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter)).
53
  * **Added:** More robust multisite support and shared avatar setting (props [@adamsilverstein](https://github.com/adamsilverstein), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul), [@dkotter](https://github.com/dkotter), [@faisal-alvi](https://github.com/faisal-alvi), [@holle75](https://github.com/holle75)).
54
  * **Added:** Settings link to plugin action links (props [@rahulsprajapati](https://github.com/rahulsprajapati), [@jeffpaul](https://github.com/jeffpaul), [@iamdharmesh](https://github.com/iamdharmesh)).
55
+ * **Added:** Dashboard setting and WP-CLI command to migrate avatars from [WP User Avatar](https://wordpress.org/plugins/wp-user-avatar/) (props [@jeffpaul](https://github.com/jeffpaul), [@claytoncollie](https://github.com/claytoncollie), [@helen](https://github.com/helen), [@faisal-alvi](https://github.com/faisal-alvi)).
56
  * **Added:** Option to clear cache of user meta to remove image sizes that do not exist (props [@jeffpaul](https://github.com/jeffpaul), [@ituk](https://github.com/ituk), [@dinhtungdu](https://github.com/dinhtungdu), [@sparkbold](https://github.com/sparkbold), [@thrijith](https://github.com/thrijith)).
57
  * **Added:** Package file (props [@faisal-alvi](https://github.com/faisal-alvi), [@jeffpaul](https://github.com/jeffpaul), [@claytoncollie](https://github.com/claytoncollie), [@cadic](https://github.com/cadic)).
58
  * **Added:** PHP Unit Tests (props [@faisal-alvi](https://github.com/faisal-alvi), [@iamdharmesh](https://github.com/iamdharmesh)).
59
  * **Added:** "No Response" GitHub Action (props [@jeffpaul](https://github.com/jeffpaul)).
60
  * **Changed:** Bump WordPress "tested up to" version to 5.9 (props [@jeffpaul](https://github.com/jeffpaul), [@ankitguptaindia](https://github.com/ankitguptaindia), [@dinhtungdu](https://github.com/dinhtungdu), [@phpbits](https://github.com/phpbits)).
61
+ * **Changed:** Bump WordPress "tested up to" version to 6.0 (props [@ajmaurya99](https://github.com/ajmaurya99) via [#110](https://github.com/10up/simple-local-avatars/pull/110)).
62
  * **Changed:** Format admin script (props [@thrijith](https://github.com/thrijith), [@dinhtungdu](https://github.com/dinhtungdu)).
63
+ * **Fixed:** Media ID as string in REST API (props [@diodoe](https://github.com/diodoe), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter)).
64
  * **Fixed:** Avatar rating text is not translated properly if a user has a custom language Set (props [@ActuallyConnor](https://github.com/ActuallyConnor), [@faisal-alvi](https://github.com/faisal-alvi)).
65
  * **Security:** PHP 8 compatibility (props [@faisal-alvi](https://github.com/faisal-alvi), [@dkotter](https://github.com/dkotter), [@Sidsector9](https://github.com/Sidsector9)).
66
  * **Security:** Bump `rmccue/requests` from 1.7.0 to 1.8.0 (props [dependabot@](https://github.com/dependabot)).
simple-local-avatars.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Local Avatars
4
  * Plugin URI: https://10up.com/plugins/simple-local-avatars-wordpress/
5
  * Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight.
6
- * Version: 2.3.0
7
  * Requires at least: 4.6
8
  * Requires PHP: 5.6
9
  * Author: Jake Goldman, 10up
3
  * Plugin Name: Simple Local Avatars
4
  * Plugin URI: https://10up.com/plugins/simple-local-avatars-wordpress/
5
  * Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar! Simple and lightweight.
6
+ * Version: 2.4.0
7
  * Requires at least: 4.6
8
  * Requires PHP: 5.6
9
  * Author: Jake Goldman, 10up