Show error messages to a user when database insert fails

You should not use the $errors globally, but use hooks in WordPress development. Since you are new to WP development, I will explain briefly how it works. What you should do instead: make a new hook, or use an existing one which you call at the location you want this error to appear in your … Read more

WordPress website dont load CSS, JS and images

Since the problem is not easily duplicated, it could be response times of your hosting place. It could also be some external javascript code required by theme or plugin not loading properly due to timeouts. You could try to see what element is causing the problem by using the Network tab of the Code Inspector … Read more

This occurs when I open admin or front on localhost

What version of WordPress are you running? Can you perhaps include the code from line 252 of that file? If it’s a current installation of WordPress, then it’s this: /** * @since 1.2.0 */ if ( !defined(‘COOKIEPATH’) ) define(‘COOKIEPATH’, preg_replace(‘|https?://[^/]+|i’, ”, get_option(‘home’) . “https://wordpress.stackexchange.com/” ) ); … And I can’t really see why that all … Read more

Undefined index when saved to options

though i am specifying it. You’re not actually specifying it. You’re trying to use it in your regex and THEN you specified it. You can’t use it in your “if” criteria when if it doesn’t exist. You need to check to see if it exists first. The following would set your value if it is … Read more

Cannot modify header information – headers already sent during plugin activation

Since the standard redirection works, I figured the conflict must be with TGM plugin activation already hooking to activated_plugin and producing output and thus preventing the redirect… Therefore the solution was to ensure that the plugin activation function hook was added to an earlier priority than the (silent) default of 10 most probably used by … Read more

how do i fix these errors my debug log gave me?

It looks like the theme you are using multinews is using deprecated functions for your version of PHP. See if you can get an updated copy of the theme from the theme author or downgrade your PHP version to pre 7.2 EDIT: Request to edit code. You can update the code by navigating to the … Read more