Questions tagged [debug]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
10 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 ...
4
votes
1answer
2k views

Tutorials for Unit-Testing in WordPress and for unit-test.svn.wordpress.org?

I'm starting to learn Selenium and PHPUnit and I am interested in implementing what I've learned in my WordPress projects. I've seen http://unit-test.svn.wordpress.org and wonder if there are any ...
0
votes
0answers
37 views

Only Wordpress home page not working and showing bunch of code with duplicate content [closed]

For some reason my site has just started not displaying the homepage properly. See www.tynanholmes.com and showing a heap of code. However, if I take that page and do not set it as the home (front) ...
1
vote
1answer
551 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 ...
9
votes
5answers
4k views

How to debug a plugin with Xdebug?

I was able to install and setup quite easily NetBeans 6.9.1 and Xdebug on my local environment, based on PHP 5.3.0 (XAMPP). My problem now is the following: if I put a breakpoint on Wordpress's index....
0
votes
1answer
461 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 ...
1
vote
1answer
426 views

Dumping variable in custom pre_gets_post function in functions.php, returns NULL

Problem Summary: I am using firePHP to analyze my variables in a custom function, but it does not display their contents into the console as I would expect. I also used var_dump(), it returns NULL. ...
2
votes
1answer
535 views

How to make debug.log timestamps local time?

I look at the debug.log file a lot while developing, and having all the timestamps in UTC drives me crazy! How can I get them to display in local time? I have my php.ini 'date_timezone' value set to ...
0
votes
1answer
558 views

Debugging WordPress with xDebug

Until now I was using a local WordPress project and I was able to define the xDebugger in the php.ini file, it's very useful and helpful. But now I'm connected to a remote server and I only have the ...
0
votes
0answers
9 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
775 views

(Xdebug Profiler) Why are there two cachegrind files generated for one page?

When I enable xdebug profiler, open a page in admin, it generates two cachegrind files with almost identical name cachegrind.out.1498219635_761795.crown__minilio_wp-admin_edit_php cachegrind.out....
0
votes
1answer
678 views

Changes to WordPress database using phpMyAdmin not reflected on blog

I am updating my database using the phpMyAdmin UI and the changes are not reflected on the WordPress blog. The reason for doing this is when some changes were made recently to the blog the site hanged ...
0
votes
1answer
45 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
2answers
124 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 ...
15
votes
5answers
13k views

Is it possible to change the log file location for WP_DEBUG_LOG?

I use WP_DEBUG_LOG in my development environment and have no issues with debug.log being in the wp-content directory. Sometimes I turn on WP_DEBUG in production when I need to debug something, and I ...
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
1answer
357 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
1k views

Admin sometimes redirects to HTTPS

I have multiple Wordpress installations hosted at Hostinger. Sometimes, when I save a post or, as happened right now, just tried to access wp-admin, it redirects me to HTTPS version of the website. ...
0
votes
3answers
6k 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 ( ...
2
votes
2answers
1k views

Send specific users an email when posts are published

I've got the following code, which is supposed to run when a new post is published for the first time, check if a custom field 'specific_users' has data (this uses Advanced Custom Fields), and if so, ...
1
vote
1answer
214 views

Intercepting wp_mail() to view contents

I'm looking for a way to hook into the mail function before it sends so I can var_dump the output. Are there any action hooks with the mail message that I can hook into? I'm having trouble finding the ...
1
vote
0answers
24 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
20 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
458 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 ...
12
votes
15answers
47k views

Unable to login to my wordpress site. reauth=1 redirection loop. Any ideas on how to fix this?

I am having some difficulty logging into my WordPress site. When I attempt to visit example.com/wp-admin, I see a blank page and the url bar changes to: http://example.com/wp-login.php?redirect_to=...
0
votes
0answers
73 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
46 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 ...
0
votes
1answer
67 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() ...
5
votes
3answers
456 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 ...
1
vote
1answer
313 views

How to find error in my code when the error message is pointing to WP core file?

While testing a plugin of mine with 4.5 RC of WordPress, after turning on debug in wp-config.php, I noticed an error showing up in a core WP file Notice: Trying to get property of non-object in /wp-...
0
votes
1answer
72 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
41 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
42 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
119 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
58 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
36 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
3answers
272 views

wp_enqueue_scripts not called on search page?

I've written a custom theme. It's pretty complex so I won't post a huge code block here for everyone's sanity. In my functions.php file I have the following hook being called: function ...
0
votes
2answers
2k views

How to debug php code in hostgator cPanel

I have installed wordpress in the hostgator service, but I need to write php scripts and when I run the php code if there is any error it just shows the page is not responding. So how can I debug my ...
0
votes
0answers
117 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
2answers
1k views

Preview with Custom Post Type Not Working

At this point I have tried everything I know to fix the issue. Issue: preview only works right after a custom posts is loaded or updated. If you make any changes or hit preview twice without updating ...
0
votes
1answer
181 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
359 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
220 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
306 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?
1
vote
1answer
3k 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 ...
0
votes
1answer
884 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
30 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
27 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 ...
20
votes
5answers
11k views

Define WP_DEBUG conditionally / for admins only / log errors (append query arg for all links?)

I'm developing a site on a server that the client has access to as well and what I'd like to do is show WP_DEBUG only for administrators. Referencing Yoast's article on a way around this: if ( isset($...
0
votes
0answers
64 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 ...