In which functions.php file am I supposed to drop an include
statement, so that the Hello World shortcode plugin is ‘executable’?
None. You don’t do this. The file with the
Plugin Name: HELLO WORLD PLUGIN comment is your main plugin file. To load it you activate the plugin in Plugins. This is all described clearly in the Plugin Handbook:
Now that you’re editing your new plugin’s PHP file, you’ll need to add
a plugin header comment. This is a specially formatted PHP block
comment that contains metadata about the plugin, such as its name,
author, version, license, etc. The plugin header comment must comply
with the header requirements, and at the very least, contain the name
of the plugin.
Only one file in the plugin’s folder should have the header comment —
if the plugin has multiple PHP files, only one of those files should
have the header comment.
After you save the file, you should be able to see your plugin listed
in your WordPress site. Log in to your WordPress site, and click
Plugins on the left navigation pane of your WordPress Admin. This page
displays a listing of all the plugins your WordPress site has. Your
new plugin should now be in that list!
To address some of your other comments:
Furthermore, when I try to Activate my plugin, I get the following error on my WP Dashboard and on the whole damn page:
The plugin generated 213 characters of unexpected output during
activation. If you notice “headers already sent” messages, problems
with syndication feeds or other issues, try deactivating or removing
It sounds like your plugin is missing an opening PHP tag,
<?php, so when your plugin is activated the web server is loading your code as text and printing it to the browser.
if I subsequently add any code which gives an error, the page is
affected, the whole theme is affected, the whole site is affected and
even the whole WP Dashboard shows the error ! (Reminds me of Windows
3.1 when a driver error crashed the whole OS. For me, the whole WP architecture sucks but I am stuck with it.) /rant
If you write code with errors you will get errors. WordPress is not an operating system and plugins are not drivers. The same thing happens if you put bad code into a Laravel app, an Express.js app, or a million other frameworks. You are writing code that is running on the same server as WordPress. If that code has a fatal error in it then of course it’s going to affect the rest of the site. That has nothing to do with WordPress’s architecture.