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

Version Description

  • Plugin name changed from "Wonderm00n's Simple Facebook Open Graph Meta Tags" to "Facebook Open Graph Meta Tags for WordPress"
  • You can now set a specific Open Graph image per post, if you don't want it to be the same as the post featured image
  • Settings are now stored on a array instead of multiple variables on the options table (and necessary changes along the code)
  • Internationalization support added
  • Portuguese translation added (we welcome other translations if you want to do it)
  • Added webdados as contributor (Wonderm00n's company)
  • Fix: Several PHP warnings when WP_DEBUG is turned on. Thanks to @flynsarmy (yet again)
  • Fix: og:type was not set correctly for the homepage in case it was a static page. Thanks to yakitori
  • Fix: When the site url was not the same as the wordpress installation folder the wrong url was used in the homepage og:url/canonical tag. Thanks to theonetruebix
  • Using the requested url as og:urgl/canonical on not known areas of wordpress. Not really a canonical url but better than using the homepage one
Download this release

Release Info

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

Code changes from version 0.5.4 to 1.0

includes/settings-page.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  /**
3
- * @package Wonderm00n's Simple Facebook Open Graph Tags
4
  * @subpackage Settings Page
5
  *
6
  * @since 0.1
7
- * @author Marco Almeida (Wonderm00n)
8
  *
9
  *
10
  */
@@ -13,63 +13,52 @@
13
  if ( isset($_POST['action']) ) {
14
  if (trim($_POST['action'])=='save') {
15
  //This should also use the $wonderm00n_open_graph_plugin_settings array, but because of intval and trim we still can't
16
- update_option('wonderm00n_open_graph_fb_app_id_show', intval(wonderm00n_open_graph_post($_POST['fb_app_id_show'])));
17
- update_option('wonderm00n_open_graph_fb_app_id', trim(wonderm00n_open_graph_post($_POST['fb_app_id'])));
18
- update_option('wonderm00n_open_graph_fb_admin_id_show', intval(wonderm00n_open_graph_post($_POST['fb_admin_id_show'])));
19
- update_option('wonderm00n_open_graph_fb_admin_id', trim(wonderm00n_open_graph_post($_POST['fb_admin_id'])));
20
- update_option('wonderm00n_open_graph_fb_locale_show', intval(wonderm00n_open_graph_post($_POST['fb_locale_show'])));
21
- update_option('wonderm00n_open_graph_fb_locale', trim(wonderm00n_open_graph_post($_POST['fb_locale'])));
22
- update_option('wonderm00n_open_graph_fb_sitename_show', intval(wonderm00n_open_graph_post($_POST['fb_sitename_show'])));
23
- update_option('wonderm00n_open_graph_fb_title_show', intval(wonderm00n_open_graph_post($_POST['fb_title_show'])));
24
- update_option('wonderm00n_open_graph_fb_title_show_schema', intval(wonderm00n_open_graph_post($_POST['fb_title_show_schema'])));
25
- update_option('wonderm00n_open_graph_fb_url_show', intval(wonderm00n_open_graph_post($_POST['fb_url_show'])));
26
- update_option('wonderm00n_open_graph_fb_url_canonical', intval(wonderm00n_open_graph_post($_POST['fb_url_canonical'])));
27
- update_option('wonderm00n_open_graph_fb_url_add_trailing', intval(wonderm00n_open_graph_post($_POST['fb_url_add_trailing'])));
28
- update_option('wonderm00n_open_graph_fb_type_show', intval(wonderm00n_open_graph_post($_POST['fb_type_show'])));
29
- update_option('wonderm00n_open_graph_fb_type_homepage', trim(wonderm00n_open_graph_post($_POST['fb_type_homepage'])));
30
- update_option('wonderm00n_open_graph_fb_desc_show', intval(wonderm00n_open_graph_post($_POST['fb_desc_show'])));
31
- update_option('wonderm00n_open_graph_fb_desc_show_meta', intval(wonderm00n_open_graph_post($_POST['fb_desc_show_meta'])));
32
- update_option('wonderm00n_open_graph_fb_desc_show_schema', intval(wonderm00n_open_graph_post($_POST['fb_desc_show_schema'])));
33
- update_option('wonderm00n_open_graph_fb_desc_chars', intval(wonderm00n_open_graph_post($_POST['fb_desc_chars'])));
34
- update_option('wonderm00n_open_graph_fb_desc_homepage', trim(wonderm00n_open_graph_post($_POST['fb_desc_homepage'])));
35
- update_option('wonderm00n_open_graph_fb_desc_homepage_customtext', trim(wonderm00n_open_graph_post($_POST['fb_desc_homepage_customtext'])));
36
- update_option('wonderm00n_open_graph_fb_image_show', intval(wonderm00n_open_graph_post($_POST['fb_image_show'])));
37
- update_option('wonderm00n_open_graph_fb_image_show_schema', intval(wonderm00n_open_graph_post($_POST['fb_image_show_schema'])));
38
- update_option('wonderm00n_open_graph_fb_image', trim(wonderm00n_open_graph_post($_POST['fb_image'])));
39
- update_option('wonderm00n_open_graph_fb_image_rss', intval(wonderm00n_open_graph_post($_POST['fb_image_rss'])));
40
- update_option('wonderm00n_open_graph_fb_image_use_featured', intval(wonderm00n_open_graph_post($_POST['fb_image_use_featured'])));
41
- update_option('wonderm00n_open_graph_fb_image_use_content', intval(wonderm00n_open_graph_post($_POST['fb_image_use_content'])));
42
- update_option('wonderm00n_open_graph_fb_image_use_media', intval(wonderm00n_open_graph_post($_POST['fb_image_use_media'])));
43
- update_option('wonderm00n_open_graph_fb_image_use_default', intval(wonderm00n_open_graph_post($_POST['fb_image_use_default'])));
44
- update_option('wonderm00n_open_graph_fb_show_subheading', intval(wonderm00n_open_graph_post($_POST['fb_show_subheading'])));
45
- update_option('wonderm00n_open_graph_fb_show_businessdirectoryplugin', intval(wonderm00n_open_graph_post($_POST['fb_show_businessdirectoryplugin'])));
 
 
 
46
  }
47
  }
48
 
49
- //Load the defaults
50
- $defaults=wonderm00n_open_graph_default_values();
51
- //Load the user settings (if they exist)
52
- foreach($wonderm00n_open_graph_plugin_settings as $key) {
53
- $usersettings[$key]=get_option('wonderm00n_open_graph_'.$key);
54
- }
55
- //Merge the settings "all together now" (yes, it's a Beatles reference)
56
- foreach($usersettings as $key => $value) {
57
- //if ($value=='') {
58
- if (strlen(trim($value))==0) {
59
- if (!empty($defaults[$key])) {
60
- $usersettings[$key]=$defaults[$key];
61
- }
62
- }
63
- }
64
- extract($usersettings);
65
 
66
  ?>
67
  <div class="wrap">
68
 
69
  <?php screen_icon(); ?>
70
- <h2>Wonderm00n's Simple Facebook Open Graph Tags (<?php echo $wonderm00n_open_graph_plugin_version; ?>)</h2>
71
  <br class="clear"/>
72
- <p>Please set some default values and which tags should, or should not, be included. It may be necessary to exclude some tags if other plugins are already including them.</p>
73
 
74
  <?php
75
  settings_fields('wonderm00n_open_graph');
@@ -79,17 +68,17 @@
79
  <div id="poststuff">
80
  <form name="form1" method="post">
81
  <div id="wonderm00n_open_graph-settings" class="postbox">
82
- <h3 id="settings">Settings</h3>
83
  <div class="inside">
84
  <table width="100%" class="form-table">
85
  <tr>
86
- <th scope="row" nowrap="nowrap">Include Facebook Platform App ID (fb:app_id) tag?</th>
87
  <td>
88
  <input type="checkbox" name="fb_app_id_show" id="fb_app_id_show" value="1" <?php echo (intval($fb_app_id_show)==1 ? ' checked="checked"' : ''); ?> onclick="showAppidOptions();"/>
89
  </td>
90
  </tr>
91
  <tr class="fb_app_id_options">
92
- <th scope="row" nowrap="nowrap">Facebook Platform App ID:</th>
93
  <td>
94
  <input type="text" name="fb_app_id" id="fb_app_id" size="30" value="<?php echo $fb_app_id; ?>"/>
95
  </td>
@@ -98,87 +87,89 @@
98
  <td colspan="2"><hr/></td>
99
  </tr>
100
  <tr>
101
- <th scope="row" nowrap="nowrap">Include Facebook Admin(s) ID (fb:admins) tag?</th>
102
  <td>
103
  <input type="checkbox" name="fb_admin_id_show" id="fb_admin_id_show" value="1" <?php echo (intval($fb_admin_id_show)==1 ? ' checked="checked"' : ''); ?> onclick="showAdminOptions();"/>
104
  </td>
105
  </tr>
106
  <tr class="fb_admin_id_options">
107
- <th scope="row" nowrap="nowrap">Facebook Admin(s) ID:</th>
108
  <td>
109
  <input type="text" name="fb_admin_id" id="fb_admin_id" size="30" value="<?php echo $fb_admin_id; ?>"/>
110
  <br/>
111
- Comma separated if more than one
112
  </td>
113
  </tr>
114
  <tr>
115
  <td colspan="2"><hr/></td>
116
  </tr>
117
  <tr>
118
- <th scope="row" nowrap="nowrap">Include locale (fb:locale) tag?</th>
119
  <td>
120
  <input type="checkbox" name="fb_locale_show" id="fb_locale_show" value="1" <?php echo (intval($fb_locale_show)==1 ? ' checked="checked"' : ''); ?> onclick="showLocaleOptions();"/>
121
  </td>
122
  </tr>
123
  <tr class="fb_locale_options">
124
- <th scope="row" nowrap="nowrap">Locale:</th>
125
  <td>
126
  <select name="fb_locale" id="fb_locale">
127
- <option value=""<?php if (trim($fb_locale)=='') echo ' selected="selected"'; ?>>Wordpress current locale/language (<?php echo get_locale(); ?>)&nbsp;</option>
128
- <?php
129
- $listLocales=false;
130
- $loadedOnline=false;
131
- $loadedOffline=false;
132
- //Online
133
- if (intval($_GET['localeOnline'])==1) {
134
- if ($ch = curl_init('http://www.facebook.com/translations/FacebookLocales.xml')) {
135
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
136
- $fb_locales=curl_exec($ch);
137
- if (curl_errno($ch)) {
138
- //echo curl_error($ch);
139
- } else {
140
- $info = curl_getinfo($ch);
141
- if (intval($info['http_code'])==200) {
142
- //Save the file locally
143
- $fh = fopen(ABSPATH . 'wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml', 'w') or die("Can't open file");
144
- fwrite($fh, $fb_locales);
145
- fclose($fh);
146
- $listLocales=true;
147
- $loadedOnline=true;
 
 
 
 
148
  }
149
  }
150
- curl_close($ch);
151
  }
152
- }
153
- //Offline
154
- if (!$listLocales) {
155
- if ($fb_locales=file_get_contents(ABSPATH . 'wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml')) {
156
- $listLocales=true;
157
- $loadedOffline=true;
158
  }
159
- }
160
- //OK
161
- if ($listLocales) {
162
- $xml=simplexml_load_string($fb_locales);
163
- $json = json_encode($xml);
164
- $locales = json_decode($json,TRUE);
165
- if (is_array($locales['locale'])) {
166
- foreach ($locales['locale'] as $locale) {
167
- ?><option value="<?php echo $locale['codes']['code']['standard']['representation']; ?>"<?php if (trim($fb_locale)==trim($locale['codes']['code']['standard']['representation'])) echo ' selected="selected"'; ?>><?php echo $locale['englishName']; ?> (<?php echo $locale['codes']['code']['standard']['representation']; ?>)</option><?php
168
  }
169
  }
170
- }
171
- ?>
172
  </select>
173
  <br/>
174
  <?php
175
  if ($loadedOnline) {
176
- ?>List loaded from Facebook (online)<?php
177
  } else {
178
  if ($loadedOffline) {
179
- ?>List loaded from local cache (offline) - <a href="?page=wonderm00n-open-graph.php&amp;localeOnline=1" onClick="return(confirm('You\'l lose any changes you haven\'t saved. Are you sure?'));">Reload from Facebook</a><?php
180
  } else {
181
- ?>List not loaded<?php
182
  }
183
  }
184
  ?>
@@ -188,7 +179,7 @@
188
  <td colspan="2"><hr/></td>
189
  </tr>
190
  <tr>
191
- <th scope="row" nowrap="nowrap">Include Site Name (og:site_name) tag?</th>
192
  <td>
193
  <input type="checkbox" name="fb_sitename_show" id="fb_sitename_show" value="1" <?php echo (intval($fb_sitename_show)==1 ? ' checked="checked"' : ''); ?>/>
194
  </td>
@@ -197,32 +188,32 @@
197
  <td colspan="2"><hr/></td>
198
  </tr>
199
  <tr>
200
- <th scope="row" nowrap="nowrap">Include Post/Page title (og:title) tag?</th>
201
  <td>
202
  <input type="checkbox" name="fb_title_show" id="fb_title_show" value="1" <?php echo (intval($fb_title_show)==1 ? ' checked="checked"' : ''); ?> onclick="showTitleOptions();"/>
203
  </td>
204
  </tr>
205
  <tr class="fb_title_options">
206
- <th scope="row" nowrap="nowrap">Also include Schema.org "itemprop" Name tag?</th>
207
  <td>
208
  <input type="checkbox" name="fb_title_show_schema" id="fb_title_show_schema" value="1" <?php echo (intval($fb_title_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
209
  <br/>
210
  <i>&lt;meta itemprop="name" content="..."/&gt;</i>
211
  <br/>
212
- Recommended for G+ sharing purposes if no other plugin is setting it already
213
  </td>
214
  </tr>
215
  <tr>
216
  <td colspan="2"><hr/></td>
217
  </tr>
218
  <tr>
219
- <th scope="row" nowrap="nowrap">Include URL (og:url) tag?</th>
220
  <td>
221
  <input type="checkbox" name="fb_url_show" id="fb_url_show" value="1" <?php echo (intval($fb_url_show)==1 ? ' checked="checked"' : ''); ?> onclick="showUrlOptions();"/>
222
  </td>
223
  </tr>
224
  <tr class="fb_url_options">
225
- <th scope="row" nowrap="nowrap">Also set Canonical URL:</th>
226
  <td>
227
  <input type="checkbox" name="fb_url_canonical" id="fb_url_canonical" value="1" <?php echo (intval($fb_url_canonical)==1 ? ' checked="checked"' : ''); ?>/>
228
  <br/>
@@ -230,28 +221,28 @@
230
  </td>
231
  </tr>
232
  <tr class="fb_url_options">
233
- <th scope="row" nowrap="nowrap">Add trailing slash at the end:</th>
234
  <td>
235
  <input type="checkbox" name="fb_url_add_trailing" id="fb_url_add_trailing" value="1" <?php echo (intval($fb_url_add_trailing)==1 ? ' checked="checked"' : ''); ?> onclick="showUrlTrail();"/>
236
  <br/>
237
- On the homepage will be: <i><?php echo get_option('siteurl'); ?><span id="fb_url_add_trailing_example">/</span></i>
238
  </td>
239
  </tr>
240
  <tr>
241
  <td colspan="2"><hr/></td>
242
  </tr>
243
  <tr>
244
- <th scope="row" nowrap="nowrap">Include Type (og:type) tag?</th>
245
  <td>
246
  <input type="checkbox" name="fb_type_show" id="fb_type_show" value="1" <?php echo (intval($fb_type_show)==1 ? ' checked="checked"' : ''); ?> onclick="showTypeOptions();"/>
247
  <br/>
248
- Will be &quot;article&quot; for posts and pages and &quot;website&quot; or &quot;blog&quot; for the homepage
249
  </td>
250
  </tr>
251
  <tr class="fb_type_options">
252
- <th scope="row" nowrap="nowrap">Homepage type:</th>
253
  <td>
254
- Use
255
  <select name="fb_type_homepage" id="fb_type_homepage">
256
  <option value="website"<?php if (trim($fb_type_homepage)=='' || trim($fb_type_homepage)=='website') echo ' selected="selected"'; ?>>website&nbsp;</option>
257
  <option value="blog"<?php if (trim($fb_type_homepage)=='blog') echo ' selected="selected"'; ?>>blog&nbsp;</option>
@@ -262,46 +253,46 @@
262
  <td colspan="2"><hr/></td>
263
  </tr>
264
  <tr>
265
- <th scope="row" nowrap="nowrap">Include Description (og:description) tag?</th>
266
  <td>
267
  <input type="checkbox" name="fb_desc_show" id="fb_desc_show" value="1" <?php echo (intval($fb_desc_show)==1 ? ' checked="checked"' : ''); ?> onclick="showDescriptionOptions();"/>
268
  </td>
269
  </tr>
270
  <tr class="fb_description_options">
271
- <th scope="row" nowrap="nowrap">Also include Meta Description tag?</th>
272
  <td>
273
  <input type="checkbox" name="fb_desc_show_meta" id="fb_desc_show_meta" value="1" <?php echo (intval($fb_desc_show_meta)==1 ? ' checked="checked"' : ''); ?>/>
274
  <br/>
275
  <i>&lt;meta name="description" content="..."/&gt;</i>
276
  <br/>
277
- Recommended for SEO purposes if no other plugin is setting it already
278
  </td>
279
  </tr>
280
  <tr class="fb_description_options">
281
- <th scope="row" nowrap="nowrap">Also include Schema.org "itemprop" Description tag?</th>
282
  <td>
283
  <input type="checkbox" name="fb_desc_show_schema" id="fb_desc_show_schema" value="1" <?php echo (intval($fb_desc_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
284
  <br/>
285
  <i>&lt;meta itemprop="description" content="..."/&gt;</i>
286
  <br/>
287
- Recommended for G+ sharing purposes if no other plugin is setting it already
288
  </td>
289
  </tr>
290
  <tr class="fb_description_options">
291
- <th scope="row" nowrap="nowrap">Description maximum length:</th>
292
  <td>
293
  <input type="text" name="fb_desc_chars" id="fb_desc_chars" size="3" maxlength="3" value="<?php echo (intval($fb_desc_chars)>0 ? intval($fb_desc_chars) : ''); ?>"/> characters,
294
  <br/>
295
- 0 or blank for no maximum length
296
  </td>
297
  </tr>
298
  <tr class="fb_description_options">
299
- <th scope="row" nowrap="nowrap">Homepage description:</th>
300
  <td>
301
- Use
302
  <select name="fb_desc_homepage" id="fb_desc_homepage" onchange="showDescriptionCustomText();">
303
- <option value=""<?php if (trim($fb_desc_homepage)=='') echo ' selected="selected"'; ?>>Website tagline&nbsp;</option>
304
- <option value="custom"<?php if (trim($fb_desc_homepage)=='custom') echo ' selected="selected"'; ?>>Custom text&nbsp;</option>
305
  </select>
306
  <div id="fb_desc_homepage_customtext_div">
307
  <textarea name="fb_desc_homepage_customtext" id="fb_desc_homepage_customtext" rows="3" cols="50"><?php echo $fb_desc_homepage_customtext; ?></textarea>
@@ -312,58 +303,64 @@
312
  <td colspan="2"><hr/></td>
313
  </tr>
314
  <tr>
315
- <th scope="row" nowrap="nowrap">Include Image (og:image) tag?</th>
316
  <td>
317
  <input type="checkbox" name="fb_image_show" id="fb_image_show" value="1" <?php echo (intval($fb_image_show)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOptions();"/>
318
  <br/>
319
- It's HIGHLY recommended that all images have at least 200px on both dimensions in order to Facebook to properly load them
320
  </td>
321
  </tr>
322
  <tr class="fb_image_options">
323
- <th scope="row" nowrap="nowrap">Also include Schema.org "itemprop" Image tag?</th>
324
  <td>
325
  <input type="checkbox" name="fb_image_show_schema" id="fb_image_show_schema" value="1" <?php echo (intval($fb_image_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
326
  <br/>
327
  <i>&lt;meta itemprop="image" content="..."/&gt;</i>
328
  <br/>
329
- Recommended for G+ sharing purposes if no other plugin is setting it already
330
  </td>
331
  </tr>
332
  <tr class="fb_image_options">
333
- <th scope="row" nowrap="nowrap">Default image:</th>
334
  <td>
335
  <input type="text" name="fb_image" id="fb_image" size="50" value="<?php echo $fb_image; ?>"/>
336
  <input id="fb_image_button" class="button" type="button" value="Upload/Choose image" />
337
  <br/>
338
- Full URL with http://
 
 
339
  </td>
340
  </tr>
341
  <tr class="fb_image_options">
342
- <th scope="row" nowrap="nowrap">Also add image to RSS/RSS2 feeds?</th>
343
  <td>
344
  <input type="checkbox" name="fb_image_rss" id="fb_image_rss" value="1" <?php echo (intval($fb_image_rss)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOptions();"/>
345
  <br/>
346
- For auto-posting apps like RSS Graffiti, twitterfeed, ...
347
  </td>
348
  </tr>
349
  <tr class="fb_image_options">
350
- <th scope="row" nowrap="nowrap">On posts/pages:</th>
351
  <td>
352
  <div>
353
- 1) <input type="checkbox" name="fb_image_use_featured" id="fb_image_use_featured" value="1" <?php echo (intval($fb_image_use_featured)==1 ? ' checked="checked"' : ''); ?>/>
354
- Image will be fetched from post/page featured/thumbnail picture
355
  </div>
356
  <div>
357
- 2) <input type="checkbox" name="fb_image_use_content" id="fb_image_use_content" value="1" <?php echo (intval($fb_image_use_content)==1 ? ' checked="checked"' : ''); ?>/>
358
- If it doesn't exist, use the first image from the post/page content
359
  </div>
360
  <div>
361
- 3) <input type="checkbox" name="fb_image_use_media" id="fb_image_use_media" value="1" <?php echo (intval($fb_image_use_media)==1 ? ' checked="checked"' : ''); ?>/>
362
- If it doesn't exist, use first image from the post/page media gallery
363
  </div>
364
  <div>
365
- 4) <input type="checkbox" name="fb_image_use_default" id="fb_image_use_default" value="1" <?php echo (intval($fb_image_use_default)==1 ? ' checked="checked"' : ''); ?>/>
366
- If it doesn't exist, use the default image above
 
 
 
 
367
  </div>
368
  </td>
369
  </tr>
@@ -371,7 +368,7 @@
371
  </div>
372
  </div>
373
  <div id="wonderm00n_open_graph-thirdparty" class="postbox">
374
- <h3 id="thirdparty">3rd Party Integration</h3>
375
  <div class="inside">
376
  <?php
377
  $thirdparty=false;
@@ -381,7 +378,7 @@
381
  <h4><a href="http://wordpress.org/extend/plugins/subheading/" target="_blank">SubHeading</a></h4>
382
  <table width="100%" class="form-table">
383
  <tr>
384
- <th scope="row" nowrap="nowrap">Add SubHeading to Post/Page title?</th>
385
  <td>
386
  <input type="checkbox" name="fb_show_subheading" id="fb_show_subheading" value="1" <?php echo (intval($fb_show_subheading)==1 ? ' checked="checked"' : ''); ?>/>
387
  </td>
@@ -395,11 +392,11 @@
395
  <h4><a href="http://wordpress.org/extend/plugins/business-directory-plugin/" target="_blank">Business Directory Plugin</a></h4>
396
  <table width="100%" class="form-table">
397
  <tr>
398
- <th scope="row" nowrap="nowrap">Use listing BDP listing contents as OG tags?</th>
399
  <td>
400
  <input type="checkbox" name="fb_show_businessdirectoryplugin" id="fb_show_businessdirectoryplugin" value="1" <?php echo (intval($fb_show_businessdirectoryplugin)==1 ? ' checked="checked"' : ''); ?>/>
401
  <br/>
402
- Setting "Include URL", "Also set Canonical URL", "Include Description" and "Include Image" options above is HIGHLY recommended
403
  </td>
404
  </tr>
405
  </table>
@@ -407,8 +404,8 @@
407
  }
408
  if (!$thirdparty) {
409
  ?>
410
- <p>You don't have any compatible 3rd Party plugin installed/active.</p>
411
- <p>This plugin is currently compatible with:</p>
412
  <ul>
413
  <li><a href="http://wordpress.org/extend/plugins/subheading/" target="_blank">SubHeading</a></li>
414
  <li><a href="http://wordpress.org/extend/plugins/business-directory-plugin/" target="_blank">Business Directory Plugin</a></li>
@@ -427,35 +424,41 @@
427
  </div>
428
 
429
  <?php
430
- $links[0]['text']='Test your URLs at Facebook URL Linter / Debugger';
431
  $links[0]['url']='https://developers.facebook.com/tools/debug';
432
- $links[10]['text']='About the Open Graph Protocol (on Facebook)';
 
433
  $links[10]['url']='https://developers.facebook.com/docs/opengraph/';
434
- $links[20]['text']='The Open Graph Protocol (official website)';
 
435
  $links[20]['url']='http://ogp.me/';
436
- $links[30]['text']='Plugin official URL (feedback is welcomed)';
437
- $links[30]['url']='http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/';
438
- $links[40]['text']='Author\'s website: Marco Almeida (Wonderm00n)';
439
- $links[40]['url']='http://wonderm00n.com';
440
- $links[50]['text']='Author\'s Twitter account: @Wonderm00n';
441
- $links[50]['url']='http://twitter.com/wonderm00n';
442
- $links[60]['text']='Author\'s Facebook account: Wonderm00n';
443
- $links[60]['url']='http://www.facebook.com/wonderm00n';
 
 
 
 
444
  ?>
445
  <div class="postbox-container" style="width: 29%; float: right;">
446
 
447
  <div id="poststuff">
448
  <div id="wonderm00n_open_graph_links" class="postbox">
449
- <h3 id="settings">Rate this plugin</h3>
450
  <div class="inside">
451
- If you like this plugin, <a href="http://wordpress.org/extend/plugins/wonderm00ns-simple-facebook-open-graph-tags/" target="_blank">please give it a high Rating</a>.
452
  </div>
453
  </div>
454
  </div>
455
 
456
  <div id="poststuff">
457
  <div id="wonderm00n_open_graph_links" class="postbox">
458
- <h3 id="settings">Useful links</h3>
459
  <div class="inside">
460
  <ul>
461
  <?php foreach($links as $link) { ?>
@@ -468,9 +471,9 @@
468
 
469
  <div id="poststuff">
470
  <div id="wonderm00n_open_graph_donation" class="postbox">
471
- <h3 id="settings">Donate</h3>
472
  <div class="inside">
473
- <p>If you find this plugin useful and want to make a contribution towards future development please consider making a small, or big ;-), donation.</p>
474
  <center><form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
475
  <input type="hidden" name="cmd" value="_donations">
476
  <input type="hidden" name="business" value="wonderm00n@gmail.com">
@@ -489,7 +492,7 @@
489
  </div>
490
 
491
  <div class="clear">
492
- <p><br/>&copy 2011<?php if(date('Y')>2011) echo '-'.date('Y'); ?> <a href="http://wonderm00n.com" target="_blank">Marco Almeida (Wonderm00n)</a></p>
493
  </div>
494
 
495
  </div>
1
  <?php
2
  /**
3
+ * @package Facebook Open Graph Meta Tags for WordPress
4
  * @subpackage Settings Page
5
  *
6
  * @since 0.1
7
+ * @author Webdados
8
  *
9
  *
10
  */
13
  if ( isset($_POST['action']) ) {
14
  if (trim($_POST['action'])=='save') {
15
  //This should also use the $wonderm00n_open_graph_plugin_settings array, but because of intval and trim we still can't
16
+ $usersettings['fb_app_id_show']= intval(wonderm00n_open_graph_post('fb_app_id_show'));
17
+ $usersettings['fb_app_id']= trim(wonderm00n_open_graph_post('fb_app_id'));
18
+ $usersettings['fb_admin_id_show']= intval(wonderm00n_open_graph_post('fb_admin_id_show'));
19
+ $usersettings['fb_admin_id']= trim(wonderm00n_open_graph_post('fb_admin_id'));
20
+ $usersettings['fb_locale_show']= intval(wonderm00n_open_graph_post('fb_locale_show'));
21
+ $usersettings['fb_locale']= trim(wonderm00n_open_graph_post('fb_locale'));
22
+ $usersettings['fb_sitename_show']= intval(wonderm00n_open_graph_post('fb_sitename_show'));
23
+ $usersettings['fb_title_show']= intval(wonderm00n_open_graph_post('fb_title_show'));
24
+ $usersettings['fb_title_show_schema']= intval(wonderm00n_open_graph_post('fb_title_show_schema'));
25
+ $usersettings['fb_url_show']= intval(wonderm00n_open_graph_post('fb_url_show'));
26
+ $usersettings['fb_url_canonical']= intval(wonderm00n_open_graph_post('fb_url_canonical'));
27
+ $usersettings['fb_url_add_trailing']= intval(wonderm00n_open_graph_post('fb_url_add_trailing'));
28
+ $usersettings['fb_type_show']= intval(wonderm00n_open_graph_post('fb_type_show'));
29
+ $usersettings['fb_type_homepage']= trim(wonderm00n_open_graph_post('fb_type_homepage'));
30
+ $usersettings['fb_desc_show']= intval(wonderm00n_open_graph_post('fb_desc_show'));
31
+ $usersettings['fb_desc_show_meta']= intval(wonderm00n_open_graph_post('fb_desc_show_meta'));
32
+ $usersettings['fb_desc_show_schema']= intval(wonderm00n_open_graph_post('fb_desc_show_schema'));
33
+ $usersettings['fb_desc_chars']= intval(wonderm00n_open_graph_post('fb_desc_chars'));
34
+ $usersettings['fb_desc_homepage']= trim(wonderm00n_open_graph_post('fb_desc_homepage'));
35
+ $usersettings['fb_desc_homepage_customtext']= trim(wonderm00n_open_graph_post('fb_desc_homepage_customtext'));
36
+ $usersettings['fb_image_show']= intval(wonderm00n_open_graph_post('fb_image_show'));
37
+ $usersettings['fb_image_show_schema']= intval(wonderm00n_open_graph_post('fb_image_show_schema'));
38
+ $usersettings['fb_image']= trim(wonderm00n_open_graph_post('fb_image'));
39
+ $usersettings['fb_image_rss']= intval(wonderm00n_open_graph_post('fb_image_rss'));
40
+ $usersettings['fb_image_use_specific']= intval(wonderm00n_open_graph_post('fb_image_use_specific'));
41
+ $usersettings['fb_image_use_featured']= intval(wonderm00n_open_graph_post('fb_image_use_featured'));
42
+ $usersettings['fb_image_use_content']= intval(wonderm00n_open_graph_post('fb_image_use_content'));
43
+ $usersettings['fb_image_use_media']= intval(wonderm00n_open_graph_post('fb_image_use_media'));
44
+ $usersettings['fb_image_use_default']= intval(wonderm00n_open_graph_post('fb_image_use_default'));
45
+ $usersettings['fb_show_subheading']= intval(wonderm00n_open_graph_post('fb_show_subheading'));
46
+ $usersettings['fb_show_businessdirectoryplugin']= intval(wonderm00n_open_graph_post('fb_show_businessdirectoryplugin'));
47
+ //Update
48
+ update_option('webdados_fb_open_graph_settings', $usersettings);
49
  }
50
  }
51
 
52
+ //Load the settings
53
+ extract(wonderm00n_open_graph_load_settings());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
  ?>
56
  <div class="wrap">
57
 
58
  <?php screen_icon(); ?>
59
+ <h2>Facebook Open Graph Meta Tags for WordPress (<?php echo $wonderm00n_open_graph_plugin_version; ?>)</h2>
60
  <br class="clear"/>
61
+ <p><?php _e('Please set some default values and which tags should, or should not, be included. It may be necessary to exclude some tags if other plugins are already including them.', 'wd-fb-og'); ?></p>
62
 
63
  <?php
64
  settings_fields('wonderm00n_open_graph');
68
  <div id="poststuff">
69
  <form name="form1" method="post">
70
  <div id="wonderm00n_open_graph-settings" class="postbox">
71
+ <h3 id="settings"><?php _e('Settings'); ?></h3>
72
  <div class="inside">
73
  <table width="100%" class="form-table">
74
  <tr>
75
+ <th scope="row" nowrap="nowrap"><?php _e('Include Facebook Platform App ID (fb:app_id) tag?', 'wd-fb-og'); ?></th>
76
  <td>
77
  <input type="checkbox" name="fb_app_id_show" id="fb_app_id_show" value="1" <?php echo (intval($fb_app_id_show)==1 ? ' checked="checked"' : ''); ?> onclick="showAppidOptions();"/>
78
  </td>
79
  </tr>
80
  <tr class="fb_app_id_options">
81
+ <th scope="row" nowrap="nowrap"><?php _e('Facebook Platform App ID', 'wd-fb-og'); ?>:</th>
82
  <td>
83
  <input type="text" name="fb_app_id" id="fb_app_id" size="30" value="<?php echo $fb_app_id; ?>"/>
84
  </td>
87
  <td colspan="2"><hr/></td>
88
  </tr>
89
  <tr>
90
+ <th scope="row" nowrap="nowrap"><?php _e('Include Facebook Admin(s) ID (fb:admins) tag?', 'wd-fb-og'); ?></th>
91
  <td>
92
  <input type="checkbox" name="fb_admin_id_show" id="fb_admin_id_show" value="1" <?php echo (intval($fb_admin_id_show)==1 ? ' checked="checked"' : ''); ?> onclick="showAdminOptions();"/>
93
  </td>
94
  </tr>
95
  <tr class="fb_admin_id_options">
96
+ <th scope="row" nowrap="nowrap"><?php _e('Facebook Admin(s) ID', 'wd-fb-og'); ?>:</th>
97
  <td>
98
  <input type="text" name="fb_admin_id" id="fb_admin_id" size="30" value="<?php echo $fb_admin_id; ?>"/>
99
  <br/>
100
+ <?php _e('Comma separated if more than one', 'wd-fb-og'); ?>
101
  </td>
102
  </tr>
103
  <tr>
104
  <td colspan="2"><hr/></td>
105
  </tr>
106
  <tr>
107
+ <th scope="row" nowrap="nowrap"><?php _e('Include locale (fb:locale) tag?', 'wd-fb-og'); ?></th>
108
  <td>
109
  <input type="checkbox" name="fb_locale_show" id="fb_locale_show" value="1" <?php echo (intval($fb_locale_show)==1 ? ' checked="checked"' : ''); ?> onclick="showLocaleOptions();"/>
110
  </td>
111
  </tr>
112
  <tr class="fb_locale_options">
113
+ <th scope="row" nowrap="nowrap"><?php _e('Locale', 'wd-fb-og'); ?>:</th>
114
  <td>
115
  <select name="fb_locale" id="fb_locale">
116
+ <option value=""<?php if (trim($fb_locale)=='') echo ' selected="selected"'; ?>><?php _e('WordPress current locale/language', 'wd-fb-og'); ?> (<?php echo get_locale(); ?>)&nbsp;</option>
117
+ <?php
118
+ $listLocales=false;
119
+ $loadedOnline=false;
120
+ $loadedOffline=false;
121
+ //Online
122
+ if (!empty($_GET['localeOnline'])) {
123
+ if (intval($_GET['localeOnline'])==1) {
124
+ if ($ch = curl_init('http://www.facebook.com/translations/FacebookLocales.xml')) {
125
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
126
+ $fb_locales=curl_exec($ch);
127
+ if (curl_errno($ch)) {
128
+ //echo curl_error($ch);
129
+ } else {
130
+ $info = curl_getinfo($ch);
131
+ if (intval($info['http_code'])==200) {
132
+ //Save the file locally
133
+ $fh = fopen(ABSPATH . 'wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml', 'w') or die("Can't open file");
134
+ fwrite($fh, $fb_locales);
135
+ fclose($fh);
136
+ $listLocales=true;
137
+ $loadedOnline=true;
138
+ }
139
+ }
140
+ curl_close($ch);
141
  }
142
  }
 
143
  }
144
+ //Offline
145
+ if (!$listLocales) {
146
+ if ($fb_locales=file_get_contents(ABSPATH . 'wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/includes/FacebookLocales.xml')) {
147
+ $listLocales=true;
148
+ $loadedOffline=true;
149
+ }
150
  }
151
+ //OK
152
+ if ($listLocales) {
153
+ $xml=simplexml_load_string($fb_locales);
154
+ $json = json_encode($xml);
155
+ $locales = json_decode($json,TRUE);
156
+ if (is_array($locales['locale'])) {
157
+ foreach ($locales['locale'] as $locale) {
158
+ ?><option value="<?php echo $locale['codes']['code']['standard']['representation']; ?>"<?php if (trim($fb_locale)==trim($locale['codes']['code']['standard']['representation'])) echo ' selected="selected"'; ?>><?php echo $locale['englishName']; ?> (<?php echo $locale['codes']['code']['standard']['representation']; ?>)</option><?php
159
+ }
160
  }
161
  }
162
+ ?>
 
163
  </select>
164
  <br/>
165
  <?php
166
  if ($loadedOnline) {
167
+ _e('List loaded from Facebook (online)', 'wd-fb-og');
168
  } else {
169
  if ($loadedOffline) {
170
+ _e('List loaded from local cache (offline)', 'wd-fb-og'); ?> - <a href="?page=wonderm00n-open-graph.php&amp;localeOnline=1" onClick="return(confirm('<?php _e('You\\\'l lose any changes you haven\\\'t saved. Are you sure?', 'wd-fb-og'); ?>'));"><?php _e('Reload from Facebook', 'wd-fb-og'); ?></a><?php
171
  } else {
172
+ _e('List not loaded', 'wd-fb-og');
173
  }
174
  }
175
  ?>
179
  <td colspan="2"><hr/></td>
180
  </tr>
181
  <tr>
182
+ <th scope="row" nowrap="nowrap"><?php _e('Include Site Name (og:site_name) tag?', 'wd-fb-og');?></th>
183
  <td>
184
  <input type="checkbox" name="fb_sitename_show" id="fb_sitename_show" value="1" <?php echo (intval($fb_sitename_show)==1 ? ' checked="checked"' : ''); ?>/>
185
  </td>
188
  <td colspan="2"><hr/></td>
189
  </tr>
190
  <tr>
191
+ <th scope="row" nowrap="nowrap"><?php _e('Include Post/Page title (og:title) tag?', 'wd-fb-og');?></th>
192
  <td>
193
  <input type="checkbox" name="fb_title_show" id="fb_title_show" value="1" <?php echo (intval($fb_title_show)==1 ? ' checked="checked"' : ''); ?> onclick="showTitleOptions();"/>
194
  </td>
195
  </tr>
196
  <tr class="fb_title_options">
197
+ <th scope="row" nowrap="nowrap"><?php _e('Also include Schema.org "itemprop" Name tag?', 'wd-fb-og');?></th>
198
  <td>
199
  <input type="checkbox" name="fb_title_show_schema" id="fb_title_show_schema" value="1" <?php echo (intval($fb_title_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
200
  <br/>
201
  <i>&lt;meta itemprop="name" content="..."/&gt;</i>
202
  <br/>
203
+ <?php _e('Recommended for Google+ sharing purposes if no other plugin is setting it already', 'wd-fb-og');?>
204
  </td>
205
  </tr>
206
  <tr>
207
  <td colspan="2"><hr/></td>
208
  </tr>
209
  <tr>
210
+ <th scope="row" nowrap="nowrap"><?php _e('Include URL (og:url) tag?', 'wd-fb-og');?></th>
211
  <td>
212
  <input type="checkbox" name="fb_url_show" id="fb_url_show" value="1" <?php echo (intval($fb_url_show)==1 ? ' checked="checked"' : ''); ?> onclick="showUrlOptions();"/>
213
  </td>
214
  </tr>
215
  <tr class="fb_url_options">
216
+ <th scope="row" nowrap="nowrap"><?php _e('Also set Canonical URL', 'wd-fb-og');?>:</th>
217
  <td>
218
  <input type="checkbox" name="fb_url_canonical" id="fb_url_canonical" value="1" <?php echo (intval($fb_url_canonical)==1 ? ' checked="checked"' : ''); ?>/>
219
  <br/>
221
  </td>
222
  </tr>
223
  <tr class="fb_url_options">
224
+ <th scope="row" nowrap="nowrap"><?php _e('Add trailing slash at the end', 'wd-fb-og');?>:</th>
225
  <td>
226
  <input type="checkbox" name="fb_url_add_trailing" id="fb_url_add_trailing" value="1" <?php echo (intval($fb_url_add_trailing)==1 ? ' checked="checked"' : ''); ?> onclick="showUrlTrail();"/>
227
  <br/>
228
+ <?php _e('On the homepage will be', 'wd-fb-og');?>: <i><?php echo get_option('siteurl'); ?><span id="fb_url_add_trailing_example">/</span></i>
229
  </td>
230
  </tr>
231
  <tr>
232
  <td colspan="2"><hr/></td>
233
  </tr>
234
  <tr>
235
+ <th scope="row" nowrap="nowrap"><?php _e('Include Type (og:type) tag?', 'wd-fb-og');?></th>
236
  <td>
237
  <input type="checkbox" name="fb_type_show" id="fb_type_show" value="1" <?php echo (intval($fb_type_show)==1 ? ' checked="checked"' : ''); ?> onclick="showTypeOptions();"/>
238
  <br/>
239
+ <?php printf( __('Will be "%1$s" for posts and pages and "%2$s" or "%3$s"; for the homepage', 'wd-fb-og'), 'article', 'website', 'blog' );?>
240
  </td>
241
  </tr>
242
  <tr class="fb_type_options">
243
+ <th scope="row" nowrap="nowrap"><?php _e('Homepage type', 'wd-fb-og');?>:</th>
244
  <td>
245
+ <?php _e('Use', 'wd-fb-og');?>
246
  <select name="fb_type_homepage" id="fb_type_homepage">
247
  <option value="website"<?php if (trim($fb_type_homepage)=='' || trim($fb_type_homepage)=='website') echo ' selected="selected"'; ?>>website&nbsp;</option>
248
  <option value="blog"<?php if (trim($fb_type_homepage)=='blog') echo ' selected="selected"'; ?>>blog&nbsp;</option>
253
  <td colspan="2"><hr/></td>
254
  </tr>
255
  <tr>
256
+ <th scope="row" nowrap="nowrap"><?php _e('Include Description (og:description) tag?', 'wd-fb-og');?></th>
257
  <td>
258
  <input type="checkbox" name="fb_desc_show" id="fb_desc_show" value="1" <?php echo (intval($fb_desc_show)==1 ? ' checked="checked"' : ''); ?> onclick="showDescriptionOptions();"/>
259
  </td>
260
  </tr>
261
  <tr class="fb_description_options">
262
+ <th scope="row" nowrap="nowrap"><?php _e('Also include Meta Description tag?', 'wd-fb-og');?></th>
263
  <td>
264
  <input type="checkbox" name="fb_desc_show_meta" id="fb_desc_show_meta" value="1" <?php echo (intval($fb_desc_show_meta)==1 ? ' checked="checked"' : ''); ?>/>
265
  <br/>
266
  <i>&lt;meta name="description" content="..."/&gt;</i>
267
  <br/>
268
+ <?php _e('Recommended for SEO purposes if no other plugin is setting it already', 'wd-fb-og');?>
269
  </td>
270
  </tr>
271
  <tr class="fb_description_options">
272
+ <th scope="row" nowrap="nowrap"><?php _e('Also include Schema.org "itemprop" Description tag?', 'wd-fb-og');?></th>
273
  <td>
274
  <input type="checkbox" name="fb_desc_show_schema" id="fb_desc_show_schema" value="1" <?php echo (intval($fb_desc_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
275
  <br/>
276
  <i>&lt;meta itemprop="description" content="..."/&gt;</i>
277
  <br/>
278
+ <?php _e('Recommended for Google+ sharing purposes if no other plugin is setting it already', 'wd-fb-og');?>
279
  </td>
280
  </tr>
281
  <tr class="fb_description_options">
282
+ <th scope="row" nowrap="nowrap"><?php _e('Description maximum length', 'wd-fb-og');?>:</th>
283
  <td>
284
  <input type="text" name="fb_desc_chars" id="fb_desc_chars" size="3" maxlength="3" value="<?php echo (intval($fb_desc_chars)>0 ? intval($fb_desc_chars) : ''); ?>"/> characters,
285
  <br/>
286
+ <?php _e('0 or blank for no maximum length', 'wd-fb-og');?>
287
  </td>
288
  </tr>
289
  <tr class="fb_description_options">
290
+ <th scope="row" nowrap="nowrap"><?php _e('Homepage description', 'wd-fb-og');?>:</th>
291
  <td>
292
+ <?php _e('Use', 'wd-fb-og');?>
293
  <select name="fb_desc_homepage" id="fb_desc_homepage" onchange="showDescriptionCustomText();">
294
+ <option value=""<?php if (trim($fb_desc_homepage)=='') echo ' selected="selected"'; ?>><?php _e('Website tagline', 'wd-fb-og');?>&nbsp;</option>
295
+ <option value="custom"<?php if (trim($fb_desc_homepage)=='custom') echo ' selected="selected"'; ?>><?php _e('Custom text', 'wd-fb-og');?>&nbsp;</option>
296
  </select>
297
  <div id="fb_desc_homepage_customtext_div">
298
  <textarea name="fb_desc_homepage_customtext" id="fb_desc_homepage_customtext" rows="3" cols="50"><?php echo $fb_desc_homepage_customtext; ?></textarea>
303
  <td colspan="2"><hr/></td>
304
  </tr>
305
  <tr>
306
+ <th scope="row" nowrap="nowrap"><?php _e('Include Image (og:image) tag?', 'wd-fb-og');?></th>
307
  <td>
308
  <input type="checkbox" name="fb_image_show" id="fb_image_show" value="1" <?php echo (intval($fb_image_show)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOptions();"/>
309
  <br/>
310
+ <?php _e('All images MUST have at least 200px on both dimensions in order to Facebook to load them at all. Minimum of 600x315px is recommended.', 'wd-fb-og');?>
311
  </td>
312
  </tr>
313
  <tr class="fb_image_options">
314
+ <th scope="row" nowrap="nowrap"><?php _e('Also include Schema.org "itemprop" Image tag?', 'wd-fb-og');?></th>
315
  <td>
316
  <input type="checkbox" name="fb_image_show_schema" id="fb_image_show_schema" value="1" <?php echo (intval($fb_image_show_schema)==1 ? ' checked="checked"' : ''); ?>/>
317
  <br/>
318
  <i>&lt;meta itemprop="image" content="..."/&gt;</i>
319
  <br/>
320
+ <?php _e('Recommended for Google+ sharing purposes if no other plugin is setting it already', 'wd-fb-og');?>
321
  </td>
322
  </tr>
323
  <tr class="fb_image_options">
324
+ <th scope="row" nowrap="nowrap"><?php _e('Default image', 'wd-fb-og');?>:</th>
325
  <td>
326
  <input type="text" name="fb_image" id="fb_image" size="50" value="<?php echo $fb_image; ?>"/>
327
  <input id="fb_image_button" class="button" type="button" value="Upload/Choose image" />
328
  <br/>
329
+ <?php _e('Full URL with http://', 'wd-fb-og');?>
330
+ <br/>
331
+ <?php _e('Recommended size: 1200x630px', 'wd-fb-og'); ?>
332
  </td>
333
  </tr>
334
  <tr class="fb_image_options">
335
+ <th scope="row" nowrap="nowrap"><?php _e('Also add image to RSS/RSS2 feeds?', 'wd-fb-og');?></th>
336
  <td>
337
  <input type="checkbox" name="fb_image_rss" id="fb_image_rss" value="1" <?php echo (intval($fb_image_rss)==1 ? ' checked="checked"' : ''); ?> onclick="showImageOptions();"/>
338
  <br/>
339
+ <?php _e('For auto-posting apps like RSS Graffiti, twitterfeed, ...', 'wd-fb-og');?>
340
  </td>
341
  </tr>
342
  <tr class="fb_image_options">
343
+ <th scope="row" nowrap="nowrap"><?php _e('On posts/pages', 'wd-fb-og');?>:</th>
344
  <td>
345
  <div>
346
+ 1) <input type="checkbox" name="fb_image_use_specific" id="fb_image_use_specific" value="1" <?php echo (intval($fb_image_use_specific)==1 ? ' checked="checked"' : ''); ?>/>
347
+ <?php _e('Image will be fetched from the specific "Open Graph Image" custom field on the post', 'wd-fb-og');?>
348
  </div>
349
  <div>
350
+ 2) <input type="checkbox" name="fb_image_use_featured" id="fb_image_use_featured" value="1" <?php echo (intval($fb_image_use_featured)==1 ? ' checked="checked"' : ''); ?>/>
351
+ <?php _e('If it\'s not set, image will be fetched from post/page featured/thumbnail picture', 'wd-fb-og');?>
352
  </div>
353
  <div>
354
+ 3) <input type="checkbox" name="fb_image_use_content" id="fb_image_use_content" value="1" <?php echo (intval($fb_image_use_content)==1 ? ' checked="checked"' : ''); ?>/>
355
+ <?php _e('If it doesn\'t exist, use the first image from the post/page content', 'wd-fb-og');?>
356
  </div>
357
  <div>
358
+ 4) <input type="checkbox" name="fb_image_use_media" id="fb_image_use_media" value="1" <?php echo (intval($fb_image_use_media)==1 ? ' checked="checked"' : ''); ?>/>
359
+ <?php _e('If it doesn\'t exist, use first image from the post/page media gallery', 'wd-fb-og');?>
360
+ </div>
361
+ <div>
362
+ 5) <input type="checkbox" name="fb_image_use_default" id="fb_image_use_default" value="1" <?php echo (intval($fb_image_use_default)==1 ? ' checked="checked"' : ''); ?>/>
363
+ <?php _e('If it doesn\'t exist, use the default image above', 'wd-fb-og');?>
364
  </div>
365
  </td>
366
  </tr>
368
  </div>
369
  </div>
370
  <div id="wonderm00n_open_graph-thirdparty" class="postbox">
371
+ <h3 id="thirdparty"><?php _e('3rd Party Integration', 'wd-fb-og');?></h3>
372
  <div class="inside">
373
  <?php
374
  $thirdparty=false;
378
  <h4><a href="http://wordpress.org/extend/plugins/subheading/" target="_blank">SubHeading</a></h4>
379
  <table width="100%" class="form-table">
380
  <tr>
381
+ <th scope="row" nowrap="nowrap"><?php _e('Add SubHeading to Post/Page title?', 'wd-fb-og');?></th>
382
  <td>
383
  <input type="checkbox" name="fb_show_subheading" id="fb_show_subheading" value="1" <?php echo (intval($fb_show_subheading)==1 ? ' checked="checked"' : ''); ?>/>
384
  </td>
392
  <h4><a href="http://wordpress.org/extend/plugins/business-directory-plugin/" target="_blank">Business Directory Plugin</a></h4>
393
  <table width="100%" class="form-table">
394
  <tr>
395
+ <th scope="row" nowrap="nowrap"><?php _e('Use BDP listing contents as OG tags?', 'wd-fb-og');?></th>
396
  <td>
397
  <input type="checkbox" name="fb_show_businessdirectoryplugin" id="fb_show_businessdirectoryplugin" value="1" <?php echo (intval($fb_show_businessdirectoryplugin)==1 ? ' checked="checked"' : ''); ?>/>
398
  <br/>
399
+ <?php _e('Setting "Include URL", "Also set Canonical URL", "Include Description" and "Include Image" options above is HIGHLY recommended', 'wd-fb-og');?>
400
  </td>
401
  </tr>
402
  </table>
404
  }
405
  if (!$thirdparty) {
406
  ?>
407
+ <p><?php _e('You don\'t have any compatible 3rd Party plugin installed/active.', 'wd-fb-og');?></p>
408
+ <p><?php _e('This plugin is currently compatible with:', 'wd-fb-og');?></p>
409
  <ul>
410
  <li><a href="http://wordpress.org/extend/plugins/subheading/" target="_blank">SubHeading</a></li>
411
  <li><a href="http://wordpress.org/extend/plugins/business-directory-plugin/" target="_blank">Business Directory Plugin</a></li>
424
  </div>
425
 
426
  <?php
427
+ $links[0]['text']=__('Test your URLs at Facebook URL Linter / Debugger', 'wd-fb-og');
428
  $links[0]['url']='https://developers.facebook.com/tools/debug';
429
+
430
+ $links[10]['text']=__('About the Open Graph Protocol (on Facebook)', 'wd-fb-og');
431
  $links[10]['url']='https://developers.facebook.com/docs/opengraph/';
432
+
433
+ $links[20]['text']=__('The Open Graph Protocol (official website)', 'wd-fb-og');
434
  $links[20]['url']='http://ogp.me/';
435
+
436
+ $links[30]['text']=__('Plugin official URL', 'wd-fb-og');
437
+ $links[30]['url']='http://www.webdados.pt/produtos-e-servicos/internet/desenvolvimento-wordpress/facebook-open-graph-meta-tags-wordpress/';
438
+
439
+ $links[40]['text']=__('Author\'s website: Webdados', 'wd-fb-og');
440
+ $links[40]['url']='http://www.webdados.pt';
441
+
442
+ $links[50]['text']=__('Author\'s Facebook page: Webdados', 'wd-fb-og');
443
+ $links[50]['url']='http://www.facebook.com/Webdados';
444
+
445
+ $links[60]['text']=__('Author\'s Twitter account: @Wonderm00n<br/>(Webdados founder)', 'wd-fb-og');
446
+ $links[60]['url']='http://twitter.com/wonderm00n';
447
  ?>
448
  <div class="postbox-container" style="width: 29%; float: right;">
449
 
450
  <div id="poststuff">
451
  <div id="wonderm00n_open_graph_links" class="postbox">
452
+ <h3 id="settings"><?php _e('Rate this plugin', 'wd-fb-og');?></h3>
453
  <div class="inside">
454
+ <?php _e('If you like this plugin,', 'wd-fb-og');?> <a href="http://wordpress.org/extend/plugins/wonderm00ns-simple-facebook-open-graph-tags/" target="_blank"><?php _e('please give it a high Rating', 'wd-fb-og');?></a>.
455
  </div>
456
  </div>
457
  </div>
458
 
459
  <div id="poststuff">
460
  <div id="wonderm00n_open_graph_links" class="postbox">
461
+ <h3 id="settings"><?php _e('Useful links', 'wd-fb-og');?></h3>
462
  <div class="inside">
463
  <ul>
464
  <?php foreach($links as $link) { ?>
471
 
472
  <div id="poststuff">
473
  <div id="wonderm00n_open_graph_donation" class="postbox">
474
+ <h3 id="settings"><?php _e('Donate', 'wd-fb-og');?></h3>
475
  <div class="inside">
476
+ <p><?php _e('If you find this plugin useful and want to make a contribution towards future development please consider making a small, or big ;-), donation.', 'wd-fb-og');?></p>
477
  <center><form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
478
  <input type="hidden" name="cmd" value="_donations">
479
  <input type="hidden" name="business" value="wonderm00n@gmail.com">
492
  </div>
493
 
494
  <div class="clear">
495
+ <p><br/>&copy 2011<?php if(date('Y')>2011) echo '-'.date('Y'); ?> <a href="http://www.webdados.pt" target="_blank">Webdados</a> &amp; <a href="http://wonderm00n.com" target="_blank">Marco Almeida (Wonderm00n)</a></p>
496
  </div>
497
 
498
  </div>
lang/wd-fb-og-pt_PT.mo ADDED
Binary file
lang/wd-fb-og-pt_PT.po ADDED
@@ -0,0 +1,415 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Facebook Open Graph Meta Tags for WordPress v1.0\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-11-15 14:24-0000\n"
7
+ "Last-Translator: Wonderm00n <wonderm00n@gmail.com>\n"
8
+ "Language-Team: Webdados <info@webdados.pt>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: Poedit 1.5.7\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "Language: pt_PT\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ # @ wd-fb-og
23
+ #: includes/settings-page.php:61
24
+ msgid ""
25
+ "Please set some default values and which tags should, or should not, be "
26
+ "included. It may be necessary to exclude some tags if other plugins are "
27
+ "already including them."
28
+ msgstr ""
29
+ "Por favor defina alguns valores padrão e que tags devem, ou não, ser "
30
+ "incluídas. Pode ser necessário excluir algumas tags se outros plugins já as "
31
+ "estão a incluir."
32
+
33
+ # @ wd-fb-og
34
+ #: includes/settings-page.php:75
35
+ msgid "Include Facebook Platform App ID (fb:app_id) tag?"
36
+ msgstr "Incluir tag \"Facebook Platform App ID\" (fb:app_id)?"
37
+
38
+ # @ wd-fb-og
39
+ #: includes/settings-page.php:81
40
+ msgid "Facebook Platform App ID"
41
+ msgstr "Facebook Platform App ID"
42
+
43
+ # @ wd-fb-og
44
+ #: includes/settings-page.php:90
45
+ msgid "Include Facebook Admin(s) ID (fb:admins) tag?"
46
+ msgstr "Inluir tag com ID dos admin de Facebook (fb:admins)?"
47
+
48
+ # @ wd-fb-og
49
+ #: includes/settings-page.php:96
50
+ msgid "Facebook Admin(s) ID"
51
+ msgstr "ID do(s) Admin(s) no Facebook"
52
+
53
+ # @ wd-fb-og
54
+ #: includes/settings-page.php:100
55
+ msgid "Comma separated if more than one"
56
+ msgstr "Separados por vírgulas se mais do que um"
57
+
58
+ # @ wd-fb-og
59
+ #: includes/settings-page.php:107
60
+ msgid "Include locale (fb:locale) tag?"
61
+ msgstr "Incluir tag \"Locale\" (fb:locale)?"
62
+
63
+ # @ wd-fb-og
64
+ #: includes/settings-page.php:113
65
+ msgid "Locale"
66
+ msgstr "Locale"
67
+
68
+ # @ wd-fb-og
69
+ #: includes/settings-page.php:116
70
+ msgid "WordPress current locale/language"
71
+ msgstr "O \"locale\"/idíoma actual do WordPress"
72
+
73
+ # @ wd-fb-og
74
+ #: includes/settings-page.php:167
75
+ msgid "List loaded from Facebook (online)"
76
+ msgstr "Lista carregada do Facebook (online)"
77
+
78
+ # @ wd-fb-og
79
+ #: includes/settings-page.php:170
80
+ msgid "List loaded from local cache (offline)"
81
+ msgstr "Lista carregada da cache local (offline)"
82
+
83
+ # @ wd-fb-og
84
+ #: includes/settings-page.php:170
85
+ msgid "You\\'l lose any changes you haven\\'t saved. Are you sure?"
86
+ msgstr ""
87
+ "Vai perder quaisquer modificações que não tenha gravado. Tem a certeza?"
88
+
89
+ # @ wd-fb-og
90
+ #: includes/settings-page.php:170
91
+ msgid "Reload from Facebook"
92
+ msgstr "(Re)carregar a partir do Facebook"
93
+
94
+ # @ wd-fb-og
95
+ #: includes/settings-page.php:172
96
+ msgid "List not loaded"
97
+ msgstr "Lista não carregada"
98
+
99
+ # @ wd-fb-og
100
+ #: includes/settings-page.php:182
101
+ msgid "Include Site Name (og:site_name) tag?"
102
+ msgstr "Incluir tag Nome do site (og:site_name)?"
103
+
104
+ # @ wd-fb-og
105
+ #: includes/settings-page.php:191
106
+ msgid "Include Post/Page title (og:title) tag?"
107
+ msgstr "Incluir tag Título do artigo/página (og:title)?"
108
+
109
+ # @ wd-fb-og
110
+ #: includes/settings-page.php:197
111
+ msgid "Also include Schema.org \"itemprop\" Name tag?"
112
+ msgstr "Incluir também a tag \"itemprop Name\" do Schema.org?"
113
+
114
+ # @ wd-fb-og
115
+ #: includes/settings-page.php:203 includes/settings-page.php:278
116
+ #: includes/settings-page.php:320
117
+ msgid ""
118
+ "Recommended for Google+ sharing purposes if no other plugin is setting it "
119
+ "already"
120
+ msgstr ""
121
+ "Recomendado para efeitos de partilha no Google+, se outro plugin ainda não a "
122
+ "está a definir"
123
+
124
+ # @ wd-fb-og
125
+ #: includes/settings-page.php:210
126
+ msgid "Include URL (og:url) tag?"
127
+ msgstr "Incluir tag URL (og:url)?"
128
+
129
+ # @ wd-fb-og
130
+ #: includes/settings-page.php:216
131
+ msgid "Also set Canonical URL"
132
+ msgstr "Incluir também a tag URL Canónico"
133
+
134
+ # @ wd-fb-og
135
+ #: includes/settings-page.php:224
136
+ msgid "Add trailing slash at the end"
137
+ msgstr "Adicionar barra invertida no final"
138
+
139
+ # @ wd-fb-og
140
+ #: includes/settings-page.php:228
141
+ msgid "On the homepage will be"
142
+ msgstr "Na página inicial será"
143
+
144
+ # @ wd-fb-og
145
+ #: includes/settings-page.php:235
146
+ msgid "Include Type (og:type) tag?"
147
+ msgstr "Incluir tag Tipo (og:type)?"
148
+
149
+ # @ wd-fb-og
150
+ #: includes/settings-page.php:239
151
+ #, php-format
152
+ msgid ""
153
+ "Will be \"%1$s\" for posts and pages and \"%2$s\" or \"%3$s\"; for the "
154
+ "homepage"
155
+ msgstr ""
156
+ "Será \"%1$s\" para artigos e páginas, e \"%2$s\" ou \"%3$s\"; para a página "
157
+ "inicial"
158
+
159
+ # @ wd-fb-og
160
+ #: includes/settings-page.php:243
161
+ msgid "Homepage type"
162
+ msgstr "Tipo para a página inicial"
163
+
164
+ # @ wd-fb-og
165
+ #: includes/settings-page.php:245 includes/settings-page.php:292
166
+ msgid "Use"
167
+ msgstr "Utilizar"
168
+
169
+ # @ wd-fb-og
170
+ #: includes/settings-page.php:256
171
+ msgid "Include Description (og:description) tag?"
172
+ msgstr "Incluir tag Descrição (og:description)?"
173
+
174
+ # @ wd-fb-og
175
+ #: includes/settings-page.php:262
176
+ msgid "Also include Meta Description tag?"
177
+ msgstr "Incluir também a tag \"Meta Description\"?"
178
+
179
+ # @ wd-fb-og
180
+ #: includes/settings-page.php:268
181
+ msgid "Recommended for SEO purposes if no other plugin is setting it already"
182
+ msgstr ""
183
+ "Recomendado para efeitos de Optimização para Motores de Busca, se outro "
184
+ "plugin ainda não a está a definir"
185
+
186
+ # @ wd-fb-og
187
+ #: includes/settings-page.php:272
188
+ msgid "Also include Schema.org \"itemprop\" Description tag?"
189
+ msgstr "Incluir também a tag \"itemprop Description\" do Schema.org?"
190
+
191
+ # @ wd-fb-og
192
+ #: includes/settings-page.php:282
193
+ msgid "Description maximum length"
194
+ msgstr "Comprimento máximo da descrição"
195
+
196
+ # @ wd-fb-og
197
+ #: includes/settings-page.php:286
198
+ msgid "0 or blank for no maximum length"
199
+ msgstr "0 ou em branco para não definir máximo"
200
+
201
+ # @ wd-fb-og
202
+ #: includes/settings-page.php:290
203
+ msgid "Homepage description"
204
+ msgstr "Descrição da página inicial"
205
+
206
+ # @ wd-fb-og
207
+ #: includes/settings-page.php:294
208
+ msgid "Website tagline"
209
+ msgstr "Descrição do site"
210
+
211
+ # @ wd-fb-og
212
+ #: includes/settings-page.php:295
213
+ msgid "Custom text"
214
+ msgstr "Texto personalizado"
215
+
216
+ # @ wd-fb-og
217
+ #: includes/settings-page.php:306
218
+ msgid "Include Image (og:image) tag?"
219
+ msgstr "Incluir tag Imagem (og:image)?"
220
+
221
+ # @ wd-fb-og
222
+ #: includes/settings-page.php:310
223
+ msgid ""
224
+ "All images MUST have at least 200px on both dimensions in order to Facebook "
225
+ "to load them at all. Minimum of 600x315px is recommended."
226
+ msgstr ""
227
+ "Todas as imagens TÊM de ter pelo menos 200px em ambas as dimensões para que "
228
+ "o Facebook as carregue. Um mínimo de 600x315px é recomendado."
229
+
230
+ # @ wd-fb-og
231
+ #: includes/settings-page.php:314
232
+ msgid "Also include Schema.org \"itemprop\" Image tag?"
233
+ msgstr "Incluir também a tag \"itemprop Image\" do Schema.org?"
234
+
235
+ # @ wd-fb-og
236
+ #: includes/settings-page.php:324
237
+ msgid "Default image"
238
+ msgstr "Imagem por omissão"
239
+
240
+ # @ wd-fb-og
241
+ #: includes/settings-page.php:329
242
+ msgid "Full URL with http://"
243
+ msgstr "URL completo com http://"
244
+
245
+ # @ wd-fb-og
246
+ #: includes/settings-page.php:331
247
+ msgid "Recommended size: 1200x630px"
248
+ msgstr "Tamanho recomendado: 1200x630px"
249
+
250
+ # @ wd-fb-og
251
+ #: includes/settings-page.php:335
252
+ msgid "Also add image to RSS/RSS2 feeds?"
253
+ msgstr "Incluir também a imagem aos feeds RSS/RSS2?"
254
+
255
+ # @ wd-fb-og
256
+ #: includes/settings-page.php:339
257
+ msgid "For auto-posting apps like RSS Graffiti, twitterfeed, ..."
258
+ msgstr ""
259
+ "Para aplicação de posts automáticos como o RSS Graffitti, twitterfeed, etc..."
260
+
261
+ # @ wd-fb-og
262
+ #: includes/settings-page.php:343
263
+ msgid "On posts/pages"
264
+ msgstr "Nos artigos/páginas"
265
+
266
+ # @ wd-fb-og
267
+ #: includes/settings-page.php:347
268
+ msgid ""
269
+ "Image will be fetched from the specific \"Open Graph Image\" custom field on "
270
+ "the post"
271
+ msgstr ""
272
+ "A imagem utilizada será a definida no campo específico \"Open Graph Image\" "
273
+ "no artigo"
274
+
275
+ # @ wd-fb-og
276
+ #: includes/settings-page.php:351
277
+ msgid ""
278
+ "If it's not set, image will be fetched from post/page featured/thumbnail "
279
+ "picture"
280
+ msgstr ""
281
+ "Se não definida, a imagem utilizada será a imagem de destaque do artigo/"
282
+ "página"
283
+
284
+ # @ wd-fb-og
285
+ #: includes/settings-page.php:355
286
+ msgid "If it doesn't exist, use the first image from the post/page content"
287
+ msgstr ""
288
+ "Se não existir, será utilizada a primeira imagem no conteúdo do artigo/página"
289
+
290
+ # @ wd-fb-og
291
+ #: includes/settings-page.php:359
292
+ msgid "If it doesn't exist, use first image from the post/page media gallery"
293
+ msgstr ""
294
+ "Se não existir, será usada a primeira imagem na galeria multimédia do artigo/"
295
+ "página"
296
+
297
+ # @ wd-fb-og
298
+ #: includes/settings-page.php:363
299
+ msgid "If it doesn't exist, use the default image above"
300
+ msgstr "Se não existir, utilizar a imagem por omissão em cima"
301
+
302
+ # @ wd-fb-og
303
+ #: includes/settings-page.php:371
304
+ msgid "3rd Party Integration"
305
+ msgstr "Integração com outros plugins"
306
+
307
+ # @ wd-fb-og
308
+ #: includes/settings-page.php:381
309
+ msgid "Add SubHeading to Post/Page title?"
310
+ msgstr "Adicionar \"SubHeading\" ao título do artigo/página?"
311
+
312
+ # @ wd-fb-og
313
+ #: includes/settings-page.php:395
314
+ msgid "Use BDP listing contents as OG tags?"
315
+ msgstr "Utilizar o conteúdo dos anúncios BDP como tags OG?"
316
+
317
+ # @ wd-fb-og
318
+ #: includes/settings-page.php:399
319
+ msgid ""
320
+ "Setting \"Include URL\", \"Also set Canonical URL\", \"Include Description\" "
321
+ "and \"Include Image\" options above is HIGHLY recommended"
322
+ msgstr ""
323
+ "Activar as opções \"Incluir tag URL (og:url)\", \"Incluir também a tag URL "
324
+ "Canónico\", \"Incluir tag Descrição (og:description)\" e \"Incluir tag "
325
+ "Imagem (og:image)\" é ALTAMENTE recomendado"
326
+
327
+ # @ wd-fb-og
328
+ #: includes/settings-page.php:407
329
+ msgid "You don't have any compatible 3rd Party plugin installed/active."
330
+ msgstr "Não tem nenhum plugin compatível instalado/activo."
331
+
332
+ # @ wd-fb-og
333
+ #: includes/settings-page.php:408
334
+ msgid "This plugin is currently compatible with:"
335
+ msgstr "Este plugin é actualmente compatível com:"
336
+
337
+ # @ wd-fb-og
338
+ #: includes/settings-page.php:427
339
+ msgid "Test your URLs at Facebook URL Linter / Debugger"
340
+ msgstr "Teste os seus URLs no \"Facebook URL Linter / Debugger\""
341
+
342
+ # @ wd-fb-og
343
+ #: includes/settings-page.php:430
344
+ msgid "About the Open Graph Protocol (on Facebook)"
345
+ msgstr "Sobre o Protocolo Open Graph (no Facebook)"
346
+
347
+ # @ wd-fb-og
348
+ #: includes/settings-page.php:433
349
+ msgid "The Open Graph Protocol (official website)"
350
+ msgstr "O Protocolo Open Graph (website oficial)"
351
+
352
+ # @ wd-fb-og
353
+ #: includes/settings-page.php:436
354
+ msgid "Plugin official URL"
355
+ msgstr "URL oficial do plugin"
356
+
357
+ # @ wd-fb-og
358
+ #: includes/settings-page.php:439
359
+ msgid "Author's website: Webdados"
360
+ msgstr "Website do autor: Webdados"
361
+
362
+ # @ wd-fb-og
363
+ #: includes/settings-page.php:442
364
+ msgid "Author's Facebook page: Webdados"
365
+ msgstr "Página Facebook do autor: Webdados"
366
+
367
+ # @ wd-fb-og
368
+ #: includes/settings-page.php:445
369
+ msgid "Author's Twitter account: @Wonderm00n<br/>(Webdados founder)"
370
+ msgstr "Conta Twitter do autor: @Wonderm00n<br/>(fundador da Webdados)"
371
+
372
+ # @ wd-fb-og
373
+ #: includes/settings-page.php:452
374
+ msgid "Rate this plugin"
375
+ msgstr "Avalie este plugin"
376
+
377
+ # @ wd-fb-og
378
+ #: includes/settings-page.php:454
379
+ msgid "If you like this plugin,"
380
+ msgstr "Se gosta deste plugin,"
381
+
382
+ # @ wd-fb-og
383
+ #: includes/settings-page.php:454
384
+ msgid "please give it a high Rating"
385
+ msgstr "dê-lhe uma nota elevada"
386
+
387
+ # @ wd-fb-og
388
+ #: includes/settings-page.php:461
389
+ msgid "Useful links"
390
+ msgstr "Links úteis"
391
+
392
+ # @ wd-fb-og
393
+ #: includes/settings-page.php:474
394
+ msgid "Donate"
395
+ msgstr "Doar"
396
+
397
+ # @ wd-fb-og
398
+ #: includes/settings-page.php:476
399
+ msgid ""
400
+ "If you find this plugin useful and want to make a contribution towards "
401
+ "future development please consider making a small, or big ;-), donation."
402
+ msgstr ""
403
+ "Se pensa que este plugin é útil e quer fazer uma contribuição para o "
404
+ "desenvolvimento no futuro, considere fazer uma pequena, ou grande ;-), "
405
+ "doação."
406
+
407
+ # @ wd-fb-og
408
+ #: wonderm00n-open-graph.php:500
409
+ msgid "Use this image:"
410
+ msgstr "Utilizar esta imagem:"
411
+
412
+ # @ wd-fb-og
413
+ #: wonderm00n-open-graph.php:503 wonderm00n-open-graph.php:508
414
+ msgid "Upload/Choose Open Graph Image"
415
+ msgstr "Carregar/Escolher Imagem Open Graph"
lang/wd-fb-og.pot ADDED
@@ -0,0 +1,389 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Facebook Open Graph Meta Tags for WordPress v1.0\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-11-15 13:25-0000\n"
7
+ "Last-Translator: Webdados <info@webdados.pt>\n"
8
+ "Language-Team: Webdados <info@webdados.pt>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: Poedit 1.5.7\n"
14
+ "X-Poedit-SourceCharset: UTF-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "Language: en_US\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ # @ wd-fb-og
23
+ #: includes/settings-page.php:61
24
+ msgid ""
25
+ "Please set some default values and which tags should, or should not, be "
26
+ "included. It may be necessary to exclude some tags if other plugins are "
27
+ "already including them."
28
+ msgstr ""
29
+
30
+ # @ wd-fb-og
31
+ #: includes/settings-page.php:75
32
+ msgid "Include Facebook Platform App ID (fb:app_id) tag?"
33
+ msgstr ""
34
+
35
+ # @ wd-fb-og
36
+ #: includes/settings-page.php:81
37
+ msgid "Facebook Platform App ID"
38
+ msgstr ""
39
+
40
+ # @ wd-fb-og
41
+ #: includes/settings-page.php:90
42
+ msgid "Include Facebook Admin(s) ID (fb:admins) tag?"
43
+ msgstr ""
44
+
45
+ # @ wd-fb-og
46
+ #: includes/settings-page.php:96
47
+ msgid "Facebook Admin(s) ID"
48
+ msgstr ""
49
+
50
+ # @ wd-fb-og
51
+ #: includes/settings-page.php:100
52
+ msgid "Comma separated if more than one"
53
+ msgstr ""
54
+
55
+ # @ wd-fb-og
56
+ #: includes/settings-page.php:107
57
+ msgid "Include locale (fb:locale) tag?"
58
+ msgstr ""
59
+
60
+ # @ wd-fb-og
61
+ #: includes/settings-page.php:113
62
+ msgid "Locale"
63
+ msgstr ""
64
+
65
+ # @ wd-fb-og
66
+ #: includes/settings-page.php:116
67
+ msgid "WordPress current locale/language"
68
+ msgstr ""
69
+
70
+ # @ wd-fb-og
71
+ #: includes/settings-page.php:167
72
+ msgid "List loaded from Facebook (online)"
73
+ msgstr ""
74
+
75
+ # @ wd-fb-og
76
+ #: includes/settings-page.php:170
77
+ msgid "List loaded from local cache (offline)"
78
+ msgstr ""
79
+
80
+ # @ wd-fb-og
81
+ #: includes/settings-page.php:170
82
+ msgid "You\\'l lose any changes you haven\\'t saved. Are you sure?"
83
+ msgstr ""
84
+
85
+ # @ wd-fb-og
86
+ #: includes/settings-page.php:170
87
+ msgid "Reload from Facebook"
88
+ msgstr ""
89
+
90
+ # @ wd-fb-og
91
+ #: includes/settings-page.php:172
92
+ msgid "List not loaded"
93
+ msgstr ""
94
+
95
+ # @ wd-fb-og
96
+ #: includes/settings-page.php:182
97
+ msgid "Include Site Name (og:site_name) tag?"
98
+ msgstr ""
99
+
100
+ # @ wd-fb-og
101
+ #: includes/settings-page.php:191
102
+ msgid "Include Post/Page title (og:title) tag?"
103
+ msgstr ""
104
+
105
+ # @ wd-fb-og
106
+ #: includes/settings-page.php:197
107
+ msgid "Also include Schema.org \"itemprop\" Name tag?"
108
+ msgstr ""
109
+
110
+ # @ wd-fb-og
111
+ #: includes/settings-page.php:203 includes/settings-page.php:278
112
+ #: includes/settings-page.php:320
113
+ msgid ""
114
+ "Recommended for Google+ sharing purposes if no other plugin is setting it "
115
+ "already"
116
+ msgstr ""
117
+
118
+ # @ wd-fb-og
119
+ #: includes/settings-page.php:210
120
+ msgid "Include URL (og:url) tag?"
121
+ msgstr ""
122
+
123
+ # @ wd-fb-og
124
+ #: includes/settings-page.php:216
125
+ msgid "Also set Canonical URL"
126
+ msgstr ""
127
+
128
+ # @ wd-fb-og
129
+ #: includes/settings-page.php:224
130
+ msgid "Add trailing slash at the end"
131
+ msgstr ""
132
+
133
+ # @ wd-fb-og
134
+ #: includes/settings-page.php:228
135
+ msgid "On the homepage will be"
136
+ msgstr ""
137
+
138
+ # @ wd-fb-og
139
+ #: includes/settings-page.php:235
140
+ msgid "Include Type (og:type) tag?"
141
+ msgstr ""
142
+
143
+ # @ wd-fb-og
144
+ #: includes/settings-page.php:239
145
+ #, php-format
146
+ msgid ""
147
+ "Will be \"%1$s\" for posts and pages and \"%2$s\" or \"%3$s\"; for the "
148
+ "homepage"
149
+ msgstr ""
150
+
151
+ # @ wd-fb-og
152
+ #: includes/settings-page.php:243
153
+ msgid "Homepage type"
154
+ msgstr ""
155
+
156
+ # @ wd-fb-og
157
+ #: includes/settings-page.php:245 includes/settings-page.php:292
158
+ msgid "Use"
159
+ msgstr ""
160
+
161
+ # @ wd-fb-og
162
+ #: includes/settings-page.php:256
163
+ msgid "Include Description (og:description) tag?"
164
+ msgstr ""
165
+
166
+ # @ wd-fb-og
167
+ #: includes/settings-page.php:262
168
+ msgid "Also include Meta Description tag?"
169
+ msgstr ""
170
+
171
+ # @ wd-fb-og
172
+ #: includes/settings-page.php:268
173
+ msgid "Recommended for SEO purposes if no other plugin is setting it already"
174
+ msgstr ""
175
+
176
+ # @ wd-fb-og
177
+ #: includes/settings-page.php:272
178
+ msgid "Also include Schema.org \"itemprop\" Description tag?"
179
+ msgstr ""
180
+
181
+ # @ wd-fb-og
182
+ #: includes/settings-page.php:282
183
+ msgid "Description maximum length"
184
+ msgstr ""
185
+
186
+ # @ wd-fb-og
187
+ #: includes/settings-page.php:286
188
+ msgid "0 or blank for no maximum length"
189
+ msgstr ""
190
+
191
+ # @ wd-fb-og
192
+ #: includes/settings-page.php:290
193
+ msgid "Homepage description"
194
+ msgstr ""
195
+
196
+ # @ wd-fb-og
197
+ #: includes/settings-page.php:294
198
+ msgid "Website tagline"
199
+ msgstr ""
200
+
201
+ # @ wd-fb-og
202
+ #: includes/settings-page.php:295
203
+ msgid "Custom text"
204
+ msgstr ""
205
+
206
+ # @ wd-fb-og
207
+ #: includes/settings-page.php:306
208
+ msgid "Include Image (og:image) tag?"
209
+ msgstr ""
210
+
211
+ # @ wd-fb-og
212
+ #: includes/settings-page.php:310
213
+ msgid ""
214
+ "All images MUST have at least 200px on both dimensions in order to Facebook "
215
+ "to load them at all. Minimum of 600x315px is recommended."
216
+ msgstr ""
217
+
218
+ # @ wd-fb-og
219
+ #: includes/settings-page.php:314
220
+ msgid "Also include Schema.org \"itemprop\" Image tag?"
221
+ msgstr ""
222
+
223
+ # @ wd-fb-og
224
+ #: includes/settings-page.php:324
225
+ msgid "Default image"
226
+ msgstr ""
227
+
228
+ # @ wd-fb-og
229
+ #: includes/settings-page.php:329
230
+ msgid "Full URL with http://"
231
+ msgstr ""
232
+
233
+ # @ wd-fb-og
234
+ #: includes/settings-page.php:331
235
+ msgid "Recommended size: 1200x630px"
236
+ msgstr ""
237
+
238
+ # @ wd-fb-og
239
+ #: includes/settings-page.php:335
240
+ msgid "Also add image to RSS/RSS2 feeds?"
241
+ msgstr ""
242
+
243
+ # @ wd-fb-og
244
+ #: includes/settings-page.php:339
245
+ msgid "For auto-posting apps like RSS Graffiti, twitterfeed, ..."
246
+ msgstr ""
247
+
248
+ # @ wd-fb-og
249
+ #: includes/settings-page.php:343
250
+ msgid "On posts/pages"
251
+ msgstr ""
252
+
253
+ # @ wd-fb-og
254
+ #: includes/settings-page.php:347
255
+ msgid ""
256
+ "Image will be fetched from the specific \"Open Graph Image\" custom field on "
257
+ "the post"
258
+ msgstr ""
259
+
260
+ # @ wd-fb-og
261
+ #: includes/settings-page.php:351
262
+ msgid ""
263
+ "If it's not set, image will be fetched from post/page featured/thumbnail "
264
+ "picture"
265
+ msgstr ""
266
+
267
+ # @ wd-fb-og
268
+ #: includes/settings-page.php:355
269
+ msgid "If it doesn't exist, use the first image from the post/page content"
270
+ msgstr ""
271
+
272
+ # @ wd-fb-og
273
+ #: includes/settings-page.php:359
274
+ msgid "If it doesn't exist, use first image from the post/page media gallery"
275
+ msgstr ""
276
+
277
+ # @ wd-fb-og
278
+ #: includes/settings-page.php:363
279
+ msgid "If it doesn't exist, use the default image above"
280
+ msgstr ""
281
+
282
+ # @ wd-fb-og
283
+ #: includes/settings-page.php:371
284
+ msgid "3rd Party Integration"
285
+ msgstr ""
286
+
287
+ # @ wd-fb-og
288
+ #: includes/settings-page.php:381
289
+ msgid "Add SubHeading to Post/Page title?"
290
+ msgstr ""
291
+
292
+ # @ wd-fb-og
293
+ #: includes/settings-page.php:395
294
+ msgid "Use BDP listing contents as OG tags?"
295
+ msgstr ""
296
+
297
+ # @ wd-fb-og
298
+ #: includes/settings-page.php:399
299
+ msgid ""
300
+ "Setting \"Include URL\", \"Also set Canonical URL\", \"Include Description\" "
301
+ "and \"Include Image\" options above is HIGHLY recommended"
302
+ msgstr ""
303
+
304
+ # @ wd-fb-og
305
+ #: includes/settings-page.php:407
306
+ msgid "You don't have any compatible 3rd Party plugin installed/active."
307
+ msgstr ""
308
+
309
+ # @ wd-fb-og
310
+ #: includes/settings-page.php:408
311
+ msgid "This plugin is currently compatible with:"
312
+ msgstr ""
313
+
314
+ # @ wd-fb-og
315
+ #: includes/settings-page.php:427
316
+ msgid "Test your URLs at Facebook URL Linter / Debugger"
317
+ msgstr ""
318
+
319
+ # @ wd-fb-og
320
+ #: includes/settings-page.php:430
321
+ msgid "About the Open Graph Protocol (on Facebook)"
322
+ msgstr ""
323
+
324
+ # @ wd-fb-og
325
+ #: includes/settings-page.php:433
326
+ msgid "The Open Graph Protocol (official website)"
327
+ msgstr ""
328
+
329
+ # @ wd-fb-og
330
+ #: includes/settings-page.php:436
331
+ msgid "Plugin official URL"
332
+ msgstr ""
333
+
334
+ # @ wd-fb-og
335
+ #: includes/settings-page.php:439
336
+ msgid "Author's website: Webdados"
337
+ msgstr ""
338
+
339
+ # @ wd-fb-og
340
+ #: includes/settings-page.php:442
341
+ msgid "Author's Facebook page: Webdados"
342
+ msgstr ""
343
+
344
+ # @ wd-fb-og
345
+ #: includes/settings-page.php:445
346
+ msgid "Author's Twitter account: @Wonderm00n<br/>(Webdados founder)"
347
+ msgstr ""
348
+
349
+ # @ wd-fb-og
350
+ #: includes/settings-page.php:452
351
+ msgid "Rate this plugin"
352
+ msgstr ""
353
+
354
+ # @ wd-fb-og
355
+ #: includes/settings-page.php:454
356
+ msgid "If you like this plugin,"
357
+ msgstr ""
358
+
359
+ # @ wd-fb-og
360
+ #: includes/settings-page.php:454
361
+ msgid "please give it a high Rating"
362
+ msgstr ""
363
+
364
+ # @ wd-fb-og
365
+ #: includes/settings-page.php:461
366
+ msgid "Useful links"
367
+ msgstr ""
368
+
369
+ # @ wd-fb-og
370
+ #: includes/settings-page.php:474
371
+ msgid "Donate"
372
+ msgstr ""
373
+
374
+ # @ wd-fb-og
375
+ #: includes/settings-page.php:476
376
+ msgid ""
377
+ "If you find this plugin useful and want to make a contribution towards "
378
+ "future development please consider making a small, or big ;-), donation."
379
+ msgstr ""
380
+
381
+ # @ wd-fb-og
382
+ #: wonderm00n-open-graph.php:500
383
+ msgid "Use this image:"
384
+ msgstr ""
385
+
386
+ # @ wd-fb-og
387
+ #: wonderm00n-open-graph.php:503 wonderm00n-open-graph.php:508
388
+ msgid "Upload/Choose Open Graph Image"
389
+ msgstr ""
readme.txt CHANGED
@@ -1,18 +1,18 @@
1
- === Wonderm00n's Simple Facebook Open Graph Meta Tags ===
2
- Contributors: wonderm00n
3
  Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
4
- Tags: facebook, open graph, seo, share, social, meta
5
- Requires at least: 3
6
  Tested up to: 3.5.1
7
- Stable tag: 0.5.4
8
 
9
- This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
10
- It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results.
11
 
12
  == Description ==
13
 
14
- This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results.
15
- It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ sharing results.
16
  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.
17
 
18
  It allows the user to choose which tags are, or not, included and also the default image if the post/page doesn't have one.
@@ -46,10 +46,23 @@ Other Tags:
46
 
47
  1. Upload the `wonderm00n-open-graph` to the `/wp-content/plugins/` directory
48
  2. Activate the plugin through the 'Plugins' menu in WordPress
49
- 3. Got to `Options`, `Wonderm00n's Open Graph` to set it up
50
 
51
  == Changelog ==
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  = 0.5.4 =
54
 
55
  * Fix in order to be compatible with "Business Directory Plugin" 3.0
1
+ === Facebook Open Graph Meta Tags for WordPress ===
2
+ Contributors: webdados, wonderm00n
3
  Donate link: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
4
+ Tags: facebook, open graph, open graph protocol, seo, share, social, meta, schema, google+, g+, google, google plus, image, like, meta, search engine optimization
5
+ Requires at least: 3.5
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.0
8
 
9
+ This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective and efficient Facebook sharing results.
10
+ It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective and efficient Google+ sharing results.
11
 
12
  == Description ==
13
 
14
+ This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective and efficient Facebook sharing results.
15
+ It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective and efficien Google+ sharing results.
16
  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.
17
 
18
  It allows the user to choose which tags are, or not, included and also the default image if the post/page doesn't have one.
46
 
47
  1. Upload the `wonderm00n-open-graph` to the `/wp-content/plugins/` directory
48
  2. Activate the plugin through the 'Plugins' menu in WordPress
49
+ 3. Got to `Options`, `Facebook Open Graph Tags` to set it up
50
 
51
  == Changelog ==
52
 
53
+ = 1.0 =
54
+
55
+ * Plugin name changed from "Wonderm00n's Simple Facebook Open Graph Meta Tags" to "Facebook Open Graph Meta Tags for WordPress"
56
+ * You can now set a specific Open Graph image per post, if you don't want it to be the same as the post featured image
57
+ * Settings are now stored on a array instead of multiple variables on the options table (and necessary changes along the code)
58
+ * Internationalization support added
59
+ * Portuguese translation added (we welcome other translations if you want to do it)
60
+ * Added webdados as contributor (Wonderm00n's company)
61
+ * Fix: Several PHP warnings when WP_DEBUG is turned on. Thanks to @flynsarmy (yet again)
62
+ * Fix: og:type was not set correctly for the homepage in case it was a static page. Thanks to yakitori
63
+ * Fix: When the site url was not the same as the wordpress installation folder the wrong url was used in the homepage og:url/canonical tag. Thanks to theonetruebix
64
+ * Using the requested url as og:urgl/canonical on not known areas of wordpress. Not really a canonical url but better than using the homepage one
65
+
66
  = 0.5.4 =
67
 
68
  * Fix in order to be compatible with "Business Directory Plugin" 3.0
wonderm00n-open-graph.php CHANGED
@@ -1,18 +1,22 @@
1
  <?php
2
  /**
3
- * @package Wonderm00n's Simple Facebook Open Graph Meta Tags
4
- * @version 0.5.4
5
  */
6
  /*
7
- Plugin Name: Wonderm00n's Simple Facebook Open Graph Meta Tags
8
  Plugin URI: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
9
- Description: This plugin inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective Facebook sharing results. It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective Google+ 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
- Author: Marco Almeida (Wonderm00n)
11
- Version: 0.5.4
12
- Author URI: http://wonderm00n.com
 
 
13
  */
14
 
15
- $wonderm00n_open_graph_plugin_version='0.5.4';
 
 
16
  $wonderm00n_open_graph_plugin_settings=array(
17
  'fb_app_id_show',
18
  'fb_app_id',
@@ -38,6 +42,7 @@ $wonderm00n_open_graph_plugin_settings=array(
38
  'fb_image_show_schema',
39
  'fb_image',
40
  'fb_image_rss',
 
41
  'fb_image_use_featured',
42
  'fb_image_use_content',
43
  'fb_image_use_media',
@@ -46,27 +51,39 @@ $wonderm00n_open_graph_plugin_settings=array(
46
  'fb_show_businessdirectoryplugin'
47
  );
48
 
49
- //We have to remove canonical NOW because the plugin runs too late
50
- if (get_option('wonderm00n_open_graph_fb_url_show')==1) {
51
- if (get_option('wonderm00n_open_graph_fb_url_canonical')==1) {
 
52
  remove_action('wp_head', 'rel_canonical');
53
  }
54
  }
55
 
 
 
 
 
 
 
56
  function wonderm00n_open_graph() {
57
- global $wonderm00n_open_graph_plugin_settings, $wonderm00n_open_graph_plugin_version;
 
 
 
58
 
59
- //Get options
60
- foreach($wonderm00n_open_graph_plugin_settings as $key) {
61
  $$key=get_option('wonderm00n_open_graph_'.$key);
62
- }
 
 
63
 
64
  //Also set Title Tag?
65
  $fb_set_title_tag=0;
66
 
67
  $fb_type='article';
68
  if (is_singular()) {
69
- //It's a Post or a Page or an attachment page - It acan also be the homepage if it's set as a page
70
  global $post;
71
  $fb_title=esc_attr(strip_tags(stripslashes($post->post_title)));
72
  //All In One SEO - To Do
@@ -93,6 +110,11 @@ function wonderm00n_open_graph() {
93
  }
94
  }
95
  $fb_url=get_permalink();
 
 
 
 
 
96
  if (trim($post->post_excerpt)!='') {
97
  //If there's an excerpt that's what we'll use
98
  $fb_desc=trim($post->post_excerpt);
@@ -102,7 +124,7 @@ function wonderm00n_open_graph() {
102
  }
103
  $fb_desc=(intval($fb_desc_chars)>0 ? substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars) : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));
104
  if (intval($fb_image_show)==1) {
105
- $fb_image=wonderm00n_open_graph_post_image($fb_image_use_featured, $fb_image_use_content, $fb_image_use_media, $fb_image_use_default, $fb_image);
106
  }
107
  //Business Directory Plugin
108
  if ($fb_show_businessdirectoryplugin==1) {
@@ -169,7 +191,9 @@ function wonderm00n_open_graph() {
169
  global $wp_query;
170
  //Other pages - Defaults
171
  $fb_title=esc_attr(strip_tags(stripslashes(get_bloginfo('name'))));
172
- $fb_url=get_option('siteurl').(intval($fb_url_add_trailing)==1 ? '/' : '');
 
 
173
  switch(trim($fb_desc_homepage)) {
174
  case 'custom':
175
  $fb_desc=esc_attr(strip_tags(stripslashes($fb_desc_homepage_customtext)));
@@ -223,6 +247,7 @@ function wonderm00n_open_graph() {
223
  }
224
  } else {
225
  if (is_front_page()) {
 
226
  $fb_type=trim($fb_type_homepage=='' ? 'website' : $fb_type_homepage);
227
  } else {
228
  //Others... Defaults already set up there
@@ -238,7 +263,7 @@ function wonderm00n_open_graph() {
238
  if (trim($fb_desc)=='') $fb_desc=$fb_title;
239
 
240
  $html='
241
- <!-- START - Wonderm00n\'s Simple Facebook Open Graph Tags '.$wonderm00n_open_graph_plugin_version.' -->
242
  ';
243
  if (intval($fb_app_id_show)==1 && trim($fb_app_id)!='') $html.='<meta property="fb:app_id" content="'.trim($fb_app_id).'" />
244
  ';
@@ -276,7 +301,7 @@ function wonderm00n_open_graph() {
276
  ';
277
  if(intval($fb_image_show_schema)==1 && trim($fb_image)!='') $html.='<meta itemprop="image" content="'.trim(esc_attr($fb_image)).'" />
278
  ';
279
- $html.='<!-- END - Wonderm00n\'s Simple Facebook Open Graph Tags -->
280
  ';
281
  echo $html;
282
  }
@@ -301,10 +326,10 @@ function wonderm00n_open_graph_add_opengraph_namespace( $output ) {
301
  add_filter('language_attributes', 'wonderm00n_open_graph_add_opengraph_namespace',9999);
302
 
303
  //Add images also to RSS feed. Most code from WP RSS Images by Alain Gonzalez
304
- function wonderm00n_open_graph_images_on_feed($comments) {
305
- $fb_image_rss=get_option('wonderm00n_open_graph_fb_image_rss');
306
- if (intval($fb_image_rss)==1) {
307
- if (!$comments) {
308
  add_action('rss2_ns', 'wonderm00n_open_graph_images_on_feed_yahoo_media_tag');
309
  add_action('rss_item', 'wonderm00n_open_graph_images_on_feed_image');
310
  add_action('rss2_item', 'wonderm00n_open_graph_images_on_feed_image');
@@ -315,12 +340,8 @@ function wonderm00n_open_graph_images_on_feed_yahoo_media_tag() {
315
  echo 'xmlns:media="http://search.yahoo.com/mrss/"';
316
  }
317
  function wonderm00n_open_graph_images_on_feed_image() {
318
- $fb_image=get_option('wonderm00n_open_graph_fb_image');
319
- $fb_image_use_featured=get_option('wonderm00n_open_graph_fb_image_use_featured');
320
- $fb_image_use_content=get_option('wonderm00n_open_graph_fb_image_use_content');
321
- $fb_image_use_media=get_option('wonderm00n_open_graph_fb_image_use_media');
322
- $fb_image_use_default=get_option('wonderm00n_open_graph_fb_image_use_default');
323
- $fb_image = wonderm00n_open_graph_post_image($fb_image_use_featured, $fb_image_use_content, $fb_image_use_media, $fb_image_use_default, $fb_image);
324
  if ($fb_image!='') {
325
  $uploads = wp_upload_dir();
326
  $url = parse_url($fb_image);
@@ -342,20 +363,30 @@ add_action("do_feed_rss","wonderm00n_open_graph_images_on_feed",5,1);
342
  add_action("do_feed_rss2","wonderm00n_open_graph_images_on_feed",5,1);
343
 
344
  //Post image
345
- function wonderm00n_open_graph_post_image($fb_image_use_featured=1, $fb_image_use_content=1, $fb_image_use_media=1, $fb_image_use_default=1, $default_image='') {
346
  global $post;
347
  $thumbdone=false;
348
  $fb_image='';
349
- //Featured image
350
- if (function_exists('get_post_thumbnail_id')) {
351
- if (intval($fb_image_use_featured)==1) {
352
- if ($id_attachment=get_post_thumbnail_id($post->ID)) {
353
- //There's a featured/thumbnail image for this post
354
- $fb_image=wp_get_attachment_url($id_attachment, false);
355
  $thumbdone=true;
356
  }
357
  }
358
  }
 
 
 
 
 
 
 
 
 
 
 
 
359
  //From post/page content
360
  if (!$thumbdone) {
361
  if (intval($fb_image_use_content)==1) {
@@ -412,29 +443,10 @@ if ( is_admin() ) {
412
 
413
  function wonderm00n_open_graph_add_options() {
414
  if(function_exists('add_options_page')){
415
- add_options_page('Wonderm00n\'s Open Graph', 'Wonderm00n\'s Open Graph', 'manage_options', basename(__FILE__), 'wonderm00n_open_graph_admin');
416
  }
417
  }
418
 
419
- function wonderm00n_open_graph_default_values() {
420
- return array(
421
- 'fb_locale_show' => 1,
422
- 'fb_sitename_show' => 1,
423
- 'fb_title_show' => 1,
424
- 'fb_url_show' => 1,
425
- 'fb_url_canonical' => 1,
426
- 'fb_type_show' => 1,
427
- 'fb_desc_show' => 1,
428
- 'fb_desc_chars' => 300,
429
- 'fb_image_show' => 1,
430
- 'fb_image_use_featured' => 1,
431
- 'fb_image_use_content' => 1,
432
- 'fb_image_use_media' => 1,
433
- 'fb_image_use_default' => 1,
434
- 'fb_keep_data_uninstall' => 1
435
- );
436
- }
437
-
438
  function wonderm00n_open_graph_activate() {
439
  // Let's not!
440
  }
@@ -451,6 +463,7 @@ if ( is_admin() ) {
451
 
452
  function wonderm00n_open_graph_admin() {
453
  global $wonderm00n_open_graph_plugin_settings, $wonderm00n_open_graph_plugin_version;
 
454
  include_once 'includes/settings-page.php';
455
  }
456
 
@@ -464,6 +477,151 @@ if ( is_admin() ) {
464
  }
465
  add_action('admin_print_scripts', 'wonderm00n_open_graph_scripts');
466
  add_action('admin_print_styles', 'wonderm00n_open_graph_styles');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  }
468
 
469
 
@@ -471,18 +629,18 @@ if ( is_admin() ) {
471
  register_uninstall_hook(__FILE__, 'wonderm00n_open_graph_uninstall'); //NOT WORKING! WHY?
472
  function wonderm00n_open_graph_uninstall() {
473
  //NOT WORKING! WHY?
474
- global $wonderm00n_open_graph_plugin_settings;
475
  //Remove data
476
- foreach($wonderm00n_open_graph_plugin_settings as $key) {
477
  delete_option('wonderm00n_open_graph_'.$key);
478
  }
479
- delete_option('wonderm00n_open_graph_activated');
480
  }
481
 
482
  //To avoid notices when updating options on settings-page.php
483
  //Hey @flynsarmy you are here, see?
484
  function wonderm00n_open_graph_post($var, $default='') {
485
- return isset($var) ? $var : $default;
486
  }
487
 
488
  ?>
1
  <?php
2
  /**
3
+ * @package Facebook Open Graph Meta Tags for WordPress
4
+ * @version 1.0
5
  */
6
  /*
7
+ Plugin Name: Facebook Open Graph Meta Tags for WordPress
8
  Plugin URI: http://blog.wonderm00n.com/2011/10/14/wordpress-plugin-simple-facebook-open-graph-tags/
9
+ Description: This plugin (formerly known as "Wonderm00n's Simple Facebook Open Graph Meta Tags") inserts Facebook Open Graph Tags into your WordPress Blog/Website for more effective and efficient Facebook sharing results. It also allows you to add the Meta Description tag and Schema.org Name, Description and Image tags for more effective and efficient Google+ 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
+ Version: 1.0
11
+ Author: Webdados
12
+ Author URI: http://www.webdados.pt
13
+ Text Domain: wd-fb-og
14
+ Domain Path: /lang
15
  */
16
 
17
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
18
+
19
+ $wonderm00n_open_graph_plugin_version='1.0';
20
  $wonderm00n_open_graph_plugin_settings=array(
21
  'fb_app_id_show',
22
  'fb_app_id',
42
  'fb_image_show_schema',
43
  'fb_image',
44
  'fb_image_rss',
45
+ 'fb_image_use_specific',
46
  'fb_image_use_featured',
47
  'fb_image_use_content',
48
  'fb_image_use_media',
51
  'fb_show_businessdirectoryplugin'
52
  );
53
 
54
+ //We have to remove canonical NOW because the plugin runs too late - We're also loading the settings which is cool
55
+ $webdados_fb_open_graph_settings=wonderm00n_open_graph_load_settings();
56
+ if (intval($webdados_fb_open_graph_settings['fb_url_show'])==1) {
57
+ if (intval($webdados_fb_open_graph_settings['fb_url_canonical'])==1) {
58
  remove_action('wp_head', 'rel_canonical');
59
  }
60
  }
61
 
62
+ //Languages
63
+ function wonderm00n_open_graph_init() {
64
+ load_plugin_textdomain('wd-fb-og', false, dirname(plugin_basename(__FILE__)) . '/lang/');
65
+ }
66
+ add_action('plugins_loaded', 'wonderm00n_open_graph_init');
67
+
68
  function wonderm00n_open_graph() {
69
+ global $wonderm00n_open_graph_plugin_settings, $wonderm00n_open_graph_plugin_version, $webdados_fb_open_graph_settings;
70
+
71
+ //Upgrade
72
+ wonderm00n_open_graph_upgrade();
73
 
74
+ //Get options - OLD (until 0.5.4)
75
+ /*foreach($wonderm00n_open_graph_plugin_settings as $key) {
76
  $$key=get_option('wonderm00n_open_graph_'.$key);
77
+ }*/
78
+ //Get options - NEW (after 0.5.4)
79
+ extract($webdados_fb_open_graph_settings);
80
 
81
  //Also set Title Tag?
82
  $fb_set_title_tag=0;
83
 
84
  $fb_type='article';
85
  if (is_singular()) {
86
+ //It's a Post or a Page or an attachment page - It can also be the homepage if it's set as a page
87
  global $post;
88
  $fb_title=esc_attr(strip_tags(stripslashes($post->post_title)));
89
  //All In One SEO - To Do
110
  }
111
  }
112
  $fb_url=get_permalink();
113
+ if (is_front_page()) {
114
+ /* Fix homepage type when it's a static page */
115
+ $fb_url=get_option('home').(intval($fb_url_add_trailing)==1 ? '/' : '');
116
+ $fb_type=trim($fb_type_homepage=='' ? 'website' : $fb_type_homepage);
117
+ }
118
  if (trim($post->post_excerpt)!='') {
119
  //If there's an excerpt that's what we'll use
120
  $fb_desc=trim($post->post_excerpt);
124
  }
125
  $fb_desc=(intval($fb_desc_chars)>0 ? substr(esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))),0,$fb_desc_chars) : esc_attr(strip_tags(strip_shortcodes(stripslashes($fb_desc)))));
126
  if (intval($fb_image_show)==1) {
127
+ $fb_image=wonderm00n_open_graph_post_image($fb_image_use_specific, $fb_image_use_featured, $fb_image_use_content, $fb_image_use_media, $fb_image_use_default, $fb_image);
128
  }
129
  //Business Directory Plugin
130
  if ($fb_show_businessdirectoryplugin==1) {
191
  global $wp_query;
192
  //Other pages - Defaults
193
  $fb_title=esc_attr(strip_tags(stripslashes(get_bloginfo('name'))));
194
+ //$fb_url=get_option('home').(intval($fb_url_add_trailing)==1 ? '/' : ''); //2013-11-4 changed from 'siteurl' to 'home'
195
+ $fb_url=((!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; //Not really canonical but will work for now
196
+
197
  switch(trim($fb_desc_homepage)) {
198
  case 'custom':
199
  $fb_desc=esc_attr(strip_tags(stripslashes($fb_desc_homepage_customtext)));
247
  }
248
  } else {
249
  if (is_front_page()) {
250
+ $fb_url=get_option('home').(intval($fb_url_add_trailing)==1 ? '/' : '');
251
  $fb_type=trim($fb_type_homepage=='' ? 'website' : $fb_type_homepage);
252
  } else {
253
  //Others... Defaults already set up there
263
  if (trim($fb_desc)=='') $fb_desc=$fb_title;
264
 
265
  $html='
266
+ <!-- START - Facebook Open Graph Meta Tags for WordPress '.$wonderm00n_open_graph_plugin_version.' -->
267
  ';
268
  if (intval($fb_app_id_show)==1 && trim($fb_app_id)!='') $html.='<meta property="fb:app_id" content="'.trim($fb_app_id).'" />
269
  ';
301
  ';
302
  if(intval($fb_image_show_schema)==1 && trim($fb_image)!='') $html.='<meta itemprop="image" content="'.trim(esc_attr($fb_image)).'" />
303
  ';
304
+ $html.='<!-- END - Facebook Open Graph Meta Tags for WordPress -->
305
  ';
306
  echo $html;
307
  }
326
  add_filter('language_attributes', 'wonderm00n_open_graph_add_opengraph_namespace',9999);
327
 
328
  //Add images also to RSS feed. Most code from WP RSS Images by Alain Gonzalez
329
+ function wonderm00n_open_graph_images_on_feed($for_comments) {
330
+ global $webdados_fb_open_graph_settings;
331
+ if (intval($webdados_fb_open_graph_settings['fb_image_rss'])==1) {
332
+ if (!$for_comments) {
333
  add_action('rss2_ns', 'wonderm00n_open_graph_images_on_feed_yahoo_media_tag');
334
  add_action('rss_item', 'wonderm00n_open_graph_images_on_feed_image');
335
  add_action('rss2_item', 'wonderm00n_open_graph_images_on_feed_image');
340
  echo 'xmlns:media="http://search.yahoo.com/mrss/"';
341
  }
342
  function wonderm00n_open_graph_images_on_feed_image() {
343
+ global $webdados_fb_open_graph_settings;
344
+ $fb_image = wonderm00n_open_graph_post_image($webdados_fb_open_graph_settings['fb_image_use_specific'], $webdados_fb_open_graph_settings['fb_image_use_featured'], $webdados_fb_open_graph_settings['fb_image_use_content'], $webdados_fb_open_graph_settings['fb_image_use_media'], $webdados_fb_open_graph_settings['fb_image_use_default'], $webdados_fb_open_graph_settings['fb_image']);
 
 
 
 
345
  if ($fb_image!='') {
346
  $uploads = wp_upload_dir();
347
  $url = parse_url($fb_image);
363
  add_action("do_feed_rss2","wonderm00n_open_graph_images_on_feed",5,1);
364
 
365
  //Post image
366
+ function wonderm00n_open_graph_post_image($fb_image_use_specific=1,$fb_image_use_featured=1, $fb_image_use_content=1, $fb_image_use_media=1, $fb_image_use_default=1, $default_image='') {
367
  global $post;
368
  $thumbdone=false;
369
  $fb_image='';
370
+ //Specific post image
371
+ if (intval($fb_image_use_featured)==1) {
372
+ if ($fb_image=trim(get_post_meta($post->ID, '_webdados_fb_open_graph_specific_image', true))) {
373
+ if (trim($fb_image)!='') {
 
 
374
  $thumbdone=true;
375
  }
376
  }
377
  }
378
+ //Featured image
379
+ if (!$thumbdone) {
380
+ if (function_exists('get_post_thumbnail_id')) {
381
+ if (intval($fb_image_use_featured)==1) {
382
+ if ($id_attachment=get_post_thumbnail_id($post->ID)) {
383
+ //There's a featured/thumbnail image for this post
384
+ $fb_image=wp_get_attachment_url($id_attachment, false);
385
+ $thumbdone=true;
386
+ }
387
+ }
388
+ }
389
+ }
390
  //From post/page content
391
  if (!$thumbdone) {
392
  if (intval($fb_image_use_content)==1) {
443
 
444
  function wonderm00n_open_graph_add_options() {
445
  if(function_exists('add_options_page')){
446
+ add_options_page('Facebook Open Graph Tags', 'Facebook Open Graph Tags', 'manage_options', basename(__FILE__), 'wonderm00n_open_graph_admin');
447
  }
448
  }
449
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
450
  function wonderm00n_open_graph_activate() {
451
  // Let's not!
452
  }
463
 
464
  function wonderm00n_open_graph_admin() {
465
  global $wonderm00n_open_graph_plugin_settings, $wonderm00n_open_graph_plugin_version;
466
+ wonderm00n_open_graph_upgrade();
467
  include_once 'includes/settings-page.php';
468
  }
469
 
477
  }
478
  add_action('admin_print_scripts', 'wonderm00n_open_graph_scripts');
479
  add_action('admin_print_styles', 'wonderm00n_open_graph_styles');
480
+
481
+ function wonderm00n_open_graph_add_posts_options() {
482
+ global $webdados_fb_open_graph_settings;
483
+ if (intval($webdados_fb_open_graph_settings['fb_image_use_specific'])==1) {
484
+ global $post;
485
+ add_meta_box(
486
+ 'webdados_fb_open_graph',
487
+ 'Facebook Open Graph Meta Tags for WordPress',
488
+ 'wonderm00n_open_graph_add_posts_options_box',
489
+ $post->post_type
490
+ );
491
+ }
492
+ }
493
+ function wonderm00n_open_graph_add_posts_options_box() {
494
+ global $post;
495
+ // Add an nonce field so we can check for it later.
496
+ wp_nonce_field( 'webdados_fb_open_graph_custom_box', 'webdados_fb_open_graph_custom_box_nonce' );
497
+ // Current value
498
+ $value = get_post_meta($post->ID, '_webdados_fb_open_graph_specific_image', true);
499
+ echo '<label for="webdados_fb_open_graph_specific_image">';
500
+ _e('Use this image:', 'wd-fb-og');
501
+ echo '</label> ';
502
+ echo '<input type="text" id="webdados_fb_open_graph_specific_image" name="webdados_fb_open_graph_specific_image" value="' . esc_attr( $value ) . '" size="75" />
503
+ <input id="webdados_fb_open_graph_specific_image_button" class="button" type="button" value="'.__('Upload/Choose Open Graph Image','wd-fb-og').'" />';
504
+ echo '<br/>'.__('Recommended size: 1200x630px', 'wd-fb-og');
505
+ echo '<script type="text/javascript">
506
+ jQuery(document).ready(function() {
507
+ jQuery(\'#webdados_fb_open_graph_specific_image_button\').click(function(){
508
+ tb_show(\''.__('Upload/Choose Open Graph Image', 'wd-fb-og').'\',"media-upload.php?type=image&TB_iframe=true&post_id='.$post->ID.'", false);
509
+ });
510
+ window.send_to_editor = function(html) {
511
+ imgurl=jQuery("<div>" + html + "</div>").find(\'img\').attr(\'src\');
512
+ jQuery("#webdados_fb_open_graph_specific_image").val(imgurl);
513
+ tb_remove();
514
+ }
515
+ });
516
+ </script>';
517
+ }
518
+ add_action('add_meta_boxes', 'wonderm00n_open_graph_add_posts_options');
519
+ function wonderm00n_open_graph_add_posts_options_box_save( $post_id ) {
520
+
521
+ /*
522
+ * We need to verify this came from the our screen and with proper authorization,
523
+ * because save_post can be triggered at other times.
524
+ */
525
+
526
+ // Check if our nonce is set.
527
+ if ( ! isset( $_POST['webdados_fb_open_graph_custom_box_nonce'] ) )
528
+ return $post_id;
529
+
530
+ $nonce = $_POST['webdados_fb_open_graph_custom_box_nonce'];
531
+
532
+ // Verify that the nonce is valid.
533
+ if ( ! wp_verify_nonce( $nonce, 'webdados_fb_open_graph_custom_box' ) )
534
+ return $post_id;
535
+
536
+ // If this is an autosave, our form has not been submitted, so we don't want to do anything.
537
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
538
+ return $post_id;
539
+
540
+ // Check the user's permissions.
541
+ if ( 'page' == $_POST['post_type'] ) {
542
+
543
+ if ( ! current_user_can( 'edit_page', $post_id ) )
544
+ return $post_id;
545
+
546
+ } else {
547
+
548
+ if ( ! current_user_can( 'edit_post', $post_id ) )
549
+ return $post_id;
550
+ }
551
+
552
+ /* OK, its safe for us to save the data now. */
553
+
554
+ // Sanitize user input.
555
+ $mydata = sanitize_text_field( $_POST['webdados_fb_open_graph_specific_image'] );
556
+
557
+ // Update the meta field in the database.
558
+ update_post_meta( $post_id, '_webdados_fb_open_graph_specific_image', $mydata );
559
+ }
560
+ add_action('save_post', 'wonderm00n_open_graph_add_posts_options_box_save' );
561
+ }
562
+
563
+
564
+
565
+ function wonderm00n_open_graph_default_values() {
566
+ return array(
567
+ 'fb_locale_show' => 1,
568
+ 'fb_sitename_show' => 1,
569
+ 'fb_title_show' => 1,
570
+ 'fb_url_show' => 1,
571
+ 'fb_url_canonical' => 1,
572
+ 'fb_type_show' => 1,
573
+ 'fb_desc_show' => 1,
574
+ 'fb_desc_chars' => 300,
575
+ 'fb_image_show' => 1,
576
+ 'fb_image_use_specific' => 1,
577
+ 'fb_image_use_featured' => 1,
578
+ 'fb_image_use_content' => 1,
579
+ 'fb_image_use_media' => 1,
580
+ 'fb_image_use_default' => 1,
581
+ 'fb_keep_data_uninstall' => 1
582
+ );
583
+ }
584
+ function wonderm00n_open_graph_load_settings() {
585
+ $defaults=wonderm00n_open_graph_default_values();
586
+ //Load the user settings (if they exist)
587
+ if ($usersettings=get_option('webdados_fb_open_graph_settings')) {
588
+ //Merge the settings "all together now" (yes, it's a Beatles reference)
589
+ foreach($usersettings as $key => $value) {
590
+ //if ($value=='') {
591
+ if (strlen(trim($value))==0) {
592
+ if (!empty($defaults[$key])) {
593
+ $usersettings[$key]=$defaults[$key];
594
+ }
595
+ }
596
+ }
597
+ } else {
598
+ $usersettings=$defaults;
599
+ }
600
+ return $usersettings;
601
+ }
602
+
603
+ function wonderm00n_open_graph_upgrade() {
604
+ global $wonderm00n_open_graph_plugin_version;
605
+ $upgrade=false;
606
+ //Upgrade from 0.5.4 - Last version with individual settings
607
+ if (!$v=get_option('webdados_fb_open_graph_version')) {
608
+ //Convert settings
609
+ $upgrade=true;
610
+ global $wonderm00n_open_graph_plugin_settings;
611
+ foreach($wonderm00n_open_graph_plugin_settings as $key) {
612
+ $webdados_fb_open_graph_settings[$key]=get_option('wonderm00n_open_graph_'.$key);
613
+ }
614
+ // New fb_image_use_specific
615
+ $webdados_fb_open_graph_settings['fb_image_use_specific']=1;
616
+ update_option('webdados_fb_open_graph_settings', $webdados_fb_open_graph_settings);
617
+ foreach($wonderm00n_open_graph_plugin_settings as $key) {
618
+ delete_option('wonderm00n_open_graph_'.$key);
619
+ }
620
+ }
621
+ //Set version on database
622
+ if ($upgrade) {
623
+ update_option('webdados_fb_open_graph_version', $wonderm00n_open_graph_plugin_version);
624
+ }
625
  }
626
 
627
 
629
  register_uninstall_hook(__FILE__, 'wonderm00n_open_graph_uninstall'); //NOT WORKING! WHY?
630
  function wonderm00n_open_graph_uninstall() {
631
  //NOT WORKING! WHY?
632
+ //global $wonderm00n_open_graph_plugin_settings;
633
  //Remove data
634
+ /*foreach($wonderm00n_open_graph_plugin_settings as $key) {
635
  delete_option('wonderm00n_open_graph_'.$key);
636
  }
637
+ delete_option('wonderm00n_open_graph_activated');*/
638
  }
639
 
640
  //To avoid notices when updating options on settings-page.php
641
  //Hey @flynsarmy you are here, see?
642
  function wonderm00n_open_graph_post($var, $default='') {
643
+ return isset($_POST[$var]) ? $_POST[$var] : $default;
644
  }
645
 
646
  ?>