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

learn more… | top users | synonyms (1)

2
votes
3answers
1k views

Not sure how to debug: 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, ...
0
votes
0answers
23 views

Tracing which wordpress php script executes specific actions

Is there any way to trace which php script in wordpress executes a specific actions ? In my case I want to trace which php file in wordpress whether a plugin script , theme script or standard ...
1
vote
3answers
90 views

get_the_content not working in loop?

I am trying to modify my loop to save post data by category. I found some code on this site that saved the post's titles based on their categories and tried to modify this to save the post's content. ...
-2
votes
1answer
38 views

True or False: Is an Apache error or PHP error the same as a WordPress error?

I am using CentOS 6; Apache 2.2.2; MySQL 5.6; PHP 5.5.31; WordPress 3.8.13 . I do not have root access to this server because it is shared. I do have FTP and SSH (with some limits to functionality). ...
12
votes
4answers
5k 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 ( ...
2
votes
4answers
1k views

How to set up plugin project with XDebug remote debugging in PhpStorm

I am looking for a detailed setup instructions for a plugin project in PhpStorm with full comfort like quick deployment to a testing site, debugging etc. I'm going to start with how our current ...
1
vote
3answers
898 views

Debugging - trying to add search box to menus

I have already asked a similar question at stackoverflow (http://stackoverflow.com/questions/22492292/add-filter-in-wordpress-how-do-i-know-if-it-is-run), but maybe that was the wrong place? As you ...
1
vote
1answer
43 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 ...
4
votes
1answer
2k views

Getting a stack trace when an error occurs?

I was told to "get a stack trace" when an error occurs in my WordPress installation. How do I do this? This is meant to be an easy place to refer others to. Please list plugins, configuration ...
5
votes
4answers
2k views

Print WordPress template filename(s) for debugging

I've taken over the maintainance of a large WP-MS powered site. The site has ~200 templates, many page specific, and with no standard naming procedure. It would save a lot of time if while surfing ...
3
votes
1answer
33 views

Where is the “ancestors” post object attribute?

I usually work with the ancestors attribute of the post object: if ( in_array( $target_id, $post->ancestors ) ) { // do whatever } But while debugging the post object I've seen that there is ...
0
votes
1answer
33 views

How to debug theme (Theme is causing pages to have no style or HTML <head> section)

I have a WordPress theme given to me by a client, so not familiar with it at all. Activating the Twenty Sixteen theme resolves the problem, so it's not a plugin but definitely the client's theme. ...
0
votes
2answers
77 views

How to utilize WP-CLI from inside WordPress, not SSH?

I'm looking for a way to test out some WP-CLI commands but from the Debug Bar Console where I normally test PHP. For cases when I don't want to switch windows to SSH, this might be a way to ...
1
vote
2answers
87 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 ...
2
votes
4answers
9k 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: ...
35
votes
16answers
4k views

How do you debug plugins?

I am pretty new to plugin authoring and was having a hard time debuging. I used lots of echo and it is sloppy and ugly. I am sure there is a better way to do this, maybe an IDE with a debugger that ...
0
votes
1answer
31 views

How can I remove text above the header? [closed]

Embarassing problem here. A while back I added a debugging statement of showing the url of the current page, but now I can't find it to remove it. I don't remember what methods/variables I used ...
0
votes
0answers
18 views

Logging error messages with error_log() and WP_DEBUG_LOG

If I use error_log( 'foo' ) in WordPress and WP_DEBUG_LOG is set to false, where does "foo" get logged to? Note that with WP_DEBUG_LOG set to true, "foo" is logged in wp-content/debug.log.
1
vote
4answers
73 views

How to see list of plugins

Is there any tool out there for seeing a list of all the loaded plugins and how much time they took to load? Looking to analyze plugins effect on my site's performance.
0
votes
0answers
15 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 ...
0
votes
1answer
113 views

Contact Form 7 before_send_mail var_dump

I've been adding some custom functionality to the hooks that contact form 7 provides and I'm just trying to post the data to an external source now. When I try to var_dump the contents of the ...
0
votes
1answer
62 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 ( ...
0
votes
1answer
263 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 ...
0
votes
1answer
21 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 ...
1
vote
1answer
35 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
0answers
32 views

Can't show debug even after modifying wp-config

I added this to my wp-config file: /** * For developers: WordPress debugging mode. * * Change this to true to enable the display of notices during development. * It is strongly recommended that ...
0
votes
1answer
44 views

Which language files are loaded?

Is there a way to print a list of the loaded language files for debugging reasons?
0
votes
0answers
41 views

Wordpress not compatible with ios9 keyboard on older ipad

I have tested latest version of wordpress with ios9 : with iphone6 it's ok but on older version like ipad mini 2 typing is extremely sluggish not only on newpost but on search field. Speed is normal ...
0
votes
3answers
5k views

Debug 500 Internal Server Error on WordPress blog

My WordPress blog is hosted on a shared webserver on Hostgator. I've been having 500 Internal Server Errors the last couple of days. I haven't installed any new plugins since the errors started ...
0
votes
1answer
9 views

Comment form Dissappeared in posts

I suddenly noticed that comments and comment form never shows up in my website's posts: Comments in page shows up. but in post there is no comment. In single.php I have the <?php ...
0
votes
2answers
46 views

how to error_log(wp_login_url())

I am trying to confirm if a filter I have applied has changed the wp_login_url to the correct address. I just want to print out the result of wp_login_url somewhere I can see it. if ( has_shortcode( ...
-2
votes
1answer
370 views

In WordPress, after installing “Pie Register” plugin, admin permission is GONE! [closed]

After installing the Pie Register plugin to my WordPress (v4.2.2) site, I found my administrator user lost all its administrative permissions. The menus for viewing and changing the site ...
2
votes
1answer
5k views

Debugging an error: wp_enqueue_style was called incorrectly

I've just uploaded a new, custom theme to find that the container is a fraction of the intended width, and the sections below the home section(this is one single page, long site utilizing ids/anchors ...
0
votes
1answer
59 views

I'm hit with: undefined constant register_sidebar. Once in debug mode? [closed]

I'm attempting to test my theme and I switched my config to debug true and I'm now hit with "Notice: Use of undefined constant register_sidebar - assumed 'register_sidebar'" I'm struggling to fix and ...
0
votes
1answer
92 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
1answer
14 views

How do I issue a warning in a wordpress plugin?

I'm trying to debugging a plug in that's misbehaving. I don't have a good setup for debugging and developing wordpress, so I just want to output the values of some variables to the rendered page. Is ...
16
votes
2answers
3k views

Does the functions.php file ever get called during an AJAX call? Debug AJAX

Trying to figure out an issue a fellow programmer is having. I was wondering if the functions.php file get called at all when you do admin side AJAX? I know that when you do an AJAX call a part of ...
3
votes
3answers
2k views

How to Debug the 'save_post' Action?

Is it possible to validate PHP code? I have a Custom Post Type (Film) with Custom Meta Boxes. Everything is working fine, I can add new Films and details to the Custom Meta Boxes. My problem is ...
0
votes
0answers
35 views

How to find the function which is outputting Array

I'm calling a plugin (Event Rocket) from a template and the output is mostly as expected but seldom the only thing that is displayed is "Array". I have consulted the plugin's makers and they have no ...
0
votes
0answers
98 views

My website is not visible to visitors?

I don't know what happened, but my website is not visible to visitors, is only visible to me if am logged in as admin. I developed a website on a page, I could see it because I was logged in, however ...
0
votes
1answer
222 views

Suddenly lots of bugs in my WP installation? [closed]

I've been using WordPress for over 4 years without any issues. But recently I get error messages from various sources (mostly plugins). As all those plugins used to work just fine until a few days ...
0
votes
0answers
28 views

Formatting wordpress debug messages

On my local PC (win 8 & IIS) when I get a wordpress debug message I get a nicely formatted table at the top of the page with a full stack trace. When I enable debugging on my linux hosting I just ...
0
votes
1answer
27 views

Method 'post_title' not found in class.

I'm running some code through phpStorm and am getting an error: Method 'post_title' not found in class. at this line: echo $post->post_title(); Is that phpStorm getting things wrong or am I ...
6
votes
2answers
4k views

Count & Display Database Queries

I'm looking for an solution how I can count and display all queries in a WordPress site. Does anybody know, if there is an good plugin? Otherwise it would be an solution to check the queries on the ...
0
votes
0answers
681 views

How can I debug the TTFB in WP?

I'm developing a WP theme, based on _s default theme with WP 4.1.1. I keep getting a TTFB(time to first byte) of 22s, consistently both on the front and back of the site, while on localhost. Here's a ...
0
votes
1answer
20 views

Plugins effecting layout & login

I've been working on this issue by myself for a week, and I feel like I'm at my wit's end. Need some advice on what to try next. The issue is that my site has the white screen of death (no login) ...
0
votes
3answers
61 views

How to dump/log default values that are passed to hooks/filter functions?

Here's a quick example of I am trying to achieve: I am using this filter: add_filter('manage_edit-member_columns', 'set_custom_edit_member_columns'); function ...
1
vote
1answer
3k views

Failing to open advanced-cache.php which is breaking Media Library

On my WordPress install, which is 3.8 and has all plugins updated, it is using Magic Fields 2 and Hypercache amongst other plugins. I can't insert images into posts because when I upload, it gives me ...
1
vote
1answer
19 views

Rendering css to screen and debug problem

i got a website here that i am building up HERE the right arrow, in chrome, is LOW as you can see here but when i debug it with the debugger and check float on/off, it comeback to the place it ...
0
votes
2answers
193 views

Using $post->post_name in body id causing error: Trying to get property of non-object

I'm getting the following error in my debug.log: PHP Notice: Trying to get property of non-object in /my-wesbite/wp-content/themes/express/header.php on line 36 This is line 36 of header.php in my ...