Version Description
- Made clear the plugin works by modyfying the image during output, and not changing images in the post editor or in media library as some people expected
- Debug notices removed
Download this release
Release Info
Developer | freediver |
Plugin | SEO Friendly Images |
Version | 3.0.1 |
Comparing to | |
See all releases |
Code changes from version 3,0 to 3.0.1
- readme.txt +6 -2
- seo-friendly-images.class.php +8 -368
readme.txt
CHANGED
@@ -22,6 +22,10 @@ If you like what I do in WordPress, you will also like the [ManageWP](https://ma
|
|
22 |
|
23 |
== Changelog ==
|
24 |
|
|
|
|
|
|
|
|
|
25 |
= 3.0 =
|
26 |
* Major rewrite and optimization of the plugin
|
27 |
* New tags to use in ALT and TITLE attributes
|
@@ -69,8 +73,8 @@ If you like what I do in WordPress, you will also like the [ManageWP](https://ma
|
|
69 |
|
70 |
1. Upload the whole plugin folder to your /wp-content/plugins/ folder.
|
71 |
2. Go to the Plugins page and activate the plugin.
|
72 |
-
3. Use the Options page to modify ALT and TITLE options.
|
73 |
-
4.
|
74 |
|
75 |
== License ==
|
76 |
|
22 |
|
23 |
== Changelog ==
|
24 |
|
25 |
+
= 3.0.1 =
|
26 |
+
* Made clear the plugin works by modyfying the image during output, and not changing images in the post editor or in media library as some people expected
|
27 |
+
* Debug notices removed
|
28 |
+
|
29 |
= 3.0 =
|
30 |
* Major rewrite and optimization of the plugin
|
31 |
* New tags to use in ALT and TITLE attributes
|
73 |
|
74 |
1. Upload the whole plugin folder to your /wp-content/plugins/ folder.
|
75 |
2. Go to the Plugins page and activate the plugin.
|
76 |
+
3. Use the Options page to modify ALT and TITLE options. Turn on Override ALT tag and TITLe tag if you didnt not add these anywhere.
|
77 |
+
4. Note that SEO Friendly images works by modifying HTML output on the frontend of you site, and does not modyfiy images in your media gallery or while editing the post See [this link for more](https://wordpress.org/support/topic/it-does-work-you-just-wont-see-it-in-the-backend)
|
78 |
|
79 |
== License ==
|
80 |
|
seo-friendly-images.class.php
CHANGED
@@ -32,7 +32,7 @@ class SEOFriendlyImages {
|
|
32 |
$this->rules = $options['rules'];
|
33 |
$this->global = $options['global'];
|
34 |
$this->tree = null;
|
35 |
-
|
36 |
}
|
37 |
|
38 |
function add_filters_and_hooks() {
|
@@ -185,252 +185,13 @@ class SEOFriendlyImages {
|
|
185 |
$this->rules[0]['options']['title'] = ( ! isset( $_POST['default_title'] ) ? '' : $_POST['default_title'] );
|
186 |
$this->rules[0]['options']['override_alt'] = ( ! isset( $_POST['default_override_alt'] ) ? 'off' : 'on' );
|
187 |
$this->rules[0]['options']['override_title'] = ( ! isset( $_POST['default_override_title'] ) ? 'off' : 'on' );
|
188 |
-
$this->rules[0]['options']['strip_extension_title'] = ( ! isset( $_POST['default_strip_extension_title'] ) ? 'off' : 'on' );
|
189 |
-
|
190 |
-
|
191 |
$this->rules[0]['options']['enable'] = 'on';
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
$i = 1;
|
197 |
-
while ( isset( $_POST['rule_' . $i . '_hidden'] ) ) {
|
198 |
-
$this->rules[$i]['domains'] = array();
|
199 |
-
if ( isset( $_POST['rule_' . $i . '_domain_main'] ) ) {
|
200 |
-
array_push( $this->rules[$i]['domains'], 'main' );
|
201 |
-
$this->remove_from_domains( $i, 'home' );
|
202 |
-
$this->remove_from_domains( $i, 'front' );
|
203 |
-
} else {
|
204 |
-
if ( isset( $_POST['rule_' . $i . '_domain_home'] ) ) {
|
205 |
-
array_push( $this->rules[$i]['domains'], 'home' );
|
206 |
-
}
|
207 |
-
if ( isset( $_POST['rule_' . $i . '_domain_front'] ) ) {
|
208 |
-
array_push( $this->rules[$i]['domains'], 'front' );
|
209 |
-
}
|
210 |
-
}
|
211 |
-
if ( isset( $_POST['rule_' . $i . '_domain_archive'] ) ) {
|
212 |
-
if ( ( $_POST['rule_' . $i . '_domain_category_ids'] == '' ) && ( $_POST['rule_' . $i . '_domain_tag_ids'] == '' ) && ( $_POST['rule_' . $i . '_domain_taxonomy_ids'] == '' ) && ( $_POST['rule_' . $i . '_domain_author_ids'] == '' ) ) {
|
213 |
-
array_push( $this->rules[$i]['domains'], 'archive' );
|
214 |
-
$this->remove_from_domains( $i, 'category' );
|
215 |
-
$this->remove_from_domains( $i, 'tag' );
|
216 |
-
$this->remove_from_domains( $i, 'taxonomy' );
|
217 |
-
$this->remove_from_domains( $i, 'author' );
|
218 |
-
$this->remove_from_domains( $i, 'date' );
|
219 |
-
$this->remove_from_domains( $i, 'year' );
|
220 |
-
$this->remove_from_domains( $i, 'month' );
|
221 |
-
$this->remove_from_domains( $i, 'day' );
|
222 |
-
$this->remove_from_domains( $i, 'time' );
|
223 |
-
} else {
|
224 |
-
if ( isset( $_POST['rule_' . $i . '_domain_category_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_category_ids'] ) ) {
|
225 |
-
$ids = $_POST['rule_' . $i . '_domain_category_ids'];
|
226 |
-
$array_ids = explode( ',', $ids );
|
227 |
-
$this->rules[$i]['domains']['category'] = $array_ids;
|
228 |
-
$this->remove_from_domains( $i, 'category' );
|
229 |
-
} else {
|
230 |
-
array_push( $this->rules[$i]['domains'], 'category' );
|
231 |
-
unset( $this->rules[$i]['domains']['category'] );
|
232 |
-
}
|
233 |
-
if ( isset( $_POST['rule_' . $i . '_domain_tag_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_tag_ids'] ) ) {
|
234 |
-
$ids = $_POST['rule_' . $i . '_domain_tag_ids'];
|
235 |
-
$array_ids = explode( ',', $ids );
|
236 |
-
$this->rules[$i]['domains']['tag'] = $array_ids;
|
237 |
-
$this->remove_from_domains( $i, 'tag' );
|
238 |
-
} else {
|
239 |
-
array_push( $this->rules[$i]['domains'], 'tag' );
|
240 |
-
unset( $this->rules[$i]['domains']['tag'] );
|
241 |
-
}
|
242 |
-
if ( isset( $_POST['rule_' . $i . '_domain_taxonomy_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_taxonomy_ids'] ) ) {
|
243 |
-
$ids = $_POST['rule_' . $i . '_domain_taxonomy_ids'];
|
244 |
-
$array_ids = explode( ',', $ids );
|
245 |
-
$this->rules[$i]['domains']['taxonomy'] = $array_ids;
|
246 |
-
$this->remove_from_domains( $i, 'taxonomy' );
|
247 |
-
} else {
|
248 |
-
array_push( $this->rules[$i]['domains'], 'taxonomy' );
|
249 |
-
unset( $this->rules[$i]['domains']['taxonomy'] );
|
250 |
-
}
|
251 |
-
if ( isset( $_POST['rule_' . $i . '_domain_author_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_author_ids'] ) ) {
|
252 |
-
$ids = $_POST['rule_' . $i . '_domain_author_ids'];
|
253 |
-
$array_ids = explode( ',', $ids );
|
254 |
-
$this->rules[$i]['domains']['author'] = $array_ids;
|
255 |
-
$this->remove_from_domains( $i, 'author' );
|
256 |
-
} else {
|
257 |
-
array_push( $this->rules[$i]['domains'], 'author' );
|
258 |
-
unset( $this->rules[$i]['domains']['author'] );
|
259 |
-
}
|
260 |
-
array_push( $this->rules[$i]['domains'], 'date' );
|
261 |
-
$this->remove_from_domains( $i, 'year' );
|
262 |
-
$this->remove_from_domains( $i, 'month' );
|
263 |
-
$this->remove_from_domains( $i, 'day' );
|
264 |
-
$this->remove_from_domains( $i, 'time' );
|
265 |
-
}
|
266 |
-
} else {
|
267 |
-
if ( isset( $_POST['rule_' . $i . '_domain_category_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_category_ids'] ) ) {
|
268 |
-
$ids = $_POST['rule_' . $i . '_domain_category_ids'];
|
269 |
-
$array_ids = explode( ',', $ids );
|
270 |
-
$this->rules[$i]['domains']['category'] = $array_ids;
|
271 |
-
$this->remove_from_domains( $i, 'category' );
|
272 |
-
} else {
|
273 |
-
if ( isset( $_POST['rule_' . $i . '_domain_category'] ) ) {
|
274 |
-
array_push( $this->rules[$i]['domains'], 'category' );
|
275 |
-
}
|
276 |
-
unset( $this->rules[$i]['domains']['category'] );
|
277 |
-
}
|
278 |
-
if ( isset( $_POST['rule_' . $i . '_domain_tag_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_tag_ids'] ) ) {
|
279 |
-
$ids = $_POST['rule_' . $i . '_domain_tag_ids'];
|
280 |
-
$array_ids = explode( ',', $ids );
|
281 |
-
$this->rules[$i]['domains']['tag'] = $array_ids;
|
282 |
-
$this->remove_from_domains( $i, 'tag' );
|
283 |
-
} else {
|
284 |
-
if ( isset( $_POST['rule_' . $i . '_domain_tag'] ) ) {
|
285 |
-
array_push( $this->rules[$i]['domains'], 'tag' );
|
286 |
-
}
|
287 |
-
unset( $this->rules[$i]['domains']['tag'] );
|
288 |
-
}
|
289 |
-
if ( isset( $_POST['rule_' . $i . '_domain_taxonomy_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_taxonomy_ids'] ) ) {
|
290 |
-
$ids = $_POST['rule_' . $i . '_domain_taxonomy_ids'];
|
291 |
-
$array_ids = explode( ',', $ids );
|
292 |
-
$this->rules[$i]['domains']['taxonomy'] = $array_ids;
|
293 |
-
$this->remove_from_domains( $i, 'taxonomy' );
|
294 |
-
} else {
|
295 |
-
if ( isset( $_POST['rule_' . $i . '_domain_taxonomy'] ) ) {
|
296 |
-
array_push( $this->rules[$i]['domains'], 'taxonomy' );
|
297 |
-
}
|
298 |
-
unset( $this->rules[$i]['domains']['taxonomy'] );
|
299 |
-
}
|
300 |
-
if ( isset( $_POST['rule_' . $i . '_domain_author_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_author_ids'] ) ) {
|
301 |
-
$ids = $_POST['rule_' . $i . '_domain_author_ids'];
|
302 |
-
$array_ids = explode( ',', $ids );
|
303 |
-
$this->rules[$i]['domains']['author'] = $array_ids;
|
304 |
-
$this->remove_from_domains( $i, 'author' );
|
305 |
-
} else {
|
306 |
-
if ( isset( $_POST['rule_' . $i . '_domain_author'] ) ) {
|
307 |
-
array_push( $this->rules[$i]['domains'], 'author' );
|
308 |
-
}
|
309 |
-
unset( $this->rules[$i]['domains']['author'] );
|
310 |
-
}
|
311 |
-
if ( isset( $_POST['rule_' . $i . '_domain_date'] ) ) {
|
312 |
-
array_push( $this->rules[$i]['domains'], 'date' );
|
313 |
-
$this->remove_from_domains( $i, 'year' );
|
314 |
-
$this->remove_from_domains( $i, 'month' );
|
315 |
-
$this->remove_from_domains( $i, 'day' );
|
316 |
-
$this->remove_from_domains( $i, 'time' );
|
317 |
-
} else {
|
318 |
-
if ( isset( $_POST['rule_' . $i . '_domain_year'] ) ) {
|
319 |
-
array_push( $this->rules[$i]['domains'], 'year' );
|
320 |
-
}
|
321 |
-
if ( isset( $_POST['rule_' . $i . '_domain_month'] ) ) {
|
322 |
-
array_push( $this->rules[$i]['domains'], 'month' );
|
323 |
-
}
|
324 |
-
if ( isset( $_POST['rule_' . $i . '_domain_day'] ) ) {
|
325 |
-
array_push( $this->rules[$i]['domains'], 'day' );
|
326 |
-
}
|
327 |
-
if ( isset( $_POST['rule_' . $i . '_domain_time'] ) ) {
|
328 |
-
array_push( $this->rules[$i]['domains'], 'time' );
|
329 |
-
}
|
330 |
-
}
|
331 |
-
}
|
332 |
-
if ( isset( $_POST['rule_' . $i . '_domain_singular'] ) ) {
|
333 |
-
if ( ( $_POST['rule_' . $i . '_domain_post_ids'] == '' ) && ( $_POST['rule_' . $i . '_domain_page_ids'] == '' ) && ( $_POST['rule_' . $i . '_domain_attachment_ids'] == '' ) ) {
|
334 |
-
array_push( $this->rules[$i]['domains'], 'singular' );
|
335 |
-
$this->remove_from_domains( $i, 'post' );
|
336 |
-
$this->remove_from_domains( $i, 'page' );
|
337 |
-
$this->remove_from_domains( $i, 'attachment' );
|
338 |
-
} else {
|
339 |
-
if ( isset( $_POST['rule_' . $i . '_domain_post_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_post_ids'] ) ) {
|
340 |
-
$ids = $_POST['rule_' . $i . '_domain_post_ids'];
|
341 |
-
$array_ids = explode( ',', $ids );
|
342 |
-
$this->rules[$i]['domains']['post'] = $array_ids;
|
343 |
-
} else {
|
344 |
-
array_push( $this->rules[$i]['domains'], 'post' );
|
345 |
-
unset( $this->rules[$i]['domains']['post'] );
|
346 |
-
}
|
347 |
-
if ( isset( $_POST['rule_' . $i . '_domain_page_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_page_ids'] ) ) {
|
348 |
-
$ids = $_POST['rule_' . $i . '_domain_page_ids'];
|
349 |
-
$array_ids = explode( ',', $ids );
|
350 |
-
$this->rules[$i]['domains']['page'] = $array_ids;
|
351 |
-
} else {
|
352 |
-
array_push( $this->rules[$i]['domains'], 'page' );
|
353 |
-
unset( $this->rules[$i]['domains']['page'] );
|
354 |
-
}
|
355 |
-
if ( isset( $_POST['rule_' . $i . '_domain_attachment_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_attachment_ids'] ) ) {
|
356 |
-
$ids = $_POST['rule_' . $i . '_domain_attachment_ids'];
|
357 |
-
$array_ids = explode( ',', $ids );
|
358 |
-
$this->rules[$i]['domains']['attachment'] = $array_ids;
|
359 |
-
} else {
|
360 |
-
array_push( $this->rules[$i]['domains'], 'attachment' );
|
361 |
-
unset( $this->rules[$i]['domains']['attachment'] );
|
362 |
-
}
|
363 |
-
}
|
364 |
-
} else {
|
365 |
-
if ( isset( $_POST['rule_' . $i . '_domain_post_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_post_ids'] ) ) {
|
366 |
-
$ids = $_POST['rule_' . $i . '_domain_post_ids'];
|
367 |
-
$array_ids = explode( ',', $ids );
|
368 |
-
$this->rules[$i]['domains']['post'] = $array_ids;
|
369 |
-
$this->remove_from_domains( $i, 'post' );
|
370 |
-
} else {
|
371 |
-
if ( isset( $_POST['rule_' . $i . '_domain_post'] ) ) {
|
372 |
-
array_push( $this->rules[$i]['domains'], 'post' );
|
373 |
-
}
|
374 |
-
unset( $this->rules[$i]['domains']['post'] );
|
375 |
-
}
|
376 |
-
if ( isset( $_POST['rule_' . $i . '_domain_page_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_page_ids'] ) ) {
|
377 |
-
$ids = $_POST['rule_' . $i . '_domain_page_ids'];
|
378 |
-
$array_ids = explode( ',', $ids );
|
379 |
-
$this->rules[$i]['domains']['page'] = $array_ids;
|
380 |
-
$this->remove_from_domains( $i, 'page' );
|
381 |
-
} else {
|
382 |
-
if ( isset( $_POST['rule_' . $i . '_domain_page'] ) ) {
|
383 |
-
array_push( $this->rules[$i]['domains'], 'page' );
|
384 |
-
}
|
385 |
-
unset( $this->rules[$i]['domains']['page'] );
|
386 |
-
}
|
387 |
-
if ( isset( $_POST['rule_' . $i . '_domain_attachment_ids'] ) && ( "" != $_POST['rule_' . $i . '_domain_attachment_ids'] ) ) {
|
388 |
-
$ids = $_POST['rule_' . $i . '_domain_attachment_ids'];
|
389 |
-
$array_ids = explode( ',', $ids );
|
390 |
-
$this->rules[$i]['domains']['attachment'] = $array_ids;
|
391 |
-
$this->remove_from_domains( $i, 'attachment' );
|
392 |
-
} else {
|
393 |
-
if ( isset( $_POST['rule_' . $i . '_domain_attachment'] ) ) {
|
394 |
-
array_push( $this->rules[$i]['domains'], 'attachment' );
|
395 |
-
}
|
396 |
-
unset( $this->rules[$i]['domains']['attachment'] );
|
397 |
-
}
|
398 |
-
}
|
399 |
-
|
400 |
-
$this->rules[$i]['options']['enable'] = ( ! isset( $_POST['rule_' . $i . '_enable'] ) ? 'off' : ( ( $_POST['rule_' . $i . '_enable'] == 'enabled' ) ? 'on' : 'off' ) );
|
401 |
-
|
402 |
-
if ( $this->rules[$i]['options']['enable'] == 'on' ) {
|
403 |
-
$this->rules[$i]['options']['alt'] = ( ! isset( $_POST['rule_' . $i . '_alt'] ) ? '' : $_POST['default_alt'] );
|
404 |
-
$this->rules[$i]['options']['title'] = ( ! isset( $_POST['rule_' . $i . '_title'] ) ? '' : $_POST['default_title'] );
|
405 |
-
$this->rules[$i]['options']['override_alt'] = ( ! isset( $_POST['rule_' . $i . '_override_alt'] ) ? 'off' : 'on' );
|
406 |
-
$this->rules[$i]['options']['override_title'] = ( ! isset( $_POST['rule_' . $i . '_override_title'] ) ? 'off' : 'on' );
|
407 |
-
$this->rules[$i]['options']['strip_extension_title'] = ( ! isset( $_POST['rule_' . $i . '_strip_extension_title'] ) ? 'off' : 'on' );
|
408 |
-
|
409 |
-
|
410 |
-
} else {
|
411 |
-
unset( $this->rules[$i]['options']['alt'] );
|
412 |
-
unset( $this->rules[$i]['options']['title'] );
|
413 |
-
unset( $this->rules[$i]['options']['override_alt'] );
|
414 |
-
unset( $this->rules[$i]['options']['override_title'] );
|
415 |
-
unset( $this->rules[$i]['options']['strip_extension_title'] );
|
416 |
-
|
417 |
-
|
418 |
-
}
|
419 |
-
|
420 |
-
$i++;
|
421 |
-
}
|
422 |
-
|
423 |
-
for ( $j = $i; $j <= count( $this->rules ); $j++ ) {
|
424 |
-
unset( $this->rules[$j] );
|
425 |
-
}
|
426 |
-
|
427 |
$options['rules'] = $this->rules;
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
update_option( $this->key, $options );
|
432 |
$this->tree = null;
|
433 |
-
$this->
|
434 |
|
435 |
$msg_status = __( 'SEO Friendly Images settings saved.', 'seo-friendly-images' );
|
436 |
|
@@ -448,13 +209,9 @@ class SEOFriendlyImages {
|
|
448 |
$form[$key]['options']['override_alt'] = ( $rule['options']['override_alt'] == 'on' ) ? 'checked' : '';
|
449 |
$form[$key]['options']['override_title'] = ( $rule['options']['override_title'] == 'on' ) ?'checked' : '';
|
450 |
$form[$key]['options']['strip_extension_title'] = ( $rule['options']['strip_extension_title'] == 'on' ) ?'checked' : '';
|
451 |
-
|
452 |
-
$form[$key]['options']['external_links'] = ( $rule['options']['external_links'] == 'on' ) ? 'checked' : '';
|
453 |
}
|
454 |
}
|
455 |
|
456 |
-
|
457 |
-
|
458 |
$imgpath = $this->plugin_url . '/i';
|
459 |
$actionurl = $_SERVER['REQUEST_URI'];
|
460 |
// Configuration Page
|
@@ -480,7 +237,8 @@ class SEOFriendlyImages {
|
|
480 |
<form name="sfiform" action="<?php echo $actionurl; ?>" method="post">
|
481 |
<input type="hidden" name="submitted" value="1" />
|
482 |
<p><?php _e( 'SEO Friendly Images automatically adds ALT and Title attributes to all your images in all your posts. Default options are usually good but you can change them below.', 'seo-friendly-images' ); ?></p>
|
483 |
-
|
|
|
484 |
<ul>
|
485 |
<li><b>%title</b> - <?php _e( 'replaces post title', 'seo-friendly-images' ); ?></li>
|
486 |
<li><b>%desc</b> - <?php _e( 'replaces post excerpt', 'seo-friendly-images' ); ?></li>
|
@@ -724,8 +482,7 @@ class SEOFriendlyImages {
|
|
724 |
<div style="padding: 1.5em 0;margin: 5px 0;">
|
725 |
<input type="submit" name="Submit" value="<?php _e( 'Update options', 'seo-friendly-images' ); ?>" />
|
726 |
</div>
|
727 |
-
</form>
|
728 |
-
<div id="rule_copy" style="display:none;"><?php echo $this->create_rule_html( 'number' ); ?></div>
|
729 |
</div>
|
730 |
</div>
|
731 |
<h5><?php _e( 'Another fine WordPress plugin by', 'seo-friendly-images' ); ?> <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
|
@@ -1154,123 +911,6 @@ class SEOFriendlyImages {
|
|
1154 |
return $url;
|
1155 |
}
|
1156 |
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
function build_tree() {
|
1161 |
-
$this->tree["all"]["options"] = null;
|
1162 |
-
$this->tree["main"]["options"] = null;
|
1163 |
-
$this->tree["main"]["home"]["options"] = null;
|
1164 |
-
$this->tree["main"]["front"]["options"] = null;
|
1165 |
-
$this->tree["archive"]["options"] = null;
|
1166 |
-
$this->tree["archive"]["category"]["options"] = null;
|
1167 |
-
$this->tree["archive"]["tag"]["options"] = null;
|
1168 |
-
$this->tree["archive"]["taxonomy"]["options"] = null;
|
1169 |
-
$this->tree["archive"]["author"]["options"] = null;
|
1170 |
-
$this->tree["archive"]["date"]["options"] = null;
|
1171 |
-
$this->tree["archive"]["date"]["year"]["options"] = null;
|
1172 |
-
$this->tree["archive"]["date"]["month"]["options"] = null;
|
1173 |
-
$this->tree["archive"]["date"]["day"]["options"] = null;
|
1174 |
-
$this->tree["archive"]["date"]["time"]["options"] = null;
|
1175 |
-
$this->tree["archive"]["search"]["options"] = null;
|
1176 |
-
$this->tree["singular"]["options"] = null;
|
1177 |
-
$this->tree["singular"]["post"]["options"] = null;
|
1178 |
-
$this->tree["singular"]["page"]["options"] = null;
|
1179 |
-
$this->tree["singular"]["attachment"]["options"] = null;
|
1180 |
-
if (isset($this->rules))
|
1181 |
-
foreach( $this->rules as $rule ) {
|
1182 |
-
if ( isset( $rule["domains"] ) && is_array( $rule["domains"] ) )
|
1183 |
-
foreach( $rule["domains"] as $key => $domain ) {
|
1184 |
-
if( ! is_int( $key ) ) {
|
1185 |
-
switch( $key ) {
|
1186 |
-
case "category":
|
1187 |
-
$num = count( $this->tree["archive"]["category"] );
|
1188 |
-
$this->tree["archive"]["category"]["group_" . $num]["ids"] = $domain;
|
1189 |
-
$this->tree["archive"]["category"]["group_" . $num]["options"] = $rule["options"];
|
1190 |
-
break;
|
1191 |
-
case "tag":
|
1192 |
-
$num = count( $this->tree["archive"]["tag"] );
|
1193 |
-
$this->tree["archive"]["tag"]["group_" . $num]["ids"] = $domain;
|
1194 |
-
$this->tree["archive"]["tag"]["group_" . $num]["options"] = $rule["options"];
|
1195 |
-
break;
|
1196 |
-
case "taxonomy":
|
1197 |
-
$num = count( $this->tree["archive"]["taxonomy"] );
|
1198 |
-
$this->tree["archive"]["taxonomy"]["group_" . $num]["ids"] = $domain;
|
1199 |
-
$this->tree["archive"]["taxonomy"]["group_" . $num]["options"] = $rule["options"];
|
1200 |
-
break;
|
1201 |
-
case "author":
|
1202 |
-
$num = count( $this->tree["archive"]["author"] );
|
1203 |
-
$this->tree["archive"]["author"]["group_" . $num]["ids"] = $domain;
|
1204 |
-
$this->tree["archive"]["author"]["group_" . $num]["options"] = $rule["options"];
|
1205 |
-
|
1206 |
-
break;
|
1207 |
-
case "post":
|
1208 |
-
$num = count( $this->tree["singular"]["post"] );
|
1209 |
-
$this->tree["singular"]["post"]["group_" . $num]["ids"] = $domain;
|
1210 |
-
$this->tree["singular"]["post"]["group_" . $num]["options"] = $rule["options"];
|
1211 |
-
break;
|
1212 |
-
case "page":
|
1213 |
-
$num = count( $this->tree["singular"]["page"] );
|
1214 |
-
$this->tree["singular"]["page"]["group_" . $num]["ids"] = $domain;
|
1215 |
-
$this->tree["singular"]["page"]["group_" . $num]["options"] = $rule["options"];
|
1216 |
-
break;
|
1217 |
-
case "attachment":
|
1218 |
-
$num = count( $this->tree["singular"]["attachment"] );
|
1219 |
-
$this->tree["singular"]["attachment"]["group_" . $num]["ids"] = $domain;
|
1220 |
-
$this->tree["singular"]["attachment"]["group_" . $num]["options"] = $rule["options"];
|
1221 |
-
break;
|
1222 |
-
}
|
1223 |
-
} else {
|
1224 |
-
switch( $domain )
|
1225 |
-
{
|
1226 |
-
case "all":
|
1227 |
-
case "main":
|
1228 |
-
case "archive":
|
1229 |
-
case "singular":
|
1230 |
-
if( $this->tree[$domain]["options"] == null )
|
1231 |
-
{
|
1232 |
-
$this->tree[$domain]["options"] = $rule["options"];
|
1233 |
-
}
|
1234 |
-
break;
|
1235 |
-
case "home":
|
1236 |
-
case "front":
|
1237 |
-
if( $this->tree["main"][$domain]["options"] == null )
|
1238 |
-
{
|
1239 |
-
$this->tree["main"][$domain]["options"] = $rule["options"];
|
1240 |
-
}
|
1241 |
-
break;
|
1242 |
-
case "category":
|
1243 |
-
case "tag":
|
1244 |
-
case "taxonomy":
|
1245 |
-
case "author":
|
1246 |
-
case "date":
|
1247 |
-
case "search":
|
1248 |
-
if( $this->tree["archive"][$domain]["options"] == null )
|
1249 |
-
{
|
1250 |
-
$this->tree["archive"][$domain]["options"] = $rule["options"];
|
1251 |
-
}
|
1252 |
-
break;
|
1253 |
-
case "year":
|
1254 |
-
case "month":
|
1255 |
-
case "day":
|
1256 |
-
case "time":
|
1257 |
-
if( $this->tree["archive"]["date"][$domain]["options"] == null )
|
1258 |
-
{
|
1259 |
-
$this->tree["archive"]["date"][$domain]["options"] = $rule["options"];
|
1260 |
-
}
|
1261 |
-
break;
|
1262 |
-
case "post":
|
1263 |
-
case "page":
|
1264 |
-
case "attachment":
|
1265 |
-
if( $this->tree["singular"][$domain]["options"] == null ) {
|
1266 |
-
$this->tree["singular"][$domain]["options"] = $rule["options"];
|
1267 |
-
}
|
1268 |
-
break;
|
1269 |
-
}
|
1270 |
-
}
|
1271 |
-
}
|
1272 |
-
}
|
1273 |
-
}
|
1274 |
|
1275 |
function get_options() {
|
1276 |
$options = array(
|
32 |
$this->rules = $options['rules'];
|
33 |
$this->global = $options['global'];
|
34 |
$this->tree = null;
|
35 |
+
|
36 |
}
|
37 |
|
38 |
function add_filters_and_hooks() {
|
185 |
$this->rules[0]['options']['title'] = ( ! isset( $_POST['default_title'] ) ? '' : $_POST['default_title'] );
|
186 |
$this->rules[0]['options']['override_alt'] = ( ! isset( $_POST['default_override_alt'] ) ? 'off' : 'on' );
|
187 |
$this->rules[0]['options']['override_title'] = ( ! isset( $_POST['default_override_title'] ) ? 'off' : 'on' );
|
188 |
+
$this->rules[0]['options']['strip_extension_title'] = ( ! isset( $_POST['default_strip_extension_title'] ) ? 'off' : 'on' );
|
|
|
|
|
189 |
$this->rules[0]['options']['enable'] = 'on';
|
190 |
+
|
191 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
$options['rules'] = $this->rules;
|
|
|
|
|
|
|
|
|
193 |
$this->tree = null;
|
194 |
+
update_option( $this->key, $options );
|
195 |
|
196 |
$msg_status = __( 'SEO Friendly Images settings saved.', 'seo-friendly-images' );
|
197 |
|
209 |
$form[$key]['options']['override_alt'] = ( $rule['options']['override_alt'] == 'on' ) ? 'checked' : '';
|
210 |
$form[$key]['options']['override_title'] = ( $rule['options']['override_title'] == 'on' ) ?'checked' : '';
|
211 |
$form[$key]['options']['strip_extension_title'] = ( $rule['options']['strip_extension_title'] == 'on' ) ?'checked' : '';
|
|
|
|
|
212 |
}
|
213 |
}
|
214 |
|
|
|
|
|
215 |
$imgpath = $this->plugin_url . '/i';
|
216 |
$actionurl = $_SERVER['REQUEST_URI'];
|
217 |
// Configuration Page
|
237 |
<form name="sfiform" action="<?php echo $actionurl; ?>" method="post">
|
238 |
<input type="hidden" name="submitted" value="1" />
|
239 |
<p><?php _e( 'SEO Friendly Images automatically adds ALT and Title attributes to all your images in all your posts. Default options are usually good but you can change them below.', 'seo-friendly-images' ); ?></p>
|
240 |
+
<p><strong>Note: The plugin works by modyfying the image HTML output on the frontend of your site, no changes are made to images in your media library or while editing the post. See <a href="https://wordpress.org/support/topic/it-does-work-you-just-wont-see-it-in-the-backend">more info here</a>.</strong></p>
|
241 |
+
<p><?php _e( 'Plugin supports several special tags:', 'seo-friendly-images' ); ?></p>
|
242 |
<ul>
|
243 |
<li><b>%title</b> - <?php _e( 'replaces post title', 'seo-friendly-images' ); ?></li>
|
244 |
<li><b>%desc</b> - <?php _e( 'replaces post excerpt', 'seo-friendly-images' ); ?></li>
|
482 |
<div style="padding: 1.5em 0;margin: 5px 0;">
|
483 |
<input type="submit" name="Submit" value="<?php _e( 'Update options', 'seo-friendly-images' ); ?>" />
|
484 |
</div>
|
485 |
+
</form>
|
|
|
486 |
</div>
|
487 |
</div>
|
488 |
<h5><?php _e( 'Another fine WordPress plugin by', 'seo-friendly-images' ); ?> <a href="http://www.prelovac.com/vladimir/">Vladimir Prelovac</a></h5>
|
911 |
return $url;
|
912 |
}
|
913 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
914 |
|
915 |
function get_options() {
|
916 |
$options = array(
|