• innercore

    (@innercore)


    I have a custom plugin that has been working for several months and I am making some updates to it. When I upload the new plugin file via ftp, it uploads properly, I can see the file modification date changed. When I go to the page in wordpress, nothing has changed and the results are from the old plugin code. I have disabled/enabled the plugin, removed the plugin file from the server and replaced it, in both cases the page shows the shortcode while plugin disabled/removed and then goes back to the results of the old code. I have cleared caches on browser, there is no caching plugin in this wordpress install, there is no extra server caching like cloudflare, I have waited 12 hours and tried again…any thoughts? Is plugin code stored in the database and how can I clear that if it is?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    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?

    Thread Starter innercore

    (@innercore)

    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.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    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

    Thread Starter innercore

    (@innercore)

    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?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    As I said, put debug or die code in wp-content/plugins/hiddenplaces-registration-form/hiddenplaces-registration-form.php

    Thread Starter innercore

    (@innercore)

    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.

    Thread Starter innercore

    (@innercore)

    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.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom plugin code not updating’ is closed to new replies.