Jump to content

douglas81

Members
  • Posts

    125
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by douglas81

  1. Progress report: I'm developing/maintaining all the sites in question, so decided to run the risk of latest DEV (3.0.222) and PHP 8.2 ! Only hiccups so far seem to be either a) namespace issues for an old site which I hadn't declared ProcessWire namespace stuff in the templates yet, and b) PHP 8.2 being less lenient (i.e. more strict!) about certains aspects of coding. For example, one of the older libraries I had installed was accidentally using curly braces to access array index - e.g. somearray{$foo}. And I had a few errors in my code here or there where for the OR conditional, I had only put a single vertical bar (which I guess earlier versions of PHP let slide 🙂 So, yeah - so far so good. Thanks for the input everyone. Will report back when fully migrated and let you all know how it goes.
  2. Thanks very much for the insight, everyone. Keep your thoughts coming, as I'm going to take the plunge over the next couple of days.
  3. @wbmnfktr this makes a lot of sense. In your experience, PHP 8.2 with the latest DEV is pretty reliable? Any stand-out features from the DEV which you couldn't live without? @da² yes, I guess that's the thing I'm slightly concerned about, that I'll suddenly be faced with all these little niggly bugs. Even if easy fixes, when there are a few across multiple sites it could be a pain to debug.
  4. Hi folks, I'm looking for some general advice on where things stand with PHP 8.X and ProcessWire versions. Having recently migrated to a new webhost, I now have the option of using any PHP version (from 5.3 right up to 8.2) and I'm trying to decide on which version to go for. At the moment, things seem to point towards PHP 8.1, but I'd be happy to go for 8.2 if it has been confirmed as stable with the latest ProcessWire DEV (3.0.221). Most of the sites I develop run a few modules (including Formbuilder with custom Stripe payment actions). So, in a nutshell, my question is this: If you had the choice of a clean install, which version of PHP and ProcessWire would you choose? Thanks in advance for the insight! Douglas.
  5. Really appreciate that you took the time to check this out, and sorry for the slow response. Yes, it was on shared hosting, but with a lot of the shared server resources dedicated to my sites. Well, the problem was resolved by my webhosts (Gandi), and things are running quick again. The full page loads in under 500ms now, which is more in line with what I would expect.
  6. I have a little update on this. It turns out my webhosts had an issue with how their server was interfacing with Varnish, so it seems like I was on the right lines. There was nothing I could do at this end, and it was a problem they were aware of. They have now fixed it, and all the sites are running super-speedy again, which I've very relieved about! So, thanks for the help. I'll lleave this thread here incase it is useful for some people in the future. Cheers!
  7. Just tested this out on a very simple site which doesn't use ProcessWire (or any CMS for that matter), and the slowly loading images problem still there. Any clues to this issue greatfully received!
  8. Hi there, I seem to be having problems with me Processwire sites. Page load times are extremely slow. It seems to be slow loading images, but maybe it's just that they are most obvious because they are larger in (file) size. Please can somebody head to: https://douglaswhates.com/ and tell me if the home page takes a while to load? For me, sometimes it is very fast (e.g. 300ms), but sometimes it is very slow (like, 20 seconds or so). I'm struggling to repeat the problem consistently. Only happens with a hard refresh. Loading from local cache is quick. I don't think it's an issue with my router, or DNS, or anything like that, as I have tried it on multiple machines, with different internet connections. Also, same issue accross Chrome, Edge, Safari. Doesn't seem to be a coding issue, because even loading something like this will be very slow (like, 6 seconds or so on a fast 80Mbps connection). https://douglaswhates.com/site/assets/files/2442/jamie-recording-session.1536x1024-pd1-jo.jpg It's not a ping issue, as looking at network tab in inspector, it's the actual download of the file which is slow. Could it be some sort of throttling going on? I don't see this problem on my own maching with other websites. Only my websites, which suggests a clash with ProcessWire somehow?? douglaswhates.com is on PW 3.0.148. Other sites (e.g. https://elevenkinds.com) are on PW 3.0.165. All affected by the same issue. Could it be an apache issue? I recently switched servers. Now running: Server Version: Apache/2.4.43 (Unix). Also, this server is running Varnish. Any thoughts? Douglas.
  9. Glad you like the design. Thank you! You mean publish the PHP? Oh no, I couldn't possibly publish that, not until I cleaned it up.
  10. Hey, I told you not to look at the code!!! Ha ha. Seriously though, thanks for checking it out. I haven't done the meta and title stuff yet... it's on the TO DO. I haven't done *any* SEO stuff yet. The code needs tidied and optimised, make no mistake about it!
  11. Thanks Tom, This particular project has been ongoing for three or four months. But I have been busy in the shop on non-web stuff too, so it's hard to say exactly how much of that was development time!
  12. Still very fresh, but I thought... what the hell... spread the PW love and give you guys a first look... https://music-room.com This was a huge project. Still lots of debugging to do, but early feedback most welcome! Don't look at the code (particularly the js)... it's a bit of a garbled mess! Ha ha! Need to, ahem, refine it over the coming weeks and months. Haven't made the jump to PW3 yet as I'm using a few modules which don't work out of the box. Thanks again to Ryan for everything. Also, big thanks to Antti for his wonderful PadLoper module. Cheers and happy browsing! Douglas.
  13. Yep, FieldTypeRuntime module is the answer, at least for the short term. Works perfectly! Thanks everyone!!!
  14. Thanks for all the suggestions. Yes, perhaps I'm over complicating things. Basically, I'm trying to make updating and maintaining a large product price list as simple as possible. Most often manufacturers will provide us with a price list which is inc. VAT. I need to be able to quickly scan through a list of product pages and check those prices. We ship outside of the EU also, so the price field I have at the moment is ex. VAT. I have a VAT field also. For simplicity of the site admin, I have a bookmark in page lister which shows all products (i.e. template=product). In the resulting list, as well as displaying the ex.VAT field, I would like a field that shows the price inc. VAT. This doesn't need to be editable, and it cou;d be generated on the fly using PHP, but I don't know how or where to hook that in. (I originally thought it may be nice to be able to modify the inc.VAT price and have the ex.VAT price update automatically, but that's unnecessary for now.) In terms of template rendering (PHP) for the site visitor, I'm always using the ex. VAT price and generating inc. VAT prices using the ex.VAT price * tax field, depending on the product type and the customer's location.
  15. Hey all! How can I do this... I have a product template. The product template has a price field, which is for prices ex. VAT. (I have several hundred products already populated with these ex. VAT prices.) I have added another price field which is for prices including VAT. In the first circumstance, I'm trying to work out a way to iterate though each product page and auto-populate the inc. VAT price field. After that, I need a way of doing the following... If I edit/populate the ex. VAT price field, I would like the inc. VAT price field to auto-populate. Similarly, if I choose to edit the inc. VAT price field, on page (or field save) I would like the ex. VAT price field to update. I'm doing so many different wee things for this site at the moment that I'm losing focus on this little issue. Any advice on how best to achieve this would be much appreciated!
  16. Ah ha...! I'm having a related issue... I do some automatic resizing for most images on the site. For a normal image field (i.e. not in a repeater) I'm then seeing those alternative sizes listed next to the file name. But when that image is in a repeater I don't see them. Does that sound like part of the same bug?
  17. Thanks for that. Okay, that's making sense. When you say it loads them all into memory when I call the repeater... when does this happen? Like when I do a $page->some_repeater type call? Is it not possible to limit that also? using $page->some_repeater("limit=10")? And I hope I'm not being totally obtuse here, but when you say it loads them into memory, I guess you mean the pageArray for each repeater, right? With regards the MySQL thing... okay, I wonder where I have got that idea from. Maybe it was fields I was thinking about? I'm sure I remember reading something about a suggestion to try and limit fields to a certain amount. Or something along the lines of pages being nigh-on infinitely scalable, whereas fields have a limit. Does that sound totally off the mark?
  18. Every now and then I'll run into a post where Ryan seems to be suggesting Repeater fields are limited in some way, or at least not as extensible as pages. I get that. But I've also seen mention that it's not always good to have too many repeater fields as it has an effect on database rows, or columns, or something like that. I understand this has something to do with the limitations of mysql databases, or something? I wonder if someone could tell me how cautious I need to be using Repeaters and what I should be bearing in mind. I seem to be using Repeaters quite a lot, mostly when I want a user to be able to add photos or files to a page, but I want the user to be able to also add information to that file, like captions or maybe have multiple formats of the same file.
  19. Was having a few problems with this module for photos which I had stripped meta data. Kept on getting an "Undefined Index" warning. Here's the fix... public function __get($string) { if(!$this->data) return ''; // MY EDIT: make sure that what we're searching for is actually set, otherwise we get an error notice if(!isset($this->data[$string]) && !isset($this->exif['EXIF'][$string]) && !isset($this->exif['IFD0'][$string]) && !isset($this->exif['FILE'][$string])) return ''; if(in_array($string, array_keys($this->data))) return $this->data[$string]; if(in_array($string, array_keys($this->exif['EXIF']))) return $this->exif['EXIF'][$string]; if(in_array($string, array_keys($this->exif['IFD0']))) return $this->exif['IFD0'][$string]; if(in_array($string, array_keys($this->exif['FILE']))) return $this->exif['FILE'][$string]; return ''; }
  20. Agh! Developing a site and really stupidly deleted the site/config.php file. Don't ask me how, I'm not quite sure. Anyway, I don't have a log of the userAuthSalt. I guess I need to generate a new one and also new passwords? Any advice much, much appreciated.
  21. Sorry for the silence. I've been offline since yesterday. Thanks everyone for your input. I'm sure these will all come in handy for various things. I think the TextFormatter route is definitely the way to go in this instance. Not too concerned about it adding for every p tag within the textfield, as generally when I need this functionality, it's when there is only one paragraph of text. Thanks again!
  22. Yes, normally that's exactly what I'd do. But on occasion, it would be nice to target that particular block element without having to wrap it.
  23. Hi PW Boffins, So you know the way CKEditor adds <p> wrap-tags to the output. I'm actually okay with that and it's almost always exactly what I want it to do. However, one thing that has come up a couple of times is where I'd like to add a class style attribute to those tags, e.g. <p class="blah">. Is there a simple way of doing this? Lets say I have a field called "summary". Maybe I want the wrap tag to say <p class="summary">, rather than just <p>. In other words, what's the best way to add a style class to the auto p wraptag which reflects the name of the field from which it was created? Douglas.
  24. I was just trying to change the arrow thing and the code seems to work fine for me... $out .= $page->comments->renderAll(array( 'headline' => '', 'upvoteFormat' => '{cnt}', 'encoding' => 'UTF-8', 'admin' => false, // shows unapproved comments if true )); Basically the same as yours, so I'm note sure why it's not working for you. Are you using a one of the later PW dev versions? Initially I made the silly mistake of trying to use this on an master branch!
×
×
  • Create New...