cianmm
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Polylang breaking third party AJAX requests on admin panelsHiya Chouby
I’ve done some testing, and this looks like it will work! Your if statement is successfully testing if the url is equal to the ajaxurl, and if not it doesn’t apply the changes. Alternatively, if it does, it sets the polylang property on the JSON request to 1. (Of course I recommend testing this on your own environment – suffice to say that it appears to function as intended for me).
Thanks again for getting back to me so fast and being so open with working through this issue! I look forward to reaching out to our shared users and letting them know that we’ve resolved this issue.
Forum: Plugins
In reply to: [Polylang] Polylang breaking third party AJAX requests on admin panelsHi Chouby – thanks for getting back to me – I really appreciate it.
While this resolves the issue of malforming the payload, placing the pll_ajax_backend property into the request payload as a property probably isn’t the best way to resolve this issue, as some APIs (including several endpoints on ours, primarily registration for our cloud service which all users go through on onboarding for the plugin) are set to reject entire requests if they contain parameters that they don’t expect to see (we do so on these endpoints for security reasons).
I wonder if Kilbot’s solution would work a little better? Or alternatively inspecting
jqXHRto see if the url which is being hit lines up with what is returned byget_admin_url()? (We do some similar stuff in our plugin, and useget_admin_url(get_current_blog_id(), 'admin.php')to ensure that we always have the correct link, even on multisite). If it does match, then we know that the ajax request is going to wp_admin, and so should be altered.Forum: Plugins
In reply to: [Polylang] Polylang breaking third party AJAX requests on admin panelsHi – thanks for getting back to me again.
This is correct – there is no js in the downloadable plugin file – this is because we load it in remotely. The plugin PHP effectively just enqueues our remote js/css files, so you’d need to install the plugin and then make a network request (such as saving on the settings page) in order to replicate the bug.
The JS is a Backbone app. When asked to make a PATCH request, Backbone first converts the key/value pairs in the object in question to a JSON string. It then uses jQuery.ajax() to make the request.
Might a solution be to only apply prefiltering to ajax requests which have the wp admin domain as the domain name and path?
Forum: Plugins
In reply to: [Polylang] Polylang breaking third party AJAX requests on admin panelsThanks for getting back to me!
We are using Backbone, which converts values to a JSON string and then makes fairly standard jQuery ajax requests. If you’d like to check it out, you can see it happen when saving the plugin settings on our plugin.
Please let me know if I can supply any further information.
Forum: Plugins
In reply to: [Live Blogging] [Plugin: Live Blogging] Automatically add a link to tweets?Many thanks!
I appreciate your coming back a month later to help me and future people who search out.Cian
Forum: Plugins
In reply to: [Live Blogging] [Plugin: Live Blogging] Automatically add a link to tweets?Is there any chance you could elaborate on what you did to make links show up in tweets?
Thanks,
Cian