kochm / wp-mendeley-plugin

WordPress plugin for showing data from Mendeley
7 stars 4 forks source link

Query/post array instead of assembled query string #4

Closed nwoetzel closed 7 years ago

nwoetzel commented 7 years ago

Thanks for the great plugin. While I was trying to understand, what is going on (looking into the 'own' type), I saw that the query strings are assembled through string concatenation with url_encode calls, and would like to suggest to use the http_build_query function for that. Also the curl_setopt with CURLOPT_POSTFIELDS accepts an array. For me that improves readability and in the future it is easier to reuse the query args and extend them as required for certain api calls. http_build_query is not compatible to php4 (requires php5)! So I am not sure how important that is for the plugin. You state that wordpress 4 is required (I cannot find the minimal php version for wordpress 4), but I think that using php4 nowadays is not recommended anyways. Thanks for considering the contribution. Some more might follow..

nwoetzel commented 7 years ago

There seem to be some problems with the current implementation, I will reopen once it is working.