Website keep on loading on external server - php

I have made a demo agency website. It works fine on my localhost with Wamp. But when I upload it to a webserver and tried to head to my url, the only thing I can see is a loading spinning wheel. Though the title for the homepage is loaded (as I can see it in the tab bar).
I have googled for the problem, but most of them were suggestions to reduce the size of site including minified js, reducing http requests, compressed images, etc. So, I tried applying it and now I am also using cloudflare's cdn. Still, I cannot solve the problem. I am really fed up now. Any suggestions..?
NOTE: site's url is http://crazyrabbit.in and its built upon codeigniter framework.

Related

How to delete cache files everytime a user access my website with iOS' Safari?

I am quite new to Web Development, recently I made a simple website without using any framework. I make sure to follow the "Responsive Web Design" to make my website mobile-friendly. I was testing my website on several devices such as: Desktop(Firefox and Chrome) and Mobile (iOS Safari), however there was a time, after editing my CSS files, the CSS rules are not loaded properly, therefore my intended styles for the mobile website was not applied to the HTML tags.
I found a solution to this problem, which was to delete all website caches on the iOS device, after I did it, re-accessed the website and the website was displayed as intended.
Is there any way to delete/refresh the caches stored for my website on the device?
Thanks in advance!
The easiest way would be to add query parameters to the file. Which would basically would look something like this
<script src="/path/to/your-script.js?v=1.0.01"></script>
You could do the same with all your static files (CSS, JS, images). Every time you change the value of "v" it would force Safari to re-download the file. This is more of a production hack to force users to download new version of static files though.
Ultimately on your development server you want to disable browser caching with headers coming from your server (be it Apache, Nginx or whatever). Safari respects those.
If you are using PHP to spit out your HTML you can use the following code to make sure you always have dynamic variables
<script src="/path/to/your-script.js?js=<?= time(); ?>"></script>
This will basically invalidate browser cache each second.

Odd script being sourced, no idea where from

While troubleshooting my site I have ran into this error.
"This page is trying to load scripts from unauthenticated sources"
I am slowly learning to head to the Google developer console, which I found...
(program):1 Mixed Content: The page at
'https://www.thepixelfoundry.net/main/' was loaded over HTTPS, but
requested an insecure script
'http://api.sitestate.ru/scripts/stat/sitestate.js?r29'. This request
has been blocked; the content must be served over HTTPS.
This is my first Wordpress theme, as I built this page in order to better learn Wordpress. I have no idea what i sourcing that script.
I have checked my:
functions.php
header
footer
index
when I googled the scripts domain as the .ru already raised a red flag I received a warning from google questioning my computers recent traffic.
now im terrified....
How can I find this script? I have also installed Sucuri on the Wordpress side...and everything seems clean with a scan.
I got the same error in console, after I installed Ace Stream Web Extension
If you are working with it on remote server, then download all WP files and folders to your local machine and use "Search from all files" function. It is included in most text editors (Sublime, Notepad++, Brackets, etc.). Then you can track where this code comes from. When it comes from certain plugin you can disable the plugin. Or just remove that code.
But you should search, where that code get in your WP in first place. Is it some uploaded file that's supposed to be filename.jpg but is filename.jpg.php or comes from plugin or theme.
(I'd comment it but too low rep :/ )

Javascript working on one host but not the other

I have recently uploaded a site I'm working on to a clients server. Unfortunately they are only running PHP 4.3, so a few things aren't working but some of my Javascript isn't working which is strange. Can anyone give me any insight into this? Here is the site that is functioning (PHP5+): http://involutionstudios.net/earthrover
And here is the site that isn't:
http://earthtest.monpjc.com/ (PHP 4.3)
As you will be able to see once you compare the two site the Javascript for the centre console isn't working correctly and the images are failing to display.
There is no errors using F12 on Chrome, from F12 I can also see that the images are loading, so it's not a problem with incorrect directory paths.
The Twitter feed not loading isn't the problem as that's to do with PHP.
Any help would be great :)
Thanks
The images are loaded on second, but they are not visible because you are missing twitter div there, putting even empty <div id="twitter"></div> before slider will shift slider div to correct place as it does on first site

Need to disable auto downloader from site

Locally, I have developed a music site by means of a WordPress theme, and it's running well. The problem is that once the media file is streaming in the browser, Internet Download Manager(IDM) detects it and generates the download link (That's the nature of IDM) .
So, I want to build my site such that visitors will be able to play and listen to the music, but they are not allowed to download the streaming media by any downloader.
Is there any PHP code, WordPress or jQuery plugin to do this?
Thanks in advance.
If you allow visitors to listen to a file, there is no way to prevent them from downloading it. Even DRM is broken if they are determined enough. If they can play it, they can save it.
That said, you have several options.
Use Flash to stream the file.
It is still pretty easy to download unless the file is embedded in the SWF or uses DRM. This is a common solution, and works well unless you need to support mobile browsers without Flash support.
Only allow one download per IP address.
This has major usability problems and will not work in many browsers. I don't recommend it.
Send the file encrypted and decrypt with Javascript.
Could be very slow, still doesn't stop determined users, depends on Javascript, requires either dataurl support or newer html5 audio apis.
Don't worry about it.
This is what I do.

How should I resolve this conflict between facebook iframes and browser security?

I have a facebook application that I built as an FBML app. Recently I noticed that FBML is deprecated and that Facebook now recommends only iframe apps. Something I initially avoided because my understanding is that iframes are not valid xhtml code, and at the time I was trying to write 100% validated code for everything.
However I also don't like building unsupported applications, so I set about changing my app to use fully rendered html pages using the iframe method of display.
My pages render perfectly on their own when I display them in their own window however they are completely blank in Safari when rendered inside a frame provided by Facebook. At first I was stumped and couldn't figure out why nothing rendered, until a friend using Internet Explorer told me he was seeing the following error:
To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame.
So I started googling this error, and found mountains of forum discussions between confused people trying to get their frame code working and figured out it was an error that appeared overnight back in 2009 when IE8 was introduced. A little more digging on the Microsoft site reavealed that it is a security feature invented by Microsoft to prevent click-jacking.
The apparent cause of this is the server sending an X-Frame-Options heading, and the response of Firefox and Internet Explorer is to display an error message about security and frames, while the response of Webkit browsers such as Chrome and Safari is to render an unhelpful blank frame. I own the hardware running the apache server and I wrote all the html, and I certainly never explicitly sent the X-Frame-Options header, so I must assume that my installation of php sends this header by default on all pages that it serves up as a blanket security enhancement (either that or Apache is doing it).
Obviously, now that I know what causes it, I could figure out who is sending the header and stop it, but my question is on of best practises: Click-jacking prevention is obviously a worthy cause, and since some part of my server chain deems it important enough to send this header without asking, clearly someone thinks it is a good idea. However, Facebook apps, by design, load content from another website within an iframe, so I'm surprised there is little or no talk that I can find about this on the internet. Is there another way around this, or is it simply a case of something that should not be turned on for a page that is intended to be viewed from within an iframe?
Furthermore, if getting rid of the header is the correct approach, does anyone know why it is getting sent and where to turn it off? I'm running on a Snow Leopard Server with the default installation of apache and php.
Search the Apache config files for the option
$sudo grep -ir 'x-frame-options' /etc/apache2
Credit

Categories