-
Posts
17,149 -
Joined
-
Days Won
1,664
ryan last won the day on November 23
ryan had the most liked content!
Contact Methods
-
Website URL
https://processwire.com
Profile Information
-
Gender
Male
-
Location
Atlanta, GA
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
ryan's Achievements
-
@cb2004 Probably just regular markup regions would handle that just fine. Unless I misunderstand, I don't think you'd need file regions for that. Where file regions would be helpful is if you wanted to keep all that repeater matrix output code self contained, perhaps in your repeater matrix template file. Like if you had certain CSS and/or JS that was just for that repeater matrix stuff, you might find it easier to build and maintain longer term if the output code is all kept together, rather than spread across different files. That's one thing I find file regions particularly helpful for so far.
-
ryan started following PW 3.0.253 – Core updates , Weekly update – 21 November 2025 and Weekly update – 14 November 2025
-
This week I've added support for File Regions, part of the Markup Regions output system in ProcessWire. File Regions enable you to populate CSS and JS files with Markup Regions. I'm short on time today, so rather than writing much about it here, I've put up a documentation page for it in the API reference, which I'll link below. I'm using File Regions on a project right now and am finding it to very useful. Especially on a project where there are multiple developers, it simplifies a lot to be able to build features as self contained components, while still using the traditional route for site-wide stuff. It's something different, and I'm curious to know what you think. Here's the new documentation page for File Regions below. The page was a bit rushed, so I'll likely be amending it, but hopefully it gets across the main ideas. Thanks for reading and have a great weekend! https://processwire.com/api/ref/wire-markup-file-regions/
- 2 replies
-
- 11
-
-
This week I’ve been working on some useful additions to our Markup Regions system, but I don’t have those additions quite ready to commit to the core just yet. Hopefully next week they will be ready. What it involves is the ability to populate regions within CSS, JS, SCSS, LESS files. So I might output a <style> tag in my markup (for example), but the styles go into a CSS file rather than in the HTML output. That CSS file combines and contains all such instances, and can then be loaded from a dedicated <link> tag in the document head. You could do the same with JS, but using <script> tags instead. I’m not sure I’ve explained it well just yet, so I’ll have a better description of it next week, along with some practical examples. It’s very simple and I think examples will make it obvious. Stay tuned, have a great weekend and thanks for reading!
-
- 18
-
-
This week on the core dev branch there are several new hookable methods added to the Page class. While many of them may be redundant with hooks already available on the Pages class, those on the Page class are more convenient to use in some cases, especially when it comes to using custom Page classes. It's helpful because you can hook CustomPageClass::method rather than Page::method to more easily target specific types of pages. Or you can override the methods in a custom page class, without having to hook them at all. I'll get into this with more details and examples in a future blog post that goes in-depth on using custom page classes. Here's a summary of the methods that were added with links to their API reference documentation pages: Page::addReady() Page::added() Page::addStatusReady() Page::addedStatus() Page::removeStatusReady() Page::removedStatus() Page::cloneReady() Page::cloned() Page::deleteReady() Page::deleted() Page::editReady() Page::moveReady() Page::moved() Page::renameReady() Page::renamed() Page::saveReady() Page::saved() Page::renderPage() The above is just for this week, but there's quite a bit more in 3.0.253 relative to 3.0.252, so be sure to check the last issues from ProcessWire Weekly for more details.
- 6 replies
-
- 28
-
-
-
New blog: Best practices for using API variables
ryan replied to ryan's topic in News & Announcements
@Robin S Good question, theoretically it's more efficient to hook to an object directly when it suits your need, though I'm not sure if it is in practice... I've not done any tests to measure. When hooking '$pages' it's called a "local" hook because it's local to just that instance named $pages (and the hooks are stored with the instance), whereas when hooking 'Pages', it's called a "static" hook and it keeps track track of it in the WireHooks class, as it would apply to any current or future instance of the Pages class. But there's only ever one instance of Pages (named $pages) so it doesn't matter in this case. https://processwire.com/api/ref/wire/get-hooks/ Another way of saying it: The $pages->addHook('method') and $wire->addHook('Pages::method') are technically different calls in that $pages->addHook('method') is saying "Hook method in JUST THIS instance of Pages" and $wire->addHook('Pages::method') says "hook method in ALL instances of Pages". While it may not matter in the case of $pages (since only ever one instance), it does matter in cases where there can be multiple instances of the class, such as with the $page class. In that case, you have a choice to make of "do I want to hook JUST THIS $page"... $page->addHook('method', ...); ...or "do I want to hook ALL Page instances" or "do I want to hook ALL BlogPostPage instances", etc. $wire->addHook('Page::method', ...); $wire->addHook('BlogPostPage::method', ...); What's more efficient about local hooks: If hooking just a single $page instance (or other type), then the attached hooks disappear when the $page instance does. When hooking all instances of a class, then that hook sticks around for the entire request, or until manually removed. When a single instance is hooked (local) rather than all instances (static) then ProcessWire only has to consider that hook for the one instance, rather than all instances. So less work. For $pages vs Pages, there's only one of them either way, so it probably doesn't matter much one way or the other in that case. -
ProcessWire’s API is accessible through API variables and it provides multiple ways to access them. There are benefits and drawbacks to each approach and this post aims to cover them all. We also look at how to add your own API variables as well. https://processwire.com/blog/posts/api-variable-best-practices/
- 4 replies
-
- 27
-
-
-
Weekly update – 10 October 2025 – New ProCache version
ryan replied to ryan's topic in News & Announcements
@Jim Bailie This seems like a good question for ChatGPT, at least to get a starting point. I asked it if it could convert .htaccess to nginx and it said: So I uploaded this v1 ProCache ruleset from one of my site (I replaced product key with "xxx" for this example): # PROCACHE vfd31e36cd7ffdab982312621683b6fee RewriteCond %{REQUEST_METHOD} !=POST RewriteCond %{QUERY_STRING} !.*=.* RewriteCond %{HTTP_COOKIE} !^.*(wire_challenge|wires_challenge).*$ RewriteCond %{DOCUMENT_ROOT}/site/assets/ProCache-xxx/$1/index.html -f RewriteRule ^(.*) %{DOCUMENT_ROOT}/site/assets/ProCache-xxx/$1/index.html [L] # /PROCACHE And it gave me this: # PROCACHE vfd31e36cd7ffdab982312621683b6fee equivalent for Nginx location / { # Skip cache if POST request, query string present, or cookie contains wire_challenge / wires_challenge if ($request_method = POST) { break; } if ($query_string != "") { break; } if ($http_cookie ~* "(wire_challenge|wires_challenge)") { break; } # Serve static cached HTML file if it exists if (-f $document_root/site/assets/ProCache-xxx/$uri/index.html) { rewrite ^(.*)$ /site/assets/ProCache-xxx$uri/index.html break; } # Default: pass to ProcessWire (index.php) try_files $uri $uri/ /index.php?$query_string; } # /PROCACHE I have no idea if it's nginx version works or not, but seems like it might be a potentially good way to convert something like this. -
Today there’s a new version of ProCache (4.0.7) available for download in the ProCache support/upgrades board. Here’s what’s new in this version of ProCache: ProCache has been updated throughout for PHP 8.4 support. Upgraded the SCSS compiler to the latest Leafo SCSSPHP 2.0.1. This version requires PHP 8.2, so ProCache also lets you choose from two older versions if you prefer. Upgraded the LESS compiler to the latest Wikimedia LESS 5.4.1. Past versions can also be selected, including Wikimedia 3.0.0 and Leafo LESS 0.5.0. Upgraded the CSS/JS minifier to the latest available version (1.3.75 latest). Because we had customized the CSS/JS minification quite a bit, the older version (1.0 stable) also remains selectable, just in case there’s anything the older version handles that the new one doesn’t yet. LESS, SCSS and Minifier versions can be selected and changed in the ProCache configuration: Setup > ProCache > JS/CSS. Likewise the ProcessProCache module has a new JS/CSS tab for configuring the settings mentioned above. ProCache now logs LESS/SCSS and Minify status and errors to the JS console (when in debug mode or for a logged-in superuser). ProCache now has a proper API reference page available here: https://processwire.com/api/ref/pro-cache/ Because this is a brand new version with several upgraded libraries, it should be considered beta until it's been out a couple of weeks. Thanks for reading and have a great weekend!
- 7 replies
-
- 16
-
-
-
1 to 100 of 687951 (estimate) errors and website gone
ryan replied to BFD Calendar's topic in General Support
@BFD Calendar Btw, I did try to access your site, and am getting an HTTPS error. So I think whatever your webhost restored might have broken the HTTPS setup. Chances are your webhost can fix that by checking a box somewhere, or if you have cPanel or something you might be able to do it from there. Once I proceeded without HTTPS, then I got ProcessWire's "internal server error" message, which means that ProcessWire found and logged an error to /site/assets/logs/errors.txt. So the source of the issue is likely identified in that log file. -
1 to 100 of 687951 (estimate) errors and website gone
ryan replied to BFD Calendar's topic in General Support
@BFD Calendar Make sure you've got /site/config.php setting $config->debug = true; just so you can see errors. You may want to set it so that it's only in debug mode for your IP address, i.e. $config->debug = $_SERVER['REMOTE_ADDR'] === '123.123.123.123'; Keep an eye on the files in /site/assets/logs/, especially errors.txt. If you have shell access, you can "tail errors.txt" in that directory to see what the latest error messages are. You don't need to be able to login to the admin to view these logs, you can just locate them on the file system. Most of the time they will reveal whatever the issue is. If it's not clear, then post the last few log entries here to see if we can identify anything from it. The errors you mentioned may be expected, as it looks like they are trying to access something related to cgi-bin or a .well-known file, which are specific to your hosting and not to ProcessWire. So if your host blocks those addresses, then you'd expect to see this in the apache error log. Basically, I don't think those error messages are related to whatever is preventing your site from running. -
1 to 100 of 687951 (estimate) errors and website gone
ryan replied to BFD Calendar's topic in General Support
@BFD Calendar You can usually downgrade PW as easily as upgrading it, so I would probably just replace the /wire/ with the 3.0.123 version that was working well before. But I think it's unlikely that the version change is the issue, as newer versions are generally more efficient and reliable than older versions. For most sites a version upgrade like this would help the situation. Though there could be something unique in this case, who knows. I would guess you got hit by an AI bot (or a bunch of them) that went nuts and used up the resource limits. If you are hitting this query limit regularly, then your web host would need to increase the resources for your site, or you'd want to upgrade to a plan with more resources. An alternative would be to use WireRequestBlocker to keep the bots from consuming all the resources, and/or using ProCache so that most output can be cached and not hit the database. The most recent error that you posted sounds like something is missing on the file system (per what Matjaz mentioned), or that PHP's opcache needs to be cleared, perhaps a call to opcache_reset() could help matters. -
Last week I was on a boat, far from any computer, so that’s why there weren’t any updates. This week I’m back in the office and back to work on the core. The focus has been primarily on optimizations and issue fixes (see dev branch commit log). There were also a couple commits related to PHP 8.4 support. Issue fixes and optimizations will likely continue to get more focus as we get closer to our next main/master version.There are also some Pro module updates in the works as well. Have a great weekend!
-
- 19
-
-
This week we've got several updates to the core on the dev branch. It's primarily focused on small issue fixes and optimizations. Though there's enough since 3.0.251 that I'm bumping the dev branch version to 3.0.252. Next week there won't be any new updates this time next week because I'll be traveling, but will be back right working on the core right after that. Thanks for reading and have a great weekend!
-
- 12
-
-
New blog: Throttling AI bot traffic in ProcessWire
ryan replied to ryan's topic in News & Announcements
@Robin S I didn't intend for it to require PHP 8. I mistakenly was thinking str_contains and str_starts_with came in PHP 7.x. I've updated the download so that it replaces those function usages with strpos(). -
New blog: Throttling AI bot traffic in ProcessWire
ryan replied to ryan's topic in News & Announcements
@BrendonKoz it should just be a matter of replacing the module files with the new ones. Then do a modules refresh. Then go to the module config page to setup throttling features. It should install the new ProcessRequestBlocker module automatically, which will appear on the Setup top nav menu.