Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [debug]

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

1
vote
0answers
21 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
17 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
78 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
28 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
12 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
23 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
0answers
18 views

Why am i not Getting Install Prompt in PWA

I implemented PWA for my static site. service worker register successfully and my page is also working in offline as I expected but the real problem is in add to Home screen I included manifest.json ...
0
votes
1answer
25 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
449 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
48 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
27 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
25 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
47 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
52 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
35 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
57 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
93 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
283 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
120 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
170 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
596 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
23 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
275 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
48 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
24 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
0answers
6 views

Remove Double Menu in Mobile View

There is a double menu that shows up on Mobile on the following website www.plotterpro.com/newsite .... I have been attempting to hide and it just does not want to go away. I'm attaching an image ...
0
votes
1answer
19 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
13 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
0answers
272 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
119 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/...
5
votes
1answer
3k 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
446 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
112 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
88 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 ...
4
votes
2answers
3k 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
121 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 ...
0
votes
2answers
415 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
997 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
31 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
34 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
300 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
76 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?
1
vote
1answer
891 views

Debugging PHP object during Ajax call in WordPress

I'm having real trouble working on a WP plugin because I can't seem to access my PHP data to see what's going on. The plugin makes an ajax call which hangs if I put anything it doesn't like in my PHP ...
0
votes
1answer
656 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
268 views

debugging wp_cron jobs with XDebug in Eclipse

I use Eclipse for PHP Developers (Neon.3 Release (4.6.3) in case it matters) and XDebug when developing plugins/themes. It all works fine (i.e., I can set breakpoints in my plugin's code and step ...
0
votes
0answers
36 views

Plugin debugging with errors in activation routine

I'm currently developing a plugin and have the following problem. When I have errors in the activation routine of the plugin, I don't get any errors displayed (after I activated the plugin). Instead I ...
3
votes
3answers
350 views

Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?

Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB? I have two plugins both of which use Angular. One plugin (pluginA) has angular.min.js being loaded ...
2
votes
1answer
243 views

Enable/Disable WP options programmatically

o/ SO So I'm working on a plugin, that i use together with all my themes, where i have added a little option page. From my option page i would like to be able to disable stuff like WP_DEBUG, ...
0
votes
1answer
40 views

Wordpress seems broken when logged of

I'm workin on a quite simple WP site and have the following problem: When I'm logged in to my dashboard, the site works smooth and clean. As soon as I log out and try to access the site, I don't see ...