最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Custom plugin changes not showing

programmeradmin1浏览0评论

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?

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?

Share Improve this question asked May 17, 2017 at 14:24 Five CarrotsFive Carrots 414 bronze badges 8
  • 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 Commented May 17, 2017 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 Commented May 17, 2017 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 Commented May 17, 2017 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 Commented May 17, 2017 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 Commented May 17, 2017 at 16:16
 |  Show 3 more comments

2 Answers 2

Reset to default 3

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".

I was having the exact same issue and it turns out that I was uploading the file to the wrong folder! Don't I feel dumb!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论