first up, many thanks to all who help out in the Civi community.
I tried upgrading from Civi 4.6.38 to 5.28.0 which failed on the queue runner screen (JS errors).
In the screenshot you can see that the path to assets includes the constant CIVICRM_PLUGIN_URL. This explains the 404 but why hasn't the value of the constant been used? This matches whats in the Apache error log:
[Thu Aug 13 15:44:56.862133 2020] [php7:warn] [pid 19200] [client 109.148.55.130:36242] PHP Warning: Use of undefined constant CIVICRM_PLUGIN_URL - assumed 'CIVICRM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 69, referer: https://example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade&reset=1 [Thu Aug 13 15:44:56.862169 2020] [php7:warn] [pid 19200] [client 109.148.55.130:36242] PHP Warning: file_get_contents(CIVICRM_PLUGIN_DIRcivicrm/extension-compatibility.json): failed to open stream: No such file or directory in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Extension/System.php on line 290, referer: https://example.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fupgrade&reset=1
You can see that file_get_contents() is also using the constant. I tailed the civi log file in ConfigAndLog/ but nothing was appended to the log file.
I've restored and tried a few upgrades to work out where the problem begins; its version 5.27.0. Version 5.26.2 is as late as I can go, I've also tried 5.27.4 hoping to pick up a fix to no avail.
I have read version-specific notes and the release notes for 5.2.7:
https://docs.civicrm.org/sysadmin/en/latest/upgrade/version-specific/
https://civicrm.org/blog/dev-team/civicrm-527-release
I have also tried a CLI db upgrade:
wp civicrm upgrade-db
PHP Warning: Use of undefined constant CIVICRM_PLUGIN_DIR - assumed 'CIVICRM_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 68
Warning: Use of undefined constant CIVICRM_PLUGIN_DIR - assumed 'CIVICRM_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 68
PHP Warning: Use of undefined constant CIVICRM_PLUGIN_URL - assumed 'CIVICRM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 69
Warning: Use of undefined constant CIVICRM_PLUGIN_URL - assumed 'CIVICRM_PLUGIN_URL' (this will throw an Error in a future version of PHP) in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress.php on line 69
PHP Warning: file_get_contents(CIVICRM_PLUGIN_DIRcivicrm/extension-compatibility.json): failed to open stream: No such file or directory in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Extension/System.php on line 290
Warning: file_get_contents(CIVICRM_PLUGIN_DIRcivicrm/extension-compatibility.json): failed to open stream: No such file or directory in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Extension/System.php on line 290
PHP Warning: file_get_contents(CIVICRM_PLUGIN_DIRcivicrm/extension-compatibility.json): failed to open stream: No such file or directory in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Extension/System.php on line 290
Warning: file_get_contents(CIVICRM_PLUGIN_DIRcivicrm/extension-compatibility.json): failed to open stream: No such file or directory in /home/user_dev/example.com/htdocs/wp-content/plugins/civicrm/civicrm/CRM/Extension/System.php on line 290
My environment is: Wordpress 5.4.2 Debian Stretch PHP 7.3
In case its helpful files are still in plugins/files/ not the newer location of uploads/
It appears as if the code in civicrm.php which sets up the defines runs too late but that seems very strange. Thanks for reading, I hope this is a well formed question, please let me know if i can improve it.