Skip to content

Fix bugs preventing publishing to Minds + Fix html tag sent as thumbnail url bug

CodingNagger requested to merge live-publishing-hotfix into master

Investigated why publishing didn't work from codingnagger.com but worked from other websites.

The issue was due to the use of the add_option method was used. The WordPress documentation specifies that calling it on an existing option will not override that but my original implementation wrongly implied it would. As a result, the code refreshing the token would keep the old token. From there publishing a new entry would not work once the tokens expired.

Another issue found while investigating is that disconnecting would not clear the access and refresh tokens. Because of that, any attempt to clear credentials would not work. Would the first issue have not been found, this bug would have returned later and stronger.

Finally, it was spotted that the thumbnail was not returned correctly. A typo in the method loading a WordPress thumbnail led to using a method that would return a HTML tag where a URI was expected resulting in thumbnails not appearing on Minds.com.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • Manual testing was completed (where applicable)
  • If this contains visual fixes/improvements, screenshots are present

Merge request reports