I installed the plugin, it worked at first, but then when I click on the chat bubble nothing works. I think this is related to js but I don't understand how to fix it. I uninstalled the plugin, removed all the plugin files from ftp and reinstalled but nothing changes.
I found the source of the problem. Normally when the plugin is first loaded, the codes are added to the site and the output looks like this:
<!-- start: mybbmessenger_iframe -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
#messengerFrame {
height: 490px;
position: fixed;
right: 2%;
border: 0;
z-index: 99999;
border-radius: 6px;
border: 1px solid #999;
bottom: 5px;
width: 330px;
display: none;
}
#messengerClose, #messengerOpen {
position: fixed;
right: 2%;
z-index: 999;
background: #5876ab;
padding: 6px;
text-align: center;
color: #fff;
cursor: pointer;
border-radius: 50%;
border: 2px solid #fff;
bottom: 495px;
}
#messengerClose {
display: none;
}
#unreadmsg {
color: #fff !important;
position: absolute;
z-index: 999;
top: -13px;
background: green;
width: 19px;
border-radius: 50%;
height: 19px;
right: -13px;
border: 2px solid #fff;
line-height: 19px;
font-size: 12px;
display: none;
}
</style>
<div id="messengerClose">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
<div id="messengerOpen">
<span id="unreadmsg"></span><i class="fa fa-comment" aria-hidden="true"></i>
</div>
<iframe src="https://forum.filmbol.org/messenger.php" id="messengerFrame"></iframe>
<script>
document.getElementById("messengerFrame").onload = function() {
var unframe = document.getElementById("messengerFrame");
var undoc = unframe.contentDocument;
var unbody = undoc.body;
var unelm = unbody.getElementsByClassName("unreadmsg")[0];
document.getElementById("unreadmsg").innerHTML = unelm.innerHTML;
var uncom = unelm.innerHTML;
if(uncom>0) {
document.getElementById("unreadmsg").style.display = "block";
} else {
document.getElementById("unreadmsg").style.display = "none";
}
}
document.getElementById("messengerOpen").onclick = function() {
document.getElementById("messengerOpen").style.display = "none";
document.getElementById("messengerClose").style.display = "initial";
document.getElementById("messengerFrame").style.display = "initial";
}
document.getElementById("messengerClose").onclick = function() {
document.getElementById("messengerOpen").style.display = "initial";
document.getElementById("messengerClose").style.display = "none";
document.getElementById("messengerFrame").style.display = "none";
}
</script>
<!-- end: mybbmessenger_iframe -->
But when you uninstall the plugin, these codes are not deleted from the site for some reason and I have no idea where they are stored.
Then, if you decide to install the plugin again, you will install it, but since it leaves code in the background and you could not delete it the previous time, the new output looks like this:
<!-- start: mybbmessenger_iframe -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
#messengerFrame {
height: 490px;
position: fixed;
right: 2%;
border: 0;
z-index: 99999;
border-radius: 6px;
border: 1px solid #999;
bottom: 5px;
width: 330px;
display: none;
}
#messengerClose, #messengerOpen {
position: fixed;
right: 2%;
z-index: 999;
background: #5876ab;
padding: 6px;
text-align: center;
color: #fff;
cursor: pointer;
border-radius: 50%;
border: 2px solid #fff;
bottom: 495px;
}
#messengerClose {
display: none;
}
#unreadmsg {
color: #fff !important;
position: absolute;
z-index: 999;
top: -13px;
background: green;
width: 19px;
border-radius: 50%;
height: 19px;
right: -13px;
border: 2px solid #fff;
line-height: 19px;
font-size: 12px;
display: none;
}
</style>
<div id="messengerClose">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
<div id="messengerOpen">
<span id="unreadmsg"></span><i class="fa fa-comment" aria-hidden="true"></i>
</div>
<iframe src="https://forum.filmbol.org/messenger.php" id="messengerFrame"></iframe>
<script>
document.getElementById("messengerFrame").onload = function() {
var unframe = document.getElementById("messengerFrame");
var undoc = unframe.contentDocument;
var unbody = undoc.body;
var unelm = unbody.getElementsByClassName("unreadmsg")[0];
document.getElementById("unreadmsg").innerHTML = unelm.innerHTML;
var uncom = unelm.innerHTML;
if(uncom>0) {
document.getElementById("unreadmsg").style.display = "block";
} else {
document.getElementById("unreadmsg").style.display = "none";
}
}
document.getElementById("messengerOpen").onclick = function() {
document.getElementById("messengerOpen").style.display = "none";
document.getElementById("messengerClose").style.display = "initial";
document.getElementById("messengerFrame").style.display = "initial";
}
document.getElementById("messengerClose").onclick = function() {
document.getElementById("messengerOpen").style.display = "initial";
document.getElementById("messengerClose").style.display = "none";
document.getElementById("messengerFrame").style.display = "none";
}
</script>
<!-- end: mybbmessenger_iframe -->
<!-- start: mybbmessenger_iframe -->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<style>
#messengerFrame {
height: 490px;
position: fixed;
right: 2%;
border: 0;
z-index: 99999;
border-radius: 6px;
border: 1px solid #999;
bottom: 5px;
width: 330px;
display: none;
}
#messengerClose, #messengerOpen {
position: fixed;
right: 2%;
z-index: 999;
background: #5876ab;
padding: 6px;
text-align: center;
color: #fff;
cursor: pointer;
border-radius: 50%;
border: 2px solid #fff;
bottom: 495px;
}
#messengerClose {
display: none;
}
#unreadmsg {
color: #fff !important;
position: absolute;
z-index: 999;
top: -13px;
background: green;
width: 19px;
border-radius: 50%;
height: 19px;
right: -13px;
border: 2px solid #fff;
line-height: 19px;
font-size: 12px;
display: none;
}
</style>
<div id="messengerClose">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
<div id="messengerOpen">
<span id="unreadmsg"></span><i class="fa fa-comment" aria-hidden="true"></i>
</div>
<iframe src="https://forum.filmbol.org/messenger.php" id="messengerFrame"></iframe>
<script>
document.getElementById("messengerFrame").onload = function() {
var unframe = document.getElementById("messengerFrame");
var undoc = unframe.contentDocument;
var unbody = undoc.body;
var unelm = unbody.getElementsByClassName("unreadmsg")[0];
document.getElementById("unreadmsg").innerHTML = unelm.innerHTML;
var uncom = unelm.innerHTML;
if(uncom>0) {
document.getElementById("unreadmsg").style.display = "block";
} else {
document.getElementById("unreadmsg").style.display = "none";
}
}
document.getElementById("messengerOpen").onclick = function() {
document.getElementById("messengerOpen").style.display = "none";
document.getElementById("messengerClose").style.display = "initial";
document.getElementById("messengerFrame").style.display = "initial";
}
document.getElementById("messengerClose").onclick = function() {
document.getElementById("messengerOpen").style.display = "initial";
document.getElementById("messengerClose").style.display = "none";
document.getElementById("messengerFrame").style.display = "none";
}
</script>
<!-- end: mybbmessenger_iframe -->
Now the codes have been added 2 times as seen on the result screen. This negatively affects the functionality of the plugin and the chat screen does not appear. I have done the uninstallation and installation 3 times and I have 3 of the same codes appear on the result screen. When I delete more codes from the Chrome Review screen, everything works fine, but I could not find the root cause of the problem. Codes are not included in MYSQL. Everything looks normal in the templates.