Removing the nitropack inscription at the bottom

gokurdera

Member
Feb 4, 2019
80
16
8
Hi,
I have a website that is on Wordpress on Divi.
Earlier I used the WP Rocket plugin and I was satisfied, at the same time I learned about nitropack and the effects are amazing.
I use the free version and something like this (screen) appeared at the bottom. 29840
I tried to remove it using css, at the same time when I enter the site via wp-admin I can not see this inscription anymore. My guess is that this is a type of blockage so that I don't remove it.
I have my footer off, so it's not on the footer.
Do you have any ideas or someone has already done something similar?
 

ashfaqzone

New member
Jun 20, 2020
5
2
3
Hi,
I have a website that is on Wordpress on Divi.
Earlier I used the WP Rocket plugin and I was satisfied, at the same time I learned about nitropack and the effects are amazing.
I use the free version and something like this (screen) appeared at the bottom. 29840
I tried to remove it using css, at the same time when I enter the site via wp-admin I can not see this inscription anymore. My guess is that this is a type of blockage so that I don't remove it.
I have my footer off, so it's not on the footer.
Do you have any ideas or someone has already done something similar?
Hello kindly help me removing it from my site as well please?
 
  • Like
Reactions: digitalwebport

imman jeba

New member
Oct 8, 2020
2
0
1
Hi,
I have a website that is on Wordpress on Divi.
Earlier I used the WP Rocket plugin and I was satisfied, at the same time I learned about nitropack and the effects are amazing.
I use the free version and something like this (screen) appeared at the bottom. 29840
I tried to remove it using css, at the same time when I enter the site via wp-admin I can not see this inscription anymore. My guess is that this is a type of blockage so that I don't remove it.
I have my footer off, so it's not on the footer.
Do you have any ideas or someone has already done something similar?
do you have any solution for that?
 

gokurdera

Member
Feb 4, 2019
80
16
8
do you have any solution for that?
I found something like this:
.npf__message {display: none! important}

or even better:
.npf {display: none! important}

But I am afraid that this second option would hide more than badge if they also add something else to the website.

People wrote that it works, but I haven't tested it myself. I gave up nitropack because it was causing errors on the site.

Good luck ! :D
 

videva

Member
Aug 25, 2020
75
53
18
Hello kindly help me removing it from my site as well please?
do you have any solution for that?
@gokurdera there are 2 method to hide the badge
1. using javascript
put this code to footer.php and purge cache,
*the badge will remove from bottom of page but still exist if you see view-source of you page.
JavaScript:
<script>
(function() {

let divc = document.querySelector('div[style]');
if(divc){
let actdisplay = window.getComputedStyle(divc, null).display;
let actclear = window.getComputedStyle(divc, null).clear;

if(actdisplay == 'block' && actclear == 'both')    {
divc.remove();
}
}

})();

</script>
if the js code above doesn't work, use code below
JavaScript:
<script>
document.addEventListener("DOMContentLoaded", function(){
let divc = document.querySelectorAll('div[style]');
for (let i = 0, len = divc.length; i < len; i++) {

let actdisplay = window.getComputedStyle(divc[i], null).display;
let actclear = window.getComputedStyle(divc[i], null).clear;

if(actdisplay == 'block' && actclear == 'both')    {
divc[i].remove();
}
}
});  
   
</script>

2. using php
you need edit file wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache.php
you dont need purge cache if you using this method

PHP:
# first find
public function readfile()
# and find this code inside readfile function

if ($this->canUseCompression() && (ini_get("zlib.output_compression") === "0" || ini_set("zlib.output_compression", "0") !== false)) {
            $filePath .= ".gz";
}
#changed to
if ($this->canUseCompression() && (ini_get("zlib.output_compression") === "0" || ini_set("zlib.output_compression", "0") !== false)) {
           //$filePath .= ".gz";
}

# after that, find this code inside readfile function
echo $file->content;
# changed to
//echo $file->content;
echo preg_replace('/<template id="[^>]*">[^>]*<style>.*?nitropack.io.*?<\/script>.+<script>/s', '<script>', $file->content);
*ofcourse you can modify the regex to make it better, but for me it's working fine
you can see if the code working or not in here POC
11.png
 
Last edited:

xpresotw

Well-known member
Trusted Uploader
May 13, 2019
289
420
63
Indonesia
@gokurdera there are 2 method to hide the badge
1. using javascript
put this code to footer.php and purge cache,
*the badge will remove from bottom of page but still exist if you see view-source of you page.
JavaScript:
<script>
(function() {

let divc = document.querySelector('div[style]');
if(divc){
let actdisplay = window.getComputedStyle(divc, null).display;
let actclear = window.getComputedStyle(divc, null).clear;

if(actdisplay == 'block' && actclear == 'both')    {
divc.remove();
}
}

})();
</script>

2. using php
you need edit file wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache.php
you dont need purge cache if you using this method

PHP:
# first find
public function readfile()
# and find this code inside readfile function
echo $file->content;
# changed to
//echo $file->content;
echo preg_replace('/<template id="[^>]*">[^>]*<style>.*?nitropack.io.*?<\/script>.+<script>/s', '<script>', $file->content);
*ofcourse you can modify the regex to make it better, but for me it's working fine
you can see if the code working or not in here POC
11.png
Thank you, just trying, i dont event use nitropack on my site, since my site always static, only needed when editing or adding a post on EC2.

Your tips number 1, it woks. but no with number 2, there's no such a file in Nitropack SDK named Pagecache.php.

but it work on Point 1 :)
nice
 

videva

Member
Aug 25, 2020
75
53
18
Thank you, just trying, i dont event use nitropack on my site, since my site always static, only needed when editing or adding a post on EC2.

Your tips number 1, it woks. but no with number 2, there's no such a file in Nitropack SDK named Pagecache.php.

but it work on Point 1 :)
nice
maybe you didn't see it bro but the file is there :)
1.jpg
 

xpresotw

Well-known member
Trusted Uploader
May 13, 2019
289
420
63
Indonesia
maybe you didn't see it bro but the file is there :)
1.jpg
OMG! hahaha my bad, I did't check the Nitropack folder inside nitropack-sdk folder.. -_-
nitro.png.png
so when we remove the exixting site from nitropack dashboard and re-register the site, will the quota be reset? i've used 200 out of 200 available for the test :D
 
  • Love
Reactions: TassieNZ

videva

Member
Aug 25, 2020
75
53
18
OMG! hahaha my bad, I did't check the Nitropack folder inside nitropack-sdk folder.. -_-
nitro.png.png
so when we remove the exixting site from nitropack dashboard and re-register the site, will the quota be reset? i've used 200 out of 200 available for the test :D
hahaha i don't know about it bro,
i think better you use wp-rocket without quota limit.

*no need to purge your cache if you remove the nitropack badge from pagecache.php
 

xpresotw

Well-known member
Trusted Uploader
May 13, 2019
289
420
63
Indonesia
hahaha i don't know about it bro,
i think better you use wp-rocket without quota limit.

*no need to purge your cache if you remove the nitropack badge from pagecache.php
just tested and it reset actually, :)
gooooooooddd nitr.png
 

ebersol

New member
May 4, 2020
1
0
3
@gokurdera there are 2 method to hide the badge
1. using javascript
put this code to footer.php and purge cache,
*the badge will remove from bottom of page but still exist if you see view-source of you page.
JavaScript:
<script>
(function() {

let divc = document.querySelector('div[style]');
if(divc){
let actdisplay = window.getComputedStyle(divc, null).display;
let actclear = window.getComputedStyle(divc, null).clear;

if(actdisplay == 'block' && actclear == 'both')    {
divc.remove();
}
}

})();
</script>

2. using php
you need edit file wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache.php
you dont need purge cache if you using this method

PHP:
# first find
public function readfile()
# and find this code inside readfile function
echo $file->content;
# changed to
//echo $file->content;
echo preg_replace('/<template id="[^>]*">[^>]*<style>.*?nitropack.io.*?<\/script>.+<script>/s', '<script>', $file->content);
*ofcourse you can modify the regex to make it better, but for me it's working fine
you can see if the code working or not in here POC
11.png

Perfect friend. Thks.
 

danielpk

Active member
Trusted Uploader
Oct 24, 2020
178
130
43
36
Malaysia
sayanak.com.my
Hey guys. I tested out NitroPack, and somehow I only got the footer banner once, and then it was gone. Accessing the site from a different location didn't show the banner either. Purged the site cache from Cloudflare too, and I don't see the banner anymore.

Not sure what happened.
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu