Jump to content

DrQuincy

Members
  • Posts

    248
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by DrQuincy

  1. From what I can tell if you have a Page Reference field and that links to a page, e.g.: page1.pageReference links to page2 page2 is deleted page1.pageReference now equals null Is there any way here to mimic a MySQL RESTRICT action so that page2 cannot be deleted (and warns you as such in the admin) while there are page fields that point to it? Thanks.
  2. If you have an Images or Files field you can specify the maximum number of items and make it required so you need at least one — but can you set a minimum number of files like you can with a repeater? Thanks.
  3. With ProFields Table is it possible to: Set minimum and maximum row numbers? Make a column required I have checked but can't see anything. Thanks.
  4. A couple of further questions on the core's caching. When you enable the cache on a template (from the Cache tab), what is this actually caching? Does this relate to the generated PHP files in the FileCompiler folder? what are the use cases for this? Unlike the above method which invalidates the cache upon template saving out of the box (default option), if you use $cache->get() do you need to manually clear the cache using hooks if you want cache to be cleared upon page saving? I am assuming so and $cache is pretty much a wrapper for something like PHPFastCache. I could not find anything in the core for MarkupCache in V3. Thanks.
  5. Fantastic, thanks so much! I've also never heard of the Tracy plugin before so will check that out too!
  6. Thanks for all the replies, this place is mega-helpful! @teppo, that is a very detailed response and is much appreciated. Just to be clear, my numbers are from timing the execution of PHP — so from the start of the index.php right through to the end. I am not timing anything network-related. When you say “The doc (HTML) part of a fairly complex site I recently finished takes ~600-900ms” are you referring to the PHP execution time, as I am, or is this how long it takes for your browser to get the whole of the HTML document? Even so, if I add on some time for the request my simple brochureware site is still quick compared to your complex site so it tallies. You've pretty much answered my question then that this is how it is out of the box. That's good to know. Will ProCache automatically disable itself for POST requests (e.g. contact forms)? If you have a template that, for example, polls a third party service using cURL, do you simple just disable ProCache for that template in the admin? Is it possible to try ProCache first or do you need to buy it? I will look at WireCache and MarkupCache, thanks @dragan.
  7. I've done quite a number of PW sites now but have only just started looking at performance. I do a lot of custom work using libraries and have been used to very low PHP execution times as a result. Generally under 50ms with OpCache enabled. On my local MAMP server PW is taking generally over half a second to run. That's fine, it's an iMac and not really made as a web server. It speeds up considerably once I upload to my host where it runs on CentOS and Litespeed using PHP 7.4 with Opcache enabled. I am testing the speed of a small brochureware site, currently only ~20 pages. I have a very simple MVP framework I have added so I can separate getting data from PW from the actual HTML templates. Each template has a presenter that loads data from Models (just classes that get the data from PW and format accordingly). From experience, this simple reflection should not slow PW down — and I don't think it does. On my host server I have compared one a similar custom brochure site to this current PW one. Custom site (no Opcache): ~0.03ms execution time PW site (no Opcache): 0.35 to 0.5ms execution time Custom (with Opcache): ~0.02ms execution time PW (with Opcache): 0.18 to 0.35ms execution time I have broadly split the timings via a few tests: Just running the page — ~30-40ms Starting MVP framework — ~10-20ms Running global function — ~60-100ms (getting global settings from template and a few other bits all just getting data from PW pages) Loading rest of page — ~70-200ms (loads a page with a few fields, one is a repeater with 24 fields including a couple of nested repeaters and a page reference array) So the PHP execution time ranges from 180ms to 350ms when using OpCache on the exact environment I will use for the live site. It is a shared server and times always vary but the company I use have very good hardware and are strict about not overselling their resources so as shared servers go, it's a good one. Template cache seems to makes little-to-no difference. I have a somewhat blinkered view here since I don't use off-the-shelf CMSs very often but is this pretty much the execution time you would expect for a small brochure site? I.e. it's just the overhead you have to accept when using something this powerful. This is not a criticism of PW, I am just wondering if this is the norm and that trying to make it any faster is going to be a waste of my time (assuming I do not have the budget to spend on better hardware, which I don't). I do have one old WordPress site I look after and that seems to average 110ms execution time under the same environment — but I don't think it's a fair comparison since it's a five page site with no plugins installed. From other WP sites I have seen once you add plugins — which you need to do anything half-decent — then it really starts slowing down. Would ProCache make a difference or is this more for high-traffic sites (this site would not be high traffic)? Is ProCache as low maintenance as OpCache or is it easy to end up with stale data in certain contexts? Thanks. ?
  8. Another question on ProFields Repeater Matrix… Can each matrix type have its own validation? So if I have “banner” and “list” content types, for example, and the banner has a mandatory image it will only be mandatory if “banner” is chosen and not “list”. Is that how it works?
  9. I have been using repeaters as a kind of modular page builder where I have a drop down (e.g. text, image, video) and then have been showing fields in the repeater based on the drop down selection. I have noticed that ProFields Repeater Matrix seems to do this out of the box (and PageTable might've been a better choice as well!) so this will save me an awful lot of time long term. I am partway through quite a complex site though and am wondering if I buy ProFields now and install it can I convert the repeaters to Repeater Matrix fields without losing any of the content I have already added? Thanks! P.S. I am a lone web developer but I do some white label work for agencies. Can I use the ProFields plugin as a single license when working for agencies? It would appear that I can do as many sites as I like for whomever I like so long as it is only me developing with it. I thought I'd check though.
  10. In site/config I always thought $config->httpHosts was a list of HTTP hosts that were allowed to run the site. E.g. if domain1.com, www.domain1.com, domain2.com and www.domain2.com were all pointing to the web root and you only had ['domain1.com', 'www.domain1.com'] in $config->httpHosts then it prevents domain2.com and www.domain2.com from being allowed on the site (so you'd redirect them site-wide via .htaccess instead). But I have just been playing around with it and it doesn't seem to make a difference what the values of this array are. What does $config->httpHosts do exactly? Thanks.
  11. Thanks @johndoe. That's useful to know. I seem to be doing more PW sites these days so it will be worth getting the form and fields plugins. Just checking, did you mean $files? It' not a big deal either way as you can just use finfo_file() in the backend. Front-end you can just check the file extension in case of user error. Let's say you want to add Dropzone JS file uploads that upload immediately after they are added is it easy enough with FormBuilder to write custom front-end jQuery validation so that the form can't be uploaded until there is at least one file uploaded, all files have finished uploading, etc? Thanks.
  12. Thanks for showing the path to working it out, that's great! ?
  13. Thanks to you both. Thanks Robin, I'll try that! I thought it should be easy but I am new to hooks and couldn't find a way to get from $event to the template.
  14. Thanks Robin. It's not a big deal but good to know it's not me doing it wrong. Does the ProFields plugin bring this functionality? I did read something that implied this in another post but I thought ProFields added new fields rather than enhanced existing ones.
  15. For the Select Options field: Is it possible not to have a blank empty option at the top? What is the difference between Input > Default options and Details > What options do you want pre-selected? (if any)? Thanks.
  16. When using a repeater Visible if… seems to work but not Required if… So, I have a Select drop down in the repeater (foo) and I only want a field to be required if this drop down equals a certain value (6). So, I put in the Required if box foo=6 and it seems to treat it as a required field regardless of the value of foo. Is this some kind of limitation with repeaters? Thanks.
  17. I am resizing images immediately after upload using this in admin.php: wire()->addHookAfter('InputfieldFile::fileAdded', function($event) { /* ... */ }); The image field can obviously be used in multiple templates and sometimes I may want them sizing differently and want to avoid creating image variations that won't get used. Is it possible to get the template this field belongs to from $event? Thanks.
  18. I am doing a PW that has a form where users can submit a PDF or Word doc. I am interested in trying FormBuilder and can see that it supports files. What I would like to know is: For file inputs does it have a drag-and-drop file upload progress bar support (like Dropzone.js)? I.e. so if a large file is part of the form there is a progress bar for better UX. I know I could use $.ajax({xhr: function() { window.XMLHttpRequest().upload.addEventListener('progress', (evt) => {})… but wondered if it had all this built in. For larger files I just want some feedback to the user that it has not frozen. Does it handle file validation in the front and back end (using finfo)? Do you have full control over the HTML and CSS used in the forms? As an aside, is it possible to demo FormBuilder, ProFields, etc on a test site before buying?
  19. Well, that is exactly what I am doing right now, thinking about it. ? I am playing devil's advocate rather than disagreeing with you as it helps determine the pros and cons. Processwire is open source. Should Ryan decide tomorrow he's had enough while it would be a massive shame the community could take over due to the open source license. And I haven't checked on github but I'd imagine while Ryan leads it because it's likely developed with git others have pushed code to it as well. Even if you have the source to something if it has a commercial license you almost certainly can't carry on development with it without the owner's permission. That's just the point I was making.
  20. That sounds very promising. My only issue here is that since it is not open source I am concerned about the fact it is owned by a single person rather than a larger company. Is there any plan/agreement to open source it should commercial development cease? For those using V2 are they now left without support, security patches, etc? Don't get me wrong, I appreciate the time and effort put into this but I owe it to my clients to ask these questions.
×
×
  • Create New...