[/] All news in one place Evert Pot 507 Insufficient Storage (20.8.2019, 15:00 UTC) 507 Insufficient Storage is a status code that’s introduced by the WebDAV , specification. It allows a HTTP server to tell a client that for example their PUT or POST operation couldn’t succeed, maybe because it’s too large to fit on a disk. Even though it was written for WebDAV, it can be used outside of WebDAV servers though. Example: HTTP / 1.1 507 Insufficient Storage Content-Type : text/plain Wow, that's a big file. Can you store it somewhere else? We're pretty cramped here. Many WebDAV clients handle this status pretty well, and will inform the user that a disk is full. Should I use this? Even though I think this status is applicable outside of WebDAV, I think the reality is that the usefulness of this status is somewhat limited. Because 507 is specifically a server-side error, it kind of indicates that the error was server side. Maybe the disk being full was not by design or intentional. When using a status like this for REST API’s, I feel that it’s probably more likely that you’ll want to return an error when a user ran out of space, and intentionally send back a message to a user telling them ‘YOU ran out of quota’, instead of ‘OUR disk is full’. If the intent is to inform the user that they exceeded their quota, it’s better to use the more appropriate 413 Payload Too Large . References RFC4918, Section 11.5 - 507 Insuffient Storage Link Chris Shiflett Domain Registrars (19.8.2019, 21:07 UTC) A few years ago, I wrote about domain registrars . Realizing how often people still reference that post, and how old it is, I decided to ask what people are using these days. There was a lot less variety in the responses than last time I asked. In fact, four registrars accounted for almost all replies I received, even via in-person and private conversations. Here they are. Gandi My personal choice remains Gandi . Their new, JavaScript-heavy website belies the robustness of their platform, but if we judged companies by their websites, most would come up short. (This is why I want to rebuild every website I visit.) The projects they support can give you a good idea of their principles, which is something that matters to me. Gandi is committed to being the ethical choice for creating a web presence. Notable features include: Free SSL certificate Whois privacy DNS management DNSSEC Gandi is recommended by Derick Rethans , Simon Jones , Seppe Stas , and Graham Christensen . Hover Like Gandi, Hover is trying to make the web better. From podcasts to festivals, we’re proud to be patrons of inspiring projects that help fuel the internet. Most people who recommend Hover cite their excellent customer service as a reason. They also have a helpful article on how to register a domain name . Notable features include: Whois privacy DNS management Hover is recommended by Kyle Meyer , Paul Reinheimer , and Tim Cheadle . iwantmyname iwantmyname has an awkward name but a loyal customer base, and they have a wonderful sense of humor. The one-click setup of popular services like Google and AWS is a convenient way to get started quickly. Notable features include: Whois privacy DNS management Developer API iwantmyname is recommended by Aaron Gilmore , Dan Duncan , and Chanpory Rith . Namecheap Namecheap continues to be a popular choice, and their mission and values are admirable. They even advertise their support for the EFF and Fight for the Future in the footer of every page. Their domain search is one of the best I’ve seen, with a beast mode that unlocks the full gamut of search options. Notable features include: Whois privacy DNS management DNSSEC Namecheap is recommended by Ben Bodien and Jeff Lupinski . Summary I hope these recommendations can help you choose the domain registrar that’s best for you, especially if you don’t already own your own domain name(s). As I wrote in a recent article about personal websites on 99U: Owning your own domain name is important, and if this article can convince you of only one thing, let it be this. If you have any additions or corrections, please let me know . Link Derick Rethans PHP Internals News: Episode 23: Deprecated Short Open Tags, again (15.8.2019, 08:23 UTC) PHP Internals News: Episode 23: Deprecated Short Open Tags, again London, UK Thursday, August 15th 2019, 09:23 BST In this episode of "PHP Internals News" I chat with George Banyard ( Website , Twitter , GitHub , GitLab ) about his second RFC "Deprecate Short Open Tags, again". The RSS feed for this podcast is https://derickrethans.nl/feed-phpinternalsnews.xml , you can download this episode's MP3 file, and it's available on Spotify and iTunes . There is a dedicated website: https://phpinternals.news Show Notes RFC: Deprecate PHP Short open tags RFC: Deprecate short open tags, again PHP-CS-Fixer Credits Music: Chipper Doodle v2 — Kevin MacLeod (incompetech.com) — Creative Commons: By Attribution 3.0 Link Rob Allen Displaying exif information in WordPress posts (14.8.2019, 10:01 UTC) After discovering that WordPress modifies img tags when rendering a page, it crossed my mind that I could display exif information underneath each image on my new photography blog . The basic process is applicable to any manipulation of the content that you would want to do before it is displayed. To do this, we add a new filter to the the_content hook: add_filter('the_content', function ($content) { // manipulate $content return $content; }); As with all filters, we have to return data in the same format as the first parameter to our function. For the_content , we receive a string which is the post's article text. The core operation In my case, all my tags are immediately followed by a tag as I have a caption under each one. I decided to add the exif data within the . We use regex to find the tags: if (!preg_match_all( '@img [^>]+>[^<]*@', $content, $matches)) { return $content; } This will store each tag that's followed by a tag into the $matches variable, so we can now iterate over it: foreach ($matches[0] as $match) { // Find the url in the tag if (preg_match('@src="([0-9a-z:/._-]+)@i', $match, $srcList)) { $url = $srcList[1]; if ($url) { $postId = attachment_url_to_postid($url); if ($postId) { $exif = ffp_create_exifcaption($postId); $new = str_replace('', $exif .'', $match); $content = str_replace($match, $new, $content); } } } } This code iterates over each match and finds the url in the src attribute of the image tag. We can then then load the post from that url using the rather helpful $postId = attachment_url_to_postid($url); . Now that we have an ID, we can create the EXIF caption in a separate function and then finally we append it to the end of the current caption. We do this by simply replacing the closing with our text followed by which is a nice fast operation. Creating EXIF display string To create the string of EXIF data, I used a separate function to make it easier. WordPress has already extracted the EXIF data we require when the image was uploaded into the admin, so we simply need to read it and format it. To get it we do this: $metadata = wp_get_attachment_metadata($postId); if (!isset($metadata['image_meta'])) { return ''; } $imagemeta = $meta['image_meta'] ?? []; $imagemeta is an array of useful characteristics about the image. We pull the info we care into a set of variables like this: $camera = $imagemeta['camera'] ?? null; $lens = $imagemeta['lens'] ?? null; $aperture = $imagemeta['aperture'] ?? null; $shutter = $imagemeta['shutter_speed'] ?? null; $iso = $imagemeta['iso'] ?? null; $focal_length = $imagemeta['focal_length'] ?? null; if (! ($camera || $lens || $aperture || $shutter || $iso || $focal_length)) { return ''; } (Obviously, if there is no data, there's nothing to do.) Finally we format it nicely: $string = ''; return $string; We wrap our entire EXIF string in an