Leaderboard
Popular Content
Showing content with the highest reputation on 01/03/2025 in all areas
-
The plan was to merge dev to the main branch today, but I’m still working through a couple of GitHub issues that I’d like to resolve or finish the conversation before finalizing the 3.0.244 main version. One example is this issue report where it was pointed out that there are some issues with UTF-8 page names. ProcessWire uses PHP’s IDN functions to manage conversion to and from the non UTF-8 version of the URL. PHP 7.4 changed the default arguments of the idn_* functions to settings that made them not work 100% for page names in a few cases, which I didn’t realize before this week. But this is not an issue that I can just fix and be done with it… There may already be page names in any given installation that are affected by the post PHP 7.4 behavior. If I were to just fix the issue, then some affected pages might no longer match when accessed directly by URL. So this had to be a carefully considered fix. What I ended up doing is fix it for any new PW installations that occur after this weekend. PW keeps track of its installation date, so can do this by way of its $config->installedAfter(“2025-01-05”) function. Existing installations will keep the imperfect behavior. Presumably it doesn’t affect that many installations since it only came to light last week and PHP 7.4 was released roughly 5 years ago. Nevertheless, existing installations that want the “fixed” behavior can get it by specifying this in /site/config.php: $config->pageNameWhitelist = 'v3' . $config->pageNameWhitelist; That essentially says to use version 3 of the page name conversion. Version 2 will also work fine, but may be slightly slower since it uses a dedicated Punycode library. And version 1 is the one that worked correctly until PHP 7.4, and still works mosts most of the time, but can produce imperfect results in some cases. Installations prior to 5 Jan 2025 use v1 by default and installations after 5 Jan 2025 use v3 by default. Chances are few (if any) will want to specify the version manually like above, but the option is there, just in case. That’s one example of why I’m waiting another few days before the dev branch merge to main. Another is that Adrian mentioned double-clicking on the “Move to Trash” button [in the page editor] makes it permanently delete the page rather than trash it. While I can’t duplicate that, despite multiple attempts, I just want to make sure there’s not something that needs fixing there. But unless any major new issues turn up, by this time next week we’ll merge to main and bump the version to 3.0.244. Thanks and Happy New Year!10 points
-
@modifiedcontent Virtualmin is open source and has a free community version. You can host multiple sites and have multiple users. Unless you're running a serious enterprise multi-server hosting business, I think Virtualmin would suit you just fine. What constitutes "use my websites professionally" more has to do with the features you expect to need. Virtualmin has an easy and clear breakdown of whether you're a person who actually needs a professional license at all, and "best" is very subjective. Personal preference, I've never liked cPanel but it's popular so some people think it's the best for them. I'm not an expert in server management software, but from what I've used I like Virtualmin the best. A downside for a more casual user is that the main admin (the one that manages users and has total control of the server) has a lot of features and may involve a little bit of a learning curve. It's likely not something you can't handle, but you have much more granular control over the server and users. I may have used Plesk in the past, probably through some managed hosting provider but it's not memorable enough to have an opinion. Given that the software you do choose is going to manage your server for the long term and there are open source/free versions, it's worth spending an afternoon trying them out. Spin up a cheap VPS, install the software, play around with it, then destroy the instance and review your notes. I've never been satisfied by just comparing specs or features "on paper" so to speak when it comes to server management software. It's something you have to feel out. Honestly- spending some time and getting a feel for the software is time well spent. You can be confident that the hours you spend up front now will ensure that you don't need to spend way, way, way more time later migrating all of your sites later because you find you can't live with it. Vultr has a marketplace that you can select an image to spin up a VPS with both cPanel and Plesk. It doesn't include Virtualmin or Vesta but those are essentially single line bash command installs. Just remember that if you're going to install Virtualmin, spin up a blank server with Linux and without any web hosting applications like Apache or MySQL- Virtualmin will take care of all of that.2 points
-
Hey @FireWire thanks for letting me know! Really great to hear 🙂 Be sure to check out the new config migrations!!! They are a gamechanger in the gamechanger 😛 I've just updated the docs! https://www.baumrock.com/en/processwire/modules/rockmigrations/docs/config-migrations/ v6.5.0 is out now 😎1 point
-
@bernhard Just a friendly note to say how much RM has been a gamechanger for me. Started out with adopting it in RockPageBuilder but now I'm installing it on older sites that I am coming back to add features to simply for the speed and ease it provides when managing new fields. Bravo and thanks for the great module 🙌1 point
-
I've gone with Vultr. Looks very good so far. Gives you lots of control, everything works very sensibly, plenty of useful documentation and support is responsive.1 point
-
This is how you can set the DB timezone: https://stackoverflow.com/questions/930900/how-do-i-set-the-time-zone-of-mysql If you don't have access to that talk to your hosting provider.1 point
-
That works very well. Thanks very much @elabx. It will be incorporated in the next version of PipeEmailToPage.1 point
-
The hook in the linked thread fires on saveReady, so all you need should be a foreach($pages->find(...) as $p) { $p->save(); echo "Page #$p updated to {$p->name}<br>"; } If you are not dealing with a lot of pages I'd use TracyDebugger's console for that.1 point
-
@ryan and @ all of those reading this... https://hugerte.org/ "We've forked the last MIT-licensed commit of the popular TinyMCE WYSIWYG editor as they switched to a GPL-or-pay license model and we want to keep it free for everyone. We're working at improving the codebase, adding new features and fixing bugs"1 point
-
1 point
-
I've used DigitalOcean for years and the experience has been great, but little less over time. Ever since they went public with their IPO they've raised their prices noticeably and it feels like there are a bunch of upcharges for things that should be included. As a word of warning to anyone stumbling across this post, don't even bother with their managed databases. Terrible performance with high latency that really slows down applications. Not surprised that @ErikMH tests of DO vs others showed lag. I'm going to take a look at Vultr for my next move, the pricing looks good, like DO used to be. @modifiedcontent The flavor of Linux you choose will have less of an impact than the hardware. I tend to go with Ubuntu on servers because everything is easily available through apt repositories and it has wide support. You could say the same for Debian, but I go with Ubuntu since they offer Expanded Security Maintenance and Livepatch services. Knowing that there's automatic updates to the server is nice. Combine that with configuring unattended-upgrades and it's a good way to keep things up to date. When you read the information on their site about these services, the language targets the enterprise, however when you create an account you can get these services for free for a limited number of machines. I've run ProcessWire on both Ubuntu and Alpine and didn't notice a difference other than Alpine was a little more bare bones. As long as the server can handle PHP and a database, ProcessWire won't know the difference. You're better off focusing on optimizing PHP-FPM workers and taking advantage of the strong PHP features like OPcache, adding the ModPageSpeed module, and JIT compiling (if it suits your use case). If you choose to explore using ModPageSpeed that will be an easy add and configuration on Ubuntu, Alpine will require a Docker container and extra work. As for a recommendation on hardware, NVMe drives will likely have the most impact on performance, followed by the processor. Depending on how much you expect your server to handle, they're worth the few extra bucks if it's in your budget. I've switched between the basic VPS and a VPS with an upgraded drive and CPU and the difference was noticeable in how fast the PW admin runs. ProCache content is also delivered faster via NVMe. I saw some benchmarks that were performed on a DO droplet and AMD beat out Intel easily on performance. Not sure if that translates to other cloud providers, but given what we've seen with Intel and their chip shenanigans in the past year, I'm all AMD these days. Not sure of how you prefer or plan to manage the server itself, but if you want a recommendation for a control panel, I've recently had a great experience with Virtualmin. It has a lot of UI control for some granular items that you would expect to manage from the CLI. I've managed VPSs via both, and have long preferred managing everything via bare SSH and bash but Virtualmin offers pretty much everything you need in a gui, and is great on performance. It also makes managing resources much easier than CLI, like how much RAM is dedicated to the database process (if you choose to run your DB on the same server), which makes it great for running lean on lower spec servers. I did just migrate to Virtualmin + bare Ubuntu from OpenLiteSpeed + CyberPanel within the last month. OLS has some attractive features out of the box, like native support for HTTP3 which provides excellent speed on TTFB, but it comes with tradeoffs and locks a lot of things behind an upgrade package that is hard to justify in cost. OLS locks you to one worker process unless you purchase a very expensive enterprise upgrade. I use ProCache to deliver content where possible but there are times when you can't, and the PW admin can run noticeably slow. The HTTP3 and extra layer of built-in caching are eclipsed by less than stellar performance everywhere else. I added some extras here that nobody asked for, but if anyone else has some experiences they can share I'm interested in hearing more from the community as well.1 point
-
I’ve had a great experience with Vultr, first as the data center for some sites I hosted via CloudWays, and more recently (since Cloudways was bought by D.O.) directly with Vultr. I absolutely recommend their “Vultr Cloud Compute” (shared-CPU VPSs) — especially the “high performance” and “high frequency” offerings starting at $6/month. In fact, I’ve found the absolute base-level “high frequency” choice is more than adequate to host five small PW sites (single “wire” folder, multiple “site” folders): 1 vCPU (3GHz+ Intel Xeon), 1 GB RAM, 32 GB NVMe SSD, 1 TB bandwidth They give you a choice of many OSs (including CentOS 9 and 10, though I use Debian 12) and many data centers worldwide. For my niche sites with visitors from around the globe, I’ve found it practical to set up one server locally for development and data entry. Whenever I’m ready to push a code change or new postings/pages, I make a (nearly free) snapshot backup of the staging server, and restore it to a half-dozen strategically chosen server sites (at $6/each): Amsterdam, Seoul, Atlanta — you get the idea). I have set up Cloudflare to handle the load balancing geographically. If the CPU and bandwidth are adequate but you need more drive space, they offer S3-compatible object storage or inexpensive regular block storage. Or if you’re a high-traffic site you can of course up the RAM, CPU, bandwidth, and internal SSD specs. The usual background applies: I have no affiliation with Vultr, I’ve just been happily hosting with them for three years. I do recommend that you choose either “high frequency” (if speed and a little extra drive space are more important) or “high performance” (if you want more bandwidth and are willing to trade a little drive space and speed for it), rather than “regular performance,” which felt surprisingly slower to me when I set up parallel systems for comparison. https://www.vultr.com/pricing/#cloud-compute/ https://www.vultr.com/features/datacenter-locations/1 point
-
RockMigrations v5.5.0 Added PR #65 from lemachinarbo that improves the moduleInstall command; Thank you! 🚀 Added support for config migrations: See docs This update is extremely helpful and from now on the recommended way to write migrations, as this workflow makes circular references a problem of the past! 🥳💪 Added docs about automated releases1 point
-
Hello @ all, I have created a little module (adapted from Somas PageSave.module) which adds an additional save button next to the save button at the bottom. This button saves the page and redirects to the frontend page. Here ist the code: <?php /** * Adding other types of save buttons for page edit form. * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class CustomPageSave extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'CustomPageSave', 'version' => 1, 'summary' => 'Example for adding other save buttons to page edit', 'href' => 'http://www.processwire.com', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { $this->addHookAfter("ProcessPageEdit::buildForm", $this, "addSaveButton"); // tell processwire that this is a page save if ($this->input->post->submit_save_minor) { $this->input->post->submit_save = 1; // attach hook on page save $this->addHookAfter("Pages::saved", $this, "hookPageSave"); } } public function hookPageSave($event) { $page = $event->arguments("page"); if ($this->input->post->submit_save_minor) { // this will get saved after this saveReady hook so no need to save here $message = __("Page was saved"); $this->message($message); $pageid = $page->id; $goto = wire("pages")->get("id=$pageid")->url; //get url of frontend article wire("session")->redirect($goto); } } public function addSaveButton($event) { $form = $event->return; $buttontext = __("Save and go to page"); // new submit button $f = $this->modules->InputfieldSubmit; $f->attr("name", "submit_save_minor"); $f->attr("value", $buttontext); // add submit button after the regular save button $form->insertAfter($f, $form->get("submit_save")); } } Now I want to do the same for the save button (copy) at the top, but I cannot figure out how. The problem is that both save buttons have the same name: submit_save. The code line for inserting the button is the following: $form->insertAfter($f, $form->get("submit_save")); But how can I achive this if the button at the top and at the bottom have the same name? Maybe someone can help me? Best regards1 point
-
Thanks for posting this Juergen, just needed a second button, too As far as I know (and for me it works) you don't need to include two buttons just stick to your first code with the class definition inserted like so for example.. $form = $event->return; $buttontext = __("Save and go to page"); $f = $this->modules->InputfieldSubmit; $f->attr("name", "submit_save_minor"); $f->attr("value", $buttontext); $f->class .= ' ui-priority-secondary head_button_clone'; $form->insertAfter($f, $form->get("submit_save")); the class is taking care of the duplication because the upper button/s are clone using jquery, thus "head_button_clone" tells the script to clone this button, too1 point
-
Thanks BitPoet this does exactly what I wanted. Here is the complete code for all who are interested in: Edit: Condition not to show on pages under the admin section was added <?php /** * Adding other types of save buttons for page edit form. * * ProcessWire 2.x * Copyright (C) 2010 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class CustomPageSave extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'CustomPageSave', 'version' => 1, 'summary' => 'Example for adding other save buttons to page edit', 'href' => 'http://www.processwire.com', 'singular' => true, 'autoload' => true ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { $this->addHookAfter("ProcessPageEdit::buildForm", $this, "addSaveButton"); // tell processwire that this is a page save if ($this->input->post->submit_save_minor) { $this->input->post->submit_save = 1; // attach hook on page save $this->addHookAfter("Pages::saved", $this, "hookPageSave"); } } public function hookPageSave($event) { $page = $event->arguments("page"); if ($this->input->post->submit_save_minor) { // this will get saved after this saveReady hook so no need to save here $message = __("Page was saved"); $this->message($message); $pageid = $page->id; $goto = wire("pages")->get("id=$pageid")->url; //get url of frontend article wire("session")->redirect($goto); } } public function addSaveButton($event) { $page = $event->object->getPage(); if ($page->rootParent->id != "2") { //dont show on all pages which are under the admin section $form = $event->return; $buttontext = __("Save and go to page"); // new submit button $f = $f2 = $this->modules->InputfieldSubmit; $f->attr("name", "submit_save_minor"); $f->attr("value", $buttontext); $f2->attr("name", "submit_save_minor"); $f2->attr("value", $buttontext); $f2->class .= ' ui-priority-secondary head_button_clone'; // add submit button after the regular save button $form->insertAfter($f, $form->get("submit_save")); $form->insertAfter($f2, $form->get("submit_save")); } } }1 point