{"id":312,"date":"2016-02-03T11:24:38","date_gmt":"2016-02-03T11:24:38","guid":{"rendered":"http:\/\/torben.me\/en\/?p=312"},"modified":"2016-02-03T13:14:33","modified_gmt":"2016-02-03T13:14:33","slug":"wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php","status":"publish","type":"post","link":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/","title":{"rendered":"WordPress Performance &#8211; Analyze and improve the performance of admin-ajax.php"},"content":{"rendered":"<p>WordPress provides a handy solution to do AJAX calls &#8211; the admin-ajax.php file which is located in \/wp-admin\/. Sometimes AJAX calls can bloat your website and result in loading times which aren&#8217;t funny anymore. <\/p>\n<p>You ask yourself now: How can I analyze this? How can I find the particular piece on my website which results in calling admin-ajax.php for seconds? I often read &#8220;Disable all plugins, enable one plugin and check the performance again.&#8221; Yep, that is definitely one way to start but even if you find the plugin that is responsible for calling admin-ajax.php sometimes it is not a solution to just delete the plugin. <\/p>\n<h3>The solution? Do a performance analysis with GTmetrix<\/h3>\n<p><!--more--><\/p>\n<p>I started an analysis with GTmetrix and took a look at the waterfall diagram of this service. I searched for &#8220;admin-ajax&#8221; and saw this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png\" alt=\"gt_metrix_waterfall\" width=\"1274\" height=\"293\" class=\"aligncenter size-full wp-image-301\" srcset=\"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png 1274w, https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall-300x69.png 300w, https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall-768x177.png 768w, https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall-1024x236.png 1024w\" sizes=\"auto, (max-width: 1274px) 100vw, 1274px\" \/><\/p>\n<p>You can see that the plugin AdRotate calls admin-ajax.php three times, every time with the parameter <em>adrotate_impression<\/em>. This is because I used three banners in dynamic mode on this page. The dynamic mode changes banners every few seconds even when the visitor is only reading and not navigating on the page. Three banners, three calls. The loading\/idle time is 9.95 seconds, compared to the total loading time of 17.79s, this is more than 55%!<\/p>\n<p>After I saw this, I disabled the dynamic mode in AdRotate and the loading time shrinked by 9 seconds.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress provides a handy solution to do AJAX calls &#8211; the admin-ajax.php file which is located in \/wp-admin\/. Sometimes AJAX calls can bloat your website and result in loading times which aren&#8217;t funny anymore. You ask yourself now: How can I analyze this? How can I find the particular piece on my website which results [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[11],"tags":[],"class_list":{"0":"post-312","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-wordpress-performance-en","7":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WordPress Performance - Analyze and improve the performance of admin-ajax.php - Torben Finn Tschechne<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress Performance - Analyze and improve the performance of admin-ajax.php - Torben Finn Tschechne\" \/>\n<meta property=\"og:description\" content=\"WordPress provides a handy solution to do AJAX calls &#8211; the admin-ajax.php file which is located in \/wp-admin\/. Sometimes AJAX calls can bloat your website and result in loading times which aren&#8217;t funny anymore. You ask yourself now: How can I analyze this? How can I find the particular piece on my website which results [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Torben Finn Tschechne\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/torben.tschechne\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-03T11:24:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-02-03T13:14:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png\" \/>\n<meta name=\"author\" content=\"Torben\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@elbsurfer\" \/>\n<meta name=\"twitter:site\" content=\"@elbsurfer\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Torben\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/\"},\"author\":{\"name\":\"Torben\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/#\\\/schema\\\/person\\\/b9b0dc7861e1fc933b10cf2498a78a51\"},\"headline\":\"WordPress Performance &#8211; Analyze and improve the performance of admin-ajax.php\",\"datePublished\":\"2016-02-03T11:24:38+00:00\",\"dateModified\":\"2016-02-03T13:14:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/\"},\"wordCount\":246,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/torben.me\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/gt_metrix_waterfall.png\",\"articleSection\":[\"WordPress Performance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/\",\"url\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/\",\"name\":\"WordPress Performance - Analyze and improve the performance of admin-ajax.php - Torben Finn Tschechne\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/torben.me\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/gt_metrix_waterfall.png\",\"datePublished\":\"2016-02-03T11:24:38+00:00\",\"dateModified\":\"2016-02-03T13:14:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/#\\\/schema\\\/person\\\/b9b0dc7861e1fc933b10cf2498a78a51\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/torben.me\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/gt_metrix_waterfall.png\",\"contentUrl\":\"https:\\\/\\\/torben.me\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/gt_metrix_waterfall.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/torben.me\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress Performance &#8211; Analyze and improve the performance of admin-ajax.php\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/torben.me\\\/en\\\/\",\"name\":\"Torben Finn Tschechne\",\"description\":\"Freelance Web-Developer - Hamburg, Germany\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/torben.me\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/torben.me\\\/en\\\/#\\\/schema\\\/person\\\/b9b0dc7861e1fc933b10cf2498a78a51\",\"name\":\"Torben\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ad7a32811631c7904b033b893bfe9828c6dba3132d7d39b1019b78cab2c9598?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ad7a32811631c7904b033b893bfe9828c6dba3132d7d39b1019b78cab2c9598?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4ad7a32811631c7904b033b893bfe9828c6dba3132d7d39b1019b78cab2c9598?s=96&d=mm&r=g\",\"caption\":\"Torben\"},\"url\":\"https:\\\/\\\/torben.me\\\/en\\\/author\\\/torben\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress Performance - Analyze and improve the performance of admin-ajax.php - Torben Finn Tschechne","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/","og_locale":"en_US","og_type":"article","og_title":"WordPress Performance - Analyze and improve the performance of admin-ajax.php - Torben Finn Tschechne","og_description":"WordPress provides a handy solution to do AJAX calls &#8211; the admin-ajax.php file which is located in \/wp-admin\/. Sometimes AJAX calls can bloat your website and result in loading times which aren&#8217;t funny anymore. You ask yourself now: How can I analyze this? How can I find the particular piece on my website which results [&hellip;]","og_url":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/","og_site_name":"Torben Finn Tschechne","article_publisher":"http:\/\/facebook.com\/torben.tschechne","article_published_time":"2016-02-03T11:24:38+00:00","article_modified_time":"2016-02-03T13:14:33+00:00","og_image":[{"url":"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png","type":"","width":"","height":""}],"author":"Torben","twitter_card":"summary_large_image","twitter_creator":"@elbsurfer","twitter_site":"@elbsurfer","twitter_misc":{"Written by":"Torben","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#article","isPartOf":{"@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/"},"author":{"name":"Torben","@id":"https:\/\/torben.me\/en\/#\/schema\/person\/b9b0dc7861e1fc933b10cf2498a78a51"},"headline":"WordPress Performance &#8211; Analyze and improve the performance of admin-ajax.php","datePublished":"2016-02-03T11:24:38+00:00","dateModified":"2016-02-03T13:14:33+00:00","mainEntityOfPage":{"@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/"},"wordCount":246,"commentCount":0,"image":{"@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#primaryimage"},"thumbnailUrl":"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png","articleSection":["WordPress Performance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/","url":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/","name":"WordPress Performance - Analyze and improve the performance of admin-ajax.php - Torben Finn Tschechne","isPartOf":{"@id":"https:\/\/torben.me\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#primaryimage"},"image":{"@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#primaryimage"},"thumbnailUrl":"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png","datePublished":"2016-02-03T11:24:38+00:00","dateModified":"2016-02-03T13:14:33+00:00","author":{"@id":"https:\/\/torben.me\/en\/#\/schema\/person\/b9b0dc7861e1fc933b10cf2498a78a51"},"breadcrumb":{"@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#primaryimage","url":"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png","contentUrl":"https:\/\/torben.me\/wp-content\/uploads\/2016\/02\/gt_metrix_waterfall.png"},{"@type":"BreadcrumbList","@id":"https:\/\/torben.me\/en\/wordpress-performance-analyze-and-improve-the-performance-of-admin-ajax-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/torben.me\/en\/"},{"@type":"ListItem","position":2,"name":"WordPress Performance &#8211; Analyze and improve the performance of admin-ajax.php"}]},{"@type":"WebSite","@id":"https:\/\/torben.me\/en\/#website","url":"https:\/\/torben.me\/en\/","name":"Torben Finn Tschechne","description":"Freelance Web-Developer - Hamburg, Germany","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/torben.me\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/torben.me\/en\/#\/schema\/person\/b9b0dc7861e1fc933b10cf2498a78a51","name":"Torben","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4ad7a32811631c7904b033b893bfe9828c6dba3132d7d39b1019b78cab2c9598?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4ad7a32811631c7904b033b893bfe9828c6dba3132d7d39b1019b78cab2c9598?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4ad7a32811631c7904b033b893bfe9828c6dba3132d7d39b1019b78cab2c9598?s=96&d=mm&r=g","caption":"Torben"},"url":"https:\/\/torben.me\/en\/author\/torben\/"}]}},"_links":{"self":[{"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/posts\/312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/comments?post=312"}],"version-history":[{"count":3,"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":325,"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/posts\/312\/revisions\/325"}],"wp:attachment":[{"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/media?parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/categories?post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/torben.me\/en\/wp-json\/wp\/v2\/tags?post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}