Odd code being injected into WordPress site except when logged in - wordpress

I'm working on a website that was previously hacked and thought I had cleared everything out of it, but recently it started loading extremely slow (~7 seconds) without touching anything. What makes it really weird is if I'm logged into my admin account, the site loads fine and the code below isn't injected.
After digging through a bunch of stuff, I came across this code being injected and can't track down where its coming from. Not sure if its related to the slow load time, but its messing up the styling all over my site:
<div id="top_bar">
<p class="mob_phone">
<i class="icon-envelope-alt"></i>
...
<!-- weird code starts here -->
<meta charset="EUC-JP">
<title>404 File Not Found</title>
<meta name="copyright" content="Copyright XSERVER Inc.">
<meta name="robots" content="INDEX,FOLLOW">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0">
<style type="text/css">
* {
margin: 0;
padding: 0;
}
...
</style>
</p>
...
What I've Tried
I've disabled all my plugins and it still shows.
I've done a Sublime Find search in the theme and child theme directories and didn't find any of that code
I've Googled the name XSERVER but didn't find anything helpful
Searched a database dump
If anybody recognizes it and can point me to how I can remove it, or has any other ideas on how to track down whats injecting it, it would be greatly appreciated! I'm running out of ideas

It looks like you have the Japanese version of wordpress. Please see here for reference - https://translate.google.co.uk/translate?hl=en&sl=ja&u=https://www.xserver.ne.jp/manual/man_install_auto_word.php&prev=search
I would recommend uploading the core files from the English site - https://en-gb.wordpress.org/download/
This should solve your problems.
It might be worth checking what theme you're using as well and seeing if it's a Japanese theme.

Related

OG tags not working with react-helmet and Netlify

I cannot for the life of me figure this out. The following site is hosted on Netlify and prerendering is enabled. When inspecting the page, all of the OG tags are correct. These tags are injected using react-helmet.
https://browniepoints.africa/opportunities/volunteer-at-a-soup-kitchen-every-week-on-thursdays
When scraping the above URL on the Facebook debugger, it responds with:
The following required properties are missing: og:url, og:type, og:title, og:image, og:description, fb:app_id
The only one of those errors/warnings that should be there is the app_id, which I don't care about.
I've waited well over 48 hours for caches to clear, I've tried scraping with query strings appended to the URL, and the images have absolute URLs. But not even the description tag is pulling through.
Can somebody that uses react-helmet and Netlify please shed some definitive light onto this problem?
This is related to a known prerendering issue.
My fix was to remove the <!DOCTYPE html> declaration from the index.html file as a temporary workaround until the above issue is resolved.
While I can't tell you exactly why. your SSR is not working correctly. Go to Chrome DevTools and click the 3 vertical dots next to Console:
Select Networking Conditions, then uncheck Select Automatically and enter Googlebot/2.1 (+http://www.google.com/bot.html):
Now refresh the page and notice that all you see on the site is some plaintext saying "html" and even your javascript bundle is missing. This is what your html looks like:
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="fragment" content="!">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Brownie Points</title>
<link href="/static/css/2.3bf0f3c5.chunk.css" rel="stylesheet">
</head>
<body><noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
Note that Netlify SSR is in Beta but I personally didn't have those issues with it. Have you done any other steps other than enable it? I have tested it to be working with a CRA generated app before.

Springboot can't find resources! (Suddenly stopped working)

So the thing is, since I moved my resources (css, images, js) to resources/static folder my stuff started working.
Until I created a new .html page (meant to be dynamic) and pasted in resources/templates. Then all my resources (css, images) stopped working (can't be found) and I can't make it work again.
I'm using SpringBoot + Thymeleaf and the code can be found at GitHub
I couldn't manage to find a solution after 3 hours of searching, that's why I'm here. Thank you, hope you guys can help :/
Edit (some images):
My project structure
The link:
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css'/>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css'/>
What happens (was working before, I didn't change anything in the code of listed images)
I'm not sure what happened but after starting deleting/commenting some code I wasn't using anymore I started to get errors and managed to track the next file to "fix" (delete or comment) and after that it worked again.
Looks like something in the application wasn't right and it didn't give me any erros so I had to manually try to find it.
I'll keep updating this thread if I find anything useful related.

css is not working in my web2py application

I am building a web2py application.
I use my own css file called style.css
I do know that the following code
{{response.files.append(URL('static','css/base.css'))}}
{{include 'web2py_ajax.html'}}
will link my css file to my application.
I use this for layout.html; which is used for every page of application.
Initially, I do not have problem with this...
Suddenly, at some point, my css is not updated...
Every css before the point, works fine.
Every css after the point, do not work at all.
In web2py editor, all css changes are updated. However, If if run it, the css is not updated... If I inspect the css code using chrome, the css is not updated and remain to previous css file..
for clarification, I give you example
initially I just have the following.
#title{
font-size: 90px;
}
then I change it to the following
#title{
font-size:100px;
}
IN the web2py editor, the change is saved and set it to 100px. However, if i run the application and view css file using chrome inspect, it is still remained as 90px.
I thought the server may have some error, so I restarted. I still get error.
Another thing I can think of is the confit with bootstrap..
The following is the head part of layout.html
<head>
<title>NR</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
{{response.files.append(URL('static','css/bootstrap.min.css'))}}
{{response.files.append(URL('static','css/style.css'))}}
{{include 'web2py_ajax.html'}}
</head>
Actually, I do have a solution...
If I create css file with different name, and copy and paste all css work, it work!!
However, this takes extra work... create new css file and copy and paste.... It is not good way.
Can you help me?
Thank you
Perhaps your web server is configured to set the HTTP response headers so the assets will be cached by the browser (in which case, they will not be re-sent on every request). If this is just a development issue, you can simply force your browser to reload all assets (e.g., by pressing CTRL-F5).
For a more general solution, see the documentation on static asset management.
Another option is to let web2py serve the static content itself, in which case, the assets will be re-requested with each page and web2py will return 304 responses if the assets have not changed since last sent.

Jekyll on Github Pages applying css styles inconsistently

I am not sure what's going on, but my personal site - built with Jekyll and hosted on Github pages - has been exhibiting odd css styles behavior as of the last few weeks or so.
I originally set it up on Jekyll 1.something-or-other. I am aware that it is at 3.something now and for the longest time, through 2 etc. I have not had a problem with the styles, everthing was fine up until less than a month ago.
I have not made any changes to the styles configuration for a couple years, but now it is only rendering the styles for the pages (Homepage, About Page, list pages for archives, etc.). But on the actual posts, it drops all the styles - looks like raw markdown and images and no layout.
I have updated jekyll to 3.1.2 on my local machine, and what's even stranger is that when I run it locally, it builds fine and all, but the problem is the opposite. That is, all the posts are formatted with the appropriate styles, but the pages (again - Homepage, about page, archive list) are unstyled.
Again, no changes in any configurations. Is there some obvious places I should be looking? I am using the jekyll bootstrap theme that's a little customized. but not much.
Site is http://subtxt.in
I found your repo and poked around. There is a lot going on there, it seems overly complex.
Using Chromes dev tools you can see the problem is with the css loading - on good pages the correct path is: <link href="/assets/themes/the-minimum/css/style.css" rel="stylesheet" media="all">
On posts where it doesn't work it is: <link href="/assets/themes//css/style.css" rel="stylesheet" media="all">
Note the missing theme name - the-minimum.
In your repo I can't quite figure out the logic, but you could simplify it I think. This file - _includes/themes/the-minimum/default.html I believe contains the head section for all pages.
The line <link href='{{ ASSET_PATH }}/css/style.css' rel="stylesheet" media="all"> I think is the problem, `ASSET_PATH seems to come back with different values. Try just hard coding it to be the correct path like:
<link href="/assets/themes/the-minimum/css/style.css" rel="stylesheet" media="all">
I'm not 100% sure this will fix it, but I think it will.
I would add a link to your repo if this doesn't fix it for you so other people can check it.

Site hosted on dropbox not using CSS

I'm hosting a (very) small website on dropbox. I don't even have a domain name for it, I just need an easy way for my not so technology savvy teacher to access it and using an online service like wordpress or tumblr seemed like too much trouble and not as effective as I would like. I plan on putting it in my public folder and just sending her that link, something I've done in the past to show my friends websites I've made in class.
However, for some reason, CSS formatting isn't working. This is a problem I've noticed in the past but at the time wasn't important. I have it relatively linked in my head tag and it works when I pull up the files saved on my hard drive. Its only when I try to access it through dropbox do I notice this problem.
I've looked and it doesn't seem like anyone else has had this problem, I've only found multiple references to dropbox supporting CSS so I have no idea why this is happening.
This is the link in my code, and it's inside the head tag:
<link rel="stylesheet" type="text/css" href="css/format.css" />
Any help would be much appreciated. ^^
EDIT: Here's the page, there's not much on it yet but there's suppossed to be background formatting behind the navigation links in the top.
https://dl-web.dropbox.com/get/Public/EPortfolio/WritingAndForum.html?w=947f0aa1
To give an example expanding on Cfreak's comment, you would need to individually share the CSS file, then reference it in the HTML like this:
<link rel="stylesheet" type="text/css" href="https://dl.dropbox.com/u/1234567/cssfile.css">
A much easier way (and more correct) is to put your stylesheet in a folder called css and then have a relative link to it with "./" It gets you out of the long url trouble.
<link rel="stylesheet" type="text/css" href="./css/styles.css">

Resources