Removing the nitropack inscription at the bottom

danielpk

Active member
Trusted Uploader
Oct 24, 2020
178
130
43
36
Malaysia
sayanak.com.my
edit your wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache


--> find
public function readfile()
--> 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);

Thank you for sharing!
 

aminerafik

New member
Feb 6, 2021
1
0
1
hi everyone please help me remove nitropack footer link , from pagecache.php please i paste the code and my website break down, help me remove the footer link
 

harrisonsbc

New member
Feb 4, 2021
3
0
1
edit your wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache


--> find
public function readfile()
--> 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);

TKS
I will do the implementation
 

imthiyasvm

New member
Feb 7, 2021
1
1
3
edit your wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache


--> find
public function readfile()
--> 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);
 
  • Like
Reactions: Tyealia

furqan

New member
Feb 26, 2021
1
0
1
Hi, I have added above
@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
Hi, I have tried these scripts and styles. But nitro plugin showing error.
 

Saint Gabriel

Well-known member
Jan 3, 2020
2,998
3,049
113
Hey i am running a website i tried nitropack plugin to optimize my website i tried the above two codes etc.
i also tried this .npf{display: none !important}
but footer is still on the bottom.
any possible solution?
Hey i am running a website i tried nitropack plugin to optimize my website i tried the above two codes etc.
i also tried this .npf{display: none !important}
but footer is still on the bottom.
any possible solution?
Hm? @medw1311
 
Last edited by a moderator:
  • Like
Reactions: MrSam_1

maryana5

New member
Mar 22, 2021
1
0
1
Thank you very much. It worked perfectly! @dweep

Solution: modify the PHP code in wp-content/plugins/nitropack/nitropack-sdk/NitroPack/SDK/Pagecache
 

CodeGuruji

Member
Apr 17, 2020
40
17
8
Just get the HTML class and go to WP-admin -> Themes -> Customize -> Additional Css

Add this code, but before adding also copy the HTML class

Code:
YOURCLASS {
    background: #fff;
    color: #454545;
    visibility: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

Mine is something like this
Code:
.MYcAyDjwgjAZjMExYjN3DMAu2Zz3theme--light {
    background: #fff;
    color: #454545;
    visibility: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

and it works....
 

asifbaloch517

New member
Apr 4, 2021
4
0
1
You can Remove Nitropack Footer using javascript.
Please watch this tutorial on how to do it.


Just get the HTML class and go to WP-admin -> Themes -> Customize -> Additional Css

Add this code, but before adding also copy the HTML class

Code:
YOURCLASS {
    background: #fff;
    color: #454545;
    visibility: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

Mine is something like this
Code:
.MYcAyDjwgjAZjMExYjN3DMAu2Zz3theme--light {
    background: #fff;
    color: #454545;
    visibility: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

and it works...
Hi code Guruji,
you can see in that video I posted earlier these classes are being changed dynamically by the plugin so a static class will not work. you need a javascript to handle it. and its in the video.
 

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