{"id":9508,"date":"2016-07-19T21:10:10","date_gmt":"2016-07-20T04:10:10","guid":{"rendered":"http:\/\/crimeandtheforcesofevil.com\/blog\/?p=9508"},"modified":"2016-07-21T01:14:58","modified_gmt":"2016-07-21T08:14:58","slug":"anybody-out-there-know-wordpress-internals","status":"publish","type":"post","link":"https:\/\/crimeandtheforcesofevil.com\/blog\/2016\/07\/19\/anybody-out-there-know-wordpress-internals\/","title":{"rendered":"anybody out there know wordpress internals?"},"content":{"rendered":"<p>Anybody know anything about what the comments page in the WordPress administrative interface might be doing to call <Em>into<\/eM> themes?<\/p>\n<p>I&#8217;ve been trolling through the codex for a while, but hey surprise wordpress is a big project and this is a lot of code to troll. But basically, the comments page in the administrative interface takes a <EM>very<\/em> long time to load (>20s) if my current desktop theme is in use.<\/p>\n<p>If I switch to twentysixteen (the current standard included theme), it takes very little time &#8211; basically, an immediate load. That&#8217;s changing nothing else, and it is 100% reproducible.<\/p>\n<p>My <Em>suspicion<\/eM> is that it&#8217;s running some sort of check against the comments contents and\/or metadata. I <Em>suspect<\/eM> specifically something to do with the avatars, but that&#8217;s very much a guess.<\/p>\n<p>This is 100% unrelated to my digital audio workstation woes &#8211; completely different machines &#8211; and is something that has been bugging me for a while. It started all at once, after we rebuilt the server following the hax0r last year.<\/p>\n<p>Anybody out there with knowledge? Do I get lucky?<\/p>\n<p><b>eta<\/b>: I was chatting with mpol on the wordpress IRC channel, who found something in the theme&#8217;s functions.php that I&#8217;d looked at askance before, and it&#8217;s this filter call:<\/p>\n<p><code>add_filter('get_comments_number', 'comment_count', 0);<\/code><\/p>\n<p>And if I comment that out, suddenly we behave a lot better and I don&#8217;t see a functionality loss. Anybody know what this might even be doing? It&#8217;s line 364 <a href=\"https:\/\/themes.trac.wordpress.org\/browser\/piano-black\/2.3.1\/functions.php#L364\">here<\/a>.<\/p>\n<p><b>eta2:<\/b> I know what that filter was doing now. I think without that filter their custom comments counter (which added behaviour I didn&#8217;t actually like and had worked around elsewhere) becomes redundant and I&#8217;ve commented it out entirely with no bad beahviour so far. Anyone see anything weird with comment counts?<\/p>\n<p><b>eta3:<\/b> So far this is working much better! But possibly related, and possibly not, I am still getting admin-panel connection resets at random. Reloads always work, and of course, Query Monitor is not helpful here because the reload works fine without issues or errors. All of Firefox&#8217;s explanations are wrong, and this happens under Safari too.<\/p>\n<blockquote><p><b>The connection was reset<\/b><\/p>\n<p>The connection to the server was reset while the page was loading.<\/p>\n<p>    <i>The site could be temporarily unavailable or too busy. Try again in a few moments.<\/i><\/p><\/blockquote>\n<p><b>eta4:<\/b> Many super-thanks to <a target=\"_blank\" href=\"https:\/\/twitter.com\/kirrus\">Kirrus on Twitter<\/a> who has been <a href=\"https:\/\/twitter.com\/solarbirdy\/status\/755805811415195649\">majorly helpful on this<\/a>. I&#8217;m still seeing the connection reset, but the comment issue is cleared out <Em>and<\/em> along the way, using tools he and mpol recommended, I found an assortment of bugs affecting performance in the two abandonware plugins I still run and more or less privately maintain. Also, one in my now-custom once-piano-black theme which would&#8217;ve meant White Screen of Death under PHP7. I&#8217;LL NEVER CHANGE THEMES NOW XD<\/p>\n<p><b>eta5:<\/b> For even more confusing information on the remaining problem, <a target=\"_blank\" href=\"http:\/\/solarbird.dreamwidth.org\/1454965.html\">see this entry on Dreamwidth<\/a>. Honestly, what the hell?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Anybody know anything about what the comments page in the WordPress administrative interface might be doing to call into themes? I&#8217;ve been trolling through the codex for a while, but hey surprise wordpress is a big project and this is a lot of code to troll. But basically, the comments page in the administrative interface [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-9508","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/posts\/9508","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/comments?post=9508"}],"version-history":[{"count":9,"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/posts\/9508\/revisions"}],"predecessor-version":[{"id":9534,"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/posts\/9508\/revisions\/9534"}],"wp:attachment":[{"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/media?parent=9508"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/categories?post=9508"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crimeandtheforcesofevil.com\/blog\/wp-json\/wp\/v2\/tags?post=9508"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}