Thanks for the feedback. With the latest version, you will receive exception cases if your settings are correct. Please let us know if there are any issues.
WP Mail SMTP shows nothing in the Debug Events. So I don’t know what is causing the email to fail.
The server PHP error log looks a little different, but still no clue which snippet has problems.
I just know that one of the hundred snippets has a bug on line 35 and 36.
How can I search for the snippet that contains “$leaderdetail” in it?
What does the “77” mean in “shortcode-handler.php(77)” in the log? Sometimes the number changes:
[10-Jul-2024 16:47:05 UTC] PHP Warning: Undefined variable $leaderdetail in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(77) : eval()’d code on line 35
[10-Jul-2024 16:47:05 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(77) : eval()’d code on line 35
[10-Jul-2024 16:47:05 UTC] PHP Warning: Undefined variable $leaderdetail in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(77) : eval()’d code on line 36
[10-Jul-2024 16:47:05 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(77) : eval()’d code on line 36
[10-Jul-2024 16:47:05 UTC] PHP Warning: Undefined variable $leaderdetail in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(77) : eval()’d code on line 35
[10-Jul-2024 16:47:05 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(77) : eval()’d code on line 35
[10-Jul-2024 16:47:05 UTC] PHP Warning: Undefined variable $leaderdetail in /var/www/html/website/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(77) : eval()’d code on line 36
[10-Jul-2024 16:47:05 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(77) : eval()’d code on line 36
The PHP warning “Attempt to read property ‘ID’ on null” is likely due to the missing snippet preview draft page issue I previously mentioned. This can be resolved by deactivating and reactivating the plugin to restore the draft page for displaying the snippet preview.
Regarding line 77, this is where the catch function triggers the error when an exception occurs. However, we do not catch notice and warning errors as they do not break the execution of the code.We can consider addressing this in an upcoming release. If you want to eliminate these logs, you can set the error reporting to exclude notices and warnings. Otherwise, handling these warnings would require customization.
Being able to search to search the “PHP code” field for strings is valuable and essential.
Using phpMyAdmin with your SQL command worked. It was exactly what I needed to track and fix errors in snippets.
Can you include this type of search feature in the plugin so I don’t need to go to phpMyAdmin to do such a search?
Can you include an additional field called “Description” so we can write what and why a snippet exists?
FEATURE ONE: Snippet Search Search for values in the “PHP Code” field.
Add a Search or Tool section, and put a search form there with a result table that has the title and short_code. Something that would be easy to copy and paste to a notepad.
I am doing the following SQL search in phpMyAdmin: SELECT title, short_code FROM wp_xyz_ips_short_code WHERE content LIKE ‘%$leaderdetail%’;
FEATURE TWO: Add Description Field A place where we can write what and why a snippet exists.