All Meta Tags - Version 3.8

Version Description

  • Fixed the error due to which the "Fatal error: Uncaught Error: Call to a member function attributes() on boolean" message showed when the product page has no image.
Download this release

Release Info

Developer Arthur Gareginyan
Plugin Icon 128x128 All Meta Tags
Version 3.8
Comparing to
See all releases

Code changes from version 3.7 to 3.8

Files changed (2) hide show
  1. all-meta-tags.php +8 -4
  2. readme.txt +3 -1
all-meta-tags.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Easily and safely add your custom Meta Tags to WordPress website's header.
6
  * Author: Arthur Gareginyan
7
  * Author URI: http://www.arthurgareginyan.com
8
- * Version: 3.7
9
  * License: GPL3
10
  * Text Domain: all-meta-tags
11
  * Domain Path: /languages/
@@ -182,7 +182,7 @@ function allmetatags_field($name, $label, $placeholder, $help=null, $link=null,
182
  /**
183
  * Generate the Meta Tags
184
  *
185
- * @since 3.6
186
  */
187
  function allmetatags_add_meta_tags() {
188
 
@@ -306,11 +306,15 @@ function allmetatags_add_meta_tags() {
306
  if ( class_exists( 'WooCommerce' ) ) {
307
 
308
  if ( is_product() ) {
309
-
310
  $name = get_the_title();
311
  $description = get_the_excerpt();
312
  $image = simplexml_load_string(get_the_post_thumbnail());
313
- $imagesrc = $image->attributes()->src;
 
 
 
 
314
  $price = get_post_meta( get_the_ID(), '_price', true);
315
  $currency = get_woocommerce_currency();
316
 
5
  * Description: Easily and safely add your custom Meta Tags to WordPress website's header.
6
  * Author: Arthur Gareginyan
7
  * Author URI: http://www.arthurgareginyan.com
8
+ * Version: 3.8
9
  * License: GPL3
10
  * Text Domain: all-meta-tags
11
  * Domain Path: /languages/
182
  /**
183
  * Generate the Meta Tags
184
  *
185
+ * @since 3.8
186
  */
187
  function allmetatags_add_meta_tags() {
188
 
306
  if ( class_exists( 'WooCommerce' ) ) {
307
 
308
  if ( is_product() ) {
309
+
310
  $name = get_the_title();
311
  $description = get_the_excerpt();
312
  $image = simplexml_load_string(get_the_post_thumbnail());
313
+ if ( !empty($image) ) {
314
+ $imagesrc = $image->attributes()->src;
315
+ } else {
316
+ $imagesrc = "";
317
+ }
318
  $price = get_post_meta( get_the_ID(), '_price', true);
319
  $currency = get_woocommerce_currency();
320
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: meta, tag,tags, custom, simple, plugin, twitter, facebook, g+, google, goo
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
5
  Requires at least: 3.9
6
  Tested up to: 4.7
7
- Stable tag: 3.7
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -162,6 +162,8 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
162
  * [Dedicated Plugin Page on GitHub](https://github.com/ArthurGareginyan/all-meta-tags)
163
 
164
  == Changelog ==
 
 
165
  = 3.7 =
166
  * Added Italian translation. (Thanks to Stefano Tombolini)
167
  * Image of the donate button changed.
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8A88KC7TFF6CS
5
  Requires at least: 3.9
6
  Tested up to: 4.7
7
+ Stable tag: 3.8
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
162
  * [Dedicated Plugin Page on GitHub](https://github.com/ArthurGareginyan/all-meta-tags)
163
 
164
  == Changelog ==
165
+ = 3.8 =
166
+ * Fixed the error due to which the "Fatal error: Uncaught Error: Call to a member function attributes() on boolean" message showed when the product page has no image.
167
  = 3.7 =
168
  * Added Italian translation. (Thanks to Stefano Tombolini)
169
  * Image of the donate button changed.