OK, this may sound silly, but are you sure you’re uploading the the right site and, if so, to the right place?
If you delete the plugin via FTP, does it disappear from the installed plugins list on the dashboard?
Thanks for the suggestion Steve, but yes, when I delete the plugin folder and file from the server, the plugin listing is gone from installed plugins list in the admin and pages that call the plugin via shortcode display the shortcode (which is as expected) instead of output from the plugin. Then when I upload the plugin directory and file the listing shows up, I activate the plugin and it gives me results from the old code.
I have removed any changes to functional php code from the “new” version of the plugin file, and just changed some of the outputted text, so that the only change between the two versions of the plugin is one word of echoed text that is different. The text does not show my changes, just outputting the text from the old version.
if you put a call to wp_die in your code, does execution stop? If not, then it may be that your code is not getting called.
https://codex.ww.wp.xz.cn/Function_Reference/wp_die
Alternatively, you could use error_log() after enabling wp_debug to trace execution
https://codex.ww.wp.xz.cn/WP_DEBUG
The plugin builds a form and populates a dropdown in the form with custom field values from several pages. There is a warning, when the code reaches a foreach that has no value because one page that the custom fields were on has been deleted.
Warning: Invalid argument supplied for foreach() in /home/hidden66/public_html/wordpress/wp-content/plugins/hiddenplaces-registration-form/hiddenplaces-registration-form.php on line 158
However, that is part of the reason that I am updating the plugin, in the new version of the plugin there is no longer a foreach at line 158, wordpress is referencing a line in the code that no longer exists. So clearly the system is retaining the code from the old file, but how?
As I said, put debug or die code in wp-content/plugins/hiddenplaces-registration-form/hiddenplaces-registration-form.php
For anyone else with this annoying problem:
deactivated and removed plugin from server, moved the plugin file to a new plugin directory folder with a different name, (same plugin name, same shortcode) activated plugin. Now new code being used.
No idea why WordPress was holding onto the old code, but now I don’t care because my problem is solved. Actually I do care, but I can’t spend any more time on this.
Thanks Steve for your suggestions. I did add debug code to settings which gave warning: invalid argument quoted above, and verified that the new code was not being called.