Questions tagged [debug]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
15 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
25 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
26 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
14 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
19 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
18 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
10 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
46 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
25 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
23 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
683 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
97 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
79 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
76 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
219 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
458 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
80 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
46 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
49 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
156 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
64 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 ...
0
votes
0answers
136 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
210 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
384 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
259 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
343 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
983 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
38 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 ...
0
votes
1answer
524 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
70 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
20 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
386 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
268 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
4k 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
577 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
138 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 ...
0
votes
0answers
91 views

SyntaxError: unterminated string literal - if Wordpress Debug in wp-config is set to true

To clear up my notices in my Wordpress Shop (with Woocommerce) i set WP_DEBUG to true in my Wordpress wp-config file define('WP_DEBUG', true); Now im getting the following error in my firebug ...
3
votes
2answers
5k views

error_log() output for print_r() appearing on page

I am trying to debug a plugin and am using error_log() in various places to see what various things are. I am using the following: error_log( print_r( $variable ) ); When I look at debug.log, all I ...
0
votes
2answers
124 views

Hooks for post saving make a post-new.php to load latest post's data

In my plugin I'm using add_filter('wp_insert_post_data','filter_blog_post_data'); for filtering blog data before it gets saved in the database. However this hook makes post-new.php to load latest ...
1
vote
2answers
523 views

how to trace notice warning on core function is_page() & is_singular in class-wp-query.php

I’m getting overrun with these on my production site: PHP Notice: Trying to get property of non-object in /public_html/wp-includes/class-wp-query.php on line 3728 PHP Notice: Trying to get property ...
0
votes
1answer
1k views

Move product attributes after summary on single product page

I must say i don't know coding or programming. I did copy paste this code, inside my functions and it is working perfect. The code shows all the woocommerce product attributes after the product ...
0
votes
0answers
32 views

Debugging Mysterious PHP Addition

I am running a current version of Wordpress using a custom Roots/Sage theme. The other day in production, a full line of PHP containing move_uploaded_file was inserted to the top of lib/customizer....
0
votes
1answer
39 views

What is the correct entry point for capturing coverage data

I am on a mission to find out which plugins are used on a large wordpress installation. Furthermore i need to find out which parts of which plugin is used exactly. So i decided to record some code ...
0
votes
1answer
451 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?
0
votes
0answers
91 views

Debug WordPress gettext function

The gettex function: ('__') receives the original string, in spite of the fact that the po file has the translation of the string. It happens accidentally. Is there any method to find out the error?