Description
Sencha.io src is a service provided by Sencha which dynamically shrinks your images according to the device accessing them. This helps shrink images for mobile, and will cut down the size of a site with a responsive design.
This plugin replaces all image tag src’s within your content with the tinysrc src (http://mysite.com/myimage.png becomes http://src.sencha.io/http://mysite.com/myimage.png), and provides a function to call in your themes to optimise those images.
Donations
None
Installation
- Upload
auto-tinysrc.php
to the/wp-content/plugins/
directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- Place
<?php
in your templates to display any template images optimised, e.g.
if (function_exists('get_tinysrc_image')) {
get_tinysrc_image('image_url');
} else {
echo image_url;
} ?> - To get a variable containing the url of an image with the tinysrc url use
<?php
if (function_exists('get_tinysrc_image')) {
get_tinysrc_image(get_bloginfo('template_url').'/images/bonsai_404_error.png', false);
} ?>
FAQ
- What happens if sencha.io src goes down
-
If the service goes down (which as its backed by Sencha, it shouldn’t for long), simply deactivate the plugin to serve all the images from your server again. If you use the template code, be sure to use the
<?php if (function_exists('get_tinysrc_image'))
code so that you serve the original image again when deactivating the plugin. - What happens if I want to replace Sencha.io Src for WordPress with another similar service, or Sencha.io src change their url again
-
Go to the settings (Settings -> Sencha) and change the url for your desired replacement.
Contributors & Developers
“Sencha.io Src for WordPress” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Sencha.io Src for WordPress” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0
- First release
1.1
- Updated name to reflect tinysrc’s change in branding to Sencha.io Src
- Updated URL to latest http://src.sencha.io/