• We have a lot of snippets.

    I know one has an error, but how do I find out which snippet is the one with the problem?

    [16-Jun-2024 09:21:42 UTC] PHP Warning: ?Undefined variable $correct_score in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(100) : eval()’d code on line 17

    I have no idea which snippet has $correct_score.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hello,

    Please set Enabling automatic exception handling for PHP snippets to Enable and add your email address for sending exception report.

    Hope this helps.

    Thread Starter GideonLupine

    (@gideonlupine)

    I found where to make your suggested edits. Thanks.

    Thread Starter GideonLupine

    (@gideonlupine)

    I made the changes, but I got no email.

    Could you please check your spam or junk folders, as well as any other folders where the email might have been filtered?
    If you still cannot find the email, please let us know.

    Thanks and Regards,
    Anjali

    Thread Starter GideonLupine

    (@gideonlupine)

    What would the sent from or the title be?

    I don’t see anything in SPAM.

    I do see this in my error logs:

    [19-Jun-2024 21:52:53 UTC] PHP Warning:  Undefined variable $product_id in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(100) : eval()’d code on line 24

    [19-Jun-2024 22:21:39 UTC] WordPress database error Table ‘website1_db.embed_usage_log’ doesn’t exist for query SHOW FULL COLUMNS FROM embed_usage_log made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘wp-includes/theme-compat/embed.php’), get_template_part, locate_template, load_template, require(‘wp-includes/theme-compat/embed-content.php’), do_action(’embed_content’), WP_Hook->do_action, WP_Hook->apply_filters, ep_track_embed_usage

    [19-Jun-2024 22:26:12 UTC] WordPress database error Table ‘website1_db.embed_usage_log’ doesn’t exist for query SHOW FULL COLUMNS FROM embed_usage_log made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘wp-includes/theme-compat/embed.php’), get_template_part, locate_template, load_template, require(‘wp-includes/theme-compat/embed-content.php’), do_action(’embed_content’), WP_Hook->do_action, WP_Hook->apply_filters, ep_track_embed_usage

    [19-Jun-2024 22:27:13 UTC] WordPress database error Table ‘website1_db.embed_usage_log’ doesn’t exist for query SHOW FULL COLUMNS FROM embed_usage_log made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘wp-includes/theme-compat/embed.php’), get_template_part, locate_template, load_template, require(‘wp-includes/theme-compat/embed-content.php’), do_action(’embed_content’), WP_Hook->do_action, WP_Hook->apply_filters, ep_track_embed_usage

    [19-Jun-2024 22:37:51 UTC] WordPress database error Table ‘website1_db.embed_usage_log’ doesn’t exist for query SHOW FULL COLUMNS FROM embed_usage_log made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘wp-includes/theme-compat/embed.php’), get_template_part, locate_template, load_template, require(‘wp-includes/theme-compat/embed-content.php’), do_action(’embed_content’), WP_Hook->do_action, WP_Hook->apply_filters, ep_track_embed_usage

    [19-Jun-2024 22:40:50 UTC] WordPress database error Table ‘website1_db.embed_usage_log’ doesn’t exist for query SHOW FULL COLUMNS FROM embed_usage_log made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘wp-includes/theme-compat/embed.php’), get_template_part, locate_template, load_template, require(‘wp-includes/theme-compat/embed-content.php’), do_action(’embed_content’), WP_Hook->do_action, WP_Hook->apply_filters, ep_track_embed_usage

    Hello,

    The subject/title of the email will be “Exception Report”.

    For the database error, make sure that global $wpdb; is defined in the snippet and that the
    $wpdb->prefix is added to the table name before the query is executed. Also, ensure that the table exists in the WordPress database. Similarly, ensure that $product_id is defined in the snippet code.

    Thanks and Regards,
    Anjali

    Thread Starter GideonLupine

    (@gideonlupine)

    I am not gettting any emails with the subject “Exception Report” anywhere.

    I checked my spam folder also.

    I double-checked my settings.

    I just want to be sure that this thing does not send out 1,000 emails in day or something. I am getting a lot of errors.

    It would not be doing that for each one. That would be a horror.

    Thread Starter GideonLupine

    (@gideonlupine)

    Would putting something in a text file or database table be possible? I don’t feel good about this email option.

    Could it not put something a bit more helpful in the error log? I just can’t figure out which snippet in all the snippets I have.

    [21-Jun-2024 04:28:47 UTC] PHP Warning: Attempt to read property “ID” on null in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(100) : eval()’d code on line 36
    [21-Jun-2024 04:28:47 UTC] PHP Warning: Undefined variable $leaderdetail in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(100) : eval()’d code on line 37

    Hello ,

    The warning ‘Attempt to read property “ID” on null’ is likely related to the preview page added by Insert PHP Code Snippet plugin being deleted.
    To resolve this issue, please follow these steps:
    -Check if the “Snippet Preview” page is in the trash. If it is, restore it as a draft.
    -If the “Snippet Preview” page is not in the trash, deactivate and then reactivate the Insert PHP Code Snippet plugin. This action will regenerate the “Snippet Preview” page as a draft.

    For the email related error, ensure that the WordPress email settings are correctly configured.
    By default, the WordPress mail function relies on the server’s mail configuration. Some hosting providers disable this function by default. You can contact your hosting provider’s support team to check the server settings and logs to help identify the issue. Additionally, check the server logs for any errors related to email sending, as this can provide insights into what might be going wrong.

    Alternatively, you can install an SMTP (Simple Mail Transfer Protocol) plugin, like WP Mail SMTP, to ensure that your emails are sent through a proper email server.

    Thanks and Regards,
    Anjali

    Thread Starter GideonLupine

    (@gideonlupine)

    I am using WP Mail SMTP.

    I sent a test message to verify if it is sending. It worked, and I don’t see any new errors in the WP Mail SMTP Error log that I turned on.

    I just see successful WP Mail SMTP records.

    Event #1205 Debug An email request was sent. MemberPress Pro 30 (Legacy) June 22, 2024 at 3:42 pm

    Event #1204 Debug An email request was sent. WP Mail SMTP June 22, 2024 at 3:34 pm

    Event #1203 Debug An email request was sent. WPForms June 22, 2024 at 3:26 pm

    Event #1202 Debug An email request was sent. WPForms June 22, 2024 at 3:26 pm

    Event #1201 Debug An email request was sent. Sucuri Security – Auditing, Malware Scanner and Hardening June 22, 2024 at 3:23 pm

    Event #1200 Debug An email request was sent. WP Mail SMTP June 22, 2024 at 3:10 pm

    Hi,
    We have identified that the current exception handling in “Insert PHP Code Snippet” does not handle all severity levels. We are actively working on a patch to address this issue, and it will be released by next week. Your feedback is invaluable in helping us improve our product.

    Thank you for your patience and understanding.
    Best Regards,
    Anjali

    Thread Starter GideonLupine

    (@gideonlupine)

    Thank you so much for you addressing my issue.

    I think your fix will increase the value of your product.

    Being able to track down which Snippet in a large library of snippets is generating an error is valuable.

    A person may have a large library, and then something gets depreciated or changed, and a snippet that worked before, now causes errors in the log.

    Thread Starter GideonLupine

    (@gideonlupine)

    I do have two important requests:

    One: Is there anyway to have the exception report go to a file or database table? Just something simple that can’t fail in addition to the email option?

    Two: Pick a consistent and universal name for your plugin.

    You refer to your plugin as:

    • XYZ PHP Code
    • Insert PHP Code Snippet
    • XYZ WP Insert Code Snippet
    • PHPCode Snippets
    • PHP Code Snippets
    • PHP Snippet

    The benefits of using a single consistent name are:

    • Stops copycats from stealing your brand and the trust you have built.
    • Makes it easier to find you on Google etc., and not get a copycat by accident.
    • Makes it easier to manage in admin.
    • Show off the upgrade path to the pro version more clearly.

    Hi,

    We have released the update with exception handling and your suggestion two.
    I have forwarded your request for the exception handling feature to our development team, and we will definitely consider it for future updates.

    Thanks for your continued support.
    Best Regards,
    Anjali

    Thread Starter GideonLupine

    (@gideonlupine)

    OK, I just updated your plugin.

    What do I need to do now? How does it work?

    My settings are like this. Do I need to do something?

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