Open Graph for Facebook, Google+ and Twitter Card Tags - Version 3.1.0

Version Description

  • Add support for new PRO add-on features
  • Tested with WordPress 5.6-beta3-49562 and WooCommerce 4.8.0-beta.1
Download this release

Release Info

Developer webdados
Plugin Icon Open Graph for Facebook, Google+ and Twitter Card Tags
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.0 to 3.1.0

admin/class-webdados-fb-open-graph-admin.php CHANGED
@@ -423,18 +423,18 @@ class Webdados_FB_Admin {
423
  public function validate_options( $options ) {
424
  global $webdados_fb;
425
  $all_options = $webdados_fb->all_options();
426
- foreach($all_options as $key => $temp) {
427
- if ( isset($options[$key]) ) {
428
- switch($temp) {
429
  case 'intval':
430
- $options[$key] = intval($options[$key]);
431
  break;
432
  case 'trim':
433
- $options[$key] = trim($options[$key]);
434
  break;
435
  }
436
  } else {
437
- switch($temp) {
438
  case 'intval':
439
  $options[$key] = 0;
440
  break;
423
  public function validate_options( $options ) {
424
  global $webdados_fb;
425
  $all_options = $webdados_fb->all_options();
426
+ foreach( $all_options as $key => $temp ) {
427
+ if ( isset( $options[$key] ) ) {
428
+ switch( $temp ) {
429
  case 'intval':
430
+ $options[$key] = intval( $options[$key] );
431
  break;
432
  case 'trim':
433
+ $options[$key] = trim( $options[$key] );
434
  break;
435
  }
436
  } else {
437
+ switch( $temp ) {
438
  case 'intval':
439
  $options[$key] = 0;
440
  break;
admin/options-page-general.php CHANGED
@@ -234,6 +234,8 @@ global $webdados_fb;
234
  - <?php _e( 'Do not apply the overlay image to the default image set above', 'wonderm00ns-simple-facebook-open-graph-tags' ); ?>
235
  </td>
236
  </tr>
 
 
237
 
238
  <?php } else { ?>
239
  <tr>
234
  - <?php _e( 'Do not apply the overlay image to the default image set above', 'wonderm00ns-simple-facebook-open-graph-tags' ); ?>
235
  </td>
236
  </tr>
237
+
238
+ <?php do_action( 'fb_og_admin_settings_general_image_overlayoptions' ); ?>
239
 
240
  <?php } else { ?>
241
  <tr>
fbimg.php CHANGED
@@ -5,13 +5,22 @@
5
 
6
  if ( $webdados_fb = webdados_fb_run() ) {
7
 
 
 
 
 
 
 
 
 
 
8
  //Fix GET on some weird scenarios
9
- foreach ($_GET as $key => $value) {
10
- $_GET[ str_replace( 'amp;', '', $key ) ] = $value;
11
  }
12
 
13
- if ( isset($_GET['img']) && trim($_GET['img'])!='' ) {
14
- if ( $url=parse_url(urldecode(trim($_GET['img']))) ) {
15
  if ( $url['host']==$_SERVER['HTTP_HOST'] ) {
16
 
17
  if( $image=imagecreatefromfile($_SERVER['DOCUMENT_ROOT'].$url['path']) ) {
@@ -97,30 +106,40 @@
97
  }
98
 
99
  //Allow developers to change the thumb
100
- $thumb = apply_filters( 'fb_og_thumb', $thumb, $_GET );
101
 
102
  //Barra
103
  if ( trim($webdados_fb->options['fb_image_overlay_image'])!='' ) {
104
- $barra_url = parse_url( apply_filters( 'fb_og_thumb_image', trim($webdados_fb->options['fb_image_overlay_image']), intval($_GET['post_id']) ) );
105
  $barra = imagecreatefromfile($_SERVER['DOCUMENT_ROOT'].$barra_url['path']);
106
  imagecopy( $thumb, $barra, 0, 0, 0, 0, intval( $thumb_width ), intval( $thumb_height ) );
107
  }
108
-
109
- @header('HTTP/1.0 200 OK');
110
- switch( apply_filters( 'fb_og_overlayed_image_format', 'jpg' ) ) {
111
- case 'png':
112
- header('Content-Type: image/png');
113
- imagepng($thumb);
114
- break;
115
- case 'jpg':
116
- default:
117
- header('Content-Type: image/jpeg');
118
- imagejpeg( $thumb, NULL, apply_filters( 'fb_og_overlayed_image_format_jpg_quality', 100 ) );
119
- break;
 
 
 
 
 
 
 
 
120
  }
121
- imagedestroy($image);
122
- imagedestroy($thumb);
123
- imagedestroy($barra);
 
 
124
  } else {
125
 
126
  }
5
 
6
  if ( $webdados_fb = webdados_fb_run() ) {
7
 
8
+ //Base 64 from PRO add-on?
9
+ if ( isset( $_GET['b64'] ) ) {
10
+ $argstemp = base64_decode( $_GET['b64'] );
11
+ $args = array();
12
+ parse_str( $argstemp, $args );
13
+ } else {
14
+ $args = $_GET;
15
+ }
16
+
17
  //Fix GET on some weird scenarios
18
+ foreach ( $args as $key => $value ) {
19
+ $args[ str_replace( 'amp;', '', $key ) ] = $value;
20
  }
21
 
22
+ if ( isset($args['img']) && trim($args['img'])!='' ) {
23
+ if ( $url=parse_url(urldecode(trim($args['img']))) ) {
24
  if ( $url['host']==$_SERVER['HTTP_HOST'] ) {
25
 
26
  if( $image=imagecreatefromfile($_SERVER['DOCUMENT_ROOT'].$url['path']) ) {
106
  }
107
 
108
  //Allow developers to change the thumb
109
+ $thumb = apply_filters( 'fb_og_thumb', $thumb, $args );
110
 
111
  //Barra
112
  if ( trim($webdados_fb->options['fb_image_overlay_image'])!='' ) {
113
+ $barra_url = parse_url( apply_filters( 'fb_og_thumb_image', trim($webdados_fb->options['fb_image_overlay_image']), intval($args['post_id']) ) );
114
  $barra = imagecreatefromfile($_SERVER['DOCUMENT_ROOT'].$barra_url['path']);
115
  imagecopy( $thumb, $barra, 0, 0, 0, 0, intval( $thumb_width ), intval( $thumb_height ) );
116
  }
117
+
118
+ if ( has_action( 'fb_og_alternate_output' ) ) {
119
+
120
+ do_action( 'fb_og_alternate_output', $thumb, urldecode( $args['img'] ) );
121
+
122
+ } else {
123
+
124
+ @header('HTTP/1.0 200 OK');
125
+ switch( apply_filters( 'fb_og_overlayed_image_format', 'jpg' ) ) {
126
+ case 'png':
127
+ header('Content-Type: image/png');
128
+ imagepng($thumb);
129
+ break;
130
+ case 'jpg':
131
+ default:
132
+ header('Content-Type: image/jpeg');
133
+ imagejpeg( $thumb, NULL, apply_filters( 'fb_og_overlayed_image_format_jpg_quality', 100 ) );
134
+ break;
135
+ }
136
+
137
  }
138
+
139
+ imagedestroy( $image );
140
+ imagedestroy( $thumb );
141
+ imagedestroy( $barra );
142
+
143
  } else {
144
 
145
  }
public/class-webdados-fb-open-graph-public.php CHANGED
@@ -1019,7 +1019,7 @@ class Webdados_FB_Public {
1019
  if ( $fb_image_parsed['host'] == $_SERVER['HTTP_HOST'] ) {
1020
  //Params
1021
  $params['img'] = urlencode( $fb_image );
1022
- $fb_image = plugins_url( '/wonderm00ns-simple-facebook-open-graph-tags/fbimg.php' ).'?'.http_build_query($params);
1023
  return array(
1024
  'overlay' => true,
1025
  'fb_image' => $fb_image,
1019
  if ( $fb_image_parsed['host'] == $_SERVER['HTTP_HOST'] ) {
1020
  //Params
1021
  $params['img'] = urlencode( $fb_image );
1022
+ $fb_image = apply_filters( 'fb_og_image_overlay_url', plugins_url( '/wonderm00ns-simple-facebook-open-graph-tags/fbimg.php' ).'?'.http_build_query( $params ), http_build_query( $params ) );
1023
  return array(
1024
  'overlay' => true,
1025
  'fb_image' => $fb_image,
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webdados, wonderm00n
3
  Donate link: http://bit.ly/donate_fb_opengraph
4
  Tags: facebook, open graph, twitter card, social media, open graph protocol, share, social, meta, rss, twitter, google, image, like, seo, search engine optimization, woocommerce, yoast seo, wordpress seo, woocommerce, subheading, php7, webdados
5
  Requires at least: 4.5
6
- Tested up to: 5.5
7
- Stable tag: 3.0.0
8
 
9
  Improve social media sharing by inserting Facebook Open Graph, Twitter Card, and SEO Meta Tags on your WordPress website pages, posts, WooCommerce products, or any other custom post type.
10
 
@@ -84,6 +84,7 @@ The current PRO add-on features are:
84
 
85
  * [Rank Math](https://wordpress.org/plugins/seo-by-rank-math/) integration: title, description and canonical
86
  * Set different image size (instead of 1200x630)
 
87
  * Technical support (limited to the PRO add-on features)
88
  * Good karma and support the development of new features
89
 
@@ -170,6 +171,10 @@ It’s similar, yes. They’ve forked our plugin and gave no credits whatsoever
170
 
171
  == Changelog ==
172
 
 
 
 
 
173
  = 3.0.0 =
174
  * Add support for the PRO add-on
175
  * Deprecation of Business Directory Plugin integration and other minor settings
3
  Donate link: http://bit.ly/donate_fb_opengraph
4
  Tags: facebook, open graph, twitter card, social media, open graph protocol, share, social, meta, rss, twitter, google, image, like, seo, search engine optimization, woocommerce, yoast seo, wordpress seo, woocommerce, subheading, php7, webdados
5
  Requires at least: 4.5
6
+ Tested up to: 5.6
7
+ Stable tag: 3.1.0
8
 
9
  Improve social media sharing by inserting Facebook Open Graph, Twitter Card, and SEO Meta Tags on your WordPress website pages, posts, WooCommerce products, or any other custom post type.
10
 
84
 
85
  * [Rank Math](https://wordpress.org/plugins/seo-by-rank-math/) integration: title, description and canonical
86
  * Set different image size (instead of 1200x630)
87
+ * Fix chunked transfer encoding when using an image overlay
88
  * Technical support (limited to the PRO add-on features)
89
  * Good karma and support the development of new features
90
 
171
 
172
  == Changelog ==
173
 
174
+ = 3.1.0 =
175
+ * Add support for new PRO add-on features
176
+ * Tested with WordPress 5.6-beta3-49562 and WooCommerce 4.8.0-beta.1
177
+
178
  = 3.0.0 =
179
  * Add support for the PRO add-on
180
  * Deprecation of Business Directory Plugin integration and other minor settings
wonderm00n-open-graph.php CHANGED
@@ -3,17 +3,17 @@
3
  Plugin Name: Open Graph and Twitter Card Tags
4
  Plugin URI: https://www.webdados.pt/wordpress/plugins/facebook-open-graph-meta-tags-wordpress/
5
  Description: Improve social media sharing by inserting Facebook Open Graph, Twitter Card and SEO Meta Tags on your WordPress website pages, posts, WooCommerce products, or any other custom post type.
6
- Version: 3.0.0
7
  Author: Webdados
8
  Author URI: https://www.webdados.pt
9
  Text Domain: wonderm00ns-simple-facebook-open-graph-tags
10
  Domain Path: /lang
11
- WC tested up to: 4.1.0
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
 
16
- define( 'WEBDADOS_FB_VERSION', '3.0.0' );
17
  define( 'WEBDADOS_FB_PLUGIN_NAME', 'Open Graph and Twitter Card Tags' );
18
  define( 'WEBDADOS_FB_W', 1200 );
19
  define( 'WEBDADOS_FB_H', 630 );
3
  Plugin Name: Open Graph and Twitter Card Tags
4
  Plugin URI: https://www.webdados.pt/wordpress/plugins/facebook-open-graph-meta-tags-wordpress/
5
  Description: Improve social media sharing by inserting Facebook Open Graph, Twitter Card and SEO Meta Tags on your WordPress website pages, posts, WooCommerce products, or any other custom post type.
6
+ Version: 3.1.0
7
  Author: Webdados
8
  Author URI: https://www.webdados.pt
9
  Text Domain: wonderm00ns-simple-facebook-open-graph-tags
10
  Domain Path: /lang
11
+ WC tested up to: 4.8.0
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
 
16
+ define( 'WEBDADOS_FB_VERSION', '3.1.0' );
17
  define( 'WEBDADOS_FB_PLUGIN_NAME', 'Open Graph and Twitter Card Tags' );
18
  define( 'WEBDADOS_FB_W', 1200 );
19
  define( 'WEBDADOS_FB_H', 630 );