Questions tagged [errors]

Not all errors one encounters while working with WordPress are actually caused by WP. When asking about errors be as specific as possible. Just telling which error you get, is usually not enough to help you tracking it down.

Filter by
Sorted by
Tagged with
36
votes
8answers
98k views

Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error

I refer to this question previously asked and not suitably answered: Wordpress overriding actual subdirectories and also Non "Wordpress" pages/code getting 404 error I have the same problem ...
28
votes
7answers
29k views

Add validation and error handling when saving custom fields?

I have a function that defines a custom field on a post type. Say the field is "subhead". When the post is saved, I want to do some validation on the input, and display an error message on the post ...
21
votes
5answers
42k views

Showing errors with $wpdb update

I am using $wpdb->update to update a custom table I have in my database. When I var_dump the result it returns: int(0) So I tried $wpdb->print_error() to see what's wrong. However, it shows ...
21
votes
5answers
50k views

wp_enqueue_script was called incorrectly

I don't know how but now I am getting this error : Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, ...
19
votes
1answer
25k views

Change login error messages

took a look at the questions but I couldn`t find a similar one. I need to change the custom error messages that are displayed when user tries to login with a wrong username or password. Like, change ...
16
votes
3answers
25k views

How to catch/what to do with a WP Error Object

I am running some of the WP functions directly inside a plugin, including wp_insert_post(), if something goes wrong, this returns a WP Error object, what is the correct method to catch this error? ...
15
votes
12answers
43k views

Remove type attribute from script and style tags added by WordPress

Warning: The type attribute is unnecessary for JavaScript resources. From line 10, column 146; to line 10, column 176 feed/" /> <script type="text/javascript">window ...
15
votes
10answers
52k views

An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration

I'm running WordPress on a localhost WAMP server and whenever I go to "Plugins" or "Dashboard > Updates" or even to "Dashboard" nothing loads (no WordPress news, no updates, and I'm not able to search ...
14
votes
5answers
28k views

WP_DEBUG is not set, but I'm still getting warnings

If WP_DEBUG is not set, as I understand it, you should never ever see warnings. But on some sites on some servers, I'm still seeing a few. Not all the warnings that would be displayed if WP_DEBUG was ...
13
votes
1answer
4k views

How to disable the fatal error (WSOD) protection?

The fatal error handling was introduced in WordPress 5.1 and 5.2. It's sometimes referred to as the White Screen Of Death (WSOD) protection. When working on dev/local installs, we sometimes want to ...
11
votes
3answers
16k views

Error: Declaration of MyClass::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl()

I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error: ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::...
11
votes
2answers
4k views

Should I use spl_autoload_register() in my plugin?

When I use spl_autoload_register in my plugin, I get: Fatal error: Uncaught exception 'LogicException' with message 'Class wp_atom_server could not be loaded' wp-includes\pluggable-...
10
votes
6answers
4k views

What are the best practices for updating?

Don't want to do anything to take down my blog. Here are some upgrade-related questions: How often should Wordpress be updated? What is the best way to do it? How to know if there is a problem with ...
10
votes
3answers
6k views

'Password field is empty' error when using autofill in Chrome

When I open the login screen on Chrome, the browser automatically fills the form with my username and password. However, when I hit the submit button, I get the following message: ERROR: The ...
10
votes
2answers
1k views

Is there a plugin that will override the “Error establishing a database connection” message? [closed]

My provider's database server recently had some downtime and my site was displaying the classic "Error establishing a database connection" message for about an hour. I knew what the problem was but ...
9
votes
1answer
70k views

Why $wpdb->show_errors() and print_error() is showing an output even if the query output is correct?

In order of figuring out the following issue, see https://wordpress.stackexchange.com/questions/178995/sanitize-a-working-query-string-by-using-wpdb-prepare-fails-with-mysql-db-er i ran into an rather ...
9
votes
2answers
10k views

Detecting errors generated by $wpdb->get_results()

How do I detect errors when using $wpdb->get_results()? For example: $result = $wpdb->get_results("SELECT * FROM this is not a valid query"); The preceding code doesn't generate any exceptions ...
8
votes
2answers
15k views

Error “Trying to get property of non-object” with Custom Walker for wp_nav_menu

I am trying to add some ARIA related stuff to the wp_nav_menu function. I use a custom walker class for this purpose: class Walker_Nav_Menu_With_Aria extends Walker_Nav_Menu { function ...
8
votes
5answers
17k views

How to eliminate weird 404 errors in wp-admin?

I run a WordPress site with about 70 active plugins. Every so often, I'll get a random error page ("Not Found", though I haven't checked the headers to see if it's a 404) on a /wp-admin/ ...
8
votes
2answers
9k views

Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067

Hey I get this error messages on my localhost setup, but only with the Genesis Framework enabled; WordPress Twenty Eleven works fine. This happens when I want to create a new post. If I refresh the ...
8
votes
1answer
2k views

Why do I get the timeout warning?

I turned on debug mode in WordPress and the first request of the day I get this error: Warning: http_request() [function.http-request]: Timeout was reached; Operation timed out after 1000 ...
8
votes
2answers
1k views

Loading external page template and enqueue script from plugin causes 403 forbidden error

I have a plugin, which creates a panel on following page: mysite.com/wp-content/plugins/myplugin/includes/mypanel.php I want to use this panel on following page mysite.com/mypanel Solution that I ...
8
votes
3answers
4k views

How should one implement add_settings_error on custom menu pages?

The Professional WordPress Plugin Development book explains in detail how to properly use the Settings API, and it also demonstrates how to add Menus and Submenus, but unfortunately it doesn't provide ...
7
votes
2answers
21k views

Could not create directory /wp-content/upgrade/

When I try to automatically install updates to Wordpress or plugins, I receive an error: An error occurred while updating... Could not create directory .../wp-content/upgrade/... My web host ...
7
votes
3answers
9k 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 ...
7
votes
1answer
11k views

Getting the warning: Missing argument 2 for manage_posts_custom_column()?

I created a custom post type, two custom taxonomies and displayed them in the 'manage post section, but I'm getting the following warning: Warning: Missing argument 2 for ...
7
votes
1answer
6k views

Setting 404 page in Nginx

I am using this page (http://wiki.nginx.org/WordPress) to setup my WordPress on a nginx/php-fpm server. Everything is okay, except the 404 page When I request www.example.com/foo, it send me the ...
7
votes
2answers
31k views

What log files does a WordPress installation write to?

When tracking down WordPress problems, I've had a hard time finding where WordPress sends errors to. Where does WordPress send errors by default? Are there multiple files that different kinds of ...
7
votes
2answers
3k views

How to display admin error notice if settings saved succesfully?

Title sounds counter-intuitive but bear with me. :) I have options page, made with Settings API. When user enters invalid data I want to display error notice with add_settings_error() call. But! To ...
6
votes
3answers
5k views

WP-CLI - Selecting PHP version

On a development server I have a co-install of PHP 5.6 & 7; nginx is configured with PHP 5.6. When I type "wp" it returns several errors and at the end of the error is a message containing the ...
6
votes
1answer
3k views

Validation error: Extending Gutenberg gallery block

I am trying to extend the Gutenberg core/gallery block to add some new functionality to my image gallery on the frontend. I have created a separate plugin to handle this task. I have registered my ...
6
votes
3answers
9k views

Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445

After changing siteurl ,home url form database it shows 3/4 errors called Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445 Notice: Undefined index: scheme ...
6
votes
3answers
3k views

Resetting comment count

Recently, I had to move to another domain and had to recreate all my MySQL tables on the enw server. I noticed that for some posts, the number of comments is doubled. Example - http://inversekarma.in/...
6
votes
4answers
3k views

What is the best way to monitor PHP functions/executions?

I am trying to find the best way to monitor which PHP code/functions, MySQL requests and/or plugins are slowing down pages on a site. I know there are a bunch of different options out there including ...
6
votes
2answers
6k views

Notice: Use of undefined constant SCRIPT_DEBUG

I'm getting this error at the top of my wordpress site: Notice: Use of undefined constant SCRIPT_DEBUG - assumed 'SCRIPT_DEBUG' in /[wordpress path]/wp-includes/formatting.php on line 4144 No idea ...
6
votes
2answers
2k views

Customize WordPress>Error Page

Is there a way to customize the WordPress>error page template so that the user isn't shown just a blank screen with text? I'm not talking about 404, but when WordPress displays an error. I'd like to ...
6
votes
3answers
11k views

Displaying PHP Errors from admin-ajax.php

We've got some custom endpoints set up that do various things, which we access via /wp/wp-admin/admin-ajax.php?action=some_action However whenever there is an error as we're developing, such as ...
6
votes
1answer
8k views

Get error messages when $wpdb->insert() returns false?

$wpdb->insert() returns false which I've learned means that the insert failed. Now, I would like to know why it fails with the insert. According to this ticket https://core.trac.wordpress.org/...
6
votes
4answers
6k views

Uncaught ReferenceError:switchEditors is not defined

Is anyone familiar with this error? It is causing TinyMCE to break in my Wordpress theme. In console it gives me these two errors both seem to originate from wp-admin/post-new.php Uncaught ...
6
votes
1answer
3k views

Hide php Notices in Dashboard

When I program a theme, I put WP-DEBUG on. Which ensure a proper PHP code. Sadly most Plugin developers keep using non existing vars : echo $args['title']; Notice: Undefined index: title in /wp-...
6
votes
3answers
9k views

Connection lost. Saving has been disabled… (Updating Posts/Pages)

I've been developing for Wordpress for a few years now without any trouble on an old XP/WAMP development server (v1.7.4) but recently have been getting the error "Connection lost. Saving has been ...
6
votes
2answers
934 views

How to stop certain warning logging in error.log?

bbPress has an annoying error about bbp_setup_current_user was called incorrectly. bbPress topic and bbPress ticket #2412, and it looks like nothing will change to fix it. On the site we used to use ...
5
votes
4answers
57k views

Error: call_user_func_array() expects parameter 1 to be a valid callback

I have issue after upgrading my wordpress to 3.6 see below for errors which displays on wordpress admin panel not on front of website. Warning: call_user_func_array() expects parameter 1 to be a ...
5
votes
3answers
14k views

Strict Standards Error bootstrap navwalker

I am having trouble understanding this error and I've not come across it before, please could someone help? Strict Standards: Declaration of wp_bootstrap_navwalker::start_lvl() should be compatible ...
5
votes
4answers
10k views

How to work around “that email address has already been used” error?

The following error may occur if a previous registration remains pending with a conflicting email address. That email address has already been used. Please check your inbox for an activation ...
5
votes
3answers
24k views

No Error Log File, no debug info

My error when writing a plugin for uploads and yes, I can debug. But it just jumps directly from this line to destruct the end of my wp-config.php EDIT: // Enable WP_DEBUG mode define('WP_DEBUG', ...
5
votes
2answers
3k views

Debug mode shows Strict Standards

When I set WP_DEBUG to true in wp-config.php, I get to see all the strict standards and deprecated messages. I've set the error_reporting in my php.ini, ini_set() and error_reporting() to E_ERROR | ...
5
votes
1answer
903 views

$wpdb->prepare() warning in WordPress 3.5

I am receiving this warning when I try to run a database query: Warning: Missing argument 2 for wpdb::prepare() The offending query is: $result = $wpdb->get_var( $wpdb->prepare( ...
5
votes
2answers
2k views

How to use WP_Error $data argument?

The Call $error = new WP_Error( $code, $message, $data ); The Output Say I added three messages (msg A, msg B, msg C) to the code my_code and with the last message I added "Data" as $data, which ...
5
votes
4answers
33k views

Unable to locate WordPress Content directory (wp-content)

I have tried to update my plugins in wordpress-admin but for some reason i am receiving an error "Unable to locate WordPress Content directory (wp-content)" I have checked on my server and the folder ...

1
2 3 4 5
21