Questions tagged [wp-debug]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
165 views

Wordpress 6.x / PHP 8.x deprecated warnings in development environment

The problem: I want to run Wordpress 6.x with PHP 8.x in development mode - meaning define('WP_DEBUG', true); but Wordpress 6.x partial support for PHP 8.x throws a lot of deprecated warnings which do ...
user avatar
  • 1,018
1 vote
1 answer
40 views

How do you change error reporting to only show errors in WordPress?

I'm working on a development site that has some plugins that produce notices. It's a bit annoying during development when you only want to see the errors your own code produces. How can you turn off ...
user avatar
0 votes
1 answer
37 views

website has a bug

Wordpress website Red Bug shown in top line, I have an error message: NOTICE: wp-includes/functions.php:5313 - WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To ...
user avatar
0 votes
1 answer
87 views

There is no any line related the error but it says critical error

My website says critical error on website after add my custom code but there is no any line related my custom code in log file.There are only 2 repater lines and they are standard for my website, not ...
user avatar
1 vote
0 answers
18 views

WP_DEBUG must be on, otherwise edit post or page will show 404 error

encountered a very strange error: my WP_DEBUG must be on (set to true), otherwise editing post or page at the admin panel will show the 404 error. While the save post/page can still be seen. The ...
user avatar
0 votes
3 answers
145 views

Why does WordPress keep showing me error messages?

I'm trying to hide error messages on a WordPress installation on a shared hosting. I added the following code to my config. ini_set('display_errors','Off'); ini_set('error_reporting', E_ALL ); define('...
user avatar
1 vote
1 answer
52 views

Wordpress: Adding Security

Regarding this answer, is correct to add the file debug.log in this way? RewriteRule (?:debug|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html|log?) - [R=404,NC,L] Kind Regards
user avatar
1 vote
1 answer
620 views

WordPress customizer Preview not loading

I'm creating a WordPress website, today I have tried to add some new features but I'm not able to add because customizer live preview is not loading I have done some steps Update all theme and plugin ...
user avatar
  • 11
0 votes
1 answer
827 views

error log is going to the wrong location, WP_DEBUG_LOG is ignored

My WordPress error log is going to /var/log/php-fpm/www-error.log. That's not where I want it. In fact, it took me too long to figure that out. (I'm new to WP and PHP). I've tried to redirect it with ...
user avatar
0 votes
1 answer
806 views

How to display only specific Error types in debug.log? No notices, warnings, etc

I can't find the right way to make it work. I tried many things, like putting this in wp-config.php define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', false); define('WP_DEBUG_LOG', 'wp-content/...
user avatar
1 vote
2 answers
198 views

Wordpress not writing error.log

My local development WordPress install on ServerPress is not writing error logs. I made changes to my wp-config.php file to enable error log writing for WordPress, and also tried editing the php.ini ...
user avatar
1 vote
0 answers
87 views

PHP-FPM Wordpress Debug

Is there any way to get WP_DEBUG to log errors when running PHP-FPM? define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'SAVEQUERIES', true );
user avatar
  • 13
1 vote
1 answer
139 views

How to show the error causing the 'There has been a critical error on your website'?

I'm getting the error: 'There has been a critical error on your website. Learn more about debugging in WordPress.'. How do I display which error I'm getting in the frontend? I have these three lines ...
user avatar
  • 638
1 vote
1 answer
619 views

Wordpres debug.log PHP Notice: is_singular was called

I have started to get alot of "is_singular was called" and "is_page was called" in my debug.log [31-May-2020 12:10:27 UTC] PHP Notice: is_page was called <strong>incorrectly</strong>. ...
user avatar
  • 11
0 votes
0 answers
280 views

How do I specify where to save the debug.log?

According to the documentation cited below I should be able to add a path to save the debug.log at but it does not seem to be working for me. https://wordpress.org/support/article/debugging-in-...
user avatar
0 votes
1 answer
20 views

I have this error notice 'wp_enqueue_script was called incorrectly' in my plugin

I have read all the previous posts about this but can't seem to get my head around what is wrong with my code. This is in a plugin that I have written. I thought I had it sorted but looks like I haven'...
user avatar
  • 135
1 vote
1 answer
514 views

XAMPP-VM Mac OS Mojave wordpress debugging using XDebug

Someone please point me to a knowldge article or information on how to setup Xdebug on XAMPP-VM Mac OS in particular. The dev configuration: XAMPP-VM Mac OS Mojave 10.14.6 VScode with PHP debug ...
user avatar
  • 113
0 votes
5 answers
2k views

Warnings even when the WP_DEBUG set to false

The link https://vreqenz-stream.de/shop/ throws warning when opened on some devices and not on others. I thought it may be a cahce issue but I have cleared cache from WP-rocket and also browser. Just ...
user avatar
  • 11
0 votes
1 answer
644 views

Is it possible to enable and disable wp debug from functions.php?

I want to make 'WP_DEBUG' true or false from functions.php. Is it really possible?
user avatar
2 votes
3 answers
4k views

error_log is not working as expected in functions.php file

Error log on my index file get logged in the error_log.txt file but the same error log is not working in the functions.php file. I am using the latest WordPress and PHP 7.0. I am not using any plugin ...
user avatar
1 vote
1 answer
416 views

Same log message keeps on printing to debug.log file thousand of times

So i was debugging my PHP code while working with Wordpress site by writing to debug.log with error_log($message) or trigger_error($message). My message in these log statements keeps on printing ...
user avatar
0 votes
1 answer
482 views

Wordpress Cron job, 302 response

I am trying to debug a cron job in wordpress. It's supposed to update user hours but doesn't, and after putting some test statements in the code, I'm not too sure it's even running. I have debug ...
user avatar
  • 325
0 votes
0 answers
207 views

admin_post_(action) hook create console log error

In latest WordPress if web page has <input type="hidden" name="action" value="action_name"> input field with name=action then it create console log error. But this happen maybe 4.9.5/6. However....
user avatar
  • 400
1 vote
1 answer
91 views

List $wp_admin_bar menu items (debug)

I would like to dump the content of the $wp_admin_bar object in order to remove some menu items with the remove_menu() method. What is the suggested way to do it without printing anything on the ...
user avatar
6 votes
1 answer
15k views

Debug.log file is never created?

It's the first I have seen this. In a project I'm working on, I tried to switch on the debug mode for wordpress to see logs. Even if I activate the debug_log in wp-config.php, debug.log file is never ...
user avatar
  • 770
0 votes
0 answers
257 views

Notice: Undefined index: post_title error

This is my code: function insert_custom_post_test($args){ $args['post_content'] = ''; $args['post_status'] = 'publish'; if($args['post_title'] == 'test_title'){ // Code ...
user avatar
  • 23
1 vote
1 answer
1k views

Using debug log in production, is that a security concern?

Is having the WP_DEBUG_LOG enabled, and having a debug.log in a production environment a security issue?
user avatar
2 votes
1 answer
512 views

What does this message from WP_DEBUG mean?

I have been having server 500 errors on 3 separate WordPress websites over the last while. (The problem BTW does seems to be related to the wordpress_logged_in***** cookie because deleting that always ...
user avatar
  • 2,984
0 votes
1 answer
2k views

WordPress debug messages not displaying

WordPress is not displaying any errors / debug messages, even though I double- and triple-checked every setting. In php.ini, I have error_reporting = E_ALL & ~E_NOTICE display_errors = On ...
user avatar
  • 121
4 votes
1 answer
2k views

How to debug when error_log not working as expected

Trying to debug my development and running into a lot of frustrations with lack of output in the debug.log. For example, I have this defined in wp-config.php: define( 'WP_DEBUG', true ); define( '...
user avatar
0 votes
0 answers
1k views

Cannot read property 'hasClass' of undefined(…) jquery-ui

I have in my console informations about some problems: [screen from browser console][1] It causes that I can't quick edit my post, I can't turn on screen option in admin panel, and drag&drop ...
user avatar
  • 35
2 votes
1 answer
6k views

Inserting Post Using wp_insert_post. How to Fill Yoast Plugin SEO Fields

I am inserting posts into a database using wp_insert_post function once the post is inserted using below line of PHP $postId = wp_insert_post($array) I can insert values in my advanced custom fields ...
user avatar
7 votes
2 answers
6k views

Suppress deprecated notices

When I use: define('WP_DEBUG', 1); In my wp-config.php, it works fine, but I am hacking an old theme and I would like to suppress deprecated notices. My understanding is that adding this: ...
user avatar
3 votes
2 answers
3k views

Where should I tell WordPress where error_log messages should be written?

I have two different instances of the same server (one for development, one for deployment), built independently but basically the same (same OS, same WordPress version, same content etc.). However, ...
user avatar
  • 149
0 votes
2 answers
4k views

"Undefined index" error when saving empty array with checkboxes

In my plugin settings page, I have a list of checkboxes that store the value into an array. While the it works as expected, whenever I uncheck all of the checkboxes and save those changes I get the ...
user avatar
1 vote
3 answers
6k views

Undefined constant with debug set to true

I have used to following code to change the location of 'single' Wordpress templates. define(SINGLE_PATH, TEMPLATEPATH.'/single/'); add_filter('single_template', 'lsmwp_custom_single'); function ...
user avatar
  • 248
0 votes
0 answers
58 views

Unnessary character on post after restore

Recently i restored the wordpress post . Now I am getting so much problem with it. In post there are unknown characters like  like you can see in There are othermany such character. I actually want ...
user avatar
5 votes
3 answers
17k views

How to debug vars inside function at functions.php file?

I have this function: function wpse_210493_apply_advertising_position( &$posts, $return = false ) { $ad_posts = array(); $content_posts = array_filter( $posts, function ( ...
user avatar
  • 537
12 votes
1 answer
10k views

How to check if debug is true and can I use it for my own code? [duplicate]

I'm needing to debug one of my themes and I want to be able to switch on a debug mode so I can output more information or switch off debug mode and not see any information. I noticed there is a ...
user avatar
1 vote
1 answer
4k views

How to fix Uninitialized string offset: error on a checkbox in WP Settings API

I am trying to create an options page with a checkbox field. The checkbox is working fine but when I uncheck it and save settings, an error string shows on Notice: Uninitialized string offset: 0 in ...
user avatar
  • 101
0 votes
1 answer
52 views

Debugging conundrum with a problem fixed by enabling WP_DEBUG

I've got a site that has a plugin that causes problems with the admin-ajax.php file to have 500 internal errors when its turned on. The plugin causes this issue in the ajax file even on pages of the ...
user avatar
  • 288
0 votes
1 answer
3k views

Which language files are loaded?

Is there a way to print a list of the loaded language files for debugging reasons?
user avatar
  • 147
0 votes
2 answers
152 views

Style WP_Debug?

Is there any way to style the message delivered by wp_debug? Whenever I set WP_Debug to true, it pushes all my content down the page. While I admit it's easy to just set it back to false after using ...
user avatar
  • 1
3 votes
1 answer
3k views

Prevent wp_debug from polluting ajax within plugin

I've ran into an issue here where wp_debug notices foul up my ajax response. The codex suggests using ob_clean just before returning or echoing: To parse AJAX, WordPress must be reloaded through ...
user avatar
  • 855
0 votes
1 answer
39 views

what are WP_DEBUG conditions?

i'm trying to debug my theme using below code to find out some errors,do i need to fix all errors or is it OK when i ignore some of them? error_reporting(E_ALL); ini_set('display_errors', 1); define(...
user avatar
  • 171
0 votes
1 answer
117 views

How do I set up Debugging?

In my wp-config.php, I have: // Enable WP_DEBUG mode define('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); // Disable display of errors ...
user avatar
0 votes
1 answer
766 views

Disable Debug Log Programmatically

I'm trying to disable WP_DEBUG_LOG if and only if debug.log exists. I'd like to hook into wp_footer and test if the file exists and if so disable my debug log. All I've found though is that ...
user avatar
  • 19.7k
1 vote
0 answers
4k views

Wordress debug log is not working

I have tried all recommendations from here but none solves my issue. I have a couple of wordpress installations on a local machine running Win 7 and wamp 2.4 and none of them writes in the debug.log ...
user avatar
  • 343
0 votes
0 answers
152 views

WP Debug set to true but still wsod

I'm trying to do my first wordpress plugin, and I've added this on my wp-config.php define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); but i still have ...
user avatar
  • 103
0 votes
2 answers
5k views

Why does WP_DEBUG only work after wp_debug_mode() is called? [closed]

With debugging set to on, define('WP_DEBUG', true); my instance of WordPress doesn't show any debugging info. After a lot of searching I figured that after I call wp_debug_mode() debug info shows ...
user avatar
  • 187