Need help from Wordpress Experts

sabs_rocks

Active member
Oct 6, 2019
224
101
43
techarea.in
Hi,

In my website, www.techarea.in for the past few days i ecountering an 404 issue in chrome console due to the below file in site :

GET https://s0.wp.com/…ontent/js/devicepx-jetpack.js?ver=201831 net::ERR_ABORTED 404

Due to this, the google tracking ( analytics ) is not working.

I have reached out to the jetpack support forums but looks like the devicepx.js is not part of the plugin for many months now which is also correct. This was verified after checking in internet. But somehow, my website is still having this code in it .

Also, i tried completely removing the plugin, clearing files at backend and purging cache. Nothing is removing the above line of code in my website.

Any suggestions to resolve this will help!

Appreciate the support !!
 

starliner

Well-known member
Null Master
Trusted Uploader
Mar 28, 2019
559
530
93
Disable your plugins one by one check if its there
At last check your theme files, footer and header

Edit it seems your share plugin cause this.

Disable share plugin
 

Saint Gabriel

Well-known member
Jan 3, 2020
2,998
3,049
113
List the plugins you have on your website here.

Let's see which could be the culprit.

Perhaps you should clear cache then delete .htaccess file.
 
  • Like
Reactions: sabs_rocks

webhugo

Well-known member
Trusted Uploader
Jun 12, 2020
99
147
50
Hello @sabs_rocks ,

Seems you're using Jetpack plugin. Jetpack loads that .js file you mentioned. Many people use Jetpack but I don't recommend that to anyone. It eats up a lot of your website's resources and makes it slow in many ways. You can simply disable that plugin and use other alternatives.

Or, if you still want to keep using Jetpack on your site, please refer this article to unload that .js file:

I hope this helps. A Like would be appreciated if it did.:)
Thanks.
 

frizzel

Well-known member
Trusted Uploader
Jun 13, 2019
485
253
63
Wherever my imagination takes me
Although the link @webhugo provided certainly is a good solution, I'd want to see where exactly the problem originates. As the OP stated, the file devicepx.js is removed from JetPack.

It might have to do with Cloudflare which you use. If temporarily disabling and then enabling Cloudflare doesn't help, search through your files source codes where the function "parseJSAtOnload" is included, because it's that function that adds the javascript file to your footer.
 
  • Like
Reactions: sabs_rocks

sabs_rocks

Active member
Oct 6, 2019
224
101
43
techarea.in
Disable your plugins one by one check if its there
At last check your theme files, footer and header

Edit it seems your share plugin cause this.

Disable share plugin

I did that approach as suggested by Jetpack plugin creator. Disabled every plugin used ( with & without jetpack ) , still that devicepx.js was present.

For the theme files check, should i directly check the *.php files and search for the devicepx ?? OR is there other ways to check whether the code is somehow manually included in theme files ?
 

sabs_rocks

Active member
Oct 6, 2019
224
101
43
techarea.in
List the plugins you have on your website here.

Let's see which could be the culprit.

Perhaps you should clear cache then delete .htaccess file.

I have cleared the cache in website and also in the cloudflare configurations settings...

Removing htaccess file means, are you suggesting to create a new one ?

Below are plugins used

jetpack
Async Javascript
Fullwidth Page templates
Gonzales
LuckyWP TOC
SiteOrigins Page Builder
SG Optimizer( siteground plugin )
Tablepress
Ultimate Addons
UpdraftPlus
Vafpress Post Formats UI
Wordfence Security
WPBakery Builder
Yoast SEO
Yellow Pencil Pro
 

sabs_rocks

Active member
Oct 6, 2019
224
101
43
techarea.in
Hello @sabs_rocks ,

Seems you're using Jetpack plugin. Jetpack loads that .js file you mentioned. Many people use Jetpack but I don't recommend that to anyone. It eats up a lot of your website's resources and makes it slow in many ways. You can simply disable that plugin and use other alternatives.

Or, if you still want to keep using Jetpack on your site, please refer this article to unload that .js file:

I hope this helps. A Like would be appreciated if it did.:)
Thanks.

Thanks for the link but i have already tried to it, introduced the piece of code in theme php file but nothing changed. I think that solution works when the devicepx.js is actually present in jetpack.

I also now wanted to come out of jetpack, but even after deleting the plugin , the .js is still present in my website
 

sabs_rocks

Active member
Oct 6, 2019
224
101
43
techarea.in
Although the link @webhugo provided certainly is a good solution, I'd want to see where exactly the problem originates. As the OP stated, the file devicepx.js is removed from JetPack.

It might have to do with Cloudflare which you use. If temporarily disabling and then enabling Cloudflare doesn't help, search through your files source codes where the function "parseJSAtOnload" is included, because it's that function that adds the javascript file to your footer.

yes, i keeping that option of disabling cloudflare (and rerouting nameserver) and planning to do it at midnight to be safer and not break the site....

On the function 'parseJSOnload', can you clarify where exactly to check it or search for it ?
 

frizzel

Well-known member
Trusted Uploader
Jun 13, 2019
485
253
63
Wherever my imagination takes me
It's by the way no surprise the file cannot be found, as it is pointing to https://s0.wp.com/…ontent/js/devicepx-jetpack.js which is an invalid url, the file is actually located at https://s0.wp.com/wp-content/js/devicepx-jetpack.js

Anyway, since the script type has a prefix that is added by Cloudflare I keep thinking it has something to do with Cloudflare. Purging the cache is probably not enough, just completely disable Cloudflare temporarily. You should be able to de-activate Cloudflare in your SiteGround account.

If the file is then still present in your source code, the only way to find where it's added is searching through your files (but of course an automatic search, a code editor can do that in seconds).
 

videva

Member
Aug 25, 2020
75
53
18
Hi,

In my website, www.techarea.in for the past few days i ecountering an 404 issue in chrome console due to the below file in site :

GET https://s0.wp.com/…ontent/js/devicepx-jetpack.js?ver=201831 net::ERR_ABORTED 404

Due to this, the google tracking ( analytics ) is not working.

I have reached out to the jetpack support forums but looks like the devicepx.js is not part of the plugin for many months now which is also correct. This was verified after checking in internet. But somehow, my website is still having this code in it .

Also, i tried completely removing the plugin, clearing files at backend and purging cache. Nothing is removing the above line of code in my website.

Any suggestions to resolve this will help!

Appreciate the support !!
you need to remove this script from footer.php or function.php, go check your theme file, find this script
JavaScript:
function parseJSAtOnload() {var links = ["https://s0.wp.com/…ontent/js/devicepx-jetpack.js?ver=201831", "https://secure.gravatar.com/js/gprofiles.js?ver=2018Julaa","https://platform.linkedin.com/in.js?ver=4.9.7", "https://platform.twitter.com/widgets.js?ver=4.9.7"],headElement = document.getElementsByTagName("head")[0],linkElement, i;for (i = 0; i < links.length; i++) {linkElement = document.createElement("script");linkElement.src = links[i];headElement.appendChild(linkElement);}}if (window.addEventListener)
window.addEventListener("load", parseJSAtOnload, false);else if (window.attachEvent)
window.attachEvent("onload", parseJSAtOnload);else window.onload = parseJSAtOnload;
 

frizzel

Well-known member
Trusted Uploader
Jun 13, 2019
485
253
63
Wherever my imagination takes me
you need to remove this script from footer.php or function.php, go check your theme file, find this script
JavaScript:
function parseJSAtOnload() {var links = ["https://s0.wp.com/…ontent/js/devicepx-jetpack.js?ver=201831", "https://secure.gravatar.com/js/gprofiles.js?ver=2018Julaa","https://platform.linkedin.com/in.js?ver=4.9.7", "https://platform.twitter.com/widgets.js?ver=4.9.7"],headElement = document.getElementsByTagName("head")[0],linkElement, i;for (i = 0; i < links.length; i++) {linkElement = document.createElement("script");linkElement.src = links[i];headElement.appendChild(linkElement);}}if (window.addEventListener)
window.addEventListener("load", parseJSAtOnload, false);else if (window.attachEvent)
window.attachEvent("onload", parseJSAtOnload);else window.onload = parseJSAtOnload;
Yeah, that's what I already wrote, find the function "parseJSAtOnload". By the way, it doesn't seem to be in the files of the theme he uses - JNews (at least, when the OP has gotten it from Babiato).
So what exactly do you @videva contribute here?
 

videva

Member
Aug 25, 2020
75
53
18
Yeah, that's what I already wrote, find the function "parseJSAtOnload". By the way, it doesn't seem to be in the files of the theme he uses - JNews (at least, when the OP has gotten it from Babiato).
So what exactly do you @videva contribute here?


@sabs_rocks then just put this code below into footer.php if you cant find that script
put it after <? php wp_footer (); ?> and above the </body> tag

JavaScript:
function removeOnload(func)
{
    if(window.addEventListener)
        window.removeEventListener('load', func, false);
    else if(window.attachEvent)
        window.detachEvent('onload', func);
}

window.onload = removeOnload(parseJSAtOnload);
example :
HTML:
<?php wp_footer(); ?>
   
<!-- PUT CODE HERE -->
   
   
</body>
</html>
it will stop the parseJSAtOnload function.
 
Last edited:
  • Like
Reactions: sabs_rocks

videva

Member
Aug 25, 2020
75
53
18
I honestly think it's much better to get to the origin of the problem and remove that.
if he put code that i have given , the results will be same if he remove function parseJSAtOnload
directly from a file.
function parseJSAtOnload will not run anymore
 
Last edited:
  • Like
Reactions: sabs_rocks

sabs_rocks

Active member
Oct 6, 2019
224
101
43
techarea.in
@frizzel @videva Thanks for your inputs.

First, I removed cloudflare completely from the website. purged the cache, still the issue was present

Then, as @videva said introduced the given piece of code in footer.php theme file present in : Appearance -> Theme Editor -> Theme -> footer.php . But still the code is present in the site when loaded and the issue too.


I am cannot find the parseJSAtOnload function in footer,function or header php files when checking in WP dashboard.

can you advise what other ways we can search the php files in depth so that i can find the function and then insert the code there ?

Any other suggestions to fix this ?

Appreciate your support very much guys !
 

Milberg

Member
Nov 2, 2018
78
21
8
Hello Friend! From what I can see, you placed the code incorrectly. Place it before </body>
 

Attachments

  • Снимок экрана 2020-09-17 в 20.46.48.png
    Снимок экрана 2020-09-17 в 20.46.48.png
    93.7 KB · Views: 6

Milberg

Member
Nov 2, 2018
78
21
8
Another extreme option. Activate the default template. Remove the one that is installed now, reinstall it and activate it. Make a backup.
 

Forum statistics

Threads
69,498
Messages
910,047
Members
239,993
Latest member
Stopthesmoke

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