{"id":17895293,"date":"2024-07-17T09:48:08","date_gmt":"2024-07-17T09:48:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/admin-ajax-speed-xdebug-parameter\/"},"modified":"2024-07-17T09:48:08","modified_gmt":"2024-07-17T09:48:08","slug":"admin-ajax-speed-xdebug-parameter","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/admin-ajax-speed-xdebug-parameter\/","title":{"rendered":"Admin Ajax speed + Xdebug parameter"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hi there Daniele, two questions;<br \/><br \/>1]  When debugging some stuff on my end I noticed that DaReactions Pro is using the following;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8220;&#8216;ajax_url&#8217; =&gt; admin_url(&#8216;admin-ajax.php?XDEBUG_TRIGGER=xdebug_profile&#8217;),&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why is that? I&#8217;ve never seen an admin ajax call use it like this.<br \/>I also dont see it being used in the plugin further. Can you tell my why this is added?<br \/><br \/>2] Also for some reason DaReactions admin-ajax seems slow compared to other ajax calls.<br \/>Other ajax calls seems to take max 1.5-2 seconds. Which is not weird when looking at the installation size \/ complexity etc. <br \/><br \/>DaReactions (im using shortcode, see below) seems to take between 6-8 seconds. Which is a bit on the long side. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For reference I am using this in my templates;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php<br \/>if (is_plugin_active('da-reactions-premium\/da-reactions.php')) {<br \/>global $post;<br \/>$item_type = $post-&gt;post_type;<br \/>$item_id = $post-&gt;ID;<br \/>echo do_shortcode('&#091;reactions id=\"' . $item_id . '\" type=\"' . $item_type . '\"]');<br \/>}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the past for my own custom ajax functions I looked into shortinit and it&#8217;s options, my custom ajax calls take roughly 100-150ms. Shortly put at that point i have made possible user id and post id available and then could use $wpdb to do queries directly to the database, bypassing a lot of WordPress<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Is there something we can do to speed up the rendering of DaReactions?<br \/>I tried the Performance for local storage but im not sure that improves the situation in my case as I am using FlyingPress\/FlyingCDN for caching.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hope you can give some pointers \ud83d\ude42<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Best regards, Patrick<\/p>\n","protected":false},"template":"","class_list":["post-17895293","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17895293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17895293\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17895293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}