-
Posts
31 -
Joined
-
Last visited
Everything posted by Kholja
-
module PrivacyWire - Cookie Management & async external asset loading
Kholja replied to joshua's topic in Modules/Plugins
...hm - according to this: https://www.makeuseof.com/brave-blocks-cookie-consent-banners/ It seems to be a feature of Brave not a bug. Maybe it's difficult to work around this, and not using all of the typical "consent-phrases" ?. But in this case I would say it's what the user wants while he is using Brave? -
module PrivacyWire - Cookie Management & async external asset loading
Kholja replied to joshua's topic in Modules/Plugins
Brave uses filterlists to detect ads. There are a lot of "privacy" and "wire" keywords. Maybe a workaround would be to change the PrivacyWire templates and use other class names. -
module PrivacyWire - Cookie Management & async external asset loading
Kholja replied to joshua's topic in Modules/Plugins
Have you tried to deactivate Brave's internal privacy shield? Maybe Brave thinks it's an Ad-Popup. -
module PrivacyWire - Cookie Management & async external asset loading
Kholja replied to joshua's topic in Modules/Plugins
I don't know if it's possible to omit the default wire and wires cookies. But I think you don't need to as they could be declared as strictly necessary first-party cookies. -
module PrivacyWire - Cookie Management & async external asset loading
Kholja replied to joshua's topic in Modules/Plugins
I have to implement Google Consent v2 together with PrivacyWire for the first time. I tried to summarize the most imporant things and make a quick example. Hope that helps. Improvements welcome. Basically Google wants you to send the user preferences. This way Google can process at least anonymized data if the user denies permissions (and promises to respect privacy). Luckily PrivacyWire gives us the possibility to define a custom js function in the module configuration, which is executed whenever user preferences change. PrivacyWire stores user preferences in localStorage. From there we can fetch this information when needed. So we have to: 1. Integrate Google Tag Manger without modifying the script tag. 2. Set Consent v2 defaults (by default deny every permission): <!-- GOOGLE CONSENT V2 --> <script async src="https://www.googletagmanager.com/gtag/js?id=GTM-ID-HERE"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('consent', 'default', { 'ad_storage': 'denied', 'analytics_storage': 'denied', 'ad_user_data': 'denied', 'ad_personalization': 'denied' }); gtag('js', new Date()); gtag('config', 'GTM-ID-HERE'); </script> <!-- End GOOGLE CONSENT V2 --> 3. Use a function called by PrivacyWire, when user changes preferences. Fetch user preferences from localStorage and send them to Google: function updateConsentFromPrivacyWire() { console.log('update consent from privacy wire...'); const privacyWireData = localStorage.getItem('privacywire'); if (privacyWireData) { try { const consentData = JSON.parse(privacyWireData); const consentPreferences = { // Set Google params based on user preferences 'ad_storage': consentData.cookieGroups.marketing ? 'granted' : 'denied', 'analytics_storage': consentData.cookieGroups.statistics ? 'granted' : 'denied', 'ad_user_data': consentData.cookieGroups.marketing ? 'granted' : 'denied', 'ad_personalization': consentData.cookieGroups.marketing ? 'granted' : 'denied' }; // Update google consent gtag('consent', 'update', consentPreferences); console.log(consentPreferences); } catch (e) { console.error('Error parsing PrivacyWire-Data:', e); } } else { console.warn('No PrivacyWire-Data found in localStorage'); } } // Update consent at pageload document.addEventListener('DOMContentLoaded', updateConsentFromPrivacyWire); 5. This is what the parameters control: ad_storage: Controls whether ad-related cookies and identifiers are stored (e.g., for remarketing). analytics_storage: Controls whether analytics-related cookies are stored (e.g., for Google Analytics tracking). ad_user_data: Controls the collection and use of user data for advertising purposes. ad_personalization: Controls the use of data to personalize ads based on user behavior and preferences. 4. Configure the function name (here updateConsentFromPrivacyWire) in PrivacyWire module settings. -
Removing item from cart right before order placement fails
Kholja posted a topic in Padloper Support
I found a problem which might be a dealbreaker for a client. Let's say a client has two products in his cart. Right before clicking 'place order' (after typing in client date) he decides to remove one of the products. So he will navigate back to edit cart page (cart-edit.php template) and remove the product from the cart. The product is now removed from the cart, but padloper does not remove the product from the order (which is already created). The customer will find the product in the order-overview and has no chance to remove it from there. How could this be handled? Shouldn't Padloper take care of keeping cart and order in sync until order placement is completely done? -
Thanks that was the reason. I lost this setting after some experimenting with shipping settings. But I got another related problem which brought me to that state. If I try to enter countries into the field Shipping Zone Countries it does not accept other entries than Germany. A view times it worked and I could enter i.e. Austria. But after saving padloper message said that the entry is not valid and deleted all entries. After some tries I now can only enter Germany. Any other entry does not work. Is there a place where I should set valid countries?
-
Checkout shows me this error. After doing a bit of research, it turns out the reason is, that line 819 $field = $this->getInputfieldForCustomerForm($inputfield); returns null for the field shippingAdressCountry. This field is of type select which seems not handled correctly. In PadloperInputfieldHelpers.php getInputFieldSelect() returns without result, when $options['select_options'] is empty (which is true in my case). Somebody knows what to do here? Is there something wrong in my configuration?
-
As of ProcessWire 3.0.166 this may be an option: https://processwire.com/api/ref/page/secure-files/
-
I've done a small test. Let's say you have a template "onlymembers" with a files-field "members_pdf". In this case your pdf file is safe as soon as you set pagefileSecure to true AND restrict the access of the template "onlymembers" (i.e. remove all guest access rights). ProcessWire gave me a 404 page. You don't need the pagefileSecurePathPrefix line. It is set by default. Hope that helps.
-
Just to be sure - maybe it's not a PW Issue. Did you check the E-Mail Headers?
-
In case anyone stumbles upon this JavaScript error when clicking the Link-Button: ProcessWire.config.InputfieldCKEditor is undefined Workaround is to provide another field which uses the CKEditor (i.e. body field) in your template.
-
This notice can happen if you use a page reference field in your template which has a wrong defined (i.e. deleted) parent page dependency. In my case I had a blog-post template which contained a page reference field to category pages. Additionally I had a parent page defined containing the categories. The error occured when I deleted this parent page.
-
If you (or somenone) needs a more "secure" method maybe an easy review process could be realised like this: 1. Create two templates with similar fields (ie. article and article-draft). 2. article-draft is only visible to specific usergroup (ie editors) 3. after reviewing the editor could change the template from article-draft to article which is viewable by guests. This way you could also create a page showing a list of all article-draft pages, so the editor has an easy way to find all non-approved articles.
-
If you just want to store some general configuration values without the need of a seperate admin page you simply could provide some configuration fields which you can access via module settings. It's a fast and easy way and it's covered in this post by Ryan: https://processwire.com/blog/posts/new-module-configuration-options/
-
Snippet variation to achieve a optical better result. A little snippet addition to this older but maybe still useful post. If you use the orientation of an image to decide on your resize method you will often get an optical uneven impression, especially if aspect ratios of the images are very different (i.e. a row of logos). In this case it could be better to define a maximum width and a maximum height value which both should not exceed. Here's the variaton of @Soma's snippet to achieve that. $mW = 180; // max width $mH = 80; // max height $thumbUrl = ($mH / $image->height) > ($mW / $image->width) ? $image->size($mW,0)->url : $image->size(0,$mH)->url;
-
I exported the site with ryans ProcessExportProfile Module and did a fresh install. This solved the problem. But would be nice to know what caused the issue. Thanks Adrian for your quick response and your support. Your posts were often helpful und a good resource for learning ?
-
It's affecting all templates. I created a test template with only a few fields. It has the same bad performance.
-
Definitely it affects the Frontend. I think a difference by factor about 20 (300ms -> 6s server response time) is probably not caused by the core. In terms of the backend I'm not sure if I'm starting to see ghosts... the impact there is not that big. Anyway - thanks for your precious input adrian. If i find out more I will post it here.
-
Another interessting thing is that the frontend seems to slow down only when logged in as superuser. For guests the Site seems to work normal.
-
"force su into dev mode" is not checked and there are no errors or warnings I didn't checked all panels, but It's enough to add one of them: ProcessWire Info or Request Info or Console or Panel Selector. It's not speeding up with i.e. Tracy Logs or ProcessWire Logs Backend works normal exept the pagetree. pagetree takes longer than usual.
-
I tested both: Off can be "Enable Tracy Debugger" unchecked or uninstalling Tracy. Both leads to bad performance. If Tracy is enabled "Output Mode" can be "Production" or "Development". Both cases leads to normal operation. So maybe the question is what does Tracy change in the rendering process, when it is active.
-
I know this sounds crazy at first. I have a site which shows a very strange behaviour on the live server. The Site behaves normal as long as Tracy Debugger is ON. Response time is round about 200-300ms. As soon as I disable Tracy the response time grows to several seconds (6-7s !). Once the server answers, the rest of the assets deliver fast. Ideas where to begin a research welcome ?
-
Thanks mr-fan and Adrian. In case it's useful for someone, here is how I solved the problem. In fact I did not use Hanna Code in the end but some regex stuff, together with Adrians AdminActions Module (great work btw). I think this way you can convert any type of wordpress shortcuts to cleaner Hanna Code, get rid of not needed attributes or convert shortcuts to HTML. Example: I wanted to convert this: [av_image src='https://www.domain.de/link/to/image.jpg' attachment_size='large' align='center' lot_more='attributes'][/av_image] to a regular img tag. So I used a regular expression like this one: /\[av_image.*src='([^']*)([^\]]*)\]\[/av_image\]/ to match my shortcodes via the search and replace Action in AdminActions Module and replaced it with something like that: <img src="$1"> Which leads to an ordinary image Tag. $1 stands for the first group which is the src attribute. With variations of this you can convert nearly everything. But if you're not familiar with regex (like me) it can be very tricky. Database restore feature of AdminActions Module saved me some times ? For testing and learning I used this tool which helped me a lot in creating the regex Expressions: https://www.phpliveregex.com/
-
Thanks for the reply Adrian. I'm understanding your example. This is how I do it usually myself. In my case the original markup comes from the wordpress import (and the original Wordpress shortcuts). So I wanted to deal with what I got. If Hanna Code doesn't support closing tags I eventually have to find another way to convert the imported posts to fit Hanna Code.