WPIntell

Source evidence

Double json_encode for PATCH requests

AWeber – Free Sign Up Form and Landing Page Builder Plugin for Lead Generation and Email Newsletter Growth · support · 2022-07-17T12:13:00+00:00

mixedsentiment
highseverity
0.95relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 34 rows with source links

17.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
noplanman resolved
Hi, I’m making use of the API connection in some custom code and have run into a bug. When making PATCH requests, the body is being double-encoded. This first encoding happens when preparing the request here . The double happens just before dispatching it here . (same thing for OAUTH1 here and here ) Fix is to remove the secondary json_encode in the patch() and http_patch() methods. My use-case: adding and removing tags, which requires multi-level arrays. P.S. Is the source code in a public repository and open to PRs somewhere? Hey, I have talked to the developers of the integration and it looks like that is line is something that was left in and is not used by the plugin at all. The suggested work around would be using something like $this->get_api_response($url, wp_remote_request($url, $options)); I know this is not ideal. What you could do as well is make your own integration and then make your own patch request. I hope this help but please let me know if you have any further questions. Hi Steve, Thanks for your reply. To be quite frank, I can’t understand how an official plugin from AWeber doesn’t fix a bug in their code, even if it’s not used internally. I’d expect the API provided by this plugin to be the truest reflection of the AWeber API, so that any developers who would like to create simple extensions, can use this plugin as a base. Forking for my own needs is always the last option for me, as a fix would benefit everyone! If the code were open source I’d be more than happy to make a fix. P.S. I’ve seen other plugins that use the AWeber API code that’s in this plugin, and they have the bug too… Hello again, I’m flabbergasted with the latest update to the plugin, version 7.3.3. Instead of fixing a single line of code, the decision has been made to remove parts of the API… Very sad to see how actively AWeber doesn’t want to create a developer-friendly experience here. Uninstalling now… Thank you for pointing out the unused function inside the plugin. As it was not being used by our plugin it was removed. While I understand you were attempting to use a function inside the AWeber WordPress plugin to make another plugin, that is not a supported use of our plugin. Piggybacking off the existing AWeber oauth connection inside our plugin for your own plugin is a violation of user trust and a potential security vulnerability. If you are writing a WordPress plugin, please register your own developer profile and use the credentials issued for that specific plugin so end users have a clear delineation of who’s doing what with their data. A developer profile can be created free at https://labs.aweber.com/ Docs for API functions can be found at https://api.aweber.com/ -Tom Kulzer Hi Tom, Thank you for the clear response. Since this plugin is developed by AWeber itself, I wrongly assumed it was the safest way to do this. It is very clear now that I need to develop our own integration, which I’ll go ahead and do. Armando

Comments

5 shown
steveaweber 2022-07-20T19:50:00+00:00

Hey, I have talked to the developers of the integration and it looks like that is line is something that was left in and is not used by the plugin at all. The suggested work around would be using something like $this->get_api_response($url, wp_remote_request($url, $options)); I know this is not ideal. What you could do as well is make your own integration and then make your own patch request. I hope this help but please let me know if you have any further questions.

noplanman 2022-07-20T21:00:00+00:00

Hi Steve, Thanks for your reply. To be quite frank, I can’t understand how an official plugin from AWeber doesn’t fix a bug in their code, even if it’s not used internally. I’d expect the API provided by this plugin to be the truest reflection of the AWeber API, so that any developers who would like to create simple extensions, can use this plugin as a base. Forking for my own needs is always the last option for me, as a fix would benefit everyone! If the code were open source I’d be more than happy to make a fix. P.S. I’ve seen other plugins that use the AWeber API code that’s in this plugin, and they have the bug too…

noplanman 2022-07-21T18:22:00+00:00

Hello again, I’m flabbergasted with the latest update to the plugin, version 7.3.3. Instead of fixing a single line of code, the decision has been made to remove parts of the API… Very sad to see how actively AWeber doesn’t want to create a developer-friendly experience here. Uninstalling now…

AWeber Communications, Inc. 2022-07-21T19:49:00+00:00

Thank you for pointing out the unused function inside the plugin. As it was not being used by our plugin it was removed. While I understand you were attempting to use a function inside the AWeber WordPress plugin to make another plugin, that is not a supported use of our plugin. Piggybacking off the existing AWeber oauth connection inside our plugin for your own plugin is a violation of user trust and a potential security vulnerability. If you are writing a WordPress plugin, please register your own developer profile and use the credentials issued for that specific plugin so end users have a clear delineation of who’s doing what with their data. A developer profile can be created free at https://labs.aweber.com/ Docs for API functions can be found at https://api.aweber.com/ -Tom Kulzer

noplanman 2022-07-23T01:03:00+00:00

Hi Tom, Thank you for the clear response. Since this plugin is developed by AWeber itself, I wrongly assumed it was the safest way to do this. It is very clear now that I need to develop our own integration, which I’ll go ahead and do. Armando