Questions tagged [debug]

Basic techniques on debugging WordPress that can assist you on first hand.

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

How to display SQL query that ran in WC_Order_Query?

Using WP_Query you can do: (new WP_Query($arguments))->request to get the raw SQL code that was executed. But how can you do this with WooCommerces WC_Order_Query or wc_get_orders?
0
votes
0answers
25 views

Huge debug.log because of “undefined offset in media.php”

Recently debug.log (WP 5.3.2) grew to 17GB because of tons of entries like this: [17-Jan-2020 16:29:01 UTC] PHP Notice: Undefined offset: 1 in /wp-includes/media.php on line 790 [17-Jan-2020 ...
1
vote
0answers
13 views

WordPress Multi-site network tab throwing 'Error too many redirect errors'

Has anyone come across this issue.. whenever I try to access the /network section of my multisites it doesn't work which just started recently. It throws a ERR_too_many_redirects error and just shows ...
0
votes
1answer
161 views

Error on add_submenu_page() declaration

Was called incorrectly. The seventh parameter passed to an add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was ...
3
votes
1answer
138 views

Does the debug.log do log rotation?

This is more like of an inquiry. So I enabled my WP_DEBUG_LOG to true. It does work though, debug.log is in my wp-content's directory. But does it also do log rotation like different file for each day?...
0
votes
0answers
37 views

How to trace errors in debug.log for WooCommerce 3.0?

I found a debug log error that states: price was called incorrectly. Product properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), ...
0
votes
0answers
15 views

Debug a WP install: how to find which functions write post updates during a process (a woocommerce checkout in my case)

I hope this question is not too broad or not the right format. But the subject at hand is one of the vaguest: debugging. For the TLDR crowd out there, the actual question is in bold in the 'What I am ...
1
vote
0answers
328 views

Error message prevents access to WP

This message appears Attempt to create object of class W3TC\DbCache_WpdbNew has been made, but file /home/***/wp-content/plugins/w3-total-cache/DbCache_WpdbNew.php doesnt exists #0 ...
0
votes
0answers
9 views

How can I crawl through every page that wordpress generates and log any php error's that popup?

I'm looking to better automate testing of WordPress sites. Is there anyway to run a php script that crawls through every page that wordpress generates and log any php errors that popup into debug.php ...
0
votes
1answer
17 views

Wordpress website working fine on localhost but not displaying front pages on webhost

The website works perfect on my localhost. I used duplicator plugin to upload it on my web-host. Database connections are established since mywebsite.com/wp-admin works perfect. I can login the ...
-2
votes
1answer
28 views

How to check whether functions is deprecated or not?

Can you please tell me if this code is up to date? Thanks in advance. function setmot_turta_notice() { if ( is_product() && has_term( array('set-turta','set-mot' ), 'product_cat' ) ) { ...
0
votes
1answer
81 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 ...
0
votes
1answer
54 views

Getting value of variable from functions.php and debugging it

I am trying to inspect a variable obtained in functions.php for debugging purposes. I am defining a variable $current_user by executing the shortcode to obtain the current logged-in user. Then I am ...
1
vote
0answers
22 views

Problem In Advance search Plugin [closed]

I write a plugin. it has the ability to filter post by category and also its subcategories. I get some error and I don't know why I get it! I commented on the errors. Could you help me? function ...
0
votes
1answer
109 views

problem with size of debug.log file

my debug.log file in wp-content size in above 4GB and have trouble with that. can I delete this file from the server? if delete debug.log file ، No problem with my site? Does everything correctly run ...
0
votes
0answers
12 views

How to debug in wordpress like we do in java in eclipse F6,F5 and F7?

I am very new to wordpress. I have always worked on Java and its related frameworks like Spring,Hibernate. I find it very difficult to understand the flow without debugging. Is there any way to debug ...
0
votes
1answer
59 views

How can I find the cause of a 500 server error?

I'm not sure if this question fits this site, since the title specifically mentions development of WordPress. Anyway, i am running a Linode Debian Stretch server that I just built. Previously, I was ...
0
votes
0answers
8 views

wp_option table breaks layout when merging CSS

When merging css files the whole layout breaks as if no css file were being called, no matter what plugin I am using for merging. After starting a fresh install and migrate data step by step I found ...
1
vote
0answers
27 views

How to debug my custom login form looping intermittently

I have a custom log in form for users of my website where they can log in then view some information that related to them. The problem is sometimes this form will loop. I will get the message "login ...
0
votes
1answer
27 views

Problem in plugin debuging in wordpress

I want to save extra user fields in custom table after user register. In my plugin I added user_register hook and I am checking this code while user register but I cannot find any errors and cannot ...
0
votes
2answers
1k views

Cannot set property 'className' of null at setThemeFromCookie

I am coding in WordPress to make a button to toggle body class from light-mode to dark-mode. i was experimenting with trying to add a cookie so that the preference is remembered for the browser. But i ...
0
votes
0answers
163 views

No debug log for WP multisite is created

Where is the debug.log file stored on multisites? I have inserted into my wp-config: define ('WP_DEBUG', true); define ('WP_DEBUG_LOG', true); define ('WP_DEBUG_DISPLAY', true); and analogous to ...
0
votes
0answers
142 views

Log with Query Monitor during AJAX

I am trying to log my own messages using Query Monitor API, which I found in the code, like \QM::info($msg), \QM::error($msg) etc. But nothing is written to the query monitor console or developer's ...
1
vote
1answer
84 views

xdebug connects but won't break in WordPress with vvv

I am using vvv for local WordPress development and cannot get xdebug to pause on breakpoints. I have ssh'ed in and set the xdebug_on command. phpinfo() shows xdebug installed and active phpinfo() ...
0
votes
2answers
420 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 ...
5
votes
3answers
460 views

Easy code troubleshooting in wordpress

Is there an easy and standard way to debug our code in wordpress plugins? I want to print some variables in a function that runs when a certain things happen. Is there a wordpress way to save this in ...
0
votes
1answer
99 views

Debugging wp_query orderby for taxonomy

I cannot seem to find where WP_Query adds the orderby clause to a SQL query. I am using this code: function wpd_team_taxonomy_queries( $query ) { if ( !is_admin() && $query->is_tax( 'team'...
0
votes
1answer
57 views

Echo Text If User Is Logged in But NOT the Author of post

i am coding a plugin, where user can subscribe to a indvidual author of post (like we do on YouTube). I want to display the subscribe link to all logged in users, but not the author of post. my ...
0
votes
0answers
57 views

Custom Code Review: non-numeric value encountered

I am getting a E_WARNING error on my child theme template for woocommerce/content-product.php Stack trace E_WARNING: A non-numeric value encountered in {closure} called at ? (?) in array_walk called ...
0
votes
1answer
211 views

What is debug.log.old? It seems to take up a lot of space

what is debug.log.old (please see attached image). It seems to take up a lot of space. Is it necessary to delete it? Or should I leave it alone? Thanks
1
vote
1answer
86 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 ...
3
votes
0answers
39 views

Is it possible to set another language for debugging messages?

The site language is defined as Hebrew. So I get translated error messages. It's a terrible thing. It is difficult to understand, it is difficult to search on Google, the directions of the text are ...
1
vote
0answers
171 views

Debugging preview not working problem

The link here is ?p=1448&preview=true Which should be redirected to the /index.php If I press that link it goes to: /?p=1429&preview_id=1429&preview_nonce=ddfbdb8ba3&_thumbnail_id=...
0
votes
1answer
239 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 ...
0
votes
0answers
439 views

Notice : Array to string conversion on array_intersect user meta

I am trying to check if two meta data has any common array values. Its returning an error Notice: Array to string conversion in functions.php on line 1026 which is $inbox = count(array_intersect($...
0
votes
1answer
315 views

WordPress database error: [Table 'wordpress.wp_transients' doesn't exist] SHOW FULL COLUMNS FROM `wp_transients`

This is the error message: WordPress database error: [Table 'wordpress.wp_transients' doesn't exist] SHOW FULL COLUMNS FROM wp_transients This error is displayed to me on every page I open and this ...
1
vote
1answer
487 views

Enable Wordpress Debug only for Admin

Is it possible to enable debug alert just for admin user? there is a way by adding a secret query in URL. But I do not want to use it. is there anyway just display debugs, for admin?
0
votes
1answer
1k views

Why debug.log doesn't work?

I used the proper way to setup Wordpress debugging: 1.) Set up the wp-config.php: define('WP_DEBUG', true); define('WP_DEBUG_LOG', true ); define('WP_DEBUG_DISPLAY', false ); @ini_set( '...
2
votes
0answers
46 views

WordPress debug.log is not updating

In my wp-config.php file: define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', true); @ini_set('display_errors',1); In my php.ini file, track errors is = Off /wp-...
1
vote
0answers
29 views

Disappearing articles, autodeleting themself?

I'm not sure what's going on. I don't post very much lately, but the first weird thing happend when an article just disappeared. Today I was moving around my wordpress site. At some point, the last ...
1
vote
1answer
642 views

How do I debug a short code?

I am trying to debug a shortcode. I have written the following function and placed in my theme's functions.php file: function michael_function_shortcode() { return 'This is the return'; } I ...
0
votes
0answers
95 views

Need Help Understanding Debug Log Errors

I have these errors in my debug.log and I'm at a loss as to how to go about fixing them. I believe they are the culprit behind one of my plugins automatically logging me out. [15-Jun-2018 14:45:13 ...
0
votes
1answer
27 views

Stylesheet is getting removed/deregistered automatically

I've put some custom code in my active child theme's functions.php. I'm trying to enqueue some style on a admin page. However, a style enqueued in admin_enqueue_scripts hook gets automatically removed ...
0
votes
1answer
22 views

How do I isolate the reason a wordpress filter is not running?

I have a wordpress filter defined in my theme's single.php: header( 'X-Filter-1: here' ); add_filter( 'the_content', function( $content ) use ( $details ) { header( 'X-Filter-2: here' ); /...
0
votes
0answers
14 views

Debug info from request handler

I'm adding custom request handler using add_action and register_rest_root. Sometimes it's hanging and I'm stuck without any output. I would like to use something like echo "Label"; to debug my code. ...
1
vote
1answer
455 views

How do I fix this 'Undefined variable:' debug message?

The code below (which I use in functions) is from https://stackoverflow.com/questions/35263445/numeric-pagination-on-my-custom-category-page, and is showing a debug message of 'Undefined variable: ...
0
votes
1answer
455 views

.PO file is found but I don't see translations: how to debug the problem?

I have installed the Stack theme, and I want to make Danish translations. I have downloaded the Stack.pot file, made the modifications I need, and uploaded them to: /wp-content/themes/stack/languages/...
6
votes
1answer
5k 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 ...
1
vote
1answer
651 views

map_meta_cap was called incorrectly error?

This is a very odd error that I haven't been able to find the underlying cause of or the solution yet. Errors showing in various places within the WP Admin; Notice: map_meta_cap was called ...
0
votes
0answers
153 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 ...