Jump to content

Macrura

PW-Moderators
  • Posts

    2,776
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. yes, it seems undeniable that AIOM+, which is otherwise a godsend plugin, has the possible side effect of tanking an entire website, front and backend, without warning. The cause is probably some change in the permissions, or who knows what; in my case the css minify was timing out in php, but had worked fine for a year before that. The module would seem to leave no recourse in the event that it fails and the developer has not taken steps as described above and in use by @muzzer and myself to provide an alternate way of outputting the assets. I think the module should come with instructions and warnings about these possible consequences, and that function i posted or one that does the same thing, should be part of the module so that if the user sets emergency shut off, it just lists the files in the arrays that have been passed into the class as single assets... it would also make sense for there to be a simple api for the module in the event that a site has tanked, to enable emergency shutoff; the api could also possibly allow for cache clearing, enable/disable dev mode and enable/disable html minify (this could also allow one to minify html or not on a per template basis, per horst's request..)
  2. Had a strange and horrific experience on Thursday when a site i was working on suddenly could no longer create the new cache files...; i made a change to 1 line of a CSS file on the live site, and then that's when things went sideways. The CSS minify script started to fail and causing PHP timeouts, and then this took the whole site down, every page, and the admin. this is the error: 2015-05-09 18:49:28 guest **site-name** Error: Maximum execution time of 60 seconds exceeded (line 87 of /home/public_html/site/modules/AllInOneMinify/lib/cssmin.php) How I fixed it (for the moment): 1.) uninstall AIOM+ 2.) Replace with new copy 3.) Re-install it, and set on dev mode, no HTML minify. this thankfully fixed the issue, but all in all the site was down for quite a while during this, and it made me realize that this part of the chain in my websites is a weak link, especially if it can fail, in that the site cannot run without the css and js files. Typically I would always have $minifyCSS and $minifyJS vars in my _init.php which in this case i could have simply set to false and then no problem, i could have gone and fixed the AIOM+ issue while the site ran. But for this site I hadn't set that up yet and also I am using conditional loading and hadn't worked out the script to load the individual assets if one of those vars is false. After looking a bit at the module, i came up with this solution for disabling AIOM+ based on a boolean var in your init: if($minifyJS == true) { echo '<script type="text/javascript" src="' . AIOM::JS($jsfiles) . '"></script>'; } else { listAssets($jsfiles); } // END IF this is the function (may not be 100% perfect, still testing, but works ok so far): // use this to echo the assets in the AOIM+ array function listAssets($asset_files) { $templates = wire('config')->urls->templates; $current_page = wire('page'); // testing //$current_page = wire('pages')->get(1023); foreach ($asset_files as $asset_file) { if ( is_array($asset_file) AND isset($asset_file['loadOn']) AND isset($asset_file['files']) ) { $selector = $asset_file['loadOn']; if(!$current_page->is($selector)) continue; if(is_array($asset_file['files'])) { foreach ($asset_file['files'] as $_asset_file) { echo "<script src='{$templates}{$_asset_file}'></script>\n"; } } else { echo "<script src='{$templates}{$asset_file}'></script>\n"; } } else { echo "<script src='{$templates}{$asset_file}'></script>\n"; } } } In summary, i think that maybe there should be an emergency shut off in AIOM+, because without the method described above, how would you keep a site online say if AIOM+ was just totally failing?
  3. this topic will now be closed and all discussions moved to the official module for this: https://processwire.com/talk/topic/9857-module-page-field-edit-links/?p=94599
  4. it should be possible to edit any file within the templates folder. If you are experiencing issues/errors with it, I would recommend submitting it here: https://github.com/NicoKnoll/ProcessTemplateEditor/issues Also, for a better editing experience, try using the new AceExtended editor; it is supposed to work now with this. Edit: just checked and was able to open, edit and save CSS and JS files.
  5. @gazley, One possibility would be a process module that would handle the sending; for example, you would have a button on the page which would for example link to that process, even by ajax, and send the email. another way, in preserving your current method, would be to run some JS when the checkbox is checked, and display an alert "you have selected to send email on save - would you like to save the page now to initiate this action?" and then run a click action on the save button depending on their response, or even just run the click action on the save button after they select that checkbox - since it would save the page, i can't see any drawback to that...
  6. do you have open graph tags? you need to set og:image https://developers.facebook.com/docs/sharing/best-practices#tags <!-- Open Graph ================================================== --> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="website" /> <meta property="og:title" content="page title" /> <meta property="og:description" content="some description" /> <meta property="og:url" content="page URL" /> <meta property="og:site_name" content="Site Name" /> <meta property='og:image' content='url - to - image' />
  7. thetuningspoon extended this module and made it configurable, and it should be released soon.. will check in on that. this was made before options field, so i don't know about that we'll have to take a look; once you have the configurable version you would only enable it on a per-field basis
  8. hey thanks a ton for looking at that, i will continue testing later today and this week and see what's going on.
  9. @Mike - i'm wondering if there is any chance that this module may be conflicting with page path history? I have page path history enabled, and also page path history manager; I see the URLs that PPH should be redirecting to, but they no longer work; I haven't uninstalled Jumplinks to test this because i'm fearful of losing my existing Jumplinks (much to my horror, when i uninstalled the Redirects Module for testing, it deleted all of my redirects; fortunately this was after i already imported them to JL)...
  10. amazing site, absolutely stunning!
  11. yeah, ran into this issue recently and was banging my head against a wall until i realized my items needed a template, because the rss feed needs a link for the items; in my case, the template for the RSS item does a simple redirect to it's parent page with a hash to the id of the item (it is an event listing). if you don't have a template for the RSS item, how would people click on the link to your item?
  12. wow this looks great! I have several sites that could use a good calendar management interface, and i've also been gradually designing my own version of a php calendar in PW, based on the old Thyme calendar.. this will surely give me a boost.
  13. @CliffG - i've never had to do steps 5 or 6. Most if not all PW references in the database should be relative to the root; the only thing that typically needs to be updated when moving a site would be a path that is stored by a module, for example admin custom pages stores the server path to the file it renders for the custom page, and those need to be reset when moving sites; in CSS, there shouldn't be any URLs that would break when moving a site, they should be all relative to the templates folder. you can also possibly avoid some of steps 5/6 by using vars which could be set in an _init.php, using a css.php for special rules that need to be generated on the fly, though i usually do those in the head since it's not that much.
  14. @Mike - also in terms of the nginx comment, if you run cloudflare, then wappalyzer shows Nginx (and also cloudflare)..
  15. my issues appear to be solved.. thanks Mike! looking forward to using this a lot now!!
  16. I meant that the columns in the PW admin are blank; i didn't check the dates in the database, for the particular site that works...
  17. yes, linux/apache - mySQL 5.5.40-36.1-log - PHP 5.4.3 also, i have another site on the same server and on that one everything works fine; no dates are show in the columns, they are empty. on the problem site which is using the dev version of the module (latest, downloaded today) these were all imported from ProcessRedirects, but then some were added after that and all of the rows show the 2015 years ago;
  18. hi Mike - here is how the date is formatted: 0000-00-00 00:00:00
  19. Hi Mike, all of my jumplinks have: 2015 years ago in the start AND end column; but the fields are all empty, no timed activation. None of the jumplinks work, even though in debug mode it shows Match found! We'll do the following redirect (302, temporary) when Debug Mode has been turned off: - From URL: http://www.ohmspeaker.com/1/Bookshelf-Speakers.html - To URL: http://www.ohmspeaker.com/speakers/walsh-bookshelf/ - Timed: From Wed, 30 Nov -001 00:00:00 -0500 to Wed, 30 Nov -001 00:00:00 -0500 if i go in and set a start and end date for the jumplink, it does work! but i guess this needs to be fixed?
  20. your first sentence is arguable. For years we have all used page fields for selects, radios, group checkboxes. it's part of what you need to do, and once you know how to do it fast and easy, then you just do it and don't get caught up in that sort of "too much for simple case" mindset; it just works. nevertheless, Ryan introduced the options fieldtype for when you want to avoid the page field: http://lmgtfy.com/?q=processwire+fieldtype+options the first 3 results should explain it all.
  21. What Adrian said is right and this Q has been asked a lot of times. You need to first create a field, not of type checkbox. you need to use options field or page field. then you will be able to select checkboxes as the input field to select those options or pages.
  22. sometimes clients need landing pages for marketing/seo that need to live off the root. all of these pages would make a mess in the page tree, so they are stored under /landing-pages/ I always do a hook (as was demonstrated in the CMS Critic Case Study) wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'landing-page') { // ensure that pages with template 'landing-page' live off the root $event->replace = true; $event->return = "/$page->name/"; } }); on the landing page template: // if someone tries to access this page at it's real location in the page tree, redirect to the fake URL: if(!$input->urlSegment1) { $session->redirect($page->url); } i should also add that on the homepage there is this: /** * First, check to see if there is a URL segment off the homepage * this is used to generate custom landing pages, for marketing etc.. * with a shorter URL, living off the root. * */ if(strlen($input->urlSegment2)) { // we only accept 1 URL segment here, so 404 if there are any more throw new Wire404Exception(); } else if(strlen($input->urlSegment1)) { // render the landing page named in urlSegment1 $name = $sanitizer->pageName($input->urlSegment1); $landingPage = $pages->get(2281)->child("name=$name, include=hidden"); if($landingPage->id) echo $landingPage->render(); else throw new Wire404Exception(); } else { // do the normal homepage... so that's why the segment check on the landing page template, because when it is being rendered from the homepage, if(!$input->urlSegment1) will be true
  23. I use AIOM+ and then regular php to manage the array before the AIOM+ is called.. im usually setting the scripts array in the init, like $minifyCSS = true; $minifyJS = true; $stylesheets = array( 'assets/bootstrap/css/bootstrap.min.css', 'assets/css/font-awesome.min.css', 'assets/css/style.css', 'assets/css/custom.css', ); $jsfiles = array( 'assets/js/jquery-2.1.3.min.js', 'assets/js/imagesloaded.pkgd.js', 'assets/js/custom.js', ); in templates i sometimes do this (if styles/scripts need to be before last one, e.g. if last style is custom/override) $jsOffset = -1; $cssOffset = -1; //1.) Event Calendar array_splice($jsfiles, $jsOffset, 0, 'plugins/eventCalendar/js/jquery.event.calendar.js'); array_splice($jsfiles, $jsOffset, 0, 'plugins/eventCalendar/js/languages/jquery.event.calendar.en.js'); array_splice($stylesheets, $cssOffset, 0, 'plugins/eventCalendar/css/jquery.event.calendar.css'); or simple: $jsfiles[] = 'plugins/soundManager/js/soundmanager2-nodebug-jsmin.js'; $jsfiles[] = 'plugins/soundManager/page-player/script/page-player.js'; $stylesheets[] = 'plugins/soundManager/page-player/css/page-player.css'; then outputting: if($minifyCSS == true) { echo "\t" . '<link rel="stylesheet" type="text/css" href="' . AllInOneMinify::CSS($stylesheets) . '" />' . "\n"; } else { foreach($stylesheets as $stylesheet) { echo "\t<link href='{$templates}{$stylesheet}' rel='stylesheet'>\n"; } } // END IF MINIFY this lets you toggle AIOM and good for development and troubleshooting stuff.. i should also clarify that for brevity, i setup a lot of aliases in the init, like: $templates = $config->urls->templates;
  24. i would say maybe try disabling the upgrades and/or upgrade check module, then also check with the host and see if they have any security rules that your ip is triggering?
  25. that's a good question, i'm not sure, but maybe as a quick fix you could use some jQuery (e.g. using admin custom files) to parse that into formatted html
×
×
  • Create New...