WordPress custom widget undefined variable notice

You can you wp_parse_args to merge $instance with a default array. So, you would start you form function not with extract($instance) but with $defaults = array( ‘title’ => ‘Your title’, ‘text’ => ‘…’, ‘image_url’ => ‘…’ ‘textarea’ => ‘…’ ); $instance = wp_parse_args((array) $instance, $defaults);

Admin sometimes redirects to HTTPS

Finally, after MONTHS I was able to solve it. Just add $_SERVER[‘REQUEST_SCHEME’] = ‘http’; $_SERVER[‘SERVER_PORT’] = 80; To wp-config.php, preferably before calling wp-settings.php Thanks to Daan Meijer for this. PS: It was a server-side error, probably something to do with PHP process manager such as php-fpm or mod_php. The hosting company solved it without the … Read more

Comment WP_DEBUG in wp-config file

IMHO WP_DEBUG allows to enable display of notices during development. If you look at the core file default-constants.php you see this : if ( !defined(‘WP_DEBUG’) ) define( ‘WP_DEBUG’, false ); So I don’t see why you should set it to false again in wp-config.php. Regarding your issue just delete the line, WP_DEBUG should never be … Read more

WordPress Cron job, 302 response

The problem here is a mistake regarding how to schedule a cron event, lets begin with: wp_schedule_event(time(), ‘hourly’, ‘my_schedule_hook’, $args); wp_schedule_event(time(), ‘hourly’, ‘update_user_hours’); Here you are telling WordPress to fire the update_user_hours action/event on an hourly basis. You then hook into this to fire a callback: add_action(‘update_user_hours’, ‘do_this_hourly’); But then, instead of declaring do_this_hourly, for … Read more

How can I debug a docker container initialization?

Docker events command may help and Docker logs command can fetch logs even after the image failed to start. First start docker events in the background to see whats going on. docker events& Then run your failing docker run … command. Then you should see something like the following on screen: 2015-12-22T15:13:05.503402713+02:00 xxxxxxxacd8ca86df9eac5fd5466884c0b42a06293ccff0b5101b5987f5da07d: (from xxx/xxx:latest) … Read more

How can I find the cause of a 500 server error?

Okay, here’s what I did. If this happens, hopefully this will work favourably for you. If this is disabled by default, enable wp-debug by changing the value from false to true. Check that you have enabled WP_DEBUG_LOG and WP_LOG_DISPLAY. Try refreshing the page and see what happens. Either using WinSCP or the terminal, go to … Read more