-
Notifications
You must be signed in to change notification settings - Fork 59
Add LiveZilla Tag #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
many thanks for creating a new Tag.
I have a few comments below (keep in mind that I don't know LiveZilla)
Please also fix the indention as it seems to be a bit off in a few lines.
// return parent::getIcon(); | ||
// | ||
// The image should have ideally a resolution of about 64x64 pixels. | ||
return 'plugins/TagManager/images/icons/livezilla_icon.png'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to complain about the ugly icon, but it seems like you took the best they have
🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to find another Image, but im failed :(
Template/Tag/LivezillaDynamicTag.php
Outdated
}), | ||
$this->makeSetting('LivezillaDynamicDomain', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) { | ||
$field->title = 'Livezilla Domain'; | ||
$field->description = 'Enter your Domain without http:// or https://'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While obviously everyone should be using https, it is a bit counter intuitive that https is hardcoded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Livezilla is an Chat and Monitoring solution. Thoose things violates privacy of an website visitor. I do not tolerate those implementations over an insecure http connection!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fully agree, then you should make it clear to the user (e.g. make them enter the URL and throw an error if it isn't HTTPS).
If you want to I can help you write this validate function.
Template/Tag/LivezillaDynamicTag.php
Outdated
$field->description = 'In most cases it should be the Standard. (true) | ||
Available options are: true or false'; // Howto linebreak? | ||
$field->validators[] = new NotEmpty(); | ||
$field->validators[] = new CharacterLength(4, 5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a Checkbox for boolean settings instead of saving a string.
See here for an example:
tag-manager/Template/Tag/RaygunTag.php
Lines 29 to 33 in 5649e87
$this->makeSetting('raygunEnablePulse', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { | |
$field->title = 'Enable Pulse (Real User Monitoring)'; | |
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; | |
$field->description = 'Automatically identify front end performance issues causing slow page load speeds. See what your users see in the browser and discover why users had poor quality experiences.'; | |
}) |
Template/Tag/LivezillaDynamicTag.php
Outdated
$field->validators[] = new NotEmpty(); | ||
$field->validators[] = new CharacterLength(4, 5); | ||
}), | ||
$this->makeSetting('LivezillaDynamicCookieLawName', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the cookie feature makes this tag unnecessarily complicated and hard to understand.
@tsteur What do you think about adding a cookie feature (trigger?) to MTM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I using it with an other implantation for the tag-manager. It respect the Privacy of European Users and load this Tag only when he really accept those parts on an website.
The tag-manager gives me no real way to document this for other users.
if (document.cookie.indexOf('' + LivezillaDynamicCookieLawName + '=' + LivezillaDynamicCookieLawValue + '') > -1 ) { | ||
var s1 = document.createElement("script"), s0 = document.getElementsByTagName("script")[0]; | ||
s1.type = 'text/javascript'; | ||
s1.defer = LivezillaDynamicDefer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason you never store boolean values as a string.
Even in Javascript "false"
is true/truthy which means that if a user had entered "false"
into the settings it would still be deferred.
Because this returns this is truthy
if ("false") {
console.log("this is truthy")
} else {
console.log("this is falsey")
}
lang/de.json
Outdated
@@ -278,6 +278,9 @@ | |||
"LastUpdated": "Zuletzt aktualisiert", | |||
"LastVersions": "Letzte Versionen", | |||
"LearnMore": "Mehr dazu", | |||
"LivezillaDynamicTagName": "Livezilla Chat / Monitoring", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translations are managed via transifex, so please don't modify them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not knew that.
This reverts commit 9288123.
Template/Tag/LivezillaDynamicTag.php
Outdated
$field->validators[] = new NotEmpty(); | ||
$field->validators[] = new CharacterLength(32); | ||
}), | ||
$this->makeSetting('LivezillaDynamicDomain', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure but could this be maybe automatically configured in the JavaScript depending on the current domain? eg var LivezilleDomain = localhost.origin
or so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tsteur I am not sure, but as I understood it this is the URL where Livezilla is installed (so similar to the Matomo URL)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Makes sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appart from the question on how to best handle opt-out/opt-in cookies, this looks good to me now.
@tsteur, can you please take a closer look.
$this->makeSetting('LivezillaDynamicDefer', true, FieldConfig::TYPE_BOOL, function (FieldConfig $field) { | ||
$field->title = 'Livezilla Script "defer"?'; | ||
$field->uiControl = FieldConfig::UI_CONTROL_CHECKBOX; | ||
$field->description = 'In most cases you should let it activated.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, be good to give an example when it makes sense to disable it. Not needed though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No its really not needed. But sometimes you have sites where you would remove this part. So there are 2 Options. Remove "defer" completely or leave it as default and give an user no options to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it and worked fine for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheers 👍 I'll merge soon
Add LiveZilla Tag
Tested and working.
Using it a few days on own Websites.
I think it has all options that are needed.