10up / simple-local-avatars

Adds an avatar upload field to user profiles. Generates requested sizes on demand just like Gravatar!
https://wordpress.org/plugins/simple-local-avatars/
GNU General Public License v2.0
217 stars 44 forks source link

Plugin crashes after update to version 2.7.2 #186

Closed Rottinator closed 1 year ago

Rottinator commented 1 year ago

Describe the bug

Hello, since we updated to version 2.7.2 of the plugin, calls to the wordpress function get_avatar crashes. The stack trace suggests that the issue happens in the simple-local-avatars plugin:

0 /wp-content/plugins/simple-local-avatars/includes/class-simple-local-avatars.php(345): array_keys(NULL)

1 /wp-content/plugins/simple-local-avatars/includes/class-simple-local-avatars.php(271): Simple_Local_Avatars->get_simple_local_avatar_url('666', 100)

2 /wp-includes/class-wp-hook.php(308): Simple_Local_Avatars->get_avatar_data(Array, '666')

3 /wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array)

4 /wp-includes/link-template.php(4340): apply_filters('pre_getavatar...', Array, '666')

5 /wp-includes/link-template.php(4200): get_avatar_data('666', Array)

6 /wp-includes/pluggable.php(2846): get_avatar_url('666', Array)

7 /path/to/my-custom-code.php(79): get_avatar('666', 50)

After i rolled back the plugin version to 2.7.1 the code worked again, so it looked like the issue came with 2.7.2

Steps to Reproduce

I am not 100% sure, if this happens for every user or just in a few cases. Maybe you can have a look at the stack trace and tell me what information you additionally need.

Screenshots, screen recording, code snippet

No response

Environment information

I think device, browser and OS is not relevant, cause the issue appears in PHP part. The issue could be reproduced on any device (Mobile, Desktop, IPhone, Windows, Chrome, Firefox etc.)

WordPress information

`

wp-core

version: 6.1.1 site_language: de_DE user_language: de_DE timezone: Europe/Berlin permalink: /%year%/%monthnum%/%postname%/ https_status: true multisite: false user_registration: 1 blog_public: 1 default_comment_status: open environment_type: production user_count: 1119 dotorg_communication: true

wp-paths-sizes

wordpress_path: /www/htdocs/w01406c6/jedi-bibliothek.de/blog wordpress_size: 130,85 MB (137206076 bytes) uploads_path: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content/uploads uploads_size: 22,85 GB (24539951407 bytes) themes_path: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content/themes themes_size: 5,73 MB (6005416 bytes) plugins_path: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content/plugins plugins_size: 49,01 MB (51387840 bytes) database_size: 371,53 MB (389579951 bytes) total_size: 23,40 GB (25124130690 bytes)

wp-active-theme

name: Poseidon Child (poseidon-child) version: 2.3.9.2 author: JBib author_website: http://example.com parent_theme: Poseidon (poseidon) theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, post-thumbnails, menus, html5, custom-background, custom-logo, custom-header, woocommerce, editor-style, customize-selective-refresh-widgets, responsive-embeds, custom-spacing, custom-line-height, editor-color-palette, poseidon-pro, themezee-breadcrumbs, themezee-mega-menu, themezee-widget-bundle, themezee-related-posts, infinite-scroll, amp, widgets theme_path: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content/themes/poseidon-child auto_update: Deaktiviert

wp-parent-theme

name: Poseidon (poseidon) version: 2.3.9 author: ThemeZee author_website: https://themezee.com/de theme_path: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content/themes/poseidon auto_update: Deaktiviert

wp-themes-inactive (3)

Twenty Twenty-One: version: 1.7, author: WordPress-Team, Automatische Aktualisierungen deaktiviert Twenty Twenty-Three: version: 1.0, author: WordPress-Team, Automatische Aktualisierungen deaktiviert Twenty Twenty-Two: version: 1.3, author: WordPress-Team, Automatische Aktualisierungen deaktiviert

wp-plugins-active (18)

Advanced Custom Fields: version: 6.0.6, author: WP Engine, Automatische Aktualisierungen deaktiviert Antispam Bee: version: 2.11.1, author: pluginkollektiv, Automatische Aktualisierungen deaktiviert BBSpoiler: version: 2.01, author: Flector, Automatische Aktualisierungen deaktiviert Contact Form 7: version: 5.7.2, author: Takayuki Miyoshi, Automatische Aktualisierungen deaktiviert Easy FancyBox: version: 1.9.5, author: RavanH, Automatische Aktualisierungen deaktiviert Enable Media Replace: version: 4.0.2, author: ShortPixel, Automatische Aktualisierungen deaktiviert JB Gutenberg Styles: version: 1.1.6, author: Jedi-Bibliothek, Automatische Aktualisierungen deaktiviert Login-Logout: version: 3.8, author: webvitaly, Automatische Aktualisierungen deaktiviert Optimize Database after Deleting Revisions: version: 5.0.110, author: CAGE Web Design | Rolf van Gelder, Eindhoven, The Netherlands, Automatische Aktualisierungen deaktiviert Poseidon Pro: version: 1.6.1, author: ThemeZee, Automatische Aktualisierungen deaktiviert Seriously Simple Podcasting: version: 2.19.1, author: Castos, Automatische Aktualisierungen deaktiviert Seriously Simple Speakers: version: 1.0.2, author: Castos, Automatische Aktualisierungen deaktiviert Seriously Simple Stats: version: 1.4.1, author: Castos, Automatische Aktualisierungen deaktiviert Simple Comment Editing: version: 2.8.0, author: DLX Plugins, Automatische Aktualisierungen deaktiviert Simple Local Avatars: version: 2.7.1, author: Jake Goldman, 10up (latest version: 2.7.2), Automatische Aktualisierungen deaktiviert WP StopSpam: version: 1.0, author: virtuaSOFT, Automatische Aktualisierungen deaktiviert WP to Twitter: version: 3.6.2, author: Joseph C Dolson, Automatische Aktualisierungen deaktiviert Yoast SEO: version: 19.14, author: Team Yoast, Automatische Aktualisierungen deaktiviert

wp-media

image_editor: WP_Image_Editor_Imagick imagick_module_version: 1687 imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org imagick_version: 3.7.0 file_uploads: File uploads is turned off post_max_size: 200M upload_max_filesize: 200M max_effective_size: 200 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 31 GB imagick::RESOURCETYPE_DISK: 1.84467440737E+19 imagick::RESOURCETYPE_FILE: 786432 imagick::RESOURCETYPE_MAP: 31 GB imagick::RESOURCETYPE_MEMORY: 16 GB imagick::RESOURCETYPE_THREAD: 1 imagemagick_file_formats: 3FR, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, JBG, JBIG, JNG, JNX, JPE, JPEG, JPG, JPS, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV gd_version: 2.2.5 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: 9.26

wp-server

server_architecture: Linux 4.15.0-197-generic x86_64 httpd_software: Apache php_version: 8.1.13 64bit php_sapi: fpm-fcgi max_input_variables: 3000 time_limit: 30 memory_limit: 256M max_input_time: 60 upload_max_filesize: 200M php_post_max_size: 200M curl_version: 7.58.0 OpenSSL/1.1.1 suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: false

wp-database

extension: mysqli server_version: 5.7.37-nmm1-log client_version: mysqlnd 8.1.13 max_allowed_packet: 67108864 max_connections: 500

wp-constants

WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content WP_PLUGIN_DIR: /www/htdocs/w01406c6/jedi-bibliothek.de/blog/wp-content/plugins WP_MEMORY_LIMIT: 40M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: false SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_ENVIRONMENT_TYPE: Nicht definiert DB_CHARSET: utf8 DB_COLLATE: undefined

wp-filesystem

wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable

`

Code of Conduct

peterwilsoncc commented 1 year ago

@faisal-alvi I did a git bisect and this looks to have been introduced in 41878022e7a02979ac76f253092b28d7a665c412.

I was able to reproduce the error on the 2021 default theme which uses avatars on the front end.

I'll set up a quick PR.

faisal-alvi commented 1 year ago

@Rottinator Thank you for reporting. This is fixed and released in v2.7.3. Please upgrade the plugin.

Rottinator commented 1 year ago

Hi, i've updated the plugin. The problem is solved. Thank you very much for this fast fix! :)