PHP JS help needed

It looks like you have an unnecessary closing </div> tag, which will break your layout/page. Also you don't need to put your <script> tags inside <p> tags. The <br /> between the scripts is also unnecessary.

I'm on my phone but it looks like those are your issues.
 
Just looking at optimization for a second.
https://www.bestsportsbetting.co.za/wp-content/uploads/2016/10/1280250Dn21.gif is 4MB, either change to still image or video.
As a giphy video it's less than 70 KB. https://giphy.com/gifs/sports-betting-xUOxffj7qc1VdFNUsM

Optimized gif: https://s8.postimg.org/dzyi4mb1h/ezgif-5-8cc3235907.gif

EDIT: You'd like to keep your entire page under 2MB if possible, especially the home page. It does influence your google rankings as well.

EDIT2: on mobile, if possible serve a still image. Mobile devices are usually on data and less processing power.
You can use the <picture> tag. (EDIT4: https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/ might interest you)

You can also use Chrome's audit tool. First interactive for a 3G device is 10s, consistent interactive is 17s. Your perceptual speed scores 16 (11s with target <1.25s). 6s can be reduced just by image compression, though it is not reducing that GIF, which is more than half the sites total size.


EDIT3: Consider changing your logo to an SVG and use a background color. It's quite pixelated. For the footer, add a <br> just before for more information part. Your subscribe on the page should be consistent and also have the padding top above the button, same as the right-hand side does. Footer padding above/below the social icons as well.
The adds below the options should also be consistent in size.

That's just a quick look at your home page. There are other things I haven't mentioned.
 
Last edited:
Thanks man, I'm busy with optimising it as we speak but with all the business stuff I have to take care of on a d2d basis it's hard to find the time.

It looks like you have an unnecessary closing </div> tag, which will break your layout/page. Also you don't need to put your <script> tags inside <p> tags. The <br /> between the scripts is also unnecessary.

I'm on my phone but it looks like those are your issues.


Yeah it breaks the page lol. Should I just put <div id='chalkline-card'></div> in the footer and this on the post? :

<script src='http://www.chalkline.com/widget.js'></script><br />
<script>
CSW.addWidget({
apiKey: '*******************',
containerId: 'chalkline-card',
cardId: 'match-summary',
leagueId: 'premier-league',
matchId: 62822,
title: 'MCI vs. WHU'
});
</script>

Edit.

Sorry, the DIV where I want the content displayed and the script in the footer
 
Last edited:
Thanks man, I'm busy with optimising it as we speak but with all the business stuff I have to take care of on a d2d basis it's hard to find the time.

I'm on my phone but it looks like those are your issues.[/B]

Yeah it breaks the page lol. Should I just put <div id='chalkline-card'></div> in the footer and this on the post? :

<script src='http://www.chalkline.com/widget.js'></script><br />
<script>
CSW.addWidget({
apiKey: '*******************',
containerId: 'chalkline-card',
cardId: 'match-summary',
leagueId: 'premier-league',
matchId: 62822,
title: 'MCI vs. WHU'
});
</script>

Edit.

Sorry, the DIV where I want the content displayed and the script in the footer

Yes, you put the <div> where you want it to display, and anywhere below it you can put the <script> tags. It's normally the best to do it after everything else.

Code:
...
<div id='chalkline-card'></div>
...
<script src='http://www.chalkline.com/widget.js' type='text/javascript' />
<script type="text/javascript">
    CSW.addWidget({
        apiKey: '*******************',
        containerId: 'chalkline-card',
        cardId: 'match-summary',
        leagueId: 'premier-league',
        matchId: 62822,
        title: 'MCI vs. WHU'
    });
</script>
 
Last edited:
Turns out I couldn't get it right because my site is https and the other one is http
 
Top
Sign up to the MyBroadband newsletter
X