Jump to content

Erik Richter

  • Posts

  • Joined

  • Last visited

Everything posted by Erik Richter

  1. @horstthank you! I just investigated the Modules that were running.. and luckily I found out what happened and that I was not the only one having the problem. -> The Cookie Management Plugin Banner works with an external API which stopped working weeks ago and therefore was causing the loading times. I deinstalled it and everything is working fine again. Other people were talking about load times of 20-30 here (last page): Thank you everyone! Definitely a big portion of luck to find what exactly caused this..
  2. thanks @Jan Romero, best regards from and to Germany. Good tips, I just checked. This specific site does not use a ready.php file, neither is it very complex. No extra hooks or anything. What strikes me is that it has been behaving like hat for a couple of weeks now (end of November), after running without any problems for years. It's so strange, because the admin works flawlessly and it's always only the first initial visit (until something "site wide" is cached I believe)..
  3. @dragan thanks for the quick reply! I deleted the cache folder, then did reset my browser cache, did a clean visit - to the backend first: went fine. So I logged in, installed Tracy. Then visited the frontend from there (with fresh cache/private window) -> again: initial frontend load takes about 25 seconds.. all additional visits and page loads from there run fine, until you reopen browser or new session. Any Ideas? Tracy shows no errors.. just the very sad load time.
  4. Hey Guys, I have a site running for over 4 years (nothing has been changed technically the past years), client called me, suddenly it takes more than 20 seconds for initial site load! After that its all nice and fast, until you clear browser history and cache again. If you directly go to the admin area (even with fresh cache) it's also lightning fast, all the time - only frontend takes 20 seconds, EVEN if I put an empty template file without any code. Other php files, not within Processwire Framework (phpinfo eg), work fine too. Could it have something to do with the index.php/the other files that are trying to render the frontend in within Processwire framework? Processwire 3.0, PHP 7.0, Shared Hosting (Apache) - maybe they changed something over time with the configuration? But what would end up in this specific scenario? Any ideas highly appreciated! Thank you ?
  5. 500 Internal Server Error... ? as soon as I add $finder->query->where
  6. @bernhard Thanks for the quick response! Would I add the regular field names in the selector? <? $finder = $rockfinder ->find("template=physician, limit=12") ->addColumns(['title', 'created']); $finder->query->where("physician_profile_geo_lat >= $roundMinLat"); ... $finder->query->where("physician_profile_geo_lat >= $roundMinLat"); $rows = $finder->getRows();?> Thank you!!
  7. @bernhard Really great module!! I have around 1 mio pages, and it is pretty fast as long as I don't do comparisons. With more complex finders it is really slow on my end. I need to do a radius search, comparing lat/long fields to min max: <? $finder = $rockfinder ->find("template=physician, physician_profile_geo_lat>=$roundMinLat, physician_profile_geo_lat<=$roundMaxLat, physician_profile_geo_long>=$roundMaxLon, physician_profile_geo_long<=$roundMinLon, limit=12") ->addColumns(['title', 'created']); $rows = $finder->getRows();?> This is really realy slow - any tips on optimizing this? I switched to RockFinder, hoping that it would increase speed, as I reached the limits of usability with the usual $pages->find with this, too. If anyone has ideas or tips, I'd appreciate it!
  8. @cst989 Hey! I changed the fieldtyp to float in database, but still: as soon as I have negative longitude, I get no results.. any tips? Thank you!!!
  9. EDIT2: Actually I've been stupid, mixed up Max and Min for the negatives. Everything works now - pretty slow tho.. If anyone has tipps on making queries faster (talking 1 mio pages) Let me know! Hey guys, Is it possible to change fieldtype text to float for a live website? I have about 1 Mio pages with Lat/Long coordinates (from geocoding) stored in a TEXT field. Works perfectly for displaying on maps etc. - but now I wanted to implement a query filtering for radius (min/max gets calculated correctly before). This $pages->find does not find results, and I suspect it is because some values are negative? (Lang: -80.45550 for example). $pages->find("lat>=$minlat, lat<=$maxlat, lang>=$minlng, lang<=$maxlng") -> fields are TEXT fields. It looks like the Comparison operator is not working here. Any tips on this? Thank you!! EDIT: I just changed the fieldtype to Float via Tracy Adminer... no change. The operators are still not giving any results. Strange. Hopefully anyone here has an idea!
  10. @elabx thanks for the fast response! Search is fast - as long as one picks at least one filter/selector. Displaying all 1,2 mio results takes about 14-16 seconds, even with the limit and pagination. I guess its because of the count?
  11. Hey @elabx, what solution did you come up with in the end? I also am paginating (when no filters have been selected) 1,2 Million pages, and the response time is about 15 seconds - which is not usable. Let me know if you found a good solution - thank you!!
  12. Hey guys, Im trying to sort pages depening on the count of pages who has them selected as page reference (the new owner selector might be handy for this?). my array is: $array = $pages->find("template=xx, sort=-profile_linked, sort=title"); I want to add a third sort which sorts the count of pages that have the array pages in a page reference field called "refField". What I tried: $array = $pages->find("template=xx, sort=-profile_linked, sort=title, sort=refField.owner.count"); Obviously this isn't working.. can I use the owner-selector for this at all? Or what would be the best practice? Thanks in advance!
  13. @LostKobrakai thanks for the explanation! very helpful. Actually I created a second datetime field now, where I store the walltime of the user when the post is created. I just use this field then to display the time on frontend, instead of created. Messing with the actual created date could really make problems - thanks for the insights - especially because you still want to keep the real "order" (dependend on UTC or a universal time) of posts, even tho individual local time is different.
  14. @kongondo, @Sergio thank you guys! Users are logged in, but only use the fronend of the website. Would best practice be to store the users time in a hidden field (get it via javascript), submit it with the form, save it as a variable to php, do the $p->save and after that change the created date with the one from the variable and save again?
  15. Hey Guys! Hopefully someone can point me to the right direction. On my Website logged-in users can publish posts, like facebook or twitter on the frontend. These posts are created as pages via API. Since I have visitors/users from different places of the world, I need to have the created-date of the page respecting their timezone. Anyone has an idea how to grab the visitors/browsers timezone/time and use it for $page->created instead of server time? Thank you so much in advance!
  16. thank you everyone!! bernhard, this last link is awesome - just tried it. great stuff, also with a nice UI. Just what I was looking for.
  17. Hey everyone! Have just been using Ryans "Import pages from csv" module, because the UI is really nice and easy (connect fields). I always get 500 Timeouts after about 30sec, when the csv has more than 1500 rows. I already increased memory limit and other php.ini settings - doesn't help at all. When I double-check after the timeout, always only about 1500 pages have been created.. Surprisingly: deleting 2500 pages via Api or admin-actions is possible and no timeouts. So what is best practice to import 1 Million pages from a .csv ? (I already have smaller chunks of the .csv, tried with 2000, 3000 - only 1500 worked..) Help is much appreciated ?
  18. Shame on me! Looks like you HAVE to set a title when creating via api? at least inside a foreach loop. When I set a title, everything works - thank you again! Now I need to solve this ajax admin endless spinner thing, when trashing pages..
  19. Crazy, since today I have it all the time, and nothing has really changed. The never ending spinning circle and then the Bad gateway/unknown error. Regarding the main issue: $period is just a placeholder, I also tried it with other variables. The template file only has this little piece of code: <?php $pgs = array("1","2","3","4","5"); foreach ($pgs as $pi) { $p = new Page(); $p->setOutputFormatting(false); $p->template = 'test'; $p->parent = $pages->get(1); $p->save(); $p->title = $pi; $pages->uncacheAll(); } ?> I also tried it with title and name, that should not be the problem tho, since PW gives titles automatically if none are provided. Also creating only one page like this works perfectly. I work with the latest stable version of PW, not too many modules, since I just started to build the site. Also debugging is on, and Tracy doesn't provide interesting insights. Also: after the page breaks I can't access admin for some seconds to minutes. If I open a new private window tho, it works? Also: it seems like sometimes at least 2 or 3 of those pages are being created (see them in admin), even tho the page with the template gives the error and doesnt load when accessed. This is really crazy and I have no idea whereelse I could look
  20. thanks for you quick reply! I am actually using this simple code, just for testing purposes. Also changed the array to something like "array("1","2","3","4","5");" - not working either and resulting in a 504 Gateway Error. Like I said - adding one page via API is completely fine. I already checked PHP memory limit, but everything seems okay there.. Hopefully you have some more ideas where this error is coming from - thanks in advance! ... foreach ($period as $slot) { $p = new Page(); $p->setOutputFormatting(false); $p->template = 'test'; $p->parent = $pages->get(1); $p->save(); } .. Also sometimes actions on more than one page (in a short period of time) the pagetree (trash) result in a "network error". Maybe there is a connection?
  21. Hey everyone, creating multiple pages with a foreach loop from a template file fails, breaks everything and results in not loading the page and sometimes a 500 error. Creating a single page works perfectly fine. Can someone point me to the right direction? Much appreciated ? ... foreach ($period as $slot) { $p = new Page(); $p->setOutputFormatting(false); $p->template = 'test'; $p->parent = $pages->get(1); $p->save(); } ..
  22. Are there any news on this issue? ? Highly appreciated!
  23. Hey Robin! Just saw the answer - thank you! Just what I needed - perfect! Can you also point me to the right hook - after save or after field select-change of user, that fills a reference page on the "color" page with the user? Or just puts a checkbox ("linked to a user") to checked? Edit: Just noticed that this is not working with autocomplete, only with the regular select option. Also found the github thread regarding this issue - someone knows of any progress regarding "custom php code and autocomplete page reference"? Have a great weekend!
  24. Hey guys, this is my customized autoresponse (put into the template folder) if(!defined("PROCESSWIRE")) die(); ?><!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php echo $form->name; ?> auto-response</title> </head> <body> <p>Hello <?php echo $values['first_name']; ?> <?php echo $values['last_name']; ?></p> <p> Please activate your account here: <br> <?php echo $pages->get(11084)->httpUrl;?>confirm?token=<?php echo $values['confirmation_token']; ?></p> <p>Thank you</p> </body> </html> first_name, last_name and confirmation_token are the field names. Email is sent, but I get "Notice: Undefined variable: first_name in" and "Notice: Trying to get property 'value' of non-object" for each. So what is the correct way to get single field values out of the array? Looks like I am making a beginner mistake here.. Appreciate your help ?
  • Create New...