-
Posts
11,239 -
Joined
-
Last visited
-
Days Won
374
adrian last won the day on May 26
adrian had the most liked content!
Profile Information
-
Gender
Not Telling
-
Location
Canada
Recent Profile Visitors
adrian's Achievements
-
PW 3.0.265 – Core updates and AgentTools updates
adrian replied to ryan's topic in News & Announcements
Hey @ryan - Agent Tools still has the same deprecation error Deprecated: Function curl_close() is deprecated since 8.5, as it has no effect since PHP 8.0 in .../pwtest.test/site/modules/AgentTools/AgentToolsEngineer.php:2296 If you explicitly tell your AI tool to remember to always add a PHP version guard to this function, it should hopefully stop making this mistake. -
Hi @maximus - I have a fairly detailed hook set up for SEOMaestro. It tweaks the homepage title, but most importantly it sets an automatic description for staff bio pages amd blog posts from existing text fields. It also pulls the first image from the blog post for the ogimage. If I switch to Ichiban I think I will need to do something similar so that staff don't need to manually enter separate descriptions for these pages. Is there an available hook to replicate this? And, if so, could the dashboard process this hook so it knows that these pages actually do have completed descriptions. $this->wire()->addHookAfter('SeoMaestro::renderSeoDataValue', function (HookEvent $event) { $group = $event->arguments(0); $name = $event->arguments(1); $value = $event->arguments(2); $p = $event->wire('page'); if($p->template->name == 'admin' && $event->wire('process') == 'ProcessPageEdit' && $event->wire('input')->get('id')) { $p = $event->wire('pages')->get((int) $event->wire('input')->get('id')); } $service_name = $event->wire('siteSettings')->serviceName ?? 'My Site Title'; if($group === 'meta' && $name === 'title') { if($p->id === 1) { // remove automatically appended [[service_name]] from homepage because we add it to the front in the SEO tab of the homepage $event->return = str_replace(' | [[service_name]]', '', $value); } else { $event->return = str_replace('[[service_name]]', $service_name, $value); } } // people (staff & experts), blog posts — keep the meta description to whole words under 155 chars, // using the editor's explicit description when set, otherwise falling back to summary|body. if(($p->template->name === 'person' || $p->template->name === 'blog-post') && $group === 'meta' && $name === 'description') { $source = $value !== '' ? $value : $this->wire('sanitizer')->textarea($p->get('summary|body')); $event->return = $this->wire('sanitizer')->truncate($source, 155); } elseif($p->id !== 1 && $group === 'meta' && $name === 'description' && $value == '') { $event->return = $this->wire('pages')->get(1)->seo_fields->meta_description; } if($p->image && $value !== "" && $group === 'opengraph' && $name === 'image') { $event->return = $p->image->httpUrl; } elseif($p->template == 'blog-post' && $p->images->count() > 0 && $value !== "" && $group === 'opengraph' && $name === 'image') { $event->return = $p->images->first->httpUrl; } });
-
@maximus - this is really great - thank you. I have gone to town with bug reports and feature suggestions on the repo though - hope you don't mind the barrage :)
-
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Thanks @Roych - much appreciated. I have another couple of PRs for you: - fix tab querystring so now you can reload or share the URL to a tab - added another bot filter to better exclude bots probing for URLs that don't exist, with an option to still display them in the 404 panel if you want (for attack path visibility). -
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Sorry, I little more following up: 1) I see the option for disabling the page edit stats widget, but I'd like to see it on pages that are viewable (and will actually have stats). I only want to disable it on pages that aren't viewable - PW often has a lot of these - think about the pages that drive a Page Reference field. 2) For anyone using Ryan's UserActivity module, you'll notice a conflict between them - which can result in the Analytics page not loading with these errors: - ERR_CONNECTION_CLOSED on the document itself (DevTools shows 200 (OK) paradoxically) - ERR_HTTP2_PROTOCOL_ERROR cascading across all sub-resources sharing the H2 connection - Sometimes a 414 Request-URI Too Large flash Here is my report to Ryan in case you want to fix it yourself now: -
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Thanks so much @Roych - lots of great improvements there (I especially love the approach to loading matomo/device-detector - I went with installing via composer to keep it up to date. Unfortunately I was still getting a lot of bot traffic getting through. I've submitted a PR to deal with it: https://github.com/Roychgod/NativeAnalytics/pull/4 - it's made a huge difference to what I am seeing. Thanks again. -
-
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Sorry, I might start becoming a bit of an annoyance, but what do you think about removing anayltics data that is added to every page's edit interface if the page isn't viewable (no template file, etc), because it will always show zeros. -
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Hi @Roych - I am seeing a LOT of bot traffic showing up in the stats - it's effectively making the data useless. Claude's analysis and suggestions: Total identifiable non-human traffic in this top-20 alone: ~955 sessions out of your 1,789 (~53%). And the signature is unmistakable: every one of these has ~1.00 hits per session, which is exactly why your single-page rate is 90.7%. Strip these out and your real human single-page rate is probably in the 60–75% range — perfectly normal for a content site. 1. Pull in Matomo's bot regex list (one-time integration, ~thousands of patterns vs. your ~20). Highest ROI. There are a few PHP libraries that wrap it — matomo/device-detector on Packagist. 2. Add datacenter IP filtering with GeoLite2 ASN data — free database, monthly update. Drops the Chrome/142-style residential-proxy-via-datacenter traffic. 3. Consider making JS-tracking the default (set autoTrack: true in injectTracker) and demoting server-side recording to a fallback for visitors who block your JS. This single change would likely cut your bot noise by 60–80%. 4. Skip behavioral fingerprinting unless you find specific high-value bots slipping through — it's a maintenance burden that doesn't justify itself for most sites. https://github.com/matomo-org/device-detector https://github.com/JayBizzle/Crawler-Detect Please let me know if you have any thoughts, but I think it's clear that the isBotUserAgent($ua) regex isn't very useful at all. -
Thanks for the report @Robin S - I hadn't seen that because it was specific to running the Console panel from the module config settings page, but is fixed in the latest version now.
-
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Hi @Roych - do you think it would be possible to exclude URLs from the 404 pages section if they end up resolving to another page - for example, the PW core PagePathHistory modules does a great job of automatically redirecting pages with changed names to their new path, but the original failed path is still being listed. -
Sorry about that @Robin S - I had checked file downloads with the new version, but not using PW's $files->send. I tested with your example above and it's working again in the latest version. Please let me know if you notice any issues. I think it's really nice having actions run in the background now so that aren't subject to any time limits, but it has complicated things.
-
Hi @Robin S - really sorry about that I never use SessionHandlerDB but I need to remember to test with it - should be fixed in the latest version.
-
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Thanks so much @Roych - I really appreciate the quick turnaround on that. -
module Native Analytics — a native analytics module for ProcessWire
adrian replied to Roych's topic in Module/Plugin Development
Thanks for this @Roych - really excited to make use off all the event and goal tools - I feel like Google Analytics has down really downhill in recent years. Your module's layout is clean and functional. The one thing I am struggling with is PW's lack of a centrally defined nonce which means I can't run this module without hacking the core to add the nonce. I have talked about it here: https://processwire.com/talk/topic/31739-config-cspnonce - but not sure if Ryan is at all interested. I like the idea of a central $config->cspNonce() that could be used by all module developers and also in our template files. The other alternative for module developers is to add a helper function like this: function getNonce() { return preg_match('#^Content-Security-Policy(?:-Report-Only)?:.*\s(?:script-src|script-src-elem)\s+(?:[^;]+\s)?\'nonce-([\w+/]+=*)\'#mi', implode("\n", headers_list()), $m) ? $m[1] : null; } to find the set header's nonce and inject that into its script tags. This is what TracyDebugger does. Anyway, not really sure I have a definitive ask for you - maybe I am just trying to spread the word about my desires for a centrally defined nonce in the PW core.