BEARPIG

everday I concern myself with big ideas & elegant solutions

If you're interesting in chatting about freelance work either contact me at The Observatory or via the various social media links below and find out how I can help your business.

Getting Roku in Jersey to recognise UK Channels

Recently I picked up a Roku Streaming Stick to add SmartTv channels (netflix, iplayer, 4oD, ITVplayer,etc) to my rather dumb bedroom TV. It seemed like the best option as the TV is currently wall-mounted and there are no shelves/power sockets nearby that are free. This meant that an AppleTV was out of the running, as was the full Roku players. The Chromecast looked interesting but not having any Android devices, I decided on the Roku Streaming Stick.

It wasn’t the smoothest of setups. Firstly I couldn’t get an authentication code to be generated. Then after solving that issue, (I’d assume) due to being in Jersey, Channel Islands, none of the UK channels appeared which defeated the point of getting one! After some initial troubleshooting, it wasn’t apparent whether it recognised location based on GeoIP or the billing details of the account so I got in touch with Roku Support. The response was quick and managed to fix the issue. So it seems to be determined via which account setup page you use, which in turn would be decided by GeoIP on the computer you setup your account.

I’ve included the steps they provided me with for anyone else that has this issue.

  1. Unlink the Roku player from your existing account.
  2. Deactivate your Roku account.
  3. Please visit the following link through different browser window and tab:-
    https://owner.roku.com/signup-nocc/gb
    When you get the payment information page, scroll down the page to the bottom and click on ‘Skip, I’ll add later’.
  4. Once you have completed the account creation.
    Go to ‘Roku Home Screen’ on TV and click on ‘Channel Store’ >> ‘Get Started’.
    You will get a new activation code on TV screen.
  5. Go to your Roku account through your PC.
    Click on My Account (at the top right corner).
    Scroll down the page to the bottom, click on ‘Link a Device’.
  6. Enter the link activation code displaying on TV screen.
    Click on Submit.
  7. Choose/Check your favourite channels and click on ‘continue’.

WordPress troubles with .htaccess & 500 errors

Update РThanks to @retlehs pointing out, this issue is with an old version of Roots and HTML5 Boilerplate htaccess has now been moved to a plugin.

I recently had an issue with a client’s site that I’d inherited. It was a WordPress (up-to-date) and was running a theme based on Roots. I’ve used Roots a few times before and it’s always been rock solid, although due to the amount of stuff it does straight out of the box, sometimes these functions can cause errors.

The site in question was creating a 500 Internal Server error which would go away when the .htaccess file was replaced with a default one. This would be fine until the Dashboard was accessed, where upon the 500 error would appear again. Turns out Roots was set to inject the HTML5 boilerplate .htaccess content into the .htaccess file. This ordinarily isn’t a problem (it does a load of useful stuff) but in this case, the hosting environment didn’t allow this function and therefore was creating the error.

The fix was simple. Go to /themes/roots/inc/roots-htaccess.php and comment out the following line.

add_filter('mod_rewrite_rules', 'roots_add_h5bp_htaccess');

becomes

//add_filter('mod_rewrite_rules', 'roots_add_h5bp_htaccess');

Once you’ve changed that and uploaded the change, replace your .htaccess file with a standard one and you should be fine.

Email Obfuscation with WordPress & Advanced Custom Fields

I tend to use WordPress as my main goto CMS and have found it’s use expanded greatly with Advanced Custom Fields (ACF) for tailoring the backend for clients.

I recently was asked to implement email obfuscation on a site using this setup so try to defeat crawlers/spammers (the endless fight…). I thought it’d be some use to share this with the world.

Here is what I started with…

<a href="mailto:<?php the_field('email'); ?>">
<?php the_field('email'); ?></a>

 

So currently the ACF field is called ‘email’ and is being entered as the mailto: link and the description. WordPress has a built in obfuscation ability called Antispambot which converts email addresses characters to HTML entities to block spam bots (not bulletproof but better than nothing).

To use this with ACF, you just have to add a variable that you then declare in the <a>.

<?php $email = get_field("email"); ?>
<a href="mailto:<?php echo antispambot($email); ?>">
<?php echo antispambot($email); ?></a>

 

Thanks to willthemoor for the hint.

Older Posts