Version Description
Download this release
Release Info
Developer | freediver |
Plugin | SEO Friendly Images |
Version | 2.4 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.4
- readme.txt +4 -2
- seo-friendly-images.php +7 -6
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: freediver
|
|
3 |
Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=920155875
|
4 |
Tags: seo, images, Post, admin, google
|
5 |
Requires at least: 2.0
|
6 |
-
Tested up to: 2.7
|
7 |
Stable tag: trunk
|
8 |
|
9 |
SEO Friendly Images automatically adds alt and title attributes to all your images. Improves traffic from search results and makes the tags w3c/xHTML valid as well.
|
@@ -17,7 +17,9 @@ ALT attribute is important part of search engine optimization. It describes your
|
|
17 |
|
18 |
TITLE attribute play lesser role but is important for visitors as this text will automatically appear in the tooltip when mouse is over the image.
|
19 |
|
20 |
-
|
|
|
|
|
21 |
|
22 |
v2.3.2: WP 2.7 cleanup
|
23 |
|
3 |
Donate link: https://www.networkforgood.org/donation/MakeDonation.aspx?ORGID2=920155875
|
4 |
Tags: seo, images, Post, admin, google
|
5 |
Requires at least: 2.0
|
6 |
+
Tested up to: 2.7.1
|
7 |
Stable tag: trunk
|
8 |
|
9 |
SEO Friendly Images automatically adds alt and title attributes to all your images. Improves traffic from search results and makes the tags w3c/xHTML valid as well.
|
17 |
|
18 |
TITLE attribute play lesser role but is important for visitors as this text will automatically appear in the tooltip when mouse is over the image.
|
19 |
|
20 |
+
Change Log:
|
21 |
+
|
22 |
+
v2.4: Regexp Optimization. Fixed bug with single quotes used in images.
|
23 |
|
24 |
v2.3.2: WP 2.7 cleanup
|
25 |
|
seo-friendly-images.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: SEO Friendly Images
|
5 |
Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-friendly-images
|
6 |
Description: Automatically adds alt and title attributes to all your images. Improves traffic from search results and makes them W3C/xHTML valid as well.
|
7 |
-
Version: 2.
|
8 |
Author: Vladimir Prelovac
|
9 |
Author URI: http://www.prelovac.com/vladimir
|
10 |
|
@@ -160,23 +160,24 @@ function seo_friendly_images_process($matches) {
|
|
160 |
|
161 |
global $post;
|
162 |
|
163 |
-
|
164 |
-
|
165 |
$title = $post->post_title;
|
166 |
|
167 |
$alttext_rep = get_option('seo_friendly_images_alt');
|
168 |
$titletext_rep = get_option('seo_friendly_images_title');
|
169 |
$override= get_option('seo_friendly_images_override');
|
170 |
|
|
|
|
|
171 |
|
172 |
-
$matches[0]=preg_replace('|"/$|', '" /', $matches[0]);
|
173 |
-
$matches[0]=preg_replace('|"$|', '" /', $matches[0]);
|
174 |
-
$matches[0]=preg_replace('|" $|', '" /', $matches[0]);
|
175 |
|
176 |
### Normalize spacing around attributes.
|
177 |
$matches[0] = preg_replace('/\s*=\s*/', '=', substr($matches[0],0,strlen($matches[0])-2));
|
178 |
### Get source.
|
|
|
179 |
preg_match('/src\s*=\s*([\'"])?((?(1).+?|[^\s>]+))(?(1)\1)/', $matches[0], $source);
|
|
|
|
|
180 |
$saved=$source[2];
|
181 |
|
182 |
### Swap with file's base name.
|
4 |
Plugin Name: SEO Friendly Images
|
5 |
Plugin URI: http://www.prelovac.com/vladimir/wordpress-plugins/seo-friendly-images
|
6 |
Description: Automatically adds alt and title attributes to all your images. Improves traffic from search results and makes them W3C/xHTML valid as well.
|
7 |
+
Version: 2.4
|
8 |
Author: Vladimir Prelovac
|
9 |
Author URI: http://www.prelovac.com/vladimir
|
10 |
|
160 |
|
161 |
global $post;
|
162 |
|
163 |
+
|
|
|
164 |
$title = $post->post_title;
|
165 |
|
166 |
$alttext_rep = get_option('seo_friendly_images_alt');
|
167 |
$titletext_rep = get_option('seo_friendly_images_title');
|
168 |
$override= get_option('seo_friendly_images_override');
|
169 |
|
170 |
+
# take care of unsusal endings
|
171 |
+
$matches[0]=preg_replace('|([\'"])[/ ]*$|', '\1 /', $matches[0]);
|
172 |
|
|
|
|
|
|
|
173 |
|
174 |
### Normalize spacing around attributes.
|
175 |
$matches[0] = preg_replace('/\s*=\s*/', '=', substr($matches[0],0,strlen($matches[0])-2));
|
176 |
### Get source.
|
177 |
+
|
178 |
preg_match('/src\s*=\s*([\'"])?((?(1).+?|[^\s>]+))(?(1)\1)/', $matches[0], $source);
|
179 |
+
|
180 |
+
|
181 |
$saved=$source[2];
|
182 |
|
183 |
### Swap with file's base name.
|