Open Source Archives | Lee Willis https://www.leewillis.co.uk/tag/open-source/ Fri, 16 Feb 2018 09:01:08 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 Using oEmbed resources in Laravel https://www.leewillis.co.uk/using-oembed-resources-laravel/ https://www.leewillis.co.uk/using-oembed-resources-laravel/#respond Fri, 16 Feb 2018 09:01:08 +0000 https://www.leewillis.co.uk/?p=1000 On a recent project we had a requirement to let users easily include social media such as YouTube videos, and Instagram posts in their content. We choose to follow the WordPress-embed style functionality where simply including a link to the … Continue reading

The post Using oEmbed resources in Laravel appeared first on Lee Willis.

]]>
On a recent project we had a requirement to let users easily include social media such as YouTube videos, and Instagram posts in their content. We choose to follow the WordPress-embed style functionality where simply including a link to the social media in the post would embed it using oEmbed discovery.

oEmbed allows a service (such as YouTube, or Instagram) to be queried in a standard way, and to return markup representing the resource. Embedding a YouTube video this way does what you’d expect – an embed of the video. Embedding Instagram embeds the image in an Instagram frame.

Before…

 

After…

In WordPress, all of this happens without the content author having to do anything complex – just paste in the URL of the content they want to embed into their post, and WordPress does the rest. We wanted to reproduce those features, and ease of use in our project, which isn’t WordPress, but based on the Laravel framework.

There are however plenty of libraries that you can use to do the heavy lifting – particularly embed/embed:

Get info from any web service or page
https://github.com/php-embed/Embed
316 forks.
2,123 stars.
70 open issues.

Recent commits:

This lets you simply pass in a URL and get back all sorts of information, including the title, image, and embed code so you can use it how you like. This allowed us to get a proof of concept up and running in our project pretty quickly. However – everything was being embedded in realtime, with oEmbed calls being made to embed resources every time we loaded a page.

To solve this, we created a bridge between Laravel’s cache system and the embed library such that we can load an embed once, and cache the embed code produced, and just re-use that, decreasing load on external services, and increasing load times.

Usage, is simple you just use it as you would embed/embed. If the data is in the cache it will come from there, otherwise it will be fetched and cached automatically.

Happy embedding!

 

 

 

 

  1. Stuff I’ve used
  2. Error tracking with Sentry
  3. Autotrack for Google Analytics
  4. WordPress performance tracking with Time-stack
  5. Enforce user password strength
  6. WYSIWYG with Summernote
  7. Backing up your Laravel app
  8. Adding Google Maps to your Laravel application
  9. Activity logging in Laravel
  10. Image handling in PHP with Intervention Image
  11. Testing Laravel emails with MailThief
  12. Assessing software health
  13. IP Geolocation with MaxMind’s GeoLite2
  14. Uptime monitoring with Uptime Robot
  15. Product tours with Hopscotch
  16. Background processing for WordPress
  17. Using oEmbed resources in Laravel

The post Using oEmbed resources in Laravel appeared first on Lee Willis.

]]>
https://www.leewillis.co.uk/using-oembed-resources-laravel/feed/ 0
Product tours with Hopscotch https://www.leewillis.co.uk/product-tours-hopscotch/ https://www.leewillis.co.uk/product-tours-hopscotch/#respond Mon, 20 Feb 2017 14:14:34 +0000 https://www.leewillis.co.uk/?p=928 I’m just about to launch a brand new project to the world. As a small business, part of the work I’m doing on the project is looking at how I can use smart technology solutions to engage with new users automatically, and … Continue reading

The post Product tours with Hopscotch appeared first on Lee Willis.

]]>
I’m just about to launch a brand new project to the world. As a small business, part of the work I’m doing on the project is looking at how I can use smart technology solutions to engage with new users automatically, and help them through the process of getting up and running.

If you’ve used modern software-as-a-service products – you’ll be familiar with these sorts of solutions, that can include things like:

  • Online knowledgebase articles
  • Drip-fed email series
  • Online product tours

I’ll probably talk about some others another day, but today I’m looking at “Online product tours”. This is where you have pop-up dialogs guide the user through key features of your app. Not sure what I mean, check out the final result, the welcome tour on MyHill.blog.

I looked at a couple of Javascript based open source packages when I was building the tour:

As you might have guessed from the article title, I finally settled on Hopscotch for my tours. For me, the advantages where the ease with which I could get multi-page tours set up, support for callbacks, and of course the actual user-facing experience.

Shepherd was my first favourite, and I got most of the tour implemented in this initially. However I hit a couple of issues running some code I needed on callbacks – I couldn’t easily get them to run at the right time. The transitions between steps were also a little harsh for my liking, it was easy to get confused jumping between sections of (potentially) long pages. Other than that though it was a solid, good-looking solution.

I really liked the highlighting offered by intro.js, but it didn’t quite work for everything I wanted to do, and the out-of-the-box theming was a little simple for my liking. Other than that though it also seemed fairly nice.

Overall, I think I’d be happy working with any of these three in the future, but Hopscotch was definitely the best match for this project.

  1. Stuff I’ve used
  2. Error tracking with Sentry
  3. Autotrack for Google Analytics
  4. WordPress performance tracking with Time-stack
  5. Enforce user password strength
  6. WYSIWYG with Summernote
  7. Backing up your Laravel app
  8. Adding Google Maps to your Laravel application
  9. Activity logging in Laravel
  10. Image handling in PHP with Intervention Image
  11. Testing Laravel emails with MailThief
  12. Assessing software health
  13. IP Geolocation with MaxMind’s GeoLite2
  14. Uptime monitoring with Uptime Robot
  15. Product tours with Hopscotch
  16. Background processing for WordPress
  17. Using oEmbed resources in Laravel

The post Product tours with Hopscotch appeared first on Lee Willis.

]]>
https://www.leewillis.co.uk/product-tours-hopscotch/feed/ 0
Wapuuvatar https://www.leewillis.co.uk/wapuuvatar/ https://www.leewillis.co.uk/wapuuvatar/#respond Tue, 17 Nov 2015 19:10:02 +0000 http://www.leewillis.co.uk/?p=737 Everyone needs a fun project every now and then, something that’s not serious, doesn’t have deadlines, or fixed set of requirements. Something that you can just play with. I first came across Wapuu at WordCamp London, where Scott Evans had designed … Continue reading

The post Wapuuvatar appeared first on Lee Willis.

]]>
Everyone needs a fun project every now and then, something that’s not serious, doesn’t have deadlines, or fixed set of requirements. Something that you can just play with.

I first came across Wapuu at WordCamp London, where Scott Evans had designed an awesome Punk Wapuu which covered posters, stickers – and even scarves! (You can see some of the artwork here: https://london.wordcamp.org/2015/). It turns out that the Wapuu character was original developed by the Japanese WordPress community, released under the GPL, and has since been modified by many people for many different events / purposes.

Every better – they’re maintaining an archive of publicly release Wapuu interpretations.

Coincidence struck when I was:

a) Looking for a just-for-fun project to soothe my soul

b) Stumbled upon a tweet by @NickHamze

https://twitter.com/NickHamze/status/662370659075407872

Well, I couldn’t resist – the timing seemed just right 🙂

So if you want your WordPress avatars to be cute Wapuus in various poses – the wait is over – check out Wapuuvatar on GitHub – or download it from WordPress.org.

Wapuuvatar
by Lee Willis

Uses Wapuus from the Wapuu archive as your site avatars.

Stats:

  • Current version: 3.0.3
  • Rating: 100(6 ratings)
  • Downloaded 6,165 times

Use Wapuus for user avatars in WordPress
https://github.com/leewillis77/wapuuvatar
1 forks.
8 stars.
0 open issues.

Recent commits:

The post Wapuuvatar appeared first on Lee Willis.

]]>
https://www.leewillis.co.uk/wapuuvatar/feed/ 0
Karma https://www.leewillis.co.uk/karma/ https://www.leewillis.co.uk/karma/#respond Wed, 02 Apr 2014 17:00:50 +0000 http://www.leewillis.co.uk/?p=652 One of my colleagues made a comment the other day. You must get a lot of karma for all of these patches you send… I found this quite interesting. I’ve always been a fan (In a non-religious sense) of the … Continue reading

The post Karma appeared first on Lee Willis.

]]>
One of my colleagues made a comment the other day.

You must get a lot of karma for all of these patches you send…

I found this quite interesting. I’ve always been a fan (In a non-religious sense) of the concept of karma. Google helpfully provided this definition:

The sum of a person’s actions in this and previous states of existence, viewed as deciding their fate in future existences.

For me – I’ve always believed that if you have good intentions, and treat people well, then that will be rewarded.

My father-in-law has studied behaviour extensively, and I’ve had many a conversation with him about psychology, and behaviours. I recall a long conversation about altruism (doing good things for others motivated not by personal gain), and while I’m sure many people see Open Source in general as altruistic. For me though, that’s not the case.

So, what about me and Open Source. A brief history:

  • I first encountered Open Source in University. One of my classmates was a Debian Maintainer and introduced me to it. I was immediately in love with the concept. Not because it was free (as in $0) – but because it was open. I could change, extend and fix it if I needed to.
  • I got involved in WordPress when I built a site for my wife.
  • Then I built a second site for a family member. Encountering a number of bugs in the plugins I was using, I got involved in patching them. I didn’t want to have the hassle of continually applying those fixes – so I submitted them back to the project. Since this wasn’t a paid project, this also seemed like a good way of giving back (good karma – right?), so I made sure to make any fixes I made be useful in the general sense rather than just for me, and off they went.
  • I also spent time in the support forums identifying other issues and trying to provide fixes for them. After all I knew I would be called upon if any problems happened, so it made sense to me to head them off at the pass.
  • Shortly afterwards I started selling WordPress plugins. I’ve always tried to make sure that some of the time I spend “doing that” (it’s not my day-job) is spent giving back to free projects, such as plugins I’m extending, or WordPress core itself.

So, I love Open Source because it’s open and I can change, bend it, fix it, improve it. That’s empowering.

I contribute to Open Source because it makes my life easier to do that than the alternative. That’s hardly the “altruistic” angle that people often spout about Open Source (Geeks building stuff for free), but it’s honest.

The post Karma appeared first on Lee Willis.

]]>
https://www.leewillis.co.uk/karma/feed/ 0