/labs

This is a blog by the staff at the web agency Earth People in Stockholm Sweden. Check out our work and get in contact with us here.

EP Social Widget now with shortcode

2012-05-15 09:50:23

Our very popular social widget plugin has been updated with shortcode support so that you with ease can display your social links in posts and pages. Here is a short how to.

[ep-social-widget facebook="https://facebook.com" gplus="https://plus.google.com" rss="1"]

Available networks are

  • facebook
  • gplus
  • twitter
  • flickr
  • youtube
  • rss

Just use the one you want to display in your post/page and give it a link. The RSS option only need a 1 as value if you want that displayed. Remove any network completely to remove it from the post/page.

Download it from the WordPress Plugin Directory.

/ Mattias Hedman

Base64-encoding media assets in WordPress

2012-05-14 15:02:45

I needed to serve some WordPress posts as web views to some mobile apps. But the app guys wanted the all the images inside the_content to be encoded into base64-strings, for offline caching. This was made into a tiny little plugin which you can download and use as you see fit.

When enabled, this plugin will encode all images sitewide on your website. This is generally a bad idea. Should you need help tweaking the plugin further, just drop me an email. Download the plugin here.

UPDATE: This plugin is now released at the WordPress Plugin Directory. Download the plugin here.

/ peder fjällström

Hashimage updated with async loading

2012-05-11 10:27:09

From the start we always felt that we needed to do something about the slow loading of the hashimage plugin. Today we have updated it with the option to use async loading, letting all the heavy work to be done after initial page load. See the settings page for this new option.

In this update we have also integrated support for pic.twitter.com and images in the lightbox are no longer cropper and cut, say hallo to the whole image scaled down.

As usual, you find this amazing plugin in the WordPress Plugin Directory and please leave a comment if you have any suggestions or just like the plugin.

The new latest version is 2.3.0.

/ Mattias Hedman

Hashimage plugin now with widget

2012-02-16 11:52:15

Today, our WordPress plugin EP Hashimage has been updated to version 2.2.0. The news is that we added the ability to display images in a widget.

You can download the latest version of the plugin over at wordpress.org

/ Mattias Hedman

Hashimage WordPress plugin updated

2012-01-23 09:54:50

During summer last year we published a dirty site for displaying images from a certain Twitter hashtag. In august the same year we got the question to make it a WordPress plugin. Said and done, we made a plugin a few hours later. Now, it’s updated with some new features and released at WordPress plugin directory.

The news in the code are:

  • Shortcode for easy use directly in your post or page content.
  • Timthumb resizing, so you don’t have to load large images every time.
  • Displaying clicked images in a lightbox with Slimbox 2.
  • Admin settings page for thumbnails and lightbox image sizes.

We hope you enjoy this plugin.

/ Mattias Hedman

EP Social Widget – Tiny social widget for wordpress

2012-01-10 13:29:17

When started, it is so much easier to continue. Today we have released our very tiny social wordpress widget. It is simple, this plugin will add and widget on your site in witch you can choose to display a RSS, Twitter, Facebook or Flickr icon, linked to you profiles or thoes sites and your sites RSS feed.

More information at the WordPress plugin directory.

Update Jan 13: Added Google Plus
Updated Jan 30: Added Youtube & rewriten CSS

/ Mattias Hedman

Our first released WP plugin – EP Comments Export

2012-01-05 10:46:17

WordPress is a system we have been using a lot , since years back. Today, for the first time, we release a plugin to the WordPress plugin directory.

The plugin, with the name EP Comments Export, lets you easily export all comments and comment meta data from a specific post, page or custom post type. The export will be saved as a .csv file for you to download. To download the .csv file, just click the new icon added in the all posts/page list.

Today you can only export comments. There are plans on making it possible to import an exported .csv file to a post.

You find more information and the plugin at wordpress.org plugin directory.

/ Mattias Hedman

WordPress plugin for fetching hashtag images

2011-07-14 00:54:27

Some time ago i made a quick and dirty site for displaying images from a certain Twitter hashtag. Some hours ago i was asked to tweak this into a WordPress plugin, and here we go. This is just tested on my environment, but should be alright on any WordPress 3+ installation on PHP5 with libcurl.

It currently works with twitpic, instagram, yfrog, plixi, flickr. Adding more services is quite easy and can be done on request. URL’s are being curled and cached for 10-12 minutes using the built-in WP_Cache.

The plugin, when enabled, exposes a template tag which you can add to your theme:

<?php
if(function_exists('hashimage')){
 echo '<ul>';
 echo hashimage('hashtag=unicorn&limit=5');
 echo '</ul>';
}
?>

I can’t be bothered add this to the official WordPress repo, but please download it (or fork it!):
https://github.com/EarthPeople/Hashimage-WP

Some notes:
- The Twitter API only returns the latest results when searching on hashtag, so the result set is limited due to this.
- CSS is up to you. Really. I can’t do CSS. It’s magic to me.

/ peder fjällström

setting up a wp dev environment on a live site

2010-05-07 16:42:04

developing a wordpress site on the domain it eventually will live on has plenty of advantages (and ok, a few obvious disadvantages not covered in this post…). no need to fiddle around in the db looking for hardcoded urls to the development domain name and when it’s time to launch – you don’t need to bother with db export/imports and stuff.

but – how to do this when there’s already an existing site live on this domain? actually it’s accomplished pretty easily.

make a folder on your live site, call it something like “dev”, put this into the index.php file within this folder:

if(isset($_GET["mode"])&&$_GET["mode"]=="dev"){
	setcookie("dev","true", time()+3600*24*7, "/");
	header("Location: /dev");
}else if(isset($_GET["mode"])&&$_GET["mode"]=="live"){
	setcookie("dev", "", time()-1000, "/");
	header("Location: /dev");
}
if(isset($_COOKIE["dev"])){
	echo "DEVELOPMENT MODE IN YOUR BROWSER: ON | SWITCH";
}else{
	echo "DEVELOPMENT MODE IN YOUR BROWSER: OFF | SWITCH";
}

when a user enters /dev on your live site and clicks ON, a cookie will be set. this cookie can then be checked for, and the server can make a decision wether to show the old site or the development site.

next upload wordpress the usual way to the docroot of the site, and install. make sure you don’t overwrite any existing files on the server when uploading.

lastly – let’s make that cookie work for us. open the file wp-blog-header.php, located in the docroot, and replace the contents with this:

if(isset($_COOKIE["dev"])){ # does the user have the dev cookie?
	if ( !isset($wp_did_header) ) {
		$wp_did_header = true;
		require_once( dirname(__FILE__) . '/wp-load.php' );
		wp();
		require_once( ABSPATH . WPINC . '/template-loader.php' );
	}
}else{
	header("Location: currentindex.htm"); # no? then show the current page
}

one word of warning though – do not run wordpress auto update while developing the site this way. doing so will remove the cookie-check in wp-blog-header.php and exposing your development site to the world. should you need to run the automatic update, remember to make the changes to wp-blog-header.php again.

when you’re ready to go live with your shiny new wordpress site – just remove the cookie check from wp-blog-header.php and let the world in. that’s it folks!

/ peder fjällström