Wordpress Site SLOW to Load - mysql

I just uploaded a Wordpress site from my local machine to a Bluehost shared server. Ran fine locally, but now it is loading very slowly (107 seconds for home page). Bluehost tech support ran GTMetrix site analyzer and came back with "it's the CSS in your theme". They say nothing is wrong with the server.
I definitely need to clean up my CSS, but I didn't think it could have such a large impact on load times. Am I wrong?

Looking at the resource load times with Chrome's developer tools makes it immediately clear that it's your main document that is responsible for the delay; not the CSS, not anything else.
Therefore we have to assume it's something in your own code that causes the delay. Since it worked fine when run locally, the most likely scenario is that your code is trying to connect to some server (perhaps a database?) that it cannot connect to, and the delay is due to the connection finally timing out.
Recommendation: double check the places where you make connections to any external resource, and especially the credentials used when you do so. Is your host authorized to make these connections the same as your local development machine is? If you are connecting by IP, are those IPs accessible from your host?

The problem is loading
http://ad.doubleclick.net/adi/N5192.395082.LOT18.COM/B5529584;sz=300x250;ord=[timestamp]?
which is probably a script?
That takes 59 seconds for me. The rest is fast.
From the Chrome dev tools (Network tab): http://screencast.com/t/8DdtXeEv
The solution: turn off your ads.

You can use quick cache plugin which will speed up you site without compromise.
http://wordpress.org/extend/plugins/quick-cache/

Related

Angular SPA for Offline Use (with DDBB)

I am developing an invoice app with Angular + NodeJs + MySql.
The thing is, the app is planned to be used by one employee in his office. No need for online servers.
It is not problematic to deploy the app online, but the internet is unstable in the zone (Latinamerican problem. You may lose connection for hours, and even voltage variations that may shut down the PC).
So the app must be self sufficient to always work offline.
So my questions are:
Can I simply deploy the app offline? Like in local. If that is the case, I would need for everything to be initialized automatically when the user opens the app (server open, database connected...).
If I have no way but to deploy the app online, should I use Firebase? Also, what happen if the internet service shut downs for hours? Is there a way for the database to be available offline and sync when the internet gets back?
You could build the app as an Electron App, then its becomes a locally run program. https://www.electronjs.org/
You can host it anywhere, but turn the app in to a PWA, which means it will work locally in the browser after a successful visit (gets installed with a service worker in browser) For the database it self, you can store data in the browser but some are limited to 5mb of data in the localstorage / sessionStorage / indexdb. Firebase does have some locally cached data. But if the browser is closed it can be lost.
If it needs to run locally i would go the electron route. Its slightly harder to do but it fills out your usecase better.
You can use both ways if you want to be sync like situation you have to hold data if your internet is not working in local storage or indexed db.
and it is fine you can deploy locally also or make one dedicated server which is always on.so any body in same network can use that angular app easily.
Just take care of backup plan when you system corrupt you should have proper backup of database for such scenario.

An Internal error occured error code 0x4 remote desktop connecting to google cloud Compute Engine VM

When tyring to login to RDP the "old" remote dekstop connection gave "an internal error occured"
And the new modern UI remote dekstop from windows store with version 10.2.1810.0 gave: error code 0x4 remote desktop
It seems a colleage has been logged in with wierd screen size. How can I resolve this without rebooting the machine?
I found a solution.
In the new GUI untick:
"Uppdatera fjärrsessionens upplösning vid storleksändring" in Swedish
Which translates to: Update the resolution of the remote session when resizing
Update remote sessions resolution when size change
Actually, even moving the port off 3389 doesn't help (for long)
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
if there is an open port allowing RDP they will find it eventually and you will need to implement one of the above programs noted by Daniel. That was exactly my issue as well. You can usually tell if the problem is intermittent since it's just luck to get by the constant pounding on the open port...
For me, it was the graphic choice. No idea why but as I swap between the 4 options, only one works
I needed to set it to Highest Quality (32 bit)
However, I then restarted the server, and it no longer worked but True Colour (24 bit) did work! So, hopefully by toggling through each will get you through
In my case the cause was AVG Firewall blocking some RDP connections. I had to configure AVG Remote Access Module to allow RDP connections from some known IP addresses.
Hope this helps someone.
Looks like this error code pop up for many things... from screen resolution resize to colour depth to firewall and more... Which is quite odd. You have to check what is your specific case.
In my case, when I had problems with error code 0x4, it was related to unprotected RDP port.
In my case, it was caused by open, unprotected, RDP port 3389. As many would guess, this is a highly targeted port by bots. If your port is open to anyone in the internet, it's just a matter of time that your server or computer will be targeted.
The best solution would be to only allow connections from trusted IP addresses, the ones you use for connecting to your server.
Of course, that can't always be possible, so another solution would be something like the fail2ban utility used on many Linux servers.
The two solution I've found are EvlWatcher which is free and open source, and IPBan that have a free and open source version, but also a paid version.
You only need one of them, as they do the same thing. Do not install both. They will scan your logs and will temporary or permanently block any IP address with repeated fail connections. I suggest you always have your main IP address whitelisted, so you don't lock yourself out.
Best regards to you all.

Lost control of PWA due to aggressive service worker

I was very cautious about adding a service worker to my PWA that would cache all my files. I tried to implement a system that would always call the server to get a "version" file so that when that "version" file updated, the cache would be cleared.
However, something didn't work correctly, and now the clients no longer call the server at all, since they have the files they need. This is perfect for offline use! But those clients will never call the server again so when I update the site to fix the problem (which I have done), they do not get the update!
Any suggestions on how I can connect with those clients again?
The easiest thing for you to do is deploy a change to your service worker code. In that version clear your cache and remove the buggy code.
Don't worry this happens a lot when you start working with service worker caching. :)

Apache server - show page while server is offline

Since my server is running off my personal laptop, it has quite a lot of down time. Is it possible to have a page that shows up when someone tries to access the site while the server is offline?
Yes, with another server. You can't show pages without server.
If your server is unreachable, then the user browser shows a default page that explains that your server is unreachable...
With an external service (external server) it is possible. A lot of ways to do it. Look for solutions about load balancing for example.
But only with apache on your laptop, I think it is impossible.
Try superuser.com, you'll certainly get more answers about your problem.

Why does my site load slow on my localhost but not on the live site?

I am currently developing a site on my localhost, using mamp, which I then push up to the live site using git. Here is my question. When I refresh the page on my localhost it takes up to a minute to load the page again. When I refresh the page on the live site it refreshes almost instantly. On each refresh it does a couple database queries, but nothing big.
I am using a mysql database, a codeigniter framework, and my site is hosted by Hostgator.
Thanks!
First of all, let me say that this is impossible to answer without a lot more information. That being said, my best guess would be that your local MAMP installation doesn't have as much memory allocated as your actual web server. The amount of RAM PHP has access to can be modified in your php.ini file or using ini_set("memory_limit","256M");
However, if your host machine doesn't have a lot of RAM to begin with, then this probably won't make a difference...