Error Establishing a Database Connection, but credentials are OK

You appear to be missing the wp_termmeta table, which I’m guessing was omitted from the backup. Here’s a ‘create table’ syntax for this table (you may have to tweak this depending on your MySQL version) CREATE TABLE `wp_termmeta` ( `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `term_id` bigint(20) unsigned NOT NULL DEFAULT ‘0’, `meta_key` varchar(255) COLLATE … Read more

“Undefined index” in wp-includes/media.php

For anyone else who stumbles on this problem I’ve found a possible cause. When you’re running wp_get_attachment_image_src($imageid,’full’) in your code if the $imageid you’re checking doesn’t have a ‘full’ size available you will see this error. As suggested above this particular problem could be caused by a plugin not checking for the existance of an … Read more

PHP Fatal error: Call to a member function get() on null in /wp-includes/cache.php on line 123

That line 123 references the WordPress object cache, see https://github.com/WordPress/wordpress-develop/blob/7c38750b162c784d92f54d9a36044c0f5318fe24/src/wp-includes/cache.php#L123 Sounds like you have an external object cache (Memcached, Redis, etc.) that isn’t set up properly or a plugin that wrongly modifies WordPress’ internal object cache (which is basically a no-op). This could be configured by your host too. Try disabling all plugins to see … Read more

Nginx 404, 500 errors and WordPress

Warning Before you get started, I highly recommend you to create a child theme to safely modify the current theme you’re using. That way, if you need to update your theme, your changes won’t be overwritten. Modifying your current error page If your theme already has a custom error page, look for a 404.php file … Read more

REST : how do you handle the rest_no_route error?

I dug in the codex and found some interesting functions. This is how I finally did it : function api_request($api_url = null, $params=null,$method = ‘GET’){ if (!$api_url){ return new WP_Error(‘no_api_url’,”Missing API URL”); } //Create request $request = WP_REST_Request::from_url( $api_url ); //Method $request->set_method( $method ); //params switch($method){ case ‘GET’: $request->set_query_params($params); break; case ‘POST’: $request->set_body_params($params); break; } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)