Version Description
- New
fb_og_enabled
filter that allow other plugins/themes to completely disable the tags output on specific situations - Fix: Use
WP_PLUGIN_DIR
instead of harcoded paths (Thanks thomasbachem) - Fix: Extra validation when getting Yoast SEO's icon on the 3rd party settings tab
Download this release
Release Info
Developer | webdados |
Plugin | Open Graph for Facebook, Google+ and Twitter Card Tags |
Version | 2.0.6 |
Comparing to | |
See all releases |
Code changes from version 2.0.5 to 2.0.6
- admin/options-page-3rdparty.php +8 -4
- admin/options-page-facebook.php +2 -2
- public/class-webdados-fb-open-graph-public.php +400 -392
- readme.txt +6 -1
- wonderm00n-open-graph.php +3 -3
admin/options-page-3rdparty.php
CHANGED
@@ -24,11 +24,15 @@ global $webdados_fb;
|
|
24 |
<div class="postbox">
|
25 |
<h3 class="hndle">
|
26 |
<?php
|
27 |
-
if ( $webdados_fb->is_yoast_seo_active() ) {
|
28 |
$wpseo_utils = new WPSEO_Utils();
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
} else {
|
33 |
?><i class="dashicons-before dashicons-editor-code"></i><?php
|
34 |
}
|
24 |
<div class="postbox">
|
25 |
<h3 class="hndle">
|
26 |
<?php
|
27 |
+
if ( $webdados_fb->is_yoast_seo_active() && class_exists('WPSEO_Utils') ) {
|
28 |
$wpseo_utils = new WPSEO_Utils();
|
29 |
+
if( method_exists($wpseo_utils, 'get_icon_svg') ) {
|
30 |
+
?>
|
31 |
+
<img src="<?php echo 'data:image/svg+xml;base64,' . base64_encode( str_replace('fill:#82878c', 'fill:#23282d', $wpseo_utils->get_icon_svg(false) ) ) ; ?>"/>
|
32 |
+
<?php
|
33 |
+
} else {
|
34 |
+
?><i class="dashicons-before dashicons-editor-code"></i><?php
|
35 |
+
}
|
36 |
} else {
|
37 |
?><i class="dashicons-before dashicons-editor-code"></i><?php
|
38 |
}
|
admin/options-page-facebook.php
CHANGED
@@ -230,7 +230,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
230 |
$info = curl_getinfo($ch);
|
231 |
if (intval($info['http_code'])==200) {
|
232 |
//Save the file locally
|
233 |
-
$fh = fopen(
|
234 |
fwrite($fh, $fb_locales);
|
235 |
fclose($fh);
|
236 |
$listLocales=true;
|
@@ -243,7 +243,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
243 |
}
|
244 |
//Offline
|
245 |
if (!$listLocales) {
|
246 |
-
if ($fb_locales=file_get_contents(
|
247 |
$listLocales=true;
|
248 |
$loadedOffline=true;
|
249 |
}
|
230 |
$info = curl_getinfo($ch);
|
231 |
if (intval($info['http_code'])==200) {
|
232 |
//Save the file locally
|
233 |
+
$fh = fopen(WP_PLUGIN_DIR . '/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml', 'w') or die("Can't open file");
|
234 |
fwrite($fh, $fb_locales);
|
235 |
fclose($fh);
|
236 |
$listLocales=true;
|
243 |
}
|
244 |
//Offline
|
245 |
if (!$listLocales) {
|
246 |
+
if ($fb_locales=file_get_contents(WP_PLUGIN_DIR . '/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml')) {
|
247 |
$listLocales=true;
|
248 |
$loadedOffline=true;
|
249 |
}
|
public/class-webdados-fb-open-graph-public.php
CHANGED
@@ -42,266 +42,269 @@ class Webdados_FB_Public {
|
|
42 |
public function insert_meta_tags() {
|
43 |
global $webdados_fb, $wp_query;
|
44 |
|
45 |
-
//Also set Title Tag? - Needed??
|
46 |
-
$fb_set_title_tag=0;
|
47 |
-
|
48 |
-
//Init values
|
49 |
-
$fb_locale = '';
|
50 |
-
$fb_title = '';
|
51 |
-
$fb_url = '';
|
52 |
-
$fb_desc = '';
|
53 |
-
$fb_image = '';
|
54 |
-
$fb_type = 'article';
|
55 |
-
$fb_author = '';
|
56 |
-
$fb_author_meta = '';
|
57 |
-
$fb_author_linkrelgp = '';
|
58 |
-
$fb_author_twitter = '';
|
59 |
-
$fb_article_pub_date = '';
|
60 |
-
$fb_article_mod_date = '';
|
61 |
-
$fb_image_additional = array();
|
62 |
-
$fb_additional_tags = array(
|
63 |
-
'name' => array(),
|
64 |
-
'property' => array(),
|
65 |
-
);
|
66 |
-
$fb_publisher = trim($this->options['fb_publisher']);
|
67 |
-
$fb_publisher_schema = trim($this->options['fb_publisher_schema']);
|
68 |
-
$fb_publisher_twitteruser = trim($this->options['fb_publisher_twitteruser']);
|
69 |
-
|
70 |
-
//Homepage Description
|
71 |
-
switch( $this->options['fb_desc_homepage'] ) {
|
72 |
-
case 'custom':
|
73 |
-
$fb_desc_homepage = $this->options['fb_desc_homepage_customtext'];
|
74 |
-
//WPML?
|
75 |
-
if ( $webdados_fb->is_wpml_active() ) {
|
76 |
-
global $sitepress;
|
77 |
-
if ( ICL_LANGUAGE_CODE != $sitepress->get_default_language() ) {
|
78 |
-
$fb_desc_homepage = icl_t( 'wd-fb-og', 'wd_fb_og_desc_homepage_customtext', $fb_desc_homepage );
|
79 |
-
}
|
80 |
-
}
|
81 |
-
break;
|
82 |
-
default:
|
83 |
-
$fb_desc_homepage = get_bloginfo( 'description' );
|
84 |
-
break;
|
85 |
-
}
|
86 |
-
|
87 |
//Open tag
|
88 |
$html='
|
89 |
<!-- START - '.WEBDADOS_FB_PLUGIN_NAME.' '.WEBDADOS_FB_VERSION.' -->
|
90 |
';
|
91 |
|
92 |
-
if (
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
} else {
|
103 |
-
|
|
|
104 |
}
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
$
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
//Published and Modified time - We should check this out and maybe have it for any kind of post...
|
136 |
-
if ( is_singular('post' ) ) {
|
137 |
-
$fb_article_pub_date = get_the_date('c' );
|
138 |
-
$fb_article_mod_date = get_the_modified_date('c' );
|
139 |
-
} else {
|
140 |
-
//Reset dates show because we're not on posts
|
141 |
-
$this->options['fb_article_dates_show'] = 0;
|
142 |
-
}
|
143 |
-
//Sections
|
144 |
-
if ( is_singular('post' ) ) {
|
145 |
-
$cats = get_the_category();
|
146 |
-
if ( !is_wp_error($cats) && (is_array($cats) && count($cats)>0) ) {
|
147 |
-
$fb_sections = array();
|
148 |
-
foreach ($cats as $cat) {
|
149 |
-
$fb_sections[] = $cat->name;
|
150 |
}
|
|
|
|
|
151 |
}
|
152 |
-
|
153 |
-
$this->options['
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
$thumbdone = true;
|
181 |
-
} else {
|
182 |
}
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
}
|
190 |
}
|
191 |
-
|
192 |
}
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
}
|
222 |
}
|
223 |
}
|
224 |
}
|
225 |
}
|
226 |
-
|
227 |
-
|
228 |
-
} else {
|
229 |
-
|
230 |
-
//Other pages - Defaults
|
231 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( get_bloginfo( 'name' ) ), true ) );
|
232 |
-
$fb_url = ( ( !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ) ? 'https://' : 'http://' ).$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; //Not really canonical but will work for now
|
233 |
-
$fb_image = trim( $this->options['fb_image'] );
|
234 |
-
|
235 |
-
$this->options['fb_article_sections_show'] = 0;
|
236 |
-
$this->options['fb_article_dates_show'] = 0;
|
237 |
-
$this->options['fb_author_show'] = 0;
|
238 |
-
$this->options['fb_author_show_meta'] = 0;
|
239 |
-
$this->options['fb_author_show_linkrelgp'] = 0;
|
240 |
-
$this->options['fb_author_show_twitter'] = 0;
|
241 |
-
$this->options['fb_author_show_twitter'] = 0;
|
242 |
-
|
243 |
-
//Category
|
244 |
-
if ( is_category() ) {
|
245 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( single_cat_title( '', false ) ), true ) );
|
246 |
-
$term = $wp_query->get_queried_object();
|
247 |
-
$fb_url = get_term_link( $term, $term->taxonomy );
|
248 |
-
$cat_desc = trim( esc_attr( wp_strip_all_tags( stripslashes( category_description() ), true ) ) );
|
249 |
-
if ( trim($cat_desc)!='' ) $fb_desc = $cat_desc;
|
250 |
} else {
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
$term = $wp_query->get_queried_object();
|
254 |
$fb_url = get_term_link( $term, $term->taxonomy );
|
255 |
-
$
|
256 |
-
if ( trim($
|
257 |
} else {
|
258 |
-
if (
|
259 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes(
|
260 |
$term = $wp_query->get_queried_object();
|
261 |
-
$fb_url = get_term_link($term, $term->taxonomy);
|
262 |
-
$
|
263 |
-
if ( trim($
|
264 |
-
|
265 |
-
if (
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
}
|
271 |
}
|
272 |
}
|
273 |
-
}
|
274 |
-
} else {
|
275 |
-
if ( is_search() ) {
|
276 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( __('Search for', 'wd-fb-og').' "'.get_search_query().'"' ), true ) );
|
277 |
-
$fb_url = get_search_link();
|
278 |
} else {
|
279 |
-
if (
|
280 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes(
|
281 |
-
$fb_url =
|
282 |
} else {
|
283 |
-
if (
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
if (
|
289 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( single_month_title( ' ', false ) . ' ' . __( 'Archives', 'wd-fb-og' ) ), true ) );
|
290 |
-
$fb_url =
|
291 |
} else {
|
292 |
-
if (
|
293 |
-
$fb_title = esc_attr( wp_strip_all_tags( stripslashes(
|
294 |
-
$fb_url =
|
|
|
|
|
|
|
|
|
|
|
295 |
}
|
296 |
}
|
297 |
-
}
|
298 |
-
} else {
|
299 |
-
if (is_front_page()) {
|
300 |
-
$fb_url = get_option('home').(intval($this->options['fb_url_add_trailing'])==1 ? '/' : '');
|
301 |
-
$fb_type = trim( $this->options['fb_type_homepage']=='' ? 'website' : $this->options['fb_type_homepage'] );
|
302 |
-
$fb_desc = $fb_desc_homepage;
|
303 |
} else {
|
304 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
}
|
306 |
}
|
307 |
}
|
@@ -309,191 +312,190 @@ class Webdados_FB_Public {
|
|
309 |
}
|
310 |
}
|
311 |
}
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
}
|
320 |
}
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
}
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
}
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
}
|
369 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
}
|
371 |
-
//URL
|
372 |
-
$fb_url_temp = $wpseo->canonical(false);
|
373 |
-
$fb_url = wp_strip_all_tags( trim($fb_url_temp)!='' ? trim($fb_url_temp) : $fb_url, true);
|
374 |
-
//Description
|
375 |
-
$fb_desc_temp = $wpseo->metadesc(false);
|
376 |
-
$fb_desc = wp_strip_all_tags( trim($fb_desc_temp)!='' ? trim($fb_desc_temp) : $fb_desc, true);
|
377 |
}
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
}
|
395 |
}
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
$show_page = false;
|
405 |
-
}
|
406 |
-
if ( $aioseop_options['aiosp_can'] ) {
|
407 |
-
if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) {
|
408 |
-
$fb_url_temp = $opts['aiosp_custom_link'];
|
409 |
}
|
410 |
-
if (
|
411 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
}
|
413 |
-
|
414 |
-
$
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
$
|
423 |
-
|
424 |
-
$post = $aiosp->get_queried_object();
|
425 |
}
|
426 |
-
$fb_desc_temp = apply_filters( 'aioseop_description', $aiosp->get_main_description( $post ) );
|
427 |
-
$fb_desc = wp_strip_all_tags( trim($fb_desc_temp)!='' ? trim($fb_desc_temp) : $fb_desc, true);
|
428 |
-
|
429 |
}
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
}
|
|
|
|
|
450 |
}
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
$
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
if ( $temp_fb_image_overlay['overlay'] ) {
|
471 |
-
$fb_image_additional[$key]['fb_image'] = $temp_fb_image_overlay['fb_image'];
|
472 |
}
|
473 |
}
|
474 |
}
|
475 |
}
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
}
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
$html.=' <!-- Facebook Open Graph -->
|
497 |
';
|
498 |
//Locale
|
499 |
if ( intval($this->options['fb_locale_show'])==1 ) $html.=' <meta property="og:locale" content="'.trim(esc_attr( trim($this->options['fb_locale'])!='' ? trim($this->options['fb_locale']) : trim(get_locale()) )).'"/>
|
@@ -626,7 +628,13 @@ class Webdados_FB_Public {
|
|
626 |
}
|
627 |
}
|
628 |
}
|
|
|
|
|
|
|
|
|
629 |
|
|
|
|
|
630 |
//Close tag
|
631 |
$html.='<!-- END - '.WEBDADOS_FB_PLUGIN_NAME.' '.WEBDADOS_FB_VERSION.' -->
|
632 |
|
42 |
public function insert_meta_tags() {
|
43 |
global $webdados_fb, $wp_query;
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
//Open tag
|
46 |
$html='
|
47 |
<!-- START - '.WEBDADOS_FB_PLUGIN_NAME.' '.WEBDADOS_FB_VERSION.' -->
|
48 |
';
|
49 |
|
50 |
+
if ( apply_filters('fb_og_enabled', true) ) {
|
51 |
+
|
52 |
+
//Also set Title Tag? - Needed??
|
53 |
+
$fb_set_title_tag=0;
|
54 |
+
|
55 |
+
//Init values
|
56 |
+
$fb_locale = '';
|
57 |
+
$fb_title = '';
|
58 |
+
$fb_url = '';
|
59 |
+
$fb_desc = '';
|
60 |
+
$fb_image = '';
|
61 |
+
$fb_type = 'article';
|
62 |
+
$fb_author = '';
|
63 |
+
$fb_author_meta = '';
|
64 |
+
$fb_author_linkrelgp = '';
|
65 |
+
$fb_author_twitter = '';
|
66 |
+
$fb_article_pub_date = '';
|
67 |
+
$fb_article_mod_date = '';
|
68 |
+
$fb_image_additional = array();
|
69 |
+
$fb_additional_tags = array(
|
70 |
+
'name' => array(),
|
71 |
+
'property' => array(),
|
72 |
+
);
|
73 |
+
$fb_publisher = trim($this->options['fb_publisher']);
|
74 |
+
$fb_publisher_schema = trim($this->options['fb_publisher_schema']);
|
75 |
+
$fb_publisher_twitteruser = trim($this->options['fb_publisher_twitteruser']);
|
76 |
+
|
77 |
+
//Homepage Description
|
78 |
+
switch( $this->options['fb_desc_homepage'] ) {
|
79 |
+
case 'custom':
|
80 |
+
$fb_desc_homepage = $this->options['fb_desc_homepage_customtext'];
|
81 |
+
//WPML?
|
82 |
+
if ( $webdados_fb->is_wpml_active() ) {
|
83 |
+
global $sitepress;
|
84 |
+
if ( ICL_LANGUAGE_CODE != $sitepress->get_default_language() ) {
|
85 |
+
$fb_desc_homepage = icl_t( 'wd-fb-og', 'wd_fb_og_desc_homepage_customtext', $fb_desc_homepage );
|
86 |
+
}
|
87 |
+
}
|
88 |
+
break;
|
89 |
+
default:
|
90 |
+
$fb_desc_homepage = get_bloginfo( 'description' );
|
91 |
+
break;
|
92 |
+
}
|
93 |
+
|
94 |
+
if ( is_singular() ) {
|
95 |
+
|
96 |
+
global $post;
|
97 |
+
// Title
|
98 |
+
//It's a Post or a Page or an attachment page - It can also be the homepage if it's set as a page
|
99 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( $post->post_title ), true ) );
|
100 |
+
//SubHeading
|
101 |
+
if ( isset($this->options['fb_show_subheading']) && intval($this->options['fb_show_subheading'])==1 && $webdados_fb->is_subheading_plugin_active() ) {
|
102 |
+
if (isset($this->options['fb_subheading_position']) && $this->options['fb_subheading_position']=='before' ) {
|
103 |
+
$fb_title = trim( trim(get_the_subheading()).' - '.trim($fb_title), ' -' );
|
104 |
+
} else {
|
105 |
+
$fb_title = trim( trim($fb_title).' - '.trim(get_the_subheading()), ' -' );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
// URL
|
109 |
+
$fb_url = get_permalink();
|
110 |
+
// Type if it's a homepage page
|
111 |
+
if ( is_front_page() ) {
|
112 |
+
/* Fix homepage type when it's a static page */
|
113 |
+
$fb_url = get_option('home' ).(intval($this->options['fb_url_add_trailing'])==1 ? '/' : '' );
|
114 |
+
$fb_type = trim($this->options['fb_type_homepage']=='' ? 'website' : $this->options['fb_type_homepage']);
|
115 |
+
}
|
116 |
+
// Description
|
117 |
+
if ( trim($post->post_excerpt) != '' ) {
|
118 |
+
//If there's an excerpt that's what we'll use
|
119 |
+
$fb_desc = trim($post->post_excerpt);
|
120 |
} else {
|
121 |
+
//If not we grab it from the content
|
122 |
+
$fb_desc = trim($post->post_content);
|
123 |
}
|
124 |
+
// Image
|
125 |
+
if ( intval($this->options['fb_image_show'])==1 || intval($this->options['fb_image_show_schema'])==1 || intval($this->options['fb_image_show_twitter'])==1 ) {
|
126 |
+
$fb_image = $this->get_post_image();
|
127 |
+
}
|
128 |
+
// Author
|
129 |
+
$author_id = $post->post_author;
|
130 |
+
if ( $author_id > 0 && ! ( is_page() && intval($this->options['fb_author_hide_on_pages'])==1 ) ) {
|
131 |
+
$fb_author = get_the_author_meta('facebook', $author_id);
|
132 |
+
$fb_author_meta = get_the_author_meta('display_name', $author_id);
|
133 |
+
$fb_author_linkrelgp = get_the_author_meta('googleplus', $author_id);
|
134 |
+
$fb_author_twitter = get_the_author_meta('twitter', $author_id);
|
135 |
+
}
|
136 |
+
|
137 |
+
//Published and Modified time - We should check this out and maybe have it for any kind of post...
|
138 |
+
if ( is_singular('post' ) ) {
|
139 |
+
$fb_article_pub_date = get_the_date('c' );
|
140 |
+
$fb_article_mod_date = get_the_modified_date('c' );
|
141 |
+
} else {
|
142 |
+
//Reset dates show because we're not on posts
|
143 |
+
$this->options['fb_article_dates_show'] = 0;
|
144 |
+
}
|
145 |
+
//Sections
|
146 |
+
if ( is_singular('post' ) ) {
|
147 |
+
$cats = get_the_category();
|
148 |
+
if ( !is_wp_error($cats) && (is_array($cats) && count($cats)>0) ) {
|
149 |
+
$fb_sections = array();
|
150 |
+
foreach ($cats as $cat) {
|
151 |
+
$fb_sections[] = $cat->name;
|
152 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
}
|
154 |
+
} else {
|
155 |
+
$this->options['fb_article_sections_show'] = 0;
|
156 |
}
|
157 |
+
// Business Directory Plugin
|
158 |
+
if ( isset( $this->options['fb_show_businessdirectoryplugin'] ) && $webdados_fb->is_business_directory_active() ) {
|
159 |
+
global $wpbdp;
|
160 |
+
$bdp_action = wpbdp_current_action();
|
161 |
+
$bdp_disable_cpt = wpbdp_get_option( 'disable-cpt' );
|
162 |
+
$current_view_object = $wpbdp->dispatcher->current_view_object();
|
163 |
+
switch( $bdp_action ) {
|
164 |
+
case 'show_listing':
|
165 |
+
$fb_title = trim( esc_attr( wp_strip_all_tags( stripslashes( $this->post->post_title ), true ) ).' - '.$fb_title, ' -' );
|
166 |
+
$fb_set_title_tag = 1;
|
167 |
+
$fb_url = get_permalink($this->post->ID);
|
168 |
+
if ( trim($this->post->post_excerpt)!='' ) {
|
169 |
+
//If there's an excerpt that's what we'll use
|
170 |
+
$fb_desc = trim($this->post->post_excerpt);
|
171 |
+
} else {
|
172 |
+
//If not we grab it from the content
|
173 |
+
$fb_desc = trim($this->post->post_content);
|
174 |
+
}
|
175 |
+
if (intval($this->options['fb_image_show'])==1 || intval($this->options['fb_image_show_schema'])==1 || intval($this->options['fb_image_show_twitter'])==1) {
|
176 |
+
$thumbdone = false;
|
177 |
+
if ( intval($this->options['fb_image_use_featured'])==1 ) {
|
178 |
+
//Featured
|
179 |
+
if ( $id_attachment = get_post_thumbnail_id( $this->post->ID ) ) {
|
180 |
+
//There's a featured/thumbnail image for this listing
|
181 |
+
$fb_image = wp_get_attachment_url( $id_attachment, false );
|
182 |
+
$thumbdone = true;
|
183 |
+
} else {
|
184 |
+
}
|
|
|
|
|
185 |
}
|
186 |
+
if ( !$thumbdone ) {
|
187 |
+
//Main image loaded
|
188 |
+
if ( $thumbnail_id = wpbdp_listings_api()->get_thumbnail_id( $this->post->ID ) ) {
|
189 |
+
$fb_image = wp_get_attachment_url( $thumbnail_id, false );
|
190 |
+
$thumbdone = true;
|
191 |
+
}
|
192 |
}
|
193 |
}
|
194 |
+
}
|
195 |
}
|
196 |
+
// WooCommerce
|
197 |
+
if ( $webdados_fb->is_woocommerce_active() && is_product() ) {
|
198 |
+
$fb_type = 'product';
|
199 |
+
$product = new WC_Product( $post->ID );
|
200 |
+
//Price
|
201 |
+
$fb_additional_tags['property']['og_price_amount'] = array(
|
202 |
+
$product->get_price_including_tax()
|
203 |
+
);
|
204 |
+
if ( function_exists('get_woocommerce_currency') ) $fb_additional_tags['property']['og_price_currency'] = array(
|
205 |
+
get_woocommerce_currency()
|
206 |
+
);
|
207 |
+
$fb_additional_tags['name']['twitter_label1'] = array(
|
208 |
+
__('Price', 'wd-fb-og')
|
209 |
+
);
|
210 |
+
if ( function_exists('get_woocommerce_currency') ) $fb_additional_tags['name']['twitter_data1'] = array(
|
211 |
+
$product->get_price_including_tax().' '.get_woocommerce_currency()
|
212 |
+
);
|
213 |
+
//Additional product images?
|
214 |
+
if ( intval($this->options['fb_image_show'])==1 && $this->options['fb_wc_useproductgallery']==1 ) {
|
215 |
+
if ( $attachment_ids = $product->get_gallery_attachment_ids() ) {
|
216 |
+
foreach ( $attachment_ids as $attachment_id ) {
|
217 |
+
if ( $image_link = wp_get_attachment_url( $attachment_id ) ) {
|
218 |
+
if ( trim($image_link)!='' ) {
|
219 |
+
$fb_image_additional[] = array(
|
220 |
+
'fb_image' => trim($image_link),
|
221 |
+
'png_overlay' => ( intval($this->options['fb_wc_usepg_png_overlay']) ? true : false ),
|
222 |
+
);
|
223 |
+
}
|
224 |
}
|
225 |
}
|
226 |
}
|
227 |
}
|
228 |
}
|
229 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
} else {
|
231 |
+
|
232 |
+
//Other pages - Defaults
|
233 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( get_bloginfo( 'name' ) ), true ) );
|
234 |
+
$fb_url = ( ( !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ) ? 'https://' : 'http://' ).$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; //Not really canonical but will work for now
|
235 |
+
$fb_image = trim( $this->options['fb_image'] );
|
236 |
+
|
237 |
+
$this->options['fb_article_sections_show'] = 0;
|
238 |
+
$this->options['fb_article_dates_show'] = 0;
|
239 |
+
$this->options['fb_author_show'] = 0;
|
240 |
+
$this->options['fb_author_show_meta'] = 0;
|
241 |
+
$this->options['fb_author_show_linkrelgp'] = 0;
|
242 |
+
$this->options['fb_author_show_twitter'] = 0;
|
243 |
+
$this->options['fb_author_show_twitter'] = 0;
|
244 |
+
|
245 |
+
//Category
|
246 |
+
if ( is_category() ) {
|
247 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( single_cat_title( '', false ) ), true ) );
|
248 |
$term = $wp_query->get_queried_object();
|
249 |
$fb_url = get_term_link( $term, $term->taxonomy );
|
250 |
+
$cat_desc = trim( esc_attr( wp_strip_all_tags( stripslashes( category_description() ), true ) ) );
|
251 |
+
if ( trim($cat_desc)!='' ) $fb_desc = $cat_desc;
|
252 |
} else {
|
253 |
+
if ( is_tag() ) {
|
254 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( single_tag_title( '', false ) ), true ) );
|
255 |
$term = $wp_query->get_queried_object();
|
256 |
+
$fb_url = get_term_link( $term, $term->taxonomy );
|
257 |
+
$tag_desc = trim( esc_attr( wp_strip_all_tags( stripslashes( tag_description() ), true ) ) );
|
258 |
+
if ( trim($tag_desc)!='' ) $fb_desc = $tag_desc;
|
259 |
+
} else {
|
260 |
+
if (is_tax()) {
|
261 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( single_term_title( '', false ) ), true ) );
|
262 |
+
$term = $wp_query->get_queried_object();
|
263 |
+
$fb_url = get_term_link($term, $term->taxonomy);
|
264 |
+
$tax_desc = trim( esc_attr( wp_strip_all_tags( stripslashes( term_description() ), true ) ) );
|
265 |
+
if ( trim($tax_desc)!='' ) $fb_desc = $tag_desc;
|
266 |
+
//WooCommerce
|
267 |
+
if ( $webdados_fb->is_woocommerce_active() && intval($this->options['fb_wc_usecategthumb'])==1 && is_product_category() ) {
|
268 |
+
if ( intval($this->options['fb_image_show'])==1 || intval($this->options['fb_image_show_schema'])==1 || intval($this->options['fb_image_show_twitter'])==1 ) {
|
269 |
+
if ( $thumbnail_id = get_woocommerce_term_meta( $term->term_id, 'thumbnail_id', true ) ) {
|
270 |
+
if ( $image = wp_get_attachment_url( $thumbnail_id ) ) {
|
271 |
+
$fb_image = $image;
|
272 |
+
}
|
273 |
}
|
274 |
}
|
275 |
}
|
|
|
|
|
|
|
|
|
|
|
276 |
} else {
|
277 |
+
if ( is_search() ) {
|
278 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( __('Search for', 'wd-fb-og').' "'.get_search_query().'"' ), true ) );
|
279 |
+
$fb_url = get_search_link();
|
280 |
} else {
|
281 |
+
if (is_author()) {
|
282 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( get_the_author_meta('display_name', get_query_var('author') ) ), true ) );
|
283 |
+
$fb_url = get_author_posts_url( get_query_var('author'), get_query_var('author_name') );
|
284 |
+
} else {
|
285 |
+
if ( is_archive() ) {
|
286 |
+
if ( is_day() ) {
|
287 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( get_query_var( 'day' ) . ' ' .single_month_title( ' ', false ) . ' ' . __( 'Archives', 'wd-fb-og' ) ), true ) );
|
288 |
+
$fb_url = get_day_link( get_query_var( 'year' ), get_query_var( 'monthnum' ), get_query_var( 'day' ) );
|
289 |
} else {
|
290 |
+
if ( is_month() ) {
|
291 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( single_month_title( ' ', false ) . ' ' . __( 'Archives', 'wd-fb-og' ) ), true ) );
|
292 |
+
$fb_url = get_month_link( get_query_var( 'year' ), get_query_var( 'monthnum' ) );
|
293 |
+
} else {
|
294 |
+
if ( is_year() ) {
|
295 |
+
$fb_title = esc_attr( wp_strip_all_tags( stripslashes( get_query_var( 'year' ) . ' ' . __( 'Archives', 'wd-fb-og' ) ), true ) );
|
296 |
+
$fb_url = get_year_link( get_query_var( 'year' ) );
|
297 |
+
}
|
298 |
}
|
299 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
} else {
|
301 |
+
if (is_front_page()) {
|
302 |
+
$fb_url = get_option('home').(intval($this->options['fb_url_add_trailing'])==1 ? '/' : '');
|
303 |
+
$fb_type = trim( $this->options['fb_type_homepage']=='' ? 'website' : $this->options['fb_type_homepage'] );
|
304 |
+
$fb_desc = $fb_desc_homepage;
|
305 |
+
} else {
|
306 |
+
//Others... Defaults already set up there
|
307 |
+
}
|
308 |
}
|
309 |
}
|
310 |
}
|
312 |
}
|
313 |
}
|
314 |
}
|
315 |
+
|
316 |
+
//og:type for WPML root page?
|
317 |
+
if ( $webdados_fb->is_wpml_active() ) {
|
318 |
+
if ( class_exists('WPML_Root_Page') ) {
|
319 |
+
if ( WPML_Root_Page::is_current_request_root() ) {
|
320 |
+
$fb_type = trim( $this->options['fb_type_homepage']=='' ? 'website' : $this->options['fb_type_homepage'] );
|
321 |
+
}
|
322 |
}
|
323 |
}
|
324 |
+
|
325 |
+
|
326 |
+
|
327 |
+
//Default description, if empty until now
|
328 |
+
if ( trim($fb_desc)=='' ) {
|
329 |
+
switch( $this->options['fb_desc_default_option'] ) {
|
330 |
+
case 'custom':
|
331 |
+
$fb_desc = $this->options['fb_desc_default'];
|
332 |
+
//WPML?
|
333 |
+
if ( $webdados_fb->is_wpml_active() ) {
|
334 |
+
global $sitepress;
|
335 |
+
if ( ICL_LANGUAGE_CODE != $sitepress->get_default_language() ) {
|
336 |
+
$fb_desc = icl_t( 'wd-fb-og', 'wd_fb_og_fb_desc_default', $fb_desc );
|
337 |
+
}
|
338 |
}
|
339 |
+
break;
|
340 |
+
default:
|
341 |
+
$fb_desc = $fb_desc_homepage;
|
342 |
+
break;
|
343 |
+
}
|
344 |
}
|
345 |
+
|
346 |
+
//Trim description
|
347 |
+
$fb_desc = trim( str_replace(' ', ' ', $fb_desc) ); //Non-breaking spaces are usefull on a meta description. We'll just convert them to normal spaces to really trim it
|
348 |
+
$fb_desc = trim(
|
349 |
+
intval($this->options['fb_desc_chars'])>0
|
350 |
+
?
|
351 |
+
mb_substr( wp_strip_all_tags( strip_shortcodes( stripslashes( $fb_desc ), true ) ), 0, intval($this->options['fb_desc_chars']) )
|
352 |
+
:
|
353 |
+
wp_strip_all_tags( strip_shortcodes( stripslashes( $fb_desc ), true ) )
|
354 |
+
);
|
355 |
+
|
356 |
+
//YOAST SEO?
|
357 |
+
if ( $this->options['fb_show_wpseoyoast']==1 ) {
|
358 |
+
if ( $webdados_fb->is_yoast_seo_active() ) {
|
359 |
+
$wpseo = WPSEO_Frontend::get_instance();
|
360 |
+
//Title
|
361 |
+
$fb_title_temp = $wpseo->title(false);
|
362 |
+
$fb_title = wp_strip_all_tags( trim($fb_title_temp)!='' ? trim($fb_title_temp) : $fb_title, true);
|
363 |
+
//Title - SubHeading plugin
|
364 |
+
if ( $fb_title_temp!='' && $this->options['fb_show_subheading']==1 ) {
|
365 |
+
if ( $webdados_fb->is_subheading_plugin_active() ) {
|
366 |
+
if ( isset($this->options['fb_subheading_position']) && $this->options['fb_subheading_position']=='before' ) {
|
367 |
+
$fb_title = trim( trim( get_the_subheading() ).' - '.trim($fb_title), ' -');
|
368 |
+
} else {
|
369 |
+
$fb_title = trim( trim( $fb_title ).' - '.trim( get_the_subheading() ), ' -');
|
370 |
+
}
|
371 |
}
|
372 |
}
|
373 |
+
//URL
|
374 |
+
$fb_url_temp = $wpseo->canonical(false);
|
375 |
+
$fb_url = wp_strip_all_tags( trim($fb_url_temp)!='' ? trim($fb_url_temp) : $fb_url, true);
|
376 |
+
//Description
|
377 |
+
$fb_desc_temp = $wpseo->metadesc(false);
|
378 |
+
$fb_desc = wp_strip_all_tags( trim($fb_desc_temp)!='' ? trim($fb_desc_temp) : $fb_desc, true);
|
379 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
}
|
381 |
+
|
382 |
+
//All in One SEO Pack?
|
383 |
+
if ( $this->options['fb_show_aioseop']==1 ) {
|
384 |
+
if ( $webdados_fb->is_aioseop_active() ) {
|
385 |
+
global $aiosp;
|
386 |
+
//Title - Why are we getting the first post title on archives and homepage...?!?
|
387 |
+
$fb_title_temp = $aiosp->orig_title;
|
388 |
+
$fb_title = wp_strip_all_tags( trim($fb_title_temp)!='' ? trim($fb_title_temp) : $fb_title, true);
|
389 |
+
//Title - SubHeading plugin
|
390 |
+
if ( $fb_title_temp!='' && $this->options['fb_show_subheading']==1 ) {
|
391 |
+
if ( $webdados_fb->is_subheading_plugin_active() ) {
|
392 |
+
if ( isset($this->options['fb_subheading_position']) && $this->options['fb_subheading_position']=='before' ) {
|
393 |
+
$fb_title = trim( trim( get_the_subheading() ).' - '.trim($fb_title), ' -');
|
394 |
+
} else {
|
395 |
+
$fb_title = trim( trim( $fb_title ).' - '.trim( get_the_subheading() ), ' -');
|
396 |
+
}
|
397 |
}
|
398 |
}
|
399 |
+
//URL - See aioseop_class.php 3898 - We have a problem because wp_query is not the same right now
|
400 |
+
/*$fb_url_temp = '';
|
401 |
+
$aioseop_options = get_option( 'aioseop_options' );
|
402 |
+
$opts = $aiosp->meta_opts;
|
403 |
+
var_dump($wp_query);
|
404 |
+
$show_page = true;
|
405 |
+
if ( ! empty( $aioseop_options['aiosp_no_paged_canonical_links'] ) ) {
|
406 |
+
$show_page = false;
|
|
|
|
|
|
|
|
|
|
|
407 |
}
|
408 |
+
if ( $aioseop_options['aiosp_can'] ) {
|
409 |
+
if ( ! empty( $aioseop_options['aiosp_customize_canonical_links'] ) && ! empty( $opts['aiosp_custom_link'] ) ) {
|
410 |
+
$fb_url_temp = $opts['aiosp_custom_link'];
|
411 |
+
}
|
412 |
+
if ( empty( $url ) ) {
|
413 |
+
$fb_url_temp = $aiosp->aiosp_mrt_get_url( $wp_query, $show_page );
|
414 |
+
}
|
415 |
+
|
416 |
+
$fb_url_temp = $aiosp->validate_url_scheme( $fb_url_temp );
|
417 |
+
|
418 |
+
$fb_url_temp = apply_filters( 'aioseop_canonical_url', $fb_url_temp );
|
419 |
}
|
420 |
+
var_dump($fb_url_temp);
|
421 |
+
$fb_url = wp_strip_all_tags( trim($fb_url_temp)!='' ? trim($fb_url_temp) : $fb_url, true);*/
|
422 |
+
//Description - Why are we getting the first post description on archives and homepage...?!?
|
423 |
+
if ( is_home() && ! is_front_page() ) {
|
424 |
+
$post = aiosp_common::get_blog_page();
|
425 |
+
} else {
|
426 |
+
$post = $aiosp->get_queried_object();
|
427 |
+
}
|
428 |
+
$fb_desc_temp = apply_filters( 'aioseop_description', $aiosp->get_main_description( $post ) );
|
429 |
+
$fb_desc = wp_strip_all_tags( trim($fb_desc_temp)!='' ? trim($fb_desc_temp) : $fb_desc, true);
|
430 |
+
|
|
|
431 |
}
|
|
|
|
|
|
|
432 |
}
|
433 |
+
|
434 |
+
//Apply Filters
|
435 |
+
$fb_locale = apply_filters('fb_og_locale', $fb_locale);
|
436 |
+
$fb_title = apply_filters('fb_og_title', $fb_title);
|
437 |
+
$fb_url = apply_filters('fb_og_url', $fb_url);
|
438 |
+
$fb_type = apply_filters('fb_og_type', $fb_type);
|
439 |
+
$fb_desc = apply_filters('fb_og_desc', $fb_desc);
|
440 |
+
$fb_image = apply_filters('fb_og_image', $fb_image);
|
441 |
+
$fb_image_additional = apply_filters('fb_og_image_additional', $fb_image_additional);
|
442 |
+
|
443 |
+
//Image size
|
444 |
+
$fb_image_size = false;
|
445 |
+
if ( intval($this->options['fb_image_show'])==1 && trim($fb_image)!='' ) {
|
446 |
+
if ( intval($this->options['fb_image_size_show'])==1 ) {
|
447 |
+
if ( isset($this->image_size) && is_array($this->image_size) ) { //Already fetched
|
448 |
+
$fb_image_size = $this->image_size;
|
449 |
+
} else {
|
450 |
+
$fb_image_size = $this->get_open_graph_image_size($fb_image);
|
451 |
+
}
|
452 |
}
|
453 |
+
} else {
|
454 |
+
$this->options['fb_image_show'] = 0;
|
455 |
}
|
456 |
+
|
457 |
+
//Image overlay - Single?
|
458 |
+
if ( intval($this->options['fb_image_show'])==1 && intval($this->options['fb_image_overlay'])==1 && apply_filters('fb_og_image_overlay', true, $fb_image) ) {
|
459 |
+
//Single
|
460 |
+
$temp_fb_image_overlay = $this->get_image_with_overlay($fb_image);
|
461 |
+
if ( $temp_fb_image_overlay['overlay'] ) {
|
462 |
+
$fb_image = $temp_fb_image_overlay['fb_image'];
|
463 |
+
//We know the exact size now. We better just show it, right?
|
464 |
+
$this->options['fb_image_size_show'] = 1;
|
465 |
+
$fb_image_size = array(WEBDADOS_FB_W, WEBDADOS_FB_H);
|
466 |
+
}
|
467 |
+
//Additional
|
468 |
+
if ( isset($fb_image_additional) && is_array($fb_image_additional) && count($fb_image_additional)>0 ) {
|
469 |
+
foreach($fb_image_additional as $key => $value ) {
|
470 |
+
if ($value['png_overlay']) {
|
471 |
+
$temp_fb_image_overlay = $this->get_image_with_overlay($value['fb_image']);
|
472 |
+
if ( $temp_fb_image_overlay['overlay'] ) {
|
473 |
+
$fb_image_additional[$key]['fb_image'] = $temp_fb_image_overlay['fb_image'];
|
474 |
+
}
|
|
|
|
|
475 |
}
|
476 |
}
|
477 |
}
|
478 |
}
|
479 |
+
|
480 |
+
//No spaces on URLs
|
481 |
+
if ( isset($fb_url) && trim($fb_url)!='' ) $fb_url= str_replace(' ', '%20', trim($fb_url));
|
482 |
+
if ( isset($fb_publisher) && trim($fb_publisher)!='' ) $fb_publisher= str_replace(' ', '%20', trim($fb_publisher));
|
483 |
+
if ( isset($fb_publisher_schema) && trim($fb_publisher_schema)!='' ) $fb_publisher_schema= str_replace(' ', '%20', trim($fb_publisher_schema));
|
484 |
+
if ( isset($fb_author) && trim($fb_author)!='' ) $fb_author= str_replace(' ', '%20', trim($fb_author));
|
485 |
+
if ( isset($fb_author_linkrelgp) && trim($fb_author_linkrelgp)!='' ) $fb_author_linkrelgp= str_replace(' ', '%20', trim($fb_author_linkrelgp));
|
486 |
+
if ( isset($fb_image) && trim($fb_image)!='' ) $fb_image= str_replace(' ', '%20', trim($fb_image));
|
487 |
+
if ( isset($fb_image_additional) && is_array($fb_image_additional) && count($fb_image_additional) ) {
|
488 |
+
foreach ( $fb_image_additional as $key => $value ) {
|
489 |
+
$fb_image_additional[$key]['fb_image'] = str_replace( ' ', '%20', trim($value['fb_image']) );
|
490 |
+
}
|
491 |
}
|
492 |
+
|
493 |
+
//If there's still no description let's just add the title as a last resort
|
494 |
+
if ( trim($fb_desc)=='' ) $fb_desc = $fb_title;
|
495 |
+
|
496 |
+
//Print tags
|
497 |
+
// Facebook
|
498 |
+
$html.=' <!-- Facebook Open Graph -->
|
|
|
499 |
';
|
500 |
//Locale
|
501 |
if ( intval($this->options['fb_locale_show'])==1 ) $html.=' <meta property="og:locale" content="'.trim(esc_attr( trim($this->options['fb_locale'])!='' ? trim($this->options['fb_locale']) : trim(get_locale()) )).'"/>
|
628 |
}
|
629 |
}
|
630 |
}
|
631 |
+
} else {
|
632 |
+
|
633 |
+
$html.=' <!-- Removed by fb_og_enabled filter -->
|
634 |
+
';
|
635 |
|
636 |
+
}
|
637 |
+
|
638 |
//Close tag
|
639 |
$html.='<!-- END - '.WEBDADOS_FB_PLUGIN_NAME.' '.WEBDADOS_FB_VERSION.' -->
|
640 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-faceb
|
|
4 |
Tags: facebook, open graph, open graph protocol, share, social, meta, rss, twitter card, twitter, schema, google+, g+, google, google plus, image, like, seo, search engine optimization, woocommerce, yoast seo, wordpress seo, woocommerce, subheading, php7
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.6.1
|
7 |
-
Stable tag: 2.0.
|
8 |
Inserts Facebook Open Graph, Google+/Schema.org, Twitter and SEO Meta Tags into your WordPress Website for more efficient sharing results.
|
9 |
|
10 |
== Description ==
|
@@ -121,6 +121,11 @@ We DO NOT provide email support for this plugin. If you send us an email asking
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
|
|
|
|
124 |
= 2.0.5 =
|
125 |
* Calculated image dimensions are now stored in, 1 day valid, transients in order to avoid unnecessary http requests and improve performance (Thanks Piotr Bogdan)
|
126 |
|
4 |
Tags: facebook, open graph, open graph protocol, share, social, meta, rss, twitter card, twitter, schema, google+, g+, google, google plus, image, like, seo, search engine optimization, woocommerce, yoast seo, wordpress seo, woocommerce, subheading, php7
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 4.6.1
|
7 |
+
Stable tag: 2.0.6
|
8 |
Inserts Facebook Open Graph, Google+/Schema.org, Twitter and SEO Meta Tags into your WordPress Website for more efficient sharing results.
|
9 |
|
10 |
== Description ==
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 2.0.6 =
|
125 |
+
* New `fb_og_enabled` filter that allow other plugins/themes to completely disable the tags output on specific situations
|
126 |
+
* Fix: Use `WP_PLUGIN_DIR` instead of harcoded paths (Thanks thomasbachem)
|
127 |
+
* Fix: Extra validation when getting Yoast SEO's icon on the 3rd party settings tab
|
128 |
+
|
129 |
= 2.0.5 =
|
130 |
* Calculated image dimensions are now stored in, 1 day valid, transients in order to avoid unnecessary http requests and improve performance (Thanks Piotr Bogdan)
|
131 |
|
wonderm00n-open-graph.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* @package Facebook Open Graph, Google+ and Twitter Card Tags
|
4 |
-
* @version 2.0.
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: Facebook Open Graph, Google+ and Twitter Card Tags
|
8 |
Plugin URI: http://www.webdados.pt/produtos-e-servicos/internet/desenvolvimento-wordpress/facebook-open-graph-meta-tags-wordpress/
|
9 |
Description: Inserts Facebook Open Graph, Google+/Schema.org, Twitter Card and SEO Meta Tags into your WordPress Blog/Website for more effective and efficient Facebook, Google+ and Twitter sharing results. You can also choose to insert the "enclosure" and "media:content" tags to the RSS feeds, so that apps like RSS Graffiti and Twitterfeed post the image to Facebook correctly.
|
10 |
|
11 |
-
Version: 2.0.
|
12 |
Author: Webdados
|
13 |
Author URI: http://www.webdados.pt
|
14 |
Text Domain: wd-fb-og
|
@@ -17,7 +17,7 @@ Domain Path: /lang
|
|
17 |
|
18 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
19 |
|
20 |
-
define( 'WEBDADOS_FB_VERSION', '2.0.
|
21 |
define( 'WEBDADOS_FB_PLUGIN_NAME', 'Facebook Open Graph, Google+ and Twitter Card Tags' );
|
22 |
define( 'WEBDADOS_FB_W', 1200 );
|
23 |
define( 'WEBDADOS_FB_H', 630 );
|
1 |
<?php
|
2 |
/**
|
3 |
* @package Facebook Open Graph, Google+ and Twitter Card Tags
|
4 |
+
* @version 2.0.6
|
5 |
*/
|
6 |
/*
|
7 |
Plugin Name: Facebook Open Graph, Google+ and Twitter Card Tags
|
8 |
Plugin URI: http://www.webdados.pt/produtos-e-servicos/internet/desenvolvimento-wordpress/facebook-open-graph-meta-tags-wordpress/
|
9 |
Description: Inserts Facebook Open Graph, Google+/Schema.org, Twitter Card and SEO Meta Tags into your WordPress Blog/Website for more effective and efficient Facebook, Google+ and Twitter sharing results. You can also choose to insert the "enclosure" and "media:content" tags to the RSS feeds, so that apps like RSS Graffiti and Twitterfeed post the image to Facebook correctly.
|
10 |
|
11 |
+
Version: 2.0.6
|
12 |
Author: Webdados
|
13 |
Author URI: http://www.webdados.pt
|
14 |
Text Domain: wd-fb-og
|
17 |
|
18 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
19 |
|
20 |
+
define( 'WEBDADOS_FB_VERSION', '2.0.6' );
|
21 |
define( 'WEBDADOS_FB_PLUGIN_NAME', 'Facebook Open Graph, Google+ and Twitter Card Tags' );
|
22 |
define( 'WEBDADOS_FB_W', 1200 );
|
23 |
define( 'WEBDADOS_FB_H', 630 );
|