Jump to content

BrendonKoz

Members
  • Posts

    394
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by BrendonKoz

  1. Does it have the same end result if, on your dev environment, you have debug disabled? (I'm assuming the dev environment has debug enabled in this instance.)
  2. Has your server admin gotten back to you, @celfred? I'm curious if you were able to resolve this. I do think a lot of the issues may have been between the DB Session handler and your host's configuration, but (obviously) it is not just that. Would love to know if you had found a solution.
  3. When I had a similar situation and huge variants in image dimensions, I solved this a different way by moving a logo "section" from a page block to providing a full page that is dedicated to partner/sponsor organizations. It enabled me to provide the organization name (which isn't always immediately evident from just a logo [for people; bots would have indexed the ALT text just fine]), the website address (so if someone saved an image of the page the website location still exists), and a short summary description of the organization - which could be anything: how they've partnered/helped, a description of their organization, a pulled meta description from their website (if available), etc. I could display all of them at once since it was a dedicated page, I could decide to order them alphabetically, by level of sponsorship, or randomly, thereby removing unexpected bias between the sponsors (or at least defending the decision), and although it wasn't necessarily quite as nice as having a clean block of images to separate out content on the prior page, it did clean things up when it had its own dedicated space - and the original image section became a call-to-action area to link to the dedicated page. It allows a bit more freedom for design options, too.
  4. From the module's support forum topic, it seems as though there's an outstanding issue at the moment, and an update to the module is needed due to changes behind the scenes with Google. I tried installing the module and testing it out quickly to see if I could reproduce the issue, but my API key/account doesn't have billing enabled, which is required, so I unfortunately couldn't provide more insight than the link to the forum topic.
  5. Thanks @szabesz, I should've quoted that part like you did, that would've been more meaningfully useful than what I provided. ?
  6. From the comments of the linked article, there was a link to this information which covers end-of-life for v6, as well as the ability for open source projects to apply for a separate license for v7: https://github.com/tinymce/tinymce/discussions/9609
  7. All browsers request a /favicon of some sort (.ico, .png, .gif, etc) - it's the icon that shows up in your browser's TAB to identify the website at quick glance. It may not be required, but you will always have a request, and if you don't include one, you'll also always get 404 errors in your webserver log files. There are other files that browsers will automatically request. I often use a webservice to take care of (most) of them at once, such as https://realfavicongenerator.net/. Older browsers/devices may still request files that this service no longer generates for you, but thankfully those requests will slowly fade with time. ?
  8. Honestly, the fact that PW does not require composer is a selling point for me. I develop on multiple hardware, depending on where I'm at (home on my gaming machine, at work on a business class PC, or on my 2011-era Macbook Air) - all running a Docker-based solution with shared file access to a Dropbox instance (in other words: very slow access to host OS files in the virtualized host OS). It took well over an hour for my Macbook Air to finish its composer install of Statamic. When the non-composer version of it was available, it took a little over a minute to unpack everything. There are absolutely massive benefits to standing on the work of others who have come before, but the massive inclusion of unnecessary code also exists (and @wbmnfktr already mentioned the additional attack vectors and need to keep things up-to-date, and how things can break from dependencies). I'm always concerned with one small included library in a composer setup getting a repository pull request from a bad actor that gets accepted...and then any/all platforms that use that little library (and keep up-to-date) are now essentially, unknowingly, vulnerable. I'm glad that ProcessWire offers both options. Having a composer option is awesome. When solutions don't offer a simple alternative to composer, it just sucks (for me). I wish I had more to provide in terms of similar CMSs to compare to ProcessWire, but the only ones I'm aware of, and I don't even entirely consider them all too similar, have already been mentioned. ? Some features of Grav CMS, maybe, are comparable in terms of its intention for customization.
  9. Hi mel47, if you haven't yet figured this out, I think we might need a bit more information in terms of what capability your templates have - like, are there any page reference fields that could reference other pages? What page, or pages, do you want the members listed on? Since you're mentioning regions I wasn't sure if members are listed on every page, or just specific choices. When you mention "member/awardee template", are you referring to a ProcessWire template assigned to a page type, or a PHP file (template), because I got confused when you asked if you should use the member/awardee template and render it in basic-page which is itself a ProcessWire page template...and if you did intend to render an entire page's output inside another template (i.e.: basic-page) then that would seem you wanted members included on quite a few pages.
  10. My only concern with using a JSON solution is, through my experience on Dreamhost and going back and forth with disabling mod_security for various issues, I noticed that Apache sometimes logged that it delivers the HTTP request, whereas if it's a PHP include/require or database query, it's all going to be run on a single PHP process (unless explicitly coded otherwise). If using JSON since Apache is handling a separate request, I think it has the possibility to spawn/create another PHP child process. Under normal scenarios this isn't a problem, but if you start getting hit with a bot attack of some sort (dictionary attack for wp-* pages, or DoS, or just a lot of 404s from a web scraper using old data [thanks, AWS]), you'll be increasing the spawn rate of PHP child processes much more quickly for any pages requesting data externally, and possibly hit a limit. Obviously caching can alleviate a lot of that - if you've taken the time to implement it. Just something to (possibly?) keep in mind. Realistically if you're getting attacked you'll still likely hit a limit eventually. ? Since many of us like cheap hosts... ?
  11. If you prefer one-liners: <?php // https://processwire.com/api/ref/wire-array/each/ echo $pages->find('template=faq')->each("<div><h2>{question}</h2>{answer}</div>\n"); ?
  12. After enabling it, you'd then need to add it. I copy/pasted your plugin's code into a file in my test PW site, followed my steps, but then also added it to the list of items in the toolbar. It (unfortunately) doesn't show up as a suggested item, so you have to type it manually and make sure you don't misspell it. Afterward, it should be enabled on your configured field(s). My field's Tools Menu is disabled, so I didn't test against that, but it does work, at the very least, for the toolbar/icon area when added.
  13. Neat! I like the readability score - it provides some useful context back to the authors. I was originally looking to see if it'd be possible to integrate the hemingwayapp(.com) interface as a field for similar reasons, but gave up. I instead just created a "Estimated Reading Time" field for site visitors as a feel-good (for me) feature. (I'll share it in case it's useful. The $page->reading_time is a hidden integer field in the template.) Multilingual sites could use the referenced source study to define times based on available data. <?php // ready.php // Blog/News Post Page - set reading time $wire->addHookBefore('Pages::saveReady(template=news-post)', function(HookEvent $event) { // Get values of arguments sent to hook (and optionally modify them) $page = $event->arguments(0); // Get the word count of the summary and body fields (combined) $summary_word_count = count(wire('sanitizer')->wordsArray(strip_tags($page->summary_textarea))); $article_word_count = count(wire('sanitizer')->wordsArray(strip_tags($page->rte))); // Set the value for the reading time field (number) based on word count // To provide a range, a text value would have to be returned (and stored), but is possible by calculating cpm, // wpm_top, wpm_bot and determining variance // Source Study: https://iovs.arvojournals.org/article.aspx?articleid=2166061 $cpm = 987; // average characters per minute, for English $wpm_bot = 161; // English values for reading speeds $wpm_top = 228; $wpm_ave = ceil(($wpm_bot + $wpm_top) / 2); $page->reading_time = ceil(($summary_word_count + $article_word_count) / $wpm_ave); // Populate back arguments (assuming they've been modified) $event->arguments(0, $page); }); As for your actual question... I haven't done this myself, but looking at the module and the field's settings, I believe you need to: Edit the settings of the "InputfieldTinyMCE" module. Look for the (image below) External Plugin files section, expand it if necessary, and it'll show you where to place your necessary file(s) for your additional plugins. Once your additional plugin(s) have been added properly to the InputfieldTinyMCE module's settings correctly, I do believe you'd then need to go to your TinyMCE field(s) that you want to take advantage of the plugin(s), and add/enable them. To do so, edit your field(s), go to the Input tab, and configure the necessary section(s) (I would assume the "External plugins to enable" would be the first to change) - my example image is blank only because I haven't added any plugins to my system. InputfieldTinyMCE module config: TinyMCE field Input tab setting:
  14. In a long thread of similar issues, it's often blamed on Twitter's crawler failing to load for some reason, and the cache getting corrupted. It may take a few days to clear. It (your site) worked for me today, multiple times. Ignore the grammarly icon overlay. ?
  15. I just ran your home page's minified HTML source through a code beautifier so I could read it a bit better, removed all IMG elements, CSS link and JS references, and uploaded it to a subdomain of our hosted website. I tested linking to the "test.html" file via Twitter and it did not unfurl to create a card. I then noticed that you're declaring both Facebook Graph and Twitter Card meta tags. I have not done that; I've used Facebook Graph meta tags, and only added the Twitter Card meta tags that don't also exist under Facebook Graph, so I removed all of your Twitter meta tags except "card" and "site", and tried it again. This time it loaded up a preview card. The image didn't load, but it may be because the domains don't match (I'm not sure about that one). This is what I used: <meta property="og:title" content="Digital Marketing Montenegro: SEO &amp; Online Marketing Expert"> <meta property="og:description" content="Digital Marketing Montenegro. Top SEO &amp; SEM Services for Brands. Increase Website Traffic &amp; Leads. Get a Free Quote from Miljan Vujosevic Today!"> <meta property="og:type" content="website"> <meta property="og:image" content="https://vujosevic.com/site/assets/files/1/web-1.1200x630.jpg"> <meta property="og:url" content="https://vujosevic.com/"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:site" content="@VujosevicCom"> I'm not saying that will fix everything (as when I tried it the image didn't render), but it at least did get a card view to show up!
  16. I didn't see anything in particular that looked out of place from quickly looking it over either. In fact, the unofficial Twitter Card Validator rendered a Twitter card as you'd expect from your markup. Usually if something changes without you doing anything, the fault isn't on your end - or at least with your code (maybe, like you said, a change to the server, like a robots.txt file or some sort of proxy, server protection, redirection, etc.). Since Twitter's official validator/renderer isn't really active anymore, it's hard to know what isn't working and why. If you have a different server (host) and web domain that you could test against, maybe export the source code of your homepage, along with the image (and path) and recreate it elsewhere and see if linking to that test/temporary location works as expected. At the very least - if it works - it would eliminate the rendered HTML code as being the issue.
  17. The official Twitter Card Validator tool no longer functions and renders a preview, why they didn't just remove the tool is unknown to me. Instead, they direct devs to just start creating an actual tweet (no need to send it) to test rendering/preview functionality. I get the same error with my website using the Twitter Card Validator, but it renders as expected when writing out a tweet. What's the difference between your site and mine that I tested against? Your HTML is minified. Maybe that has something to do with it? I'm not sure.
  18. At this level of uncertainty, this is where I'd probably set up xdebug to integrate with an IDE to step through processes. Alternatively, maybe Ryan's ProfilerPro in ProDevTools to compare how the module version works vs the traditional?
  19. This is pretty cool - thanks for sharing! For your color assignment, if this might help, I'd used Chart.js for a PHP-based project in the past and didn't want to have to manually assign colors, so I used the data label to dynamically generate colors for the chart. Here's the helper function I came up with. In my case, I found that the haval128,4 hashtype worked well for color differentiation/contrast, but another option may end up being slightly better with different datasets. ? <?php /** * Convert a string into RGB array (with alpha transparency option) * * @param string $string Any text to be represented as color * @param string $hashtype Hashing algorithm which supports a 32-character output * @return array RGBA color set */ function string_to_rgba($string, $hashtype = 'md2') { // 32-char options: md2, md4, md5, ripemd128, tiger128,3, tiger128,4, haval128,3, haval128,4, haval128,5 if (!in_array($hashtype, ['md2', 'md4', 'md5', 'ripemd128', 'tiger128,3', 'tiger128,4', 'haval128,3', 'haval128,4', 'haval128,5'])){ $hashtype = 'md2'; } $fullhash = hash($hashtype, $string); $hash = substr($fullhash, 0, 8); $colors = str_split($hash, 2); foreach ($colors as $i => $color) { $decimal = hexdec($color); if ($decimal > 230) { $decimal -= 25; } else if ($decimal < 50) { $decimal += 50; } $colors[$i] = $decimal; } $colors[3] = intval($colors[3] / 255 * 100); return $colors; }
  20. The "summary", just in case this was overlooked, isn't (entirely) an in-built feature for the module. It needs to be told what field in your template(s) will be used for the search result summary when rendered. From the documentation on the Modules page, under the "Options" heading, check the render_args property of the module's config, and look for the below: // Summary of each result (in the search results list) is the value of this field. 'result_summary_field' => 'summary', In the config, the "result_summary_field" points to the field used in your instance of ProcessWire this module is being used in that will be used to render the search result template's summary. So if in your templates you either don't have a summary field, or the field you use to define a summary is named differently, you'd need to use whatever value you have for your template(s). If maybe you used something like "short_description" as a page summary field, go with that. If you don't have a summary, you could use a "body" or "content" field, and in the render template use some form of string truncation, such as sanitizer()->truncate($your_summary_field, 80). If you're using JSON, slightly further down is a different section for that: // These settings define the fields used when search results are rendered as JSON. 'results_json_fields' => [ 'title' => 'title', 'desc' => 'summary', 'url' => 'url', ], Does that help at all?
  21. That was likely a conscious decision with their htaccess rules to prevent numerically traversing an entire forum (and instead requires parsing HTML to identify internal hyperlinks, so more processing power on the part of bad bots). Good find though! I much prefer shorter links. ?
  22. I somehow managed to miss this reply. Thank you for both of your replies, @Robin S! I did manage to get this working, with some oddities here and there that had to be worked through due to how I was checking/setting access permissions. I chose not to explicitly set permission for each and every template per role since I'm using a field that's added to the templates to determine access, so it seemed doubly difficult to do that, and my hope was that inheritance would work properly most of the time. So far that's fairly true, with occasional exceptions (ex: nested repeaters since repeaters have their own system templates). It felt a little hack'ish but I checked against the template name and if strpos() found a match to "repeater_" against $page->template->name, then I'd allow access to the edit method (add didn't cause an issue the way I had it written). I wasn't sure how else to check if a template of a page being checked for access belonged to a repeatable fieldtype.
  23. Disabling/Uninstalling SessionHandlerDB is supposed to log out any users - did you get logged out prior to seeing that message? I should've mentioned it would be a good idea to back up the database prior to disabling, just in case, but since you just moved hosts, I'd imagine whether you did or did not get a backup prior to disabling the module, you should have the ability to restore that table and its data, if need be - and/or restore to your prior host's backup state. I know a lot of people have had issue with the SessionHandlerDB, which is why I think it's a good idea to see if running the site with it disabled might help. Unfortunately, you also want to be able to use your site, and it seems something is holding on to a cache and/or expecting the table to exist. I'm not familiar with all of the modules you've mentioned, so maybe one of them needs it too?
  24. I haven't personally messed much with the table salt things, but usually that's related to passwords. If you can log in successfully, I'm thinking that's OK (and I would not change it). If you have a feeling there may be an issue with SessionHandlerDB, try disabling it temporarily to see what happens.
  25. I tried accessing your website (and the problematic page) last night and also encountered the error. The error message that I received was about a proxy server having issue, however. Is the current host using nginx or Apache? If there's a proxy server somewhere in there (if not nginx) then it's going to be beyond my experience/capabilities to know how to help. Otherwise, maybe look into why that particular page section (Newsboard) seems to cause trouble when other pages mostly load rather quickly. ProDevTools' ProfilerPro might be useful here, if identifying problem areas on your own ends up being difficult to find.
×
×
  • Create New...