• Resolved webmiorelys

    (@webmiorelys)


    Hi,
    During development phases, the WP error log shows critical information when debugging a snippet, as in:
    “[21-Jun-2024 15:53:17 UTC] PHP Warning: Undefined variable $atts in /srv/htdocs/wp-content/plugins/code-snippets-pro/php/snippet-ops.php(609) : eval()’d code on line 8”
    But this is very vague.
    Why does this not contain the snippet ID so you can instantly target the faulty snippet? Otherwise this is just like seaching for a needle in a haystack when you have multiple snippets running in parallel.

    Have I missed something? Is there a way to direct the configuration to expose the ID that is the source of the error via “$snippet_id”?
    Kindly advise.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Unfortunately, PHP is fairly limited when it comes to error messages – we’ve done our best to customise things where possible, but we can’t rewrite warning messages in this way.

    I recommend using the search feature with keywords from the error message and the @line operator to narrow things down. For example, $atts @line:8 should lead you to the snippet causing the error mentioned in your post.

    Thread Starter webmiorelys

    (@webmiorelys)

    Thanks for prompt reply. Clearly an alternative and working approach.
    Best,

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.