-
Posts
109 -
Joined
-
Last visited
-
Days Won
1
Leftfield last won the day on May 15
Leftfield had the most liked content!
Contact Methods
-
Website URL
https://vujosevic.com/
-
Skype
mareblume
Profile Information
-
Gender
Male
-
Location
Montenegro
-
Interests
Prioritize SEO, followed by email marketing, Group B, WRC, and PPC.
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Leftfield's Achievements
Sr. Member (5/6)
75
Reputation
-
You know the story ?
-
Thanks @Pete! I will add hidpi image latter. Never did it before but now hitting my head... Yes, pricing wasn't exactly a walk in the park. But after years of wrestling with enough SEO nightmares on WordPress and Shopify to fill a horror novel (weird canonical URLs, ghost broken pages, and sitemaps that would make Einstein cry), I think it's safe to say this calls for a celebratory dance.
-
Hey @dotnetic thanks for the feedback! Thank you very much!!! Will fix first thing in the morning (hopefully)
-
Leftfield started following How to translate strings globally? , Handling JSON file - tracking certain URL parameters , Page Hit Counter – Simple Page View Tracking and 3 others
-
I had some primitive code with JavaScript (ugly enough to scare small children) and I decided to make a proper module. I've touched it, of course, and now it's organized chaos. I have issues (yea, me like a person, and the code): It wont create json file. It wont write to json file even I manually created one. It loads data from the backend pages even I am trying to avoid that. And it is working when you DO NOT reload. <?php namespace ProcessWire; class UrlTracker extends WireData implements Module { private $logFilePath; public static function getModuleInfo() { return array( 'title' => 'URL Tracker', 'version' => 1, 'summary' => 'Tracks specified tracking parameters and logs to monthly JSON files.', 'href' => 'https://vujosevic.com', 'author' => 'Leftfield', 'requires' => array('ProcessWire>=3.0.0'), 'icon' => 'link', 'autoload' => true, 'permissions' => array(), 'installs' => array(), ); } public function init() { // Ensure the tracking directory exists $trackingDir = $this->config->paths->assets . 'tracking/'; if (!is_dir($trackingDir)) { if (mkdir($trackingDir, 0777, true)) { $this->wire('log')->save('url-tracker', "Created tracking directory: $trackingDir"); } else { $this->wire('log')->save('url-tracker', "Failed to create tracking directory: $trackingDir"); } } $this->logFilePath = $trackingDir . 'url_tracker_log_' . date('Ym') . '.json'; $this->addHookAfter('ProcessPageView::execute', $this, 'trackVisitedURL'); $this->wire('log')->save('url-tracker', 'URLTracker module initialized.'); } public function ___install() { $this->wire('log')->save('url-tracker', 'URLTracker module installed.'); } public function ___uninstall() { $this->wire('log')->save('url-tracker', 'URLTracker module uninstalled.'); } public function trackVisitedURL($event) { $pageID = $event->arguments(0); // Fetch the Page object from the page ID $page = $this->pages->get((int)$pageID); // Check if $page is indeed a Page object if (!$page instanceof Page || !$page->id) { $this->wire('log')->save('url-tracker', "No valid Page object provided. Argument: " . print_r($pageID, true)); return; } // Check if the current page is not an admin page if ($this->wire('page')->template->name === 'admin' || $page->parent()->id == $this->wire('config')->adminRootPageID) { $this->wire('log')->save('url-tracker', "Page is part of admin: {$page->title}"); return; } $input = $this->wire('input'); $url = $input->url; // Log the URL $this->wire('log')->save('url-tracker', "trackVisitedURL called for URL: $url"); // Check if the page is not hidden if (!$page->isHidden()) { $this->wire('log')->save('url-tracker', "Page is visible and published: {$page->title}"); // Check if the URL contains any of the specified tracking parameters if (strpos($url, 'track=email') !== false || strpos($url, 'track=x') !== false || strpos($url, 'track=facebook') !== false || strpos($url, 'track=linkedin') !== false) { $this->wire('log')->save('url-tracker', "URL contains tracking parameter: $url"); // Log to JSON file $this->logToJSON($url); } else { $this->wire('log')->save('url-tracker', "URL does not contain tracking parameter: $url"); } } else { $this->wire('log')->save('url-tracker', "Page is hidden: {$page->title}"); } } private function logToJSON($url) { $logFilePath = $this->getLogFilePath(); $logEntry = array( 'url' => $url, 'timestamp' => array( 'year' => date('Y'), 'month' => date('m'), 'day' => date('d'), 'hours' => date('H'), 'minutes' => date('i'), 'seconds' => date('s'), ), ); // Read the log $logData = []; if (file_exists($logFilePath)) { $logData = json_decode(file_get_contents($logFilePath), true); } // Add new entry $logData[] = $logEntry; // Write log data if (file_put_contents($logFilePath, json_encode($logData, JSON_PRETTY_PRINT))) { $this->wire('log')->save('url-tracker', "Logged URL to JSON: $url"); } else { $this->wire('log')->save('url-tracker', "Failed to log URL to JSON: $url"); } } private function getLogFilePath() { $currentMonth = date('Ym'); $logFilePath = $this->config->paths->assets . 'tracking/url_tracker_log_' . $currentMonth . '.json'; return $logFilePath; } }
-
module PrivacyWire - Cookie Management & async external asset loading
Leftfield replied to joshua's topic in Modules/Plugins
That's a good point, but it is literary intended for blocking ads. That's why I am using it: to check that my popups are working, etc. For the cookies, there is a setting in the browser (and this module has it in its settings) to send "Do not track." For anyone with the same issue, I used custom classes and fixed an issue. Changed the name of classes which starts with privacywire and the word banner. @Kholja thanks again! -
module PrivacyWire - Cookie Management & async external asset loading
Leftfield replied to joshua's topic in Modules/Plugins
Yep, that was it. THANKS!!!!!!! Now I need to figure out how to go around it. Thanks once again. -
module PrivacyWire - Cookie Management & async external asset loading
Leftfield replied to joshua's topic in Modules/Plugins
@Kholjamate, try to explain to my customer who knows GDPR better than any lawyer, online audits and all AI tools. -
module PrivacyWire - Cookie Management & async external asset loading
Leftfield replied to joshua's topic in Modules/Plugins
Hey @joshua Thanks for this wonderful module! I think I found some kind of bug, IDK. I am using ProcessWire 3.0.229 and PHP 8.1. Your module Privacy Wire is the latest version: 1.1.6 The Brave browser doesn't want to show the banner at all. I've attached a screenshot. Deleted cache and cookies and tested in Chrome, Firefox, Edge, and Opera. I have no idea where to look for the "problem" in the code. -
Page Hit Counter – Simple Page View Tracking
Leftfield replied to David Karich's topic in Modules/Plugins
Hi @All, Hey @David Karicha great module!!! I mean, the possibility of tracking keywords is speechless... I've updated my botlist.txt file with this: go-http-client|googlebot|bingbot|link|googlebot-image|yandexbot|semrushBot|ahrefsBot|zoominfobot|applebot|seznambot|yak-linkfluence|barkrowler|blexbot|yandeximages|cfnetwork|linkedinbot|feed|dalvik|validator|baiduspider|2345Explorer|survey|surdotlybot| But I am not sure how to add: "Screaming Frog SEO Spider" with empty spaces between words. Thanks!- 111 replies
-
- hitcounter
- tracking
- (and 4 more)
-
module PrivacyWire - Cookie Management & async external asset loading
Leftfield replied to joshua's topic in Modules/Plugins
Hi @All, Please, and I've tried really hard to find this but I can't: How can I implement this module with the default ProcessWire cookie? I need Reject All Cookies option. -
Hey @ryanThanks for the Autolinks module! I thought about making something like this :D but I am laughing at myself and my abilities. Is there a dedicated Forum page for it (I couldn't find one), or will there be one? I wouldn't like to change the code manually because of future updates, but I would like to discuss some features I think the module should have, like adding an option for choosing templates (or excluding them) where it should work. It is uber important from an SEO point of view to control where links come from and to what pages. The architecture of inner linking is a really important signal.
-
Yes @wbmnfktr (now I count bottles of whiskey I own you), I am on my mobile, waited to come home to sit down by the computer to post here, but you posted before me. In the end, I found out it was my server blocking the outgoing SMTP connection. The module is working great! Still waiting the host to unlock it.
-
Hello @All I got a problem. Latest PW, same PHP 8.1 When sending from Localhost everything is working fine. When sending from my website I got "Connection refused". Error log: module/edit?name=WireMailSmtp&collapse_info=1 Error in hnsmtp::send : cannot connect to smtp-server! I've tried to change Hostname of this computer but no luck. Using smtp.zoho.com, port 465, SSL checked
-
@kixethat's a great solution!!! But, reducing database queries is a priority for me. So, here's a straightforward approach to prevent bloating: Example: I use a button with descriptions on various parts of the different pages. I needed a simple solution to change everything in one place, not to edit every page. So I made global-button.php (and more similar files for the same purpose) and called it wherever it needed to be with <?php include('global-button.php'); ?> So now I have only one page to edit, and voila. Hope this will help someone.
-
Yes, it is a custom (multilingual-ready) module. I thought I would write a solution here when I found a fix.