OK, as far as I understand, you’ve put this code:
$debug_log = "DEBUG-debug log";
trigger_error($debug_log);
//OR
error_log($debug_log);
directly in your functions
php` file.
It means, that this code will be executed (so new log item will be added to log file) every time the functions.php
file is loaded – so during every request to your WP.
It means, that every time someone views your page, there will be new log item added.
But… That’s not all… If you’re logged in, then WP sends Heartbeat requests. They will also result in new log items.
There are not so many log items logged with the same time in your log, so IMHO it’s unlikely that they are printed in the same request.
PS. JS won’t be executed during AJAX calls, so you won’t see them multiple times.
Related Posts:
- “Undefined index” error when saving empty array with checkboxes
- error_log() output for print_r() appearing on page
- Does the debug.log do log rotation?
- Utilize WP-CLI from inside WordPress, not SSH
- error_log is not working as expected in functions.php file
- Preferred Method of debugging a wordpress SQL calls?
- How to find error in my code when the error message is pointing to WP core file?
- XAMPP-VM Mac OS Mojave wordpress debugging using XDebug
- Getting a WordPress Debug Strategy
- Hooks for post saving make a post-new.php to load latest post’s data
- File is executed twice if plugin is activating
- How to display only specific Error types in debug.log? No notices, warnings, etc
- How to identify which php file a plugin is using on page load?
- Notice: Undefined index: post_title error
- How to send logs to plugin owner for a plugin?
- I’m writing my first plugin and my echo output is showing up on every page of my wordpress installation
- Accessing Variables Used In a Plugin Using PHPStorm + XDebug
- send popup after wp_redirect()
- WordPress – Get Posts with Category data
- no_rest_route error on custom routes
- Add a custom WooCommerce settings tab with sections
- Flatten Responses returned via WP REST API via WP_Error for obfuscation
- Publish button now showing content after saving
- How to use wp_send_json() and output the value with ajax?
- How does add_option() function enable action hooks to fire right after actiavtion?
- How to correctly escape an echo
- PHP using external anonymous function inside class
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- Is it possible to access admin-ajax.php using PHP?
- Payment field disappears on custom Paypal plugin
- Call to “admin_notices” hook from a static method
- How to Create custom block for displaying information in content section which act like shortcode
- Using ACF Relationship field to set post type to draft or published status
- Adding image upload in tag section – WordPress plugin development
- How to detect and handle the time difference between server and user in WordPress?
- Create plugin with custom page and template caused an error `Call to undefined function get_header()`
- How to Remove Theme Style CSS inside Custom Plugin?
- WordPress can’t use ZipArchive
- How to setup the Email piping in WordPress plugin?
- Create ACF Checkbox to get all ACF Values from Parent Page
- Settings API form – submit with AJAX
- How to extend SelectControl with data from my theme
- How to change basename url for wp-admin?
- Post form – AJAX won’t upload featured image – Plugin development
- Creating plugin with front-end pages
- How to Send Pingbacks for all Posts in WordPress?
- Reliable way to add nonce to HTTP Header in WordPress?
- I am having errors with checkout on wordpress
- Only the first image uploads
- Getting an error when my plugin is updated, but the files update correctly
- WordPress loading progess – wp-blog-header.php
- Creating a POP Alert
- Add Pre-Defined Value to Click Counter in WordPress
- Illegal string offset checkbox
- var_dump() and print_r() display null in php
- Fatal error: wp-settings.php on line 199
- ssl redirect function is not working
- product_type_options get saved value [closed]
- Custom plugin: how do I call a PHP file if settings option is set to true?
- Plugin won’t output characters with diacritics properly
- error log is going to the wrong location, WP_DEBUG_LOG is ignored
- Trying to use a variable to set image width
- How can i avoid duplicate same post in wp?
- Drop down question
- Display a custom name when the user has no name settle in his account
- wp_update_post gives 500 internal error
- WP Hook Before a post is created
- WordPress Plugin Development – get_option error
- how to add new PHP page in WordPress plugin
- How do I disable cache for a certain page?
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- code that I can run, or a plug in to show what sql tables something pulls information from
- Automatic email message after manual user approval
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Submit remote form to wordpress REST API and save data to custom post type
- How to check if plugin update process completed in wordpress?
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- How do I specify where to save the debug.log?
- ACF relationship on user profile page used for allowed access
- dashboard widget form not submit mails
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Looping through and combining calls to Woocommerce REST API
- Should I use wp_cache in my plugin to make it faster?
- custom mailchimp form using HTTP API
- How to override theme’s public static function inside of a trait?
- pass datetime using wp_localize_script to frontend from settings page
- register_setting not save checkbox
- add custom metabox to media library custom widget
- using filter and hook inside class
- 400 bad request admin-ajax file upload
- Store user form submitted information in post type
- Constant expression contains invalid operations plugin class properties visibility
- How to import woocommerce custom fields data into another site?
- get Woocommerce product format json for WP_Query
- Display attached images of a page or post that are insetred using gallery
- overwrite wordpress gallery with custom gallery shortcode
- Add a custom link to each image in WordPress gallery
- Gutenberg blocks shortcodes compatibility
- Enqueue sripts and styles only if function is called