Skip to main content
Jake's user avatar
Jake's user avatar
Jake's user avatar
Jake
  • Member for 10 years
  • Last seen more than a month ago
comment
is_admin() returns true when using admin-ajax.php from front end script
In my case it's someone else's AJAX request. My plugin was not initializing properly when a 3rd party plugin was using admin-ajax.php on the front end, because I had separate initialization for 'admin' and front end. I hope this was just an optimization (can't remember), and a quick fix will be to check DOING_AJAX and if set initialize both. (Can't help thinking that AJAX via WordPress's built-in mechanism will be as slow as it was 11 years ago.)
awarded
awarded
Loading…
comment
Auto insert More tags in all posts
It inserts the 'read more' tag at the first space after 280 characters, so, yes, the number of words will vary depending on their length. Since I posted this, I found that WordPress shortcodes needed to be catered for; I have now updated the code in the answer to cover this.
revised
Auto insert More tags in all posts
Updated to cater for WordPress shortcodes and not count them as words or insert a `more` tag in the middle of a shortcode definition.
Loading…
comment
Do WordPress cron jobs slow down page loading?
Actually the 1 second timeout was fixed in WordPress 4.6 by #33055. (Looking at the code base is confusing as the old code is still there, including private methods like WP_Http::_dispatch_request which are now never called.)
comment
Image Upload from URL
The trick to 'upload' directly from a URL does not work in Windows 10 (in any browser - tested Firefox, Chrome, IE11), and has probably not worked in previous versions of Windows since 2012. Windows will download the file from the URL to a temporary location on your computer and upload from there. So it is not possible to use this trick to 'upload' large video files (to bypass hosting provider's HTTP 413 response before PHP and WordPress even get a look-in).
comment
Do WordPress cron jobs slow down page loading?
@user63350 That's true of cURL but not of WordPress. From the article: "the class WP_Http_Curl adjusts the fractional timeout to one full second (even if cURL would support it)". Even in the latest WordPress (5.2.2) the timeout is still 1 second, so the issue is present in all set-ups including the very latest.
revised
Auto insert More tags in all posts
Made regex more robust.
Loading…
awarded
answered
Loading…
awarded
awarded
answered
Loading…
revised
Loading…
awarded
revised
Shortcode from a widget is wrapped in unwanted <p> element
Worked around stackexchange markup bug
Loading…
Loading…