Support » Plugin: Switch Video Quality » Issue with this error: A non-numeric value…

  • Resolved kenedyt

    (@kenedyt)


    Hi, i am getting this error:
    Warning: A non-numeric value encountered in /home/marianazambrano/public_html/academia/wp-content/plugins/switch-video-quality/switch_video_quality.php on line 465

    could you please help me with this, I am using wordpress 5.3.2

    I can’t use the plugin with that erorr popping up before the video player.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author team-ok

    (@team-ok)

    Hi,
    is debug mode turned on in your wp-config.php?
    This warning shouldn’t be displayed when debug mode is disabled.
    Try setting the WP_DEBUG constant to false:
    define( 'WP_DEBUG', false );

    At line 465 there’ s a variable that could hold a non-numeric value if the height attribute of your video shortcode is non-numeric, for example if it’s ‘480px’ instead of ‘480’.
    Did you set the height attribute? Could you post your video shortcode?

    kenedyt

    (@kenedyt)

    I usd the same video shortcodeyou provide in instruction, maybe is because i am using the latest PHP version 7.3, some people talk about going back, but i can’t do that. maybe the plugin needs to be updated to have this working properly.

    Thanks!

    Plugin Author team-ok

    (@team-ok)

    I could reproduce your error: it happens when you are using a PHP version >= 7.1, have WP debug mode turned on and copy the shortcode from my instruction straight into the wordpress editor.
    There’s something wrong with the formatting of the quotation marks in my instruction:
    [video width=”1024″ height=”576″] should really be [video width="1024" height="576"] (compare the quotation marks).
    Because of this the width and height values are read as simple strings and not as numbers (or numeric strings), which produces a warning when the plugin tries to calculate with them.
    So as a quick solution, please use this shortcode:
    [video width="1024" height="576"]
    and the warning should disappear.
    I will soon provide an update of the plugin that includes a check if it’s really a numeric value before trying to calculate with it.
    And I will try to find out what causes this strange formatting of the quotation marks in my instruction. It’s not in my readme.txt file (this file is used to produce the instructions on wordpress.org). Maybe something wrong with the markdown.

    Plugin Author team-ok

    (@team-ok)

    I’ve updated the plugin and the shortcode example in the instructions.
    Please let me know if it solved your issue.

    Yes, thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Issue with this error: A non-numeric value…’ is closed to new replies.