Frontend file upload works, but I get error “Constant ABSPATH already defined”

The code requiring wp-load is within a theme template (not a plugin). Specifically, within a page-template that allows a custom post to be added/edited from the frontend. A page template should not require any explicit loading of the WordPress Core. The template itself wouldn’t load if WordPress were not already loaded. Your other errors are … Read more

Using actions, hooks and filters in a non-WordPress page

It’s catch 22 – you need WordPress to use the hook system, but init will have already fired during load (wp-settings.php to be exact). I would create a MU “Must Use” plugin (wp-content/mu-plugins/any-filename.php) for all your “outside of WordPress” functionality, with something like this at the start: if ( ! defined( ‘LOADED_EXTERNAL’ ) || ! … Read more

Error establishing a database connection – after updating DNS

A database error can occur for many reasons. It’s usually the result of an incorrect database address, username, or password. It’s likely not a timeout failure, since WordPress has a separate error for that. Here are two common issues: DB Configuration Since you have intermittent failures, this likely points to an issue with the database … Read more