1

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?

  • 2
    Plugins can save information to the database, but the plugin itself is just the ftp files. You might try deregistering the shortcode, then re-registering it, to see if that clears it. Depending on what the shortcode does it could still be something cached - for example fetch_feed caches RSS feeds even when you clear browser, plugin, and server caches. You may need to post your plugin code if you'd like more specific tips for your particular case. – WebElaine May 17 '17 at 14:50
  • Agreed with Elaine - need to know more about what the plugin is doing to offer more ideas. Are you storing results in a transient? Could you need to deregister a cron job that is calling an archived class method? It sounds like you have tried quite a few things to resolve with no luck. – jdm2112 May 17 '17 at 14:55
  • The plugin builds a form and populates a dropdown in the form with custom field values from several pages. The relevant code segments are: – Five Carrots May 17 '17 at 16:01
  • function get_trip_dates ($id) { if (isset($id)) { $trip_dates = get_post_custom_values('trip_date', $id); return $trip_dates; } } called while building the select $trip_dates = get_circle_trip_dates(78); foreach($trip_dates as $trip_date) { echo '<option value="Antarctica - Circle: ' . $trip_date . '">Antarctica - Circle: ' . $trip_date . '</option>'; } – Five Carrots May 17 '17 at 16:15
  • Nothing is saved to the database and there is no class (I know, not best practice) it is just a simple procedural call. The code is functional, but updates to the file are not used by wordpress in the loop. That is what is mystifying me, how is the old code being retained when I am removing it from the server, it must be stored somehow in the database. I am new to wordpress and not familiar with the database schema, but my research so far does not seem to indicate that plugin code is stored in the database so I am at a loss right now. – Five Carrots May 17 '17 at 16:16
2

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 now that it is "fixed".

  • Please mark your answer as accepted if it solved your issue. Thanks. – Jack Johansson May 17 '17 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.