PB SEO Friendly Images - Version 4.0.4

Version Description

  • DISABLED: Banner in WP Dashboard
  • Bugfix & Optimization
Download this release

Release Info

Developer PascalBajorat
Plugin Icon 128x128 PB SEO Friendly Images
Version 4.0.4
Comparing to
See all releases

Code changes from version 4.0.3 to 4.0.4

inc/pbsfi_frontend.php CHANGED
@@ -55,7 +55,7 @@ class pbsfi_frontend
55
  /*
56
  * Support for AdvancedCustomFields
57
  */
58
- add_filter('acf/load_value/type=textarea', [ $this, 'optimize_html' ], 20, 3);
59
  add_filter('acf/load_value/type=wysiwyg', [ $this, 'optimize_html' ], 20, 3);
60
 
61
  // support for acf below v.4 removed
55
  /*
56
  * Support for AdvancedCustomFields
57
  */
58
+ //add_filter('acf/load_value/type=textarea', [ $this, 'optimize_html' ], 20, 3);
59
  add_filter('acf/load_value/type=wysiwyg', [ $this, 'optimize_html' ], 20, 3);
60
 
61
  // support for acf below v.4 removed
inc/pbsfi_optimizer.php CHANGED
@@ -221,9 +221,9 @@ class pbsfi_optimizer
221
  public function optimize_html( $content, $force_optimization = false )
222
  {
223
  $is_optimization_allowed = $this->is_optimization_allowed([
224
- 'post_id' => get_the_ID(),
225
- 'post_type' => get_post_type(),
226
- 'content' => $content
227
  ]);
228
 
229
  // filter for $is_optimization_allowed
@@ -234,6 +234,12 @@ class pbsfi_optimizer
234
  return $content;
235
  }
236
 
 
 
 
 
 
 
237
  // check again if DOMDocument is really available in case of force_optimization setting
238
  if( ! is_a($this->document, 'DOMDocument') ) {
239
  return $content;
221
  public function optimize_html( $content, $force_optimization = false )
222
  {
223
  $is_optimization_allowed = $this->is_optimization_allowed([
224
+ 'post_id' => get_the_ID(),
225
+ 'post_type' => get_post_type(),
226
+ 'content' => $content
227
  ]);
228
 
229
  // filter for $is_optimization_allowed
234
  return $content;
235
  }
236
 
237
+ // Do not optimize empty content
238
+ $content_trim = trim($content);
239
+ if( empty($content_trim) ) {
240
+ return $content;
241
+ }
242
+
243
  // check again if DOMDocument is really available in case of force_optimization setting
244
  if( ! is_a($this->document, 'DOMDocument') ) {
245
  return $content;
pb-seo-friendly-images.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: PB SEO Friendly Images
4
  Plugin URI: https://wordpress.org/extend/plugins/pb-seo-friendly-images/
5
  Description: This plugin is a full-featured solution for SEO friendly images. Optimize "alt" and "title" attributes for all images and post thumbnails. This plugin helps you to improve your traffic from search engines.
6
- Version: 4.0.3
7
  Author: Pascal Bajorat
8
  Author URI: https://www.bajorat-media.com
9
  Text Domain: pb-seo-friendly-images
@@ -21,7 +21,7 @@ if( ! class_exists('pbSEOFriendlyImages') ):
21
  class pbSEOFriendlyImages
22
  {
23
  /** @var string Plugin version */
24
- var $version = '4.0.3';
25
 
26
  /** @var string DB version */
27
  var $db_version = '4.0.0';
@@ -118,7 +118,7 @@ if( ! class_exists('pbSEOFriendlyImages') ):
118
  'link_de' => 'https://cockpit.bajorat-media.com/infos/?utm_source=pb-seo-friendly-images&utm_medium=banner&utm_campaign=pb-seo-friendly-images',
119
  'link_en' => 'https://cockpit.bajorat-media.com/en/infos/?utm_source=pb-seo-friendly-images&utm_medium=banner&utm_campaign=pb-seo-friendly-images',
120
  'allowed_screens' => array('settings_page_pb-seo-friendly-images'),
121
- 'only_on_screens' => $this->settings['proVersion'],
122
  'close_on_screens' => $this->settings['proVersion']
123
  ]);
124
  } catch (Exception $e) {}
3
  Plugin Name: PB SEO Friendly Images
4
  Plugin URI: https://wordpress.org/extend/plugins/pb-seo-friendly-images/
5
  Description: This plugin is a full-featured solution for SEO friendly images. Optimize "alt" and "title" attributes for all images and post thumbnails. This plugin helps you to improve your traffic from search engines.
6
+ Version: 4.0.4
7
  Author: Pascal Bajorat
8
  Author URI: https://www.bajorat-media.com
9
  Text Domain: pb-seo-friendly-images
21
  class pbSEOFriendlyImages
22
  {
23
  /** @var string Plugin version */
24
+ var $version = '4.0.4';
25
 
26
  /** @var string DB version */
27
  var $db_version = '4.0.0';
118
  'link_de' => 'https://cockpit.bajorat-media.com/infos/?utm_source=pb-seo-friendly-images&utm_medium=banner&utm_campaign=pb-seo-friendly-images',
119
  'link_en' => 'https://cockpit.bajorat-media.com/en/infos/?utm_source=pb-seo-friendly-images&utm_medium=banner&utm_campaign=pb-seo-friendly-images',
120
  'allowed_screens' => array('settings_page_pb-seo-friendly-images'),
121
+ 'only_on_screens' => true, // $this->settings['proVersion']
122
  'close_on_screens' => $this->settings['proVersion']
123
  ]);
124
  } catch (Exception $e) {}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.pascal-bajorat.com/spenden/
4
  Tags: seo, images, Post, admin, google, attachment, optimize, photo, picture, image, media, photos, pictures, alt, title, lazy, load
5
  Requires at least: 5.0
6
  Tested up to: 5.3.9
7
- Stable tag: 4.0.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -47,6 +47,10 @@ Want to add lazy load to images in your theme? You only need to do some small mo
47
 
48
  == Changelog ==
49
 
 
 
 
 
50
  = 4.0.3 =
51
  * Bugfix & Optimization
52
 
4
  Tags: seo, images, Post, admin, google, attachment, optimize, photo, picture, image, media, photos, pictures, alt, title, lazy, load
5
  Requires at least: 5.0
6
  Tested up to: 5.3.9
7
+ Stable tag: 4.0.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
47
 
48
  == Changelog ==
49
 
50
+ = 4.0.4 =
51
+ * DISABLED: Banner in WP Dashboard
52
+ * Bugfix & Optimization
53
+
54
  = 4.0.3 =
55
  * Bugfix & Optimization
56