• Resolved hudin

    (@hudin)


    My new dev server runs PHP 7.3.6 and upon firing up my site to work on, I got this warning all over the place:

    Warning: A non-numeric value encountered in [path]\wp-includes\media.php on line 648

    The cheap and dirty workaround is just commenting out line 648 in the file and the site works fine.

    //$matched = ( abs( $constrained_size[0] – $expected_size[0] ) <= 1 && abs( $constrained_size[1] – $expected_size[1] ) <= 1 );

    Can’t say I like that and any update will probably plaster over it. While just a dev server, eventually I’ll get production up to match and so has anyone found a proper solution for this?

    Cheers,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator t-p

    (@t-p)

    Have you tried:
    – If you have access to your Dashboard’s Plugins page, try deactivating ALL (yes all) plugins temporarily to see if this resolves the problem (plugin functions can interfere). If this works, re-activate them individually (one-by-one) to find the problematic plugin(s).
    – If you don’t have access to your Dashboard’s Plugins page, try manually resetting your plugins (no Dashboard access required). Here is another tutorial: http://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/ – If that resolves the issue, reactivate each one individually until you find the cause. Also remember to deactivate any plugins in the mu-plugins folder (if you have created such folder). The easiest way is to rename that folder to mu-plugins-old.
    – switching to the unedited default Theme (Twenty Nineteen, etc.) for a moment using the WP dashboard to rule out any theme-specific issue (theme functions can interfere like plugins).
    If you don’t have access to your Dashboard’s Appearance page, access your server via SFTP or FTP, or a file manager in your hosting account’s control panel (consult your hosting provider’s documentation for specifics on these), navigate to /wp-content/themes/ and rename the directory of your currently active theme. Alternately, you can remove other themes except the default theme (Twenty Nineteen, etc.). That will force your site to use it.

    Thread Starter hudin

    (@hudin)

    Ah I see, it’s just gotten stricter on lazy code. Using a bit of is_numeric() logic and not doing

    wp_get_attachment_image($attachment->ID, array(500, ”), false));

    but

    wp_get_attachment_image($attachment->ID, array(500, 0), false));

    Seems to have fixed all the issues after a quite pass. Will keep me honest now 😉

    Moderator t-p

    (@t-p)

    Glad it’s sorted 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘media.php on line 648 error’ is closed to new replies.