{"id":19034859,"date":"2026-10-02T11:45:18","date_gmt":"2026-10-02T11:45:18","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/bug-found-and-resolved\/"},"modified":"2026-10-02T11:47:57","modified_gmt":"2026-10-02T11:47:57","slug":"bug-found-and-resolved","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/bug-found-and-resolved\/","title":{"rendered":"Bug found and resolved"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello folks,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">this is a bug report, as  I couldnt find another place for this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A few days ago one of my colleagues set a focus point on one of our images located on our homepage. Suddenly the whole site broke, and exited with a HTTP 500 response and with this error:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;02-Oct-2026 09:49:41 UTC] PHP Fatal error: Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Pro\/ProPostOptions.php:108<br \/>Stack trace: 0 wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Pro\/ProPostOptions.php(108): number_format() 1 wp-includes\/class-wp-hook.php(353): WeCodePixels\\TheiaSmartThumbnails\\Pro\\ProPostOptions::attachment_fields_to_edit() 2 wp-includes\/plugin.php(206): WP_Hook-&gt;apply_filters() 3 wp-admin\/includes\/media.php(1955): apply_filters() 4 wp-includes\/media.php(4885): get_compat_media_markup() 5 &#091;internal function]: wp_prepare_attachment_for_js() 6 wp-admin\/includes\/ajax-actions.php(3126): array_map() 7 wp-includes\/class-wp-hook.php(353): wp_ajax_query_attachments() 8 wp-includes\/class-wp-hook.php(377): WP_Hook-&gt;apply_filters() 9 wp-includes\/plugin.php(523): WP_Hook-&gt;do_action() 10 wp-admin\/admin-ajax.php(192): do_action() 11 {main}<br \/><br \/>thrown in wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Pro\/ProPostOptions.php on line 108<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I was able to arrange some debug outputs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;02-Oct-2026 09:49:41 UTC] PHP Notice:  UIM-DEBUG: focus_point&#091;0] on Image-ID &#091;theiaSmartThumbnails_picker_image_77109] on Post-ID &#091;77109] with Preview-ID &#091;theiaSmartThumbnails_picker_preview_77109] at Meta-POSITION &#091;theiaSmartThumbnails_position] has VALUE &#091;0] in wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Pro\/ProPostOptions.php on line 89<br \/>&#091;02-Oct-2026 09:49:41 UTC] PHP Notice:  UIM-DEBUG: focus_point&#091;1] on Image-ID &#091;theiaSmartThumbnails_picker_image_77109] on Post-ID &#091;77109] with Preview-ID &#091;theiaSmartThumbnails_picker_preview_77109] at Meta-POSITION &#091;theiaSmartThumbnails_position] has VALUE &#091;.] in wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Pro\/ProPostOptions.php on line 93<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>So, the values of the x,y coordinates became &#8220;0&#8221; and &#8220;,&#8221;. <\/strong>I was able to quick fix the bug within two plugin files by casting the passed values to float:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ ~\/wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Frontend.php (line 37+38):<br \/><br \/>'focusPointX' =&gt; round( (float) $focusPoint&#091;0], 4 ),<br \/>'focusPointY' =&gt; round( (float) $focusPoint&#091;1], 4 )<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This solved the issue, the website showed up again without any error. The backend media screen was broken too, I fixed it with these lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ ~\/wp-content\/plugins\/theia-smart-thumbnails\/src\/WeCodePixels\/TheiaSmartThumbnails\/Pro\/ProPostOptions.php (line 96+97): <br \/><br \/>x: ' . number_format( (float) $focus_point&#091;0], 10 ) . ',<br \/>y: ' . number_format( (float) $focus_point&#091;1], 10 ) . '<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So far for my bug report, hope this helps. Versions:<br \/>WordPress: 7.1.2<br \/>Smush: 4.3.4<\/p>\n","protected":false},"template":"","class_list":["post-19034859","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19034859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19034859\/revisions"}],"predecessor-version":[{"id":19034867,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19034859\/revisions\/19034867"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19034859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}