Thumb Fixer for Facebook - Version 1.7.8

Version Description

End of life notice.

Download this release

Release Info

Developer mikeyott
Plugin Icon 128x128 Thumb Fixer for Facebook
Version 1.7.8
Comparing to
See all releases

Version 1.7.8

_facebook-thumb-fixer.php ADDED
@@ -0,0 +1,491 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Thumbnail Fixer for Facebook.
4
+ Plugin URI: https://wordpress.org/support/plugin/facebook-thumb-fixer
5
+ Description: Control how your thumbnails are viewed when a post is shared on Facebook.
6
+ Author: Michael Ott
7
+ Version: 1.7.8
8
+ Author URI: https://rocketapps.com.au/
9
+ Text Domain: facebook-thumb-fixer
10
+ Domain Path: /languages/
11
+ */
12
+
13
+ // Look for translation file.
14
+ function load_fbtf_textdomain() {
15
+ load_plugin_textdomain( 'facebook-thumb-fixer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
16
+ }
17
+ add_action( 'plugins_loaded', 'load_fbtf_textdomain' );
18
+
19
+ // Add HELP link from the plugin page
20
+ add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'link_action_on_plugin' );
21
+ function link_action_on_plugin( $links ) {
22
+ return array_merge(array('settings' => '<a href="' . admin_url( '/options-general.php' ) . '">' . __( 'Settings', 'facebook-thumb-fixer' ) . '</a> | <a href="' . admin_url( '/options-general.php?page=facebook-thumb-fixer' ) . '">' . __( 'Help', 'facebook-thumb-fixer' ) . '</a>'), $links);
23
+ }
24
+
25
+ // Include custom CSS
26
+ function admin_load_fbf_css(){
27
+ wp_enqueue_style('stylsheet', plugins_url( '/css/ftf.css', __FILE__ ) );
28
+ add_thickbox();
29
+ }
30
+ add_action('admin_enqueue_scripts', 'admin_load_fbf_css');
31
+
32
+ // Show message upon plugin activation
33
+ register_activation_hook( __FILE__, 'ftf_admin_notice_activation_hook' );
34
+
35
+ // Runs only when the plugin is activated
36
+ function ftf_admin_notice_activation_hook() {
37
+
38
+ /* Create transient data */
39
+ set_transient( 'ftf-admin-notice', true, 1000 );
40
+ }
41
+
42
+ /* Add admin notice */
43
+ add_action( 'admin_notices', 'ftf_admin_notice' );
44
+
45
+ // Admin Notice on Activation
46
+ function ftf_admin_notice(){
47
+
48
+ /* Check transient, if available display notice */
49
+ if( get_transient( 'ftf-admin-notice' ) ){
50
+ ?>
51
+ <div class="updated notice is-dismissible ir-admin-message">
52
+ <?php $presentation_options_url = admin_url() . 'options-general.php#dfb'; ?>
53
+ <p><?php printf( __( "Awesome! Don't forget to set a default facebook thumbnail <a href='%s'>here</a>.", "facebook-thumb-fixer" ), $presentation_options_url); ?></p>
54
+ </div>
55
+ <?php
56
+ /* Delete transient, only display this notice once. */
57
+ delete_transient( 'ftf-admin-notice' );
58
+ }
59
+ }
60
+
61
+ function deprecation_notice() {
62
+ ?>
63
+ <div class="error notice-success">
64
+ <?php $open_graphite_url = 'https://wordpress.org/plugins/open-graphite/'; ?>
65
+ <p><?php printf( __('<strong>Important:</strong> The <strong>Thumb Fixer for Facebook</strong> plugin is no longer maintained. It is recommended you switch to the free (and better) <a href="%s">Open Graphite</a> plugin instead.', 'facebook-thumb-fixer' ), $open_graphite_url); ?></p>
66
+ </div>
67
+ <?php
68
+ }
69
+ add_action( 'admin_notices', 'deprecation_notice' );
70
+
71
+ // Add image path field into the general settings page
72
+ $setting_default_fb_thumb = new general_setting_default_fb_thumb();
73
+ class general_setting_default_fb_thumb {
74
+ function general_setting_default_fb_thumb( ) {
75
+ add_filter( 'admin_init' , array( &$this , 'register_fields' ) );
76
+ }
77
+ function register_fields() {
78
+ register_setting( 'general', 'default_fb_thumb', 'esc_attr' );
79
+ add_settings_field('dft', '<label for="default_fb_thumb" id="dfb">' . __('Default Facebook Thumb' , 'facebook-thumb-fixer' ) . '</label>' , array(&$this, 'fields_html') , 'general' );
80
+ }
81
+ function fields_html() {
82
+ $fbt_value = get_option( 'default_fb_thumb');
83
+ $fb_URL = 'https://developers.facebook.com/docs/sharing/best-practices#images';
84
+ $settings_URL = admin_url( '/options-general.php?page=facebook-thumb-fixer' );
85
+ $home_image_ID = attachment_url_to_postid( $fbt_value ); // Get the ID of the default image
86
+ $image_attributes = wp_get_attachment_image_src( $attachment_id = $home_image_ID, 'full' ); // Get the image attributes of the default image
87
+ $width = $image_attributes[1]; // Get the width
88
+ $height = $image_attributes[2]; // Get the height
89
+ ?>
90
+
91
+ <input id="default_fb_thumb" name="default_fb_thumb" type="text" value="<?php if($fbt_value) { esc_attr_e( $fbt_value ); } ?>" />
92
+ <input id="default_fb_thumb_button" class="upload-button button" name="default_fb_thumb_button" type="text" value="<?php _e( 'Browse', 'facebook-thumb-fixer' ); ?>" />
93
+ <script>
94
+ // Media uploader
95
+ jQuery(document).ready(function($) {
96
+ var _custom_media = true,
97
+ _orig_send_attachment = wp.media.editor.send.attachment;
98
+
99
+ $('.upload-button').click(function(e) {
100
+ var send_attachment_bkp = wp.media.editor.send.attachment;
101
+ var button = $(this);
102
+ var id = button.attr('id').replace('_button', '');
103
+ _custom_media = true;
104
+ wp.media.editor.send.attachment = function(props, attachment){
105
+ if ( _custom_media ) {
106
+ $("#"+id).val(attachment.url);
107
+ } else {
108
+ return _orig_send_attachment.apply( this, [props, attachment] );
109
+ };
110
+ }
111
+
112
+ wp.media.editor.open(button);
113
+ return false;
114
+ });
115
+
116
+ $('.add_media').on('click', function(){
117
+ _custom_media = false;
118
+ });
119
+ });
120
+ </script>
121
+ <?php wp_enqueue_media(); ?>
122
+
123
+ <p class="description">
124
+ <?php echo sprintf( __( 'Browse to the preferred Facebook image for your homepage. Facebook <a href="%1$s" target="_blank">recommends</a> your image be 1200 x 630 or 600 x 315.', 'facebook-thumb-fixer' ), $fb_URL) ?>
125
+ </p>
126
+
127
+ <?php if ($fbt_value) { ?>
128
+
129
+ <a href="<?php echo $fbt_value; ?>?TB_iframe=true&width=600&height=550" class="thickbox">
130
+ <img src="<?php echo $fbt_value; ?>" class="thickbox ftf-preview" /></a>
131
+
132
+ <?php if ($width < 600 || $height < 315) { ?>
133
+ <p class="ftf-warning">
134
+ <?php echo sprintf( __( '<strong>Oops! </strong>Your default Facebook image is smaller than the minimum 600 x 315 <a href="%1$s" target="_blank">recommended</a> by Facebook.', 'facebook-thumb-fixer' ), $fb_URL) ?>
135
+ </p>
136
+ <?php } else { ?>
137
+ <p class="description good">
138
+ <span>&#10004</span> <?php echo sprintf( __( 'Your default Facebook image has dimensions of at least 600 x 315 (actual dimensions are %1$s x %2$s).', 'facebook-thumb-fixer' ), $width, $height) ?>
139
+ </p>
140
+ <?php }
141
+ }
142
+ }
143
+ }
144
+
145
+ // Add Facebook App ID field into the general settings page
146
+ $general_setting_fb_app_ID = new general_setting_fb_app_ID();
147
+ class general_setting_fb_app_ID {
148
+ function general_setting_fb_app_ID( ) {
149
+ add_filter( 'admin_init' , array( &$this , 'register_fields' ) );
150
+ }
151
+ function register_fields() {
152
+ register_setting( 'general', 'fb_app_ID', 'esc_attr' );
153
+ add_settings_field('faid', '<label for="fb_app_ID" id="fb_app_ID">' . __('Facebook App ID' , 'facebook-thumb-fixer' ).'</label>' , array(&$this, 'fb_app_ID_field') , 'general' );
154
+ }
155
+ function fb_app_ID_field() {
156
+ $fbaid_value = get_option( 'fb_app_ID', '' ); ?>
157
+
158
+ <input type="text" id="fb_app_ID" class="regular-text ltr" name="fb_app_ID" value="<?php echo $fbaid_value; ?>" />
159
+ <?php $fb_app_ID_URL = 'https://developers.facebook.com/apps/'; ?>
160
+ <p class="description"><?php echo sprintf( __( 'Find your Facebook App ID <a href="%1$s" target="_blank">here</a>.', 'facebook-thumb-fixer' ), $fb_app_ID_URL); ?></p>
161
+
162
+ <?php }
163
+ }
164
+
165
+
166
+ // Add object type selection into the general settings page
167
+ $general_setting_object_type = new general_setting_object_type();
168
+ class general_setting_object_type {
169
+ function general_setting_object_type( ) {
170
+ add_filter( 'admin_init' , array( &$this , 'register_object_type' ) );
171
+ }
172
+ function register_object_type() {
173
+ register_setting( 'general', 'homepage_object_type', 'esc_attr' );
174
+ add_settings_field('object_type', '<label for="homepage_object_type">' . __('Homepage Object Type' , 'facebook-thumb-fixer' ) . '</label>' , array(&$this, 'ot_fields_html') , 'general' );
175
+ }
176
+ function ot_fields_html() { ?>
177
+
178
+ <?php
179
+ $hpot = get_option( 'homepage_object_type', '');
180
+ ?>
181
+ <select value="homepage_object_type" name="homepage_object_type"<?php if($hpot == "") { echo " class='no-object-type'"; } ?>>
182
+ <option></option>
183
+ <option value="article"<?php if($hpot == "article") { echo " selected"; } ?>>article</option>
184
+ <option value="book"<?php if($hpot == "book") { echo " selected"; } ?>>book</option>
185
+ <option value="books.author"<?php if($hpot == "books.author") { echo " selected"; } ?>>books.author</option>
186
+ <option value="business.business"<?php if($hpot == "business.business") { echo " selected"; } ?>>business.business</option>
187
+ <option value="fitness.course"<?php if($hpot == "fitness.course") { echo " selected"; } ?>>fitness.course</option>
188
+ <option value="fitness.unit"<?php if($hpot == "fitness.unit") { echo " selected"; } ?>>fitness.unit</option>
189
+ <option value="music.album"<?php if($hpot == "music.album") { echo " selected"; } ?>>music.album</option>
190
+ <option value="music.playlist"<?php if($hpot == "music.playlist") { echo " selected"; } ?>>music.playlist</option>
191
+ <option value="music.radio_station"<?php if($hpot == "music.radio_station") { echo " selected"; } ?>>music.radio_station</option>
192
+ <option value="music.song"<?php if($hpot == "music.song") { echo " selected"; } ?>>music.song</option>
193
+ <option value="place"<?php if($hpot == "place") { echo " selected"; } ?>>place</option>
194
+ <option value="product"<?php if($hpot == "product") { echo " selected"; } ?>>product</option>
195
+ <option value="product.group"<?php if($hpot == "product.group") { echo " selected"; } ?>>product.group</option>
196
+ <option value="profile"<?php if($hpot == "profile") { echo " selected"; } ?>>profile</option>
197
+ <option value="restaurant.restaurant"<?php if($hpot == "restaurant.restaurant") { echo " selected"; } ?>>restaurant.restaurant</option>
198
+ <option value="video.episode"<?php if($hpot == "video.episode") { echo " selected"; } ?>>video.episode</option>
199
+ <option value="video.movie"<?php if($hpot == "video.movie") { echo " selected"; } ?>>video.movie</option>
200
+ <option value="video.other"<?php if($hpot == "video.other") { echo " selected"; } ?>>video.other</option>
201
+ <option value="video.tv_show"<?php if($hpot == "video.tv_show") { echo " selected"; } ?>>video.tv_show</option>
202
+ <option value="website"<?php if($hpot == "website") { echo " selected"; } ?>>website</option>
203
+ </select>
204
+
205
+ <?php $fb_object_types_URL = 'https://developers.facebook.com/docs/reference/opengraph'; ?>
206
+ <p><?php echo sprintf( __( 'Learn about Object Types <a href="%1$s" target="_blank">here</a>.', 'facebook-thumb-fixer' ), $fb_object_types_URL); ?></p>
207
+
208
+ <?php
209
+ $fbt_value = get_option( 'default_fb_thumb');
210
+ list($width, $height) = @getimagesize($fbt_value);
211
+ if($fbt_value && ($width >= 600 || $height >= 315)) { ?>
212
+ <?php include(locate_template(plugin_basename( __FILE__ ))) . 'home-preview.php'; ?>
213
+ <?php } else { ?>
214
+ <p class="howto"><?php _e( '<strong>Note: </strong>If no selection is made, the Object Type for your home page will be "website".', 'facebook-thumb-fixer' ); ?></p>
215
+ <?php } ?>
216
+
217
+ <?php }
218
+ }
219
+
220
+ // Add metabox for Object Types
221
+ class ftf_otmeta {
222
+
223
+ var $plugin_dir;
224
+ var $plugin_url;
225
+
226
+ function __construct() {
227
+
228
+ add_action( 'add_meta_boxes', array( $this, 'ftf_open_type_post_meta_box' ) );
229
+ add_action( 'add_meta_boxes', array( $this, 'ftf_open_type_page_meta_box' ) );
230
+ add_action( 'save_post', array($this, 'save_data') );
231
+ }
232
+
233
+ // Add the meta box to the POSTS sidebar
234
+ function ftf_open_type_post_meta_box(){
235
+ add_meta_box(
236
+ 'object_type'
237
+ ,'Facebook Thumb Fixer'
238
+ ,array( &$this, 'meta_box_content' )
239
+ ,'post'
240
+ ,'side'
241
+ ,'default'
242
+ );
243
+ }
244
+
245
+ // Add the meta box to the PAGES sidebar
246
+ function ftf_open_type_page_meta_box(){
247
+ add_meta_box(
248
+ 'object_type'
249
+ ,'Facebook Thumb Fixer'
250
+ ,array( &$this, 'meta_box_content' )
251
+ ,'page'
252
+ ,'side'
253
+ ,'default'
254
+ );
255
+ }
256
+
257
+ function meta_box_content(){
258
+ global $post;
259
+ // Use nonce for verification
260
+ wp_nonce_field( plugin_basename( __FILE__ ), 'ftf_open_type__nounce' ); ?>
261
+
262
+ <?php
263
+ $ot = get_post_meta($post->ID, "ftf_open_type", TRUE);
264
+ $dog = get_post_meta($post->ID, "disable_open_graph", TRUE);
265
+ $current_screen = get_current_screen();
266
+
267
+ if ($current_screen ->id === 'post') {
268
+ $post_type_label = 'post';
269
+ } else if ($current_screen ->id === 'page') {
270
+ $post_type_label = 'page';
271
+ } else {
272
+ $post_type_label = '';
273
+ }
274
+ ?>
275
+ <p><strong>Object Type</strong></p>
276
+ <select name="ftf_open_type_field" style="width:100%;">
277
+ <option></option>
278
+ <option value="article"<?php if($ot == "article") { echo " selected"; } ?>>article</option>
279
+ <option value="book"<?php if($ot == "book") { echo " selected"; } ?>>book</option>
280
+ <option value="books.author"<?php if($ot == "books.author") { echo " selected"; } ?>>books.author</option>
281
+ <option value="business.business"<?php if($ot == "business.business") { echo " selected"; } ?>>business.business</option>
282
+ <option value="fitness.course"<?php if($ot == "fitness.course") { echo " selected"; } ?>>fitness.course</option>
283
+ <option value="fitness.unit"<?php if($ot == "fitness.unit") { echo " selected"; } ?>>fitness.unit</option>
284
+ <option value="music.album"<?php if($ot == "music.album") { echo " selected"; } ?>>music.album</option>
285
+ <option value="music.playlist"<?php if($ot == "music.playlist") { echo " selected"; } ?>>music.playlist</option>
286
+ <option value="music.radio_station"<?php if($ot == "music.radio_station") { echo " selected"; } ?>>music.radio_station</option>
287
+ <option value="music.song"<?php if($ot == "music.song") { echo " selected"; } ?>>music.song</option>
288
+ <option value="place"<?php if($ot == "place") { echo " selected"; } ?>>place</option>
289
+ <option value="product"<?php if($ot == "product") { echo " selected"; } ?>>product</option>
290
+ <option value="product.group"<?php if($ot == "product.group") { echo " selected"; } ?>>product.group</option>
291
+ <option value="profile"<?php if($ot == "profile") { echo " selected"; } ?>>profile</option>
292
+ <option value="restaurant.restaurant"<?php if($ot == "restaurant.restaurant") { echo " selected"; } ?>>restaurant.restaurant</option>
293
+ <option value="video.episode"<?php if($ot == "video.episode") { echo " selected"; } ?>>video.episode</option>
294
+ <option value="video.movie"<?php if($ot == "video.movie") { echo " selected"; } ?>>video.movie</option>
295
+ <option value="video.other"<?php if($ot == "video.other") { echo " selected"; } ?>>video.other</option>
296
+ <option value="video.tv_show"<?php if($ot == "video.tv_show") { echo " selected"; } ?>>video.tv_show</option>
297
+ <option value="website"<?php if($ot == "website") { echo " selected"; } ?>>website</option>
298
+ </select>
299
+
300
+ <?php $fb_object_types_URL = 'https://developers.facebook.com/docs/reference/opengraph/'; ?>
301
+ <p><?php echo sprintf( __( 'If no selection is made, the Object Type for this %1$s will be "article". Learn about Object Types <a href="%2$s" target="_blank">here</a>.', 'facebook-thumb-fixer' ), $post_type_label, $fb_object_types_URL); ?></p>
302
+
303
+
304
+ <div class="preview-container <?php if($dog == "1") { echo 'hide'; } ?>">
305
+ <?php include(locate_template(plugin_basename( __FILE__ ))) . 'post-preview.php'; ?>
306
+ </div>
307
+
308
+ <p class="disabled-container <?php if($dog !== "1") { echo 'hide'; } ?>"><?php _e( 'Preview and debugging are not possible when open graph tags are disabled.', 'facebook-thumb-fixer' ); ?></p>
309
+
310
+ <p>
311
+ <input type="checkbox" name="disable_open_graph" class="disable_open_graph" value="1" <?php if($dog == "1") { echo " checked"; } ?>>
312
+ <label for="disable_open_graph"><?php echo sprintf( __( "Disable for this %s", "facebook-thumb-fixer" ), $post_type_label); ?></label>
313
+ </p>
314
+
315
+ <script type="text/javascript">
316
+ jQuery(".disable_open_graph").click(function() {
317
+ if(jQuery(this).is(":checked")) {
318
+ jQuery(".preview-container").fadeOut();
319
+ jQuery(".disabled-container").fadeIn();
320
+ } else {
321
+ jQuery(".preview-container").fadeIn();
322
+ jQuery(".disabled-container").fadeOut();
323
+ }
324
+ });
325
+ </script>
326
+
327
+ <?php }
328
+
329
+
330
+ function save_data($post_id) {
331
+
332
+ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
333
+ return;
334
+
335
+ if ( !wp_verify_nonce( $_POST['ftf_open_type__nounce'], plugin_basename( __FILE__ ) ) )
336
+ return;
337
+
338
+ // Check permissions
339
+ if ( 'page' == $_POST['post_type'] ){
340
+ if ( !current_user_can( 'edit_page', $post_id ) )
341
+ return;
342
+ } else {
343
+ if ( !current_user_can( 'edit_post', $post_id ) )
344
+ return;
345
+ }
346
+
347
+ $ftf_open_type_field_data = $_POST['ftf_open_type_field'];
348
+ update_post_meta($post_id, 'ftf_open_type', $ftf_open_type_field_data, $ot);
349
+ //return $ftf_open_type_field_data;
350
+
351
+ $disable_open_graph_data = $_POST['disable_open_graph'];
352
+ update_post_meta($post_id, 'disable_open_graph', $disable_open_graph_data, $dog);
353
+ //return $disable_open_graph_data;
354
+ }
355
+
356
+ }
357
+ $ftf_otmeta = new ftf_otmeta;
358
+
359
+ // Add page into the SETTINGS menu
360
+ add_action( 'admin_menu', 'ftfixer_menu' );
361
+ function ftfixer_menu() {
362
+ $icon_path = plugins_url('images/', __FILE__ ) . 'facebook-admin.png';
363
+ add_menu_page( __( 'FB Thumb Fixer' ), __( 'FB Thumb Fixer' ), 'manage_options', 'facebook-thumb-fixer', 'myfbft_plugin_options' ,$icon_path);
364
+ }
365
+ function myfbft_plugin_options() {
366
+ if ( !current_user_can( 'read' ) ) { // This help page is accessible to anyone
367
+ wp_die( __( 'You do not have sufficient permissions to access this page.', 'facebook-thumb-fixer' ) );
368
+ } ?>
369
+
370
+ <div class="wrap ftf-wrap">
371
+ <h2>Facebook Thumb Fixer</h2>
372
+ <?php
373
+ $fbt_value = get_option( 'default_fb_thumb');
374
+ if ($fbt_value) {
375
+ list($width, $height) = @getimagesize($fbt_value); ?>
376
+
377
+ <?php $settings_URL = get_admin_url() . 'options-general.php#dfb'; ?>
378
+ <p class="ftf-good">&#10004; <?php echo sprintf( __( 'Well done! You have a default Facebook thumbnail set. You can change it any time <a href="%1$s">here</a>.', 'facebook-thumb-fixer' ), $settings_URL); ?></p>
379
+
380
+ <h2><?php _e( 'Homepage Preview', 'facebook-thumb-fixer' ); ?></h2>
381
+ <p><?php _e( 'This is an approximate preview of your homepage when shared on Facebook:', 'facebook-thumb-fixer' ); ?></p>
382
+
383
+ <div class="ftf-live-home-preview">
384
+ <img src="<?php echo plugins_url('images/', __FILE__ ) . 'preview-top.png'; ?>" />
385
+
386
+ <div class="ftf-preview-details">
387
+
388
+ <div class="overflow home-thumb-image">
389
+ <img src="<?php if($fbt_value) { esc_attr_e( $fbt_value ); } ?>" />
390
+ </div>
391
+
392
+ <h1><?php echo get_bloginfo( 'name' ); ?></h1>
393
+
394
+ <p>
395
+ <?php
396
+ $description = get_bloginfo( 'description' );
397
+ if ( $description ) {
398
+ $excerpt_chars = substr($description, 0, 150);
399
+ echo strip_tags($excerpt_chars);
400
+ }
401
+ ?>
402
+ </p>
403
+ <span class="ftf-domain"><?php echo $_SERVER['SERVER_NAME']; ?></span>
404
+ </div>
405
+ </div>
406
+
407
+ <?php
408
+ $fbt_value = get_option( 'default_fb_thumb');
409
+ $fb_URL = 'https://developers.facebook.com/docs/sharing/best-practices#images';
410
+ $home_image_ID = attachment_url_to_postid( $fbt_value ); // Get the ID of the default image
411
+ $image_attributes = wp_get_attachment_image_src( $attachment_id = $home_image_ID, 'full' ); // Get the image attributes of the default image
412
+ $width = $image_attributes[1]; // Get the width
413
+ $height = $image_attributes[2]; // Get the height
414
+ ?>
415
+ <p class="description">
416
+ <?php echo sprintf( __( '<strong>Note: </strong>Facebook <a href="%1$s" target="_blank">recommends</a> your image be 1200 x 630 or 600 x 315.', 'facebook-thumb-fixer' ), $fb_URL); ?>
417
+ <?php if ($width >= 600 && $height >= 315) { ?>
418
+ <?php echo sprintf( __( 'Your image (shown here scaled down) appears to be good at %1$s x %2$s.', 'facebook-thumb-fixer' ), $width, $height); ?>
419
+ <?php } ?>
420
+ </p>
421
+
422
+ <?php
423
+ if ($width < 600 || $height < 315) { ?>
424
+ <p class="ftf-warning">
425
+ <?php echo sprintf( __('<strong>Oops! </strong>Although you do have a default Facebook thumbnail, the dimensions are smaller than the minimum 600 x 315 <a href="%1$s" target="_blank">recommended</a> by Facebook.', 'facebook-thumb-fixer' ), $fb_URL); ?>
426
+ </p>
427
+ <?php }
428
+ } else {
429
+ $settings_URL = get_admin_url() . 'options-general.php#dfb';
430
+ ?>
431
+
432
+ <p class="ftf-bad"><?php echo sprintf( __( 'You currently do not have a Default Facebook Thumbnail set. Set one <a href="%1$s">here</a>.', 'facebook-thumb-fixer' ), $settings_URL); ?></p>
433
+
434
+ <?php } ?>
435
+
436
+ <script>
437
+ // Toggle support answers
438
+ jQuery(function($) {
439
+ //hide the all of these elements
440
+ $(".help-answer").hide();
441
+ //toggle the componenet with the H2
442
+ $(".topic").click(function(){
443
+ $(this).next(".help-answer").slideToggle(150);
444
+ });
445
+
446
+ $(document).ready(function () {
447
+ $('.topic').click(function () {
448
+ $(this).toggleClass('open-help');
449
+ });
450
+ });
451
+
452
+ });
453
+ </script>
454
+ <h3><?php _e( 'Where can I get support?', 'facebook-thumb-fixer' ); ?></h3>
455
+ <?php $support_URL = 'https://wordpress.org/support/plugin/facebook-thumb-fixer'; ?>
456
+ <p><?php echo sprintf( __( 'Reach for support at the <a href="%1$s" target="_blank">Wordpress plug-in repo</a>.', 'facebook-thumb-fixer' ), $support_URL) ?></p>
457
+
458
+ </div>
459
+
460
+ <?php require_once('my-tools.php'); ?>
461
+
462
+ <?php }
463
+ add_action('wp_head', 'fbfixhead');
464
+ function fbfixhead() {
465
+
466
+ // Required for is_plugin_active to work.
467
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
468
+
469
+ // If BuddyPress is active
470
+ if ( is_plugin_active( 'buddypress/bp-loader.php' ) ) {
471
+
472
+ // If not on a BuddyPress members page
473
+ if (!bp_current_component('members')) {
474
+ require('output-logic.php');
475
+ }
476
+
477
+ }
478
+
479
+ // Otherwie, if BuddyPress is NOT active...
480
+ else if ( !is_plugin_active( 'buddypress/bp-loader.php' ) ) {
481
+ require('output-logic.php');
482
+ }
483
+
484
+ echo $ftf_head;
485
+ print "\n";
486
+ $fbaid_value = get_option('fb_app_ID');
487
+ if (!empty($fbaid_value)) { ?>
488
+ <meta property="fb:app_id" content="<?php echo get_option('fb_app_ID'); ?>" />
489
+ <?php }
490
+ print "\n";
491
+ }
css/ftf.css ADDED
@@ -0,0 +1 @@
 
1
+ #dfb{position:relative}#default_fb_thumb{width:50%}.no-fb-thumb,.no-object-type{border-bottom:solid 2px #e34c6b!important}.ftf-tick{font-size:25px;color:#7ad03a}.ftf-preview{width:315px!important;height:auto!important;margin:15px 0;display:block}.ftf-header{padding:25px 0 0 0;margin:25px 0 20px 0}#toplevel_page_facebook-thumb-fixer img{width:16px;height:16px}.home-thumb-image{display:block;height:250px}.home-thumb-image img{width:100%;height:auto;display:block;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.disabled-container.hide,.preview-container.hide{display:none}.disabled-container{padding:10px;border:dashed 1px rgba(189, 21, 80, 0.1);background:rgba(189, 21, 80, 0.05)}.ftf-live-home-preview,.ftf-live-preview{display:none;width:470px;padding:18px;background:#fff;position:fixed;left:calc(50% - 235px);top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);z-index:9999999;-webkit-box-shadow:0 0 30px rgba(0, 0, 0, 0.4);box-shadow:0 0 30px rgba(0, 0, 0, 0.4)}.ftf-live-home-preview.show-ftf-live-preview,.ftf-live-preview.show-ftf-live-preview{display:block}.ftf-live-home-preview .wp-post-image,.ftf-live-preview .wp-post-image{width:468px;height:auto;display:block}.ftf-live-home-preview .ftf-preview-details,.ftf-live-preview .ftf-preview-details{padding:10px;border:solid 1px #e5e5e5}.ftf-live-home-preview .ftf-preview-details h1,.ftf-live-preview .ftf-preview-details h1{font-weight:normal;font-size:18px;font-family:Georgia, 'lucida grande', tahoma, verdana, arial, sans-serif;margin:0 0 10px 0;color:#000;padding:0}.ftf-live-home-preview .ftf-preview-details img,.ftf-live-preview .ftf-preview-details img{display:block;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.ftf-live-home-preview .ftf-preview-details p,.ftf-live-preview .ftf-preview-details p{font-size:12px;line-height:16px;font-family:helvetica, arial, 'lucida grande', sans-serif;margin:0;color:#000}.ftf-live-home-preview .ftf-preview-details .ftf-domain,.ftf-live-preview .ftf-preview-details .ftf-domain{font-size:11px;line-height:11px;text-transform:uppercase;display:block;margin:10px 0 0 0;color:#9197a3}.ftf-live-home-preview .ftf-preview-details .overflow,.ftf-live-preview .ftf-preview-details .overflow{width:468px;height:235px;overflow:hidden;margin:0 0 5px 0;border-bottom:solid 1px #e5e5e5;position:relative;top:-10px;left:-10px}#default_fb_thumb_button{width:80px;text-align:center}.ftf-live-home-preview{display:block;position:relative;top:auto;left:auto;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);z-index:2;-webkit-box-shadow:none;box-shadow:none;margin:25px 0}.ftf-live-home-preview .edit{display:none;line-height:1em}.ftf-live-home-preview:hover .edit{display:inline-block;position:relative}.ftf-live-home-preview .thickbox img{width:calc(100% + 20px);padding:0;margin:0;position:relative;top:-10px;left:-10px;display:block}.ftf-live-home-preview h1 a{font-size:.65em;font-family:sans-serif}.debugger-button,.no-thumb-set,.open-ftf-preview{background:#3b5998;color:#fff;padding:5px 10px;text-decoration:none;border-radius:3px;text-align:center;cursor:pointer;display:inline-block}.debugger-button:hover,.no-thumb-set:hover,.open-ftf-preview:hover{color:#fff;background:#00a0d2}.debugger-button:active,.no-thumb-set:active,.open-ftf-preview:active{color:#fff}.debugger-button::-moz-selection,.no-thumb-set::-moz-selection,.open-ftf-preview::-moz-selection{color:#fff}.debugger-button::selection,.no-thumb-set::selection,.open-ftf-preview::selection{color:#fff}.debugger-button{width:67px;background:#ce3895;-webkit-box-sizing:border-box;box-sizing:border-box}.debugger-button:hover{background:#f058b6}.homepage-debug{background:#ce3895;color:#fff;padding:5px 10px;text-decoration:none;border-radius:3px;text-align:center;cursor:pointer;display:inline-block}.homepage-debug:hover{color:#fff;background:#f058b6}.homepage-debug:active{color:#fff}.homepage-debug::-moz-selection{color:#fff}.homepage-debug::selection{color:#fff}.ftf-rule{margin:15px 0;height:1px;border-top:dashed 1px #ccc}.ftf-warning{padding:10px;color:#fff;background:#e81144;border-radius:2px}.ftf-warning a{color:#fff}.good span{display:inline-block;width:15px;height:15px;border-radius:100%;background:#2CBB5F;color:#fff;font-size:.8em;font-style:normal;text-align:center}.no-thumb-set{background:#ccc}.ftf-mask{position:fixed;top:0;left:0;width:100%;height:100%;background:#3b5998;opacity:.7;z-index:999999!important;display:none}.ftf-mask.show-ftf-mask{display:block}.ftf-help{margin:0 340px 0 0}.topic{padding:5px 0;margin:0;font-weight:bold;cursor:pointer}.open-help{color:#0074a2}.help-answer{border-bottom:dashed 1px #ccc;padding:0 0 20px 25px;margin:0 0 20px 0}.help-answer h4{color:#0074a2}.task-rocket{position:fixed;bottom:0;right:-5px;width:270px;height:540px;text-indent:-9999em;display:block;-webkit-box-shadow:rgba(0, 0, 0, 0.0980392) 0px 1px 1px 0px;box-shadow:rgba(0, 0, 0, 0.0980392) 0px 1px 1px 0px;margin:55px 25px 0 0;z-index:9;-webkit-box-sizing:border-box;box-sizing:border-box;background:url("../images/task-rocket.png") no-repeat;background-size:cover;border-top-left-radius:5px;border-top-right-radius:5px}.task-rocket h3{color:#fff;text-align:center;text-transform:uppercase;font-size:2em;margin:0}.task-rocket p{margin:25px 0}.task-rocket a{display:block;width:195px;margin:10px auto 0 auto;font-weight:bold;text-transform:uppercase;color:#fff;background:#fab13f;border-bottom:solid 3px #e89b22;padding:14px 0;text-decoration:none;text-align:center;border-radius:3px}.ftf-good{background:#fff;padding:15px;-webkit-box-sizing:border-box;box-sizing:border-box;width:calc(100% - 300px)}@media only screen and (max-width:960px){.ftf-good{width:100%}}.ftf-bad{background:#e34c6b;color:#fff;padding:15px}.ftf-bad a{color:#fff}.my-stuff::-webkit-scrollbar{width:10px;background-color:rgba(255, 255, 255, 0.6)}.my-stuff::-webkit-scrollbar-thumb{background-color:#cb8ada;border-radius:10px}.my-stuff{display:block;width:300px;height:100%;background:#9a6db2;position:fixed;top:30px;right:0;text-align:center;padding:25px;-webkit-box-sizing:border-box;box-sizing:border-box;color:#fff;box-sizing:border-box;overflow:auto;-webkit-overflow-scrolling:touch}@media only screen and (max-width:960px){.my-stuff{position:relative;top:auto;right:auto;width:calc(100% - 25px);margin:25px 0 0 0}}.my-stuff strong{font-weight:bold}.my-stuff ul{margin:0;padding:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.my-stuff ul a{color:#fff;text-decoration:none}.my-stuff ul li{list-style:none;margin:0 0 25px 0;padding:0}.my-stuff ul li span{display:block;text-align:center;margin:5px 0 0 0}.my-stuff ul img{display:block;width:100%;-webkit-box-shadow:10px 10px 30px 0 rgba(0, 0, 0, 0.2);box-shadow:10px 10px 30px 0 rgba(0, 0, 0, 0.2)}.rocket-apps-logo{display:block;width:125px;margin:20px auto 0 auto}.testimonial{line-height:1.4em;border-bottom:dashed 1px rgba(255, 255, 255, 0.2);margin:0;padding:25px 0}.testimonial img{width:60px;margin:0 auto;display:block}.testimonial a{color:#fff}.testimonial span{display:block}.testimonial .title{display:block;opacity:.7}.testimonial em{font-style:normal;font-weight:bold}.testimonial .name{margin:3px 0}.cta{display:block;padding:15px;text-align:center;color:#fff;background:#ff9800;border-radius:4px;-webkit-box-shadow:10px 10px 30px 0 rgba(0, 0, 0, 0.2);box-shadow:10px 10px 30px 0 rgba(0, 0, 0, 0.2);text-decoration:none;margin:25px auto;font-weight:bold;max-width:150px}.cta:hover{color:#fff}
css/ftf.scss ADDED
@@ -0,0 +1,548 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #dfb {
2
+ position: relative
3
+ }
4
+
5
+ #default_fb_thumb {
6
+ width: 50%
7
+ }
8
+
9
+ .no-fb-thumb,
10
+ .no-object-type {
11
+ border-bottom: solid 2px #e34c6b!important
12
+ }
13
+
14
+ .ftf-tick {
15
+ font-size: 25px;
16
+ color: #7ad03a
17
+ }
18
+
19
+ .ftf-preview {
20
+ width: 315px!important;
21
+ height: auto!important;
22
+ margin: 15px 0;
23
+ display: block
24
+ }
25
+
26
+ .ftf-header {
27
+ padding: 25px 0 0 0;
28
+ margin: 25px 0 20px 0
29
+ }
30
+
31
+ #toplevel_page_facebook-thumb-fixer img {
32
+ width: 16px;
33
+ height: 16px
34
+ }
35
+
36
+ .home-thumb-image {
37
+ display: block;
38
+ height: 250px
39
+ }
40
+
41
+ .home-thumb-image {
42
+ img {
43
+ width: 100%;
44
+ height: auto;
45
+ display: block;
46
+ position: absolute;
47
+ top: 50%;
48
+ -webkit-transform: translateY(-50%);
49
+ -ms-transform: translateY(-50%);
50
+ transform: translateY(-50%)
51
+ }
52
+ }
53
+
54
+ .disabled-container.hide,
55
+ .preview-container.hide {
56
+ display: none
57
+ }
58
+
59
+ .disabled-container {
60
+ padding: 10px;
61
+ border: dashed 1px rgba(189, 21, 80, 0.1);
62
+ background: rgba(189, 21, 80, 0.05)
63
+ }
64
+
65
+ .ftf-live-home-preview,
66
+ .ftf-live-preview {
67
+ display: none;
68
+ width: 470px;
69
+ padding: 18px;
70
+ background: #fff;
71
+ position: fixed;
72
+ left: calc(50% - 235px);
73
+ top: 50%;
74
+ -webkit-transform: translateY(-50%);
75
+ -ms-transform: translateY(-50%);
76
+ transform: translateY(-50%);
77
+ z-index: 9999999;
78
+ -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
79
+ box-shadow: 0 0 30px rgba(0, 0, 0, 0.4)
80
+ }
81
+
82
+ .ftf-live-home-preview.show-ftf-live-preview,
83
+ .ftf-live-preview.show-ftf-live-preview {
84
+ display: block
85
+ }
86
+
87
+ .ftf-live-home-preview .wp-post-image,
88
+ .ftf-live-preview .wp-post-image {
89
+ width: 468px;
90
+ height: auto;
91
+ display: block
92
+ }
93
+
94
+ .ftf-live-home-preview .ftf-preview-details,
95
+ .ftf-live-preview .ftf-preview-details {
96
+ padding: 10px;
97
+ border: solid 1px #e5e5e5
98
+ }
99
+
100
+ .ftf-live-home-preview .ftf-preview-details h1,
101
+ .ftf-live-preview .ftf-preview-details h1 {
102
+ font-weight: normal;
103
+ font-size: 18px;
104
+ font-family: Georgia, 'lucida grande', tahoma, verdana, arial, sans-serif;
105
+ margin: 0 0 10px 0;
106
+ color: #000;
107
+ padding: 0
108
+ }
109
+
110
+ .ftf-live-home-preview .ftf-preview-details img,
111
+ .ftf-live-preview .ftf-preview-details img {
112
+ display: block;
113
+ position: absolute;
114
+ top: 50%;
115
+ -webkit-transform: translateY(-50%);
116
+ -ms-transform: translateY(-50%);
117
+ transform: translateY(-50%)
118
+ }
119
+
120
+ .ftf-live-home-preview .ftf-preview-details p,
121
+ .ftf-live-preview .ftf-preview-details p {
122
+ font-size: 12px;
123
+ line-height: 16px;
124
+ font-family: helvetica, arial, 'lucida grande', sans-serif;
125
+ margin: 0;
126
+ color: #000
127
+ }
128
+
129
+ .ftf-live-home-preview .ftf-preview-details .ftf-domain,
130
+ .ftf-live-preview .ftf-preview-details .ftf-domain {
131
+ font-size: 11px;
132
+ line-height: 11px;
133
+ text-transform: uppercase;
134
+ display: block;
135
+ margin: 10px 0 0 0;
136
+ color: #9197a3
137
+ }
138
+
139
+ .ftf-live-home-preview .ftf-preview-details .overflow,
140
+ .ftf-live-preview .ftf-preview-details .overflow {
141
+ width: 468px;
142
+ height: 235px;
143
+ overflow: hidden;
144
+ margin: 0 0 5px 0;
145
+ border-bottom: solid 1px #e5e5e5;
146
+ position: relative;
147
+ top: -10px;
148
+ left: -10px
149
+ }
150
+
151
+ #default_fb_thumb_button {
152
+ width: 80px;
153
+ text-align: center
154
+ }
155
+
156
+ .ftf-live-home-preview {
157
+ display: block;
158
+ position: relative;
159
+ top: auto;
160
+ left: auto;
161
+ -webkit-transform: translateY(0);
162
+ -ms-transform: translateY(0);
163
+ transform: translateY(0);
164
+ z-index: 2;
165
+ -webkit-box-shadow: none;
166
+ box-shadow: none;
167
+ margin: 25px 0
168
+ }
169
+
170
+ .ftf-live-home-preview .edit {
171
+ display: none;
172
+ line-height: 1em
173
+ }
174
+
175
+ .ftf-live-home-preview:hover .edit {
176
+ display: inline-block;
177
+ position: relative
178
+ }
179
+
180
+ .ftf-live-home-preview .thickbox img {
181
+ width: calc(100% + 20px);
182
+ padding: 0;
183
+ margin: 0;
184
+ position: relative;
185
+ top: -10px;
186
+ left: -10px;
187
+ display: block
188
+ }
189
+
190
+ .ftf-live-home-preview h1 a {
191
+ font-size: .65em;
192
+ font-family: sans-serif
193
+ }
194
+
195
+ .debugger-button,
196
+ .no-thumb-set,
197
+ .open-ftf-preview {
198
+ background: #3b5998;
199
+ color: #fff;
200
+ padding: 5px 10px;
201
+ text-decoration: none;
202
+ border-radius: 3px;
203
+ text-align: center;
204
+ cursor: pointer;
205
+ display: inline-block
206
+ }
207
+
208
+ .debugger-button:hover,
209
+ .no-thumb-set:hover,
210
+ .open-ftf-preview:hover {
211
+ color: #fff;
212
+ background: #00a0d2
213
+ }
214
+
215
+ .debugger-button:active,
216
+ .no-thumb-set:active,
217
+ .open-ftf-preview:active {
218
+ color: #fff
219
+ }
220
+
221
+ .debugger-button::-moz-selection,
222
+ .no-thumb-set::-moz-selection,
223
+ .open-ftf-preview::-moz-selection {
224
+ color: #fff
225
+ }
226
+
227
+ .debugger-button::selection,
228
+ .no-thumb-set::selection,
229
+ .open-ftf-preview::selection {
230
+ color: #fff
231
+ }
232
+
233
+ .debugger-button {
234
+ width: 67px;
235
+ background: #ce3895;
236
+ -webkit-box-sizing: border-box;
237
+ box-sizing: border-box
238
+ }
239
+
240
+ .debugger-button:hover {
241
+ background: #f058b6
242
+ }
243
+
244
+ .homepage-debug {
245
+ background: #ce3895;
246
+ color: #fff;
247
+ padding: 5px 10px;
248
+ text-decoration: none;
249
+ border-radius: 3px;
250
+ text-align: center;
251
+ cursor: pointer;
252
+ display: inline-block
253
+ }
254
+
255
+ .homepage-debug:hover {
256
+ color: #fff;
257
+ background: #f058b6
258
+ }
259
+
260
+ .homepage-debug:active {
261
+ color: #fff
262
+ }
263
+
264
+ .homepage-debug::-moz-selection {
265
+ color: #fff
266
+ }
267
+
268
+ .homepage-debug::selection {
269
+ color: #fff
270
+ }
271
+
272
+ .ftf-rule {
273
+ margin: 15px 0;
274
+ height: 1px;
275
+ border-top: dashed 1px #ccc
276
+ }
277
+
278
+ .ftf-warning {
279
+ padding: 10px;
280
+ color: #fff;
281
+ background: #e81144;
282
+ border-radius: 2px
283
+ }
284
+
285
+ .ftf-warning a {
286
+ color: #fff
287
+ }
288
+
289
+ .good span {
290
+ display: inline-block;
291
+ width: 15px;
292
+ height: 15px;
293
+ border-radius: 100%;
294
+ background: #2CBB5F;
295
+ color: #fff;
296
+ font-size: .8em;
297
+ font-style: normal;
298
+ text-align: center
299
+ }
300
+
301
+ .no-thumb-set {
302
+ background: #ccc
303
+ }
304
+
305
+ .ftf-mask {
306
+ position: fixed;
307
+ top: 0;
308
+ left: 0;
309
+ width: 100%;
310
+ height: 100%;
311
+ background: #3b5998;
312
+ opacity: .7;
313
+ z-index: 999999!important;
314
+ display: none
315
+ }
316
+
317
+ .ftf-mask.show-ftf-mask {
318
+ display: block
319
+ }
320
+
321
+ .ftf-help {
322
+ margin: 0 340px 0 0
323
+ }
324
+
325
+ .topic {
326
+ padding: 5px 0;
327
+ margin: 0;
328
+ font-weight: bold;
329
+ cursor: pointer
330
+ }
331
+
332
+ .open-help {
333
+ color: #0074a2
334
+ }
335
+
336
+ .help-answer {
337
+ border-bottom: dashed 1px #ccc;
338
+ padding: 0 0 20px 25px;
339
+ margin: 0 0 20px 0
340
+ }
341
+
342
+ .help-answer h4 {
343
+ color: #0074a2
344
+ }
345
+
346
+ .task-rocket {
347
+ position: fixed;
348
+ bottom: 0;
349
+ right: -5px;
350
+ width: 270px;
351
+ height: 540px;
352
+ text-indent: -9999em;
353
+ display: block;
354
+ -webkit-box-shadow: rgba(0, 0, 0, 0.0980392) 0px 1px 1px 0px;
355
+ box-shadow: rgba(0, 0, 0, 0.0980392) 0px 1px 1px 0px;
356
+ margin: 55px 25px 0 0;
357
+ z-index: 9;
358
+ -webkit-box-sizing: border-box;
359
+ box-sizing: border-box;
360
+ background: url("../images/task-rocket.png") no-repeat;
361
+ background-size: cover;
362
+ border-top-left-radius: 5px;
363
+ border-top-right-radius: 5px
364
+ }
365
+
366
+ .task-rocket h3 {
367
+ color: #fff;
368
+ text-align: center;
369
+ text-transform: uppercase;
370
+ font-size: 2em;
371
+ margin: 0
372
+ }
373
+
374
+ .task-rocket p {
375
+ margin: 25px 0
376
+ }
377
+
378
+ .task-rocket a {
379
+ display: block;
380
+ width: 195px;
381
+ margin: 10px auto 0 auto;
382
+ font-weight: bold;
383
+ text-transform: uppercase;
384
+ color: #fff;
385
+ background: #fab13f;
386
+ border-bottom: solid 3px #e89b22;
387
+ padding: 14px 0;
388
+ text-decoration: none;
389
+ text-align: center;
390
+ border-radius: 3px
391
+ }
392
+
393
+ .ftf-good {
394
+ background: #fff;
395
+ padding: 15px;
396
+ box-sizing: border-box;
397
+ width: calc(100% - 300px);
398
+
399
+ @media only screen and (max-width: 960px) {
400
+ width: 100%;
401
+ }
402
+ }
403
+
404
+ .ftf-bad {
405
+ background: #e34c6b;
406
+ color: #fff;
407
+ padding: 15px;
408
+
409
+ a {
410
+ color: #fff
411
+ }
412
+ }
413
+
414
+ // Thinner scrollbars
415
+ .my-stuff::-webkit-scrollbar {
416
+ width: 10px;
417
+ background-color: rgba(#fff, .6);
418
+ }
419
+
420
+ .my-stuff::-webkit-scrollbar-thumb {
421
+ background-color: #cb8ada;
422
+ border-radius: 10px;
423
+ }
424
+
425
+
426
+ .my-stuff {
427
+ display: block;
428
+ width: 300px;
429
+ height: 100%;
430
+ background: #9a6db2;
431
+ position: fixed;
432
+ top: 30px;
433
+ right: 0;
434
+ text-align: center;
435
+ padding: 25px;
436
+ box-sizing: border-box;
437
+ color: #fff;
438
+ box-sizing: border-box;
439
+ overflow: auto;
440
+ -webkit-overflow-scrolling: touch;
441
+
442
+ @media only screen and (max-width: 960px) {
443
+ position: relative;
444
+ top: auto;
445
+ right: auto;
446
+ width: calc(100% - 25px);
447
+ margin: 25px 0 0 0;
448
+ }
449
+
450
+ .valign {
451
+ // position: absolute;
452
+ // top: 50%;
453
+ // transform: translateY(-50%);
454
+ }
455
+
456
+ strong {
457
+ font-weight: bold;
458
+ }
459
+
460
+ ul {
461
+ margin: 0;
462
+ padding: 0;
463
+ display: flex;
464
+ flex-flow: row wrap;
465
+
466
+ a {
467
+ color: #fff;
468
+ text-decoration: none;
469
+ }
470
+
471
+ li {
472
+ list-style: none;
473
+ margin: 0 0 25px 0;
474
+ padding: 0;
475
+
476
+ span {
477
+ display: block;
478
+ text-align: center;
479
+ margin: 5px 0 0 0;
480
+ }
481
+ }
482
+
483
+ img {
484
+ display: block;
485
+ width: 100%;
486
+ box-shadow: 10px 10px 30px 0 rgba(0, 0, 0, 0.2);
487
+ }
488
+ }
489
+ }
490
+
491
+ .rocket-apps-logo {
492
+ display: block;
493
+ width: 125px;
494
+ margin: 20px auto 0 auto;
495
+ }
496
+
497
+ .testimonial {
498
+ line-height: 1.4em;
499
+ border-bottom: dashed 1px rgba(#fff, .2);
500
+ margin: 0;
501
+ padding: 25px 0;
502
+
503
+ img {
504
+ width: 60px;
505
+ margin: 0 auto;
506
+ display: block;
507
+ }
508
+
509
+ a {
510
+ color: #fff;
511
+ }
512
+
513
+ span {
514
+ display: block;
515
+ }
516
+
517
+ .title {
518
+ display: block;
519
+ opacity: .7;
520
+ }
521
+
522
+ em {
523
+ font-style: normal;
524
+ font-weight: bold;
525
+ }
526
+
527
+ .name {
528
+ margin: 3px 0;
529
+ }
530
+ }
531
+
532
+ .cta {
533
+ display: block;
534
+ padding: 15px;
535
+ text-align: center;
536
+ color: #fff;
537
+ background: #ff9800;
538
+ border-radius: 4px;
539
+ box-shadow: 10px 10px 30px 0 rgba(0, 0, 0, 0.2);
540
+ text-decoration: none;
541
+ margin: 25px auto;
542
+ font-weight: bold;
543
+ max-width: 150px;
544
+
545
+ &:hover {
546
+ color: #fff;
547
+ }
548
+ }
home-preview.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <br />
2
+ <p><a class="open-ftf-preview"><?php _e( 'Homepage Preview', 'facebook-thumb-fixer' ); ?></a> <a href="https://developers.facebook.com/tools/debug/sharing/?q=<?php echo get_bloginfo( 'url' ); ?>" target="_blank" class="homepage-debug"><?php _e( 'Debug', 'facebook-thumb-fixer' ); ?></a></p>
3
+ <p class="description"><?php _e( 'View an approximate preview of your homepage when shared on Facebook.', 'facebook-thumb-fixer' ); ?></p>
4
+
5
+ <div class="ftf-live-preview">
6
+ <img src="<?php echo plugins_url('images/', __FILE__ ) . 'preview-top.png'; ?>" />
7
+
8
+ <div class="ftf-preview-details">
9
+
10
+ <?php $fbt_value = get_option( 'default_fb_thumb'); ?>
11
+ <div class="overflow home-thumb-image">
12
+ <img src="<?php if($fbt_value) { esc_attr_e( $fbt_value ); } ?>" />
13
+ </div>
14
+
15
+ <h1><?php echo get_bloginfo( 'name' ); ?></h1>
16
+
17
+ <p>
18
+ <?php
19
+ $description = get_bloginfo( 'description' );
20
+ if ( $description ) {
21
+ $excerpt_chars = substr($description, 0, 150);
22
+ echo strip_tags($excerpt_chars);
23
+ }
24
+ ?>
25
+ </p>
26
+ <span class="ftf-domain"><?php echo $_SERVER['SERVER_NAME']; ?></span>
27
+ </div>
28
+ </div>
29
+
30
+ <div class="ftf-mask"></div>
31
+
32
+ <script>
33
+ // Popup
34
+ jQuery(function($) {
35
+ $('.open-ftf-preview').click(function(){
36
+ $(".ftf-live-preview").toggleClass("show-ftf-live-preview");
37
+ $(".ftf-mask").toggleClass("show-ftf-mask");
38
+ });
39
+ $('.ftf-mask').click(function(){
40
+ $(this).toggleClass("show-ftf-mask");
41
+ $(".ftf-live-preview").toggleClass("show-ftf-live-preview");
42
+ });
43
+ });
44
+ </script>
images/facebook-admin.png ADDED
Binary file
images/facebook.png ADDED
Binary file
images/facundo.png ADDED
Binary file
images/logo-rocket-apps.svg ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="430.848px" height="572.643px" viewBox="0 0 430.848 572.643" enable-background="new 0 0 430.848 572.643"
6
+ xml:space="preserve">
7
+ <g id="Layer_4">
8
+ <g>
9
+ <path fill="#414042" d="M31.536,485.667l-8.712-14.904c-0.385,0.049-0.984,0.072-1.8,0.072H9.648v14.832H0v-50.4h21.024
10
+ c6.527,0,11.567,1.512,15.12,4.535c3.552,3.025,5.328,7.297,5.328,12.816c0,3.938-0.853,7.297-2.556,10.08
11
+ c-1.704,2.785-4.188,4.873-7.452,6.264l11.088,16.705H31.536z M9.648,462.338h11.376c3.647,0,6.432-0.793,8.352-2.377
12
+ c1.919-1.584,2.88-3.936,2.88-7.055c0-3.072-0.961-5.375-2.88-6.912c-1.92-1.537-4.705-2.305-8.352-2.305H9.648V462.338z"/>
13
+ <path fill="#414042" d="M115.956,438.002c4.104,2.256,7.332,5.352,9.684,9.287c2.351,3.938,3.528,8.305,3.528,13.104
14
+ c0,4.801-1.177,9.182-3.528,13.141c-2.353,3.961-5.58,7.092-9.684,9.396s-8.652,3.455-13.644,3.455
15
+ c-4.993,0-9.54-1.15-13.644-3.455s-7.333-5.436-9.684-9.396c-2.352-3.959-3.528-8.34-3.528-13.141
16
+ c0-4.799,1.176-9.166,3.528-13.104c2.352-3.936,5.58-7.031,9.684-9.287s8.651-3.385,13.644-3.385
17
+ C107.303,434.618,111.852,435.747,115.956,438.002z M93.888,445.526c-2.641,1.512-4.729,3.576-6.264,6.191
18
+ c-1.537,2.617-2.304,5.508-2.304,8.676c0,3.17,0.779,6.074,2.34,8.713c1.559,2.641,3.647,4.729,6.264,6.264
19
+ c2.615,1.537,5.459,2.305,8.532,2.305c3.024,0,5.832-0.768,8.424-2.305c2.592-1.535,4.644-3.623,6.156-6.264
20
+ c1.512-2.639,2.268-5.543,2.268-8.713c0-3.168-0.756-6.059-2.268-8.676c-1.512-2.615-3.564-4.68-6.156-6.191
21
+ c-2.592-1.512-5.4-2.268-8.424-2.268C99.383,443.258,96.527,444.014,93.888,445.526z"/>
22
+ <path fill="#414042" d="M193.5,444.987c-2.424-1.152-4.885-1.729-7.38-1.729c-3.121,0-5.976,0.744-8.568,2.232
23
+ c-2.592,1.488-4.633,3.539-6.12,6.156c-1.488,2.615-2.232,5.484-2.232,8.604c0,3.121,0.744,5.988,2.232,8.604
24
+ c1.487,2.617,3.528,4.68,6.12,6.191c2.592,1.512,5.447,2.27,8.568,2.27c2.399,0,4.812-0.529,7.236-1.584
25
+ c2.423-1.057,4.572-2.521,6.444-4.393l5.688,6.336c-2.64,2.688-5.712,4.813-9.216,6.371c-3.504,1.561-7.056,2.34-10.656,2.34
26
+ c-4.849,0-9.288-1.15-13.32-3.455c-4.032-2.305-7.2-5.436-9.504-9.396c-2.304-3.959-3.456-8.34-3.456-13.141
27
+ c0-4.799,1.176-9.166,3.528-13.104c2.352-3.936,5.556-7.031,9.612-9.287c4.056-2.256,8.556-3.385,13.5-3.385
28
+ c3.6,0,7.128,0.721,10.584,2.16s6.408,3.432,8.856,5.977l-5.616,7.055C198.023,447.747,195.923,446.137,193.5,444.987z"/>
29
+ <path fill="#414042" d="M285.768,485.667h-11.592l-15.84-21.6l-7.92,8.711v12.889h-9.648v-50.4h9.648v25.127l22.752-25.127h11.375
30
+ l-19.367,21.313L285.768,485.667z"/>
31
+ <path fill="#414042" d="M320.399,435.266h36.937v8.424h-27.289v12.457h24.48v8.424h-24.48v12.672h28.152v8.424h-37.8V435.266z"/>
32
+ <path fill="#414042" d="M389.735,435.266h41.112v8.568h-15.696v41.832h-9.72v-41.832h-15.696V435.266z"/>
33
+ <path fill="#414042" d="M117,572.067l-4.464-10.656H87.913l-4.464,10.656H73.441l22.104-50.4h10.008l21.816,50.4H117z
34
+ M91.369,553.131h17.712l-8.784-21.168L91.369,553.131z"/>
35
+ <path fill="#414042" d="M196.236,526.202c3.479,3.025,5.22,7.297,5.22,12.816c0,5.76-1.74,10.236-5.22,13.428
36
+ c-3.481,3.193-8.388,4.789-14.724,4.789h-11.016v14.832h-9.648v-50.4h20.664C187.848,521.667,192.755,523.178,196.236,526.202z
37
+ M189.396,546.362c1.944-1.584,2.916-3.936,2.916-7.055c0-3.072-0.972-5.375-2.916-6.912c-1.944-1.537-4.741-2.305-8.388-2.305
38
+ h-10.512v18.648h10.512C184.655,548.739,187.452,547.946,189.396,546.362z"/>
39
+ <path fill="#414042" d="M272.195,526.202c3.479,3.025,5.22,7.297,5.22,12.816c0,5.76-1.74,10.236-5.22,13.428
40
+ c-3.48,3.193-8.389,4.789-14.725,4.789h-11.016v14.832h-9.648v-50.4h20.664C263.807,521.667,268.715,523.178,272.195,526.202z
41
+ M265.355,546.362c1.943-1.584,2.916-3.936,2.916-7.055c0-3.072-0.973-5.375-2.916-6.912c-1.944-1.537-4.741-2.305-8.389-2.305
42
+ h-10.512v18.648h10.512C260.614,548.739,263.411,547.946,265.355,546.362z"/>
43
+ <path fill="#414042" d="M336.49,530.954c-2.712-0.863-5.1-1.295-7.164-1.295c-2.303,0-4.129,0.432-5.472,1.295
44
+ c-1.345,0.865-2.016,2.064-2.016,3.602c0,1.393,0.468,2.555,1.403,3.492c0.937,0.936,2.112,1.703,3.528,2.303
45
+ c1.415,0.602,3.349,1.26,5.796,1.98c3.408,1.008,6.203,2.016,8.389,3.023c2.184,1.008,4.043,2.496,5.58,4.465
46
+ c1.535,1.969,2.304,4.561,2.304,7.775c0,3.072-0.828,5.748-2.484,8.027c-1.655,2.281-3.937,4.021-6.84,5.221
47
+ c-2.905,1.201-6.228,1.801-9.972,1.801c-3.937,0-7.776-0.732-11.52-2.197c-3.744-1.463-7.01-3.42-9.793-5.867l4.032-8.209
48
+ c2.544,2.354,5.399,4.201,8.567,5.545s6.121,2.016,8.856,2.016c2.688,0,4.8-0.516,6.337-1.547
49
+ c1.535-1.033,2.303-2.436,2.303-4.213c0-1.439-0.467-2.629-1.403-3.564s-2.124-1.691-3.563-2.268
50
+ c-1.44-0.576-3.409-1.225-5.904-1.943c-3.409-1.008-6.192-1.992-8.353-2.953c-2.159-0.959-4.009-2.412-5.544-4.355
51
+ c-1.537-1.943-2.304-4.5-2.304-7.668c0-2.928,0.779-5.482,2.34-7.668c1.56-2.184,3.768-3.875,6.624-5.076
52
+ c2.855-1.199,6.156-1.801,9.9-1.801c3.264,0,6.49,0.48,9.684,1.441c3.191,0.961,6.035,2.256,8.531,3.887l-3.887,8.424
53
+ C341.854,533.042,339.202,531.819,336.49,530.954z"/>
54
+ </g>
55
+ <path fill="#723860" d="M425.984,308c0,0,0-106,0-154s-56-78.667-56-78.667s-71.333-40.667-112-64.667s-84.667,0-84.667,0
56
+ s-62,34-114,64S2.651,153.333,2.651,153.333V310c3.93,22.192,15.156,39.25,28.143,52.071c2.419-0.8,5.002-1.238,7.69-1.238
57
+ c8.537,0,16.051,4.369,20.437,10.99c3.34-0.643,6.785-0.99,10.313-0.99c2.449,0,4.855,0.175,7.218,0.489
58
+ c2.677-2.859,6.474-4.656,10.699-4.656c8.1,0,14.667,6.566,14.667,14.667c0,0.133-0.017,0.262-0.02,0.394
59
+ c1.897,1.429,3.693,2.983,5.388,4.641c2.055-1.483,4.571-2.367,7.299-2.367c1.454,0,2.843,0.261,4.141,0.717
60
+ c6.023-7.478,15.089-12.397,25.328-12.845c-0.628-2.07-0.969-4.266-0.969-6.539c0-12.426,10.074-22.5,22.5-22.5
61
+ c2.214,0,4.351,0.325,6.372,0.921c2.072-4.757,6.319-8.339,11.487-9.504c-0.232-1.103-0.359-2.245-0.359-3.417
62
+ c0-4.521,1.822-8.614,4.767-11.595c-1.418-1.558-2.442-3.475-2.934-5.597c-1.163-2.431-1.833-5.142-1.833-8.016
63
+ c0-5.709,2.575-10.811,6.619-14.228c0.377-0.563,0.792-1.099,1.252-1.592c-1.179-1.908-1.872-4.148-1.872-6.556
64
+ c0-6.903,5.597-12.5,12.5-12.5c5.959,0,10.936,4.174,12.188,9.755l19.312,0.828l0.115,0.692
65
+ c5.894,1.007,10.385,6.127,10.385,12.308c0,2.98-1.047,5.713-2.787,7.861c4.979,3.202,8.287,8.779,8.287,15.139
66
+ c0,1.809-0.273,3.552-0.77,5.199c4.691,3.249,7.77,8.663,7.77,14.801c0,0.092-0.013,0.181-0.014,0.272
67
+ c0.982-0.166,1.984-0.272,3.014-0.272c9.94,0,18,8.059,18,18c0,0.545-0.034,1.08-0.081,1.613
68
+ c5.577,2.529,9.629,7.813,10.423,14.119c2.269-3.164,5.968-5.232,10.158-5.232c6.903,0,12.5,5.596,12.5,12.5
69
+ c0,1.158-0.17,2.275-0.465,3.34c1.122-0.219,2.278-0.34,3.465-0.34c3.78,0,7.284,1.17,10.181,3.16
70
+ c2.334-4.266,6.863-7.16,12.069-7.16c3.298,0,6.322,1.162,8.691,3.1c5.771-6.5,14.185-10.6,23.559-10.6
71
+ c5.441,0,10.561,1.379,15.026,3.809c1.822-1.881,4.229-3.184,6.93-3.627c1.889-5.16,6.428-9.037,11.975-9.965
72
+ C429.971,328.848,425.984,308,425.984,308z"/>
73
+ </g>
74
+ <g id="Layer_5">
75
+ <g>
76
+ <circle fill="none" cx="215.338" cy="181.349" r="18.654"/>
77
+ <path fill="#FFD105" d="M166.836,196.272l-44.771,44.771c0,0-3.731,18.656,11.192,29.847l22.386,3.73l0.088-0.016
78
+ c0.634-29.988,5.025-56.047,11.171-78.174L166.836,196.272z"/>
79
+ <path fill="#A473B2" d="M308.61,241.095l-44.771-44.771l-0.066,0.158c6.145,22.127,10.537,48.187,11.17,78.175l0.089,0.016
80
+ l22.386-3.73C312.342,259.75,308.61,241.095,308.61,241.095z"/>
81
+ <path fill="#F7912A" d="M196.684,181.349c0-10.302,8.352-18.654,18.654-18.654v-59.643V103c0,0-31.138,31.148-48.435,93.431
82
+ c-6.146,22.127-10.538,48.187-11.171,78.174c-0.052,2.469-0.088,4.955-0.088,7.479l59.694,7.41v-89.491
83
+ C205.035,200.003,196.684,191.651,196.684,181.349z"/>
84
+ <path fill="#ED664A" d="M215.338,103.052v59.643c10.303,0,18.654,8.353,18.654,18.654c0,10.303-8.352,18.654-18.654,18.654v89.491
85
+ v0.051l59.694-7.41c0-2.521-0.036-5.008-0.089-7.477c-0.633-29.989-5.025-56.048-11.17-78.175
86
+ C246.476,134.2,215.338,103.052,215.338,103.052z"/>
87
+ </g>
88
+ </g>
89
+ </svg>
images/matt.png ADDED
Binary file
images/preview-top.png ADDED
Binary file
images/rob.png ADDED
Binary file
images/task-rocket.png ADDED
Binary file
languages/facebook-thumb-fixer.pot ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: Facebook Thumb Fixer\n"
6
+ "POT-Creation-Date: 2017-08-07 19:56+0800\n"
7
+ "PO-Revision-Date: 2017-08-07 19:56+0800\n"
8
+ "Last-Translator: Michael Ott <hello@michaelott.id.au>\n"
9
+ "Language-Team: Michael Ott <hello@michaelott.id.au>\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.0.2\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-Flags-xgettext: --add-comments=translators:\n"
16
+ "X-Poedit-WPHeader: _facebook-thumb-fixer.php\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
19
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
20
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
21
+ "X-Poedit-SearchPath-0: .\n"
22
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
23
+
24
+ #: _facebook-thumb-fixer.php:22
25
+ msgid "Settings"
26
+ msgstr ""
27
+
28
+ #: _facebook-thumb-fixer.php:22
29
+ msgid "Help"
30
+ msgstr ""
31
+
32
+ #: _facebook-thumb-fixer.php:53
33
+ #, php-format
34
+ msgid ""
35
+ "Awesome! Don't forget to set a default facebook thumbnail <a "
36
+ "href='%s'>here</a>."
37
+ msgstr ""
38
+
39
+ #: _facebook-thumb-fixer.php:69
40
+ msgid "Default Facebook Thumb"
41
+ msgstr ""
42
+
43
+ #: _facebook-thumb-fixer.php:82
44
+ msgid "Browse"
45
+ msgstr ""
46
+
47
+ #: _facebook-thumb-fixer.php:114
48
+ #, php-format
49
+ msgid ""
50
+ "Browse to the preferred Facebook image for your homepage. Facebook <a href="
51
+ "\"%1$s\" target=\"_blank\">recommends</a> your image be 1200 x 630 or 600 x "
52
+ "315."
53
+ msgstr ""
54
+
55
+ #: _facebook-thumb-fixer.php:124
56
+ #, php-format
57
+ msgid ""
58
+ "<strong>Oops! </strong>Your default Facebook image is smaller than the "
59
+ "minimum 600 x 315 <a href=\"%1$s\" target=\"_blank\">recommended</a> by "
60
+ "Facebook."
61
+ msgstr ""
62
+
63
+ #: _facebook-thumb-fixer.php:128
64
+ #, php-format
65
+ msgid ""
66
+ "Your default Facebook image has dimensions of at least 600 x 315 (actual "
67
+ "dimensions are %1$s x %2$s)."
68
+ msgstr ""
69
+
70
+ #: _facebook-thumb-fixer.php:143
71
+ msgid "Facebook App ID"
72
+ msgstr ""
73
+
74
+ #: _facebook-thumb-fixer.php:150
75
+ #, php-format
76
+ msgid "Find your Facebook App ID <a href=\"%1$s\" target=\"_blank\">here</a>."
77
+ msgstr ""
78
+
79
+ #: _facebook-thumb-fixer.php:164
80
+ msgid "Homepage Object Type"
81
+ msgstr ""
82
+
83
+ #: _facebook-thumb-fixer.php:196
84
+ #, php-format
85
+ msgid "Learn about Object Types <a href=\"%1$s\" target=\"_blank\">here</a>."
86
+ msgstr ""
87
+
88
+ #: _facebook-thumb-fixer.php:204
89
+ msgid ""
90
+ "<strong>Note: </strong>If no selection is made, the Object Type for your "
91
+ "home page will be \"website\"."
92
+ msgstr ""
93
+
94
+ #: _facebook-thumb-fixer.php:291
95
+ #, php-format
96
+ msgid ""
97
+ "If no selection is made, the Object Type for this %1$s will be \"article\". "
98
+ "Learn about Object Types <a href=\"%2$s\" target=\"_blank\">here</a>."
99
+ msgstr ""
100
+
101
+ #: _facebook-thumb-fixer.php:298
102
+ msgid ""
103
+ "Preview and debugging are not possible when open graph tags are disabled."
104
+ msgstr ""
105
+
106
+ #: _facebook-thumb-fixer.php:302
107
+ #, php-format
108
+ msgid "Disable for this %s"
109
+ msgstr ""
110
+
111
+ #: _facebook-thumb-fixer.php:353
112
+ msgid "FB Thumb Fixer"
113
+ msgstr ""
114
+
115
+ #: _facebook-thumb-fixer.php:357
116
+ msgid "You do not have sufficient permissions to access this page."
117
+ msgstr ""
118
+
119
+ #: _facebook-thumb-fixer.php:370
120
+ #, php-format
121
+ msgid ""
122
+ "Well done! You have a default Facebook thumbnail set. You can change it any "
123
+ "time <a href=\"%1$s\">here</a>."
124
+ msgstr ""
125
+
126
+ #: _facebook-thumb-fixer.php:372 home-preview.php:2
127
+ msgid "Homepage Preview"
128
+ msgstr ""
129
+
130
+ #: _facebook-thumb-fixer.php:373
131
+ msgid ""
132
+ "This is an approximate preview of your homepage when shared on Facebook:"
133
+ msgstr ""
134
+
135
+ #: _facebook-thumb-fixer.php:408
136
+ #, php-format
137
+ msgid ""
138
+ "<strong>Note: </strong>Facebook <a href=\"%1$s\" target=\"_blank"
139
+ "\">recommends</a> your image be 1200 x 630 or 600 x 315."
140
+ msgstr ""
141
+
142
+ #: _facebook-thumb-fixer.php:410
143
+ #, php-format
144
+ msgid "Your image (shown here scaled down) appears to be good at %1$s x %2$s."
145
+ msgstr ""
146
+
147
+ #: _facebook-thumb-fixer.php:417
148
+ #, php-format
149
+ msgid ""
150
+ "<strong>Oops! </strong>Although you do have a default Facebook thumbnail, "
151
+ "the dimensions are smaller than the minimum 600 x 315 <a href=\"%1$s\" "
152
+ "target=\"_blank\">recommended</a> by Facebook."
153
+ msgstr ""
154
+
155
+ #: _facebook-thumb-fixer.php:424
156
+ #, php-format
157
+ msgid ""
158
+ "You currently do not have a Default Facebook Thumbnail set. Set one <a href="
159
+ "\"%1$s\">here</a>."
160
+ msgstr ""
161
+
162
+ #: _facebook-thumb-fixer.php:446
163
+ msgid "Where can I get support?"
164
+ msgstr ""
165
+
166
+ #: _facebook-thumb-fixer.php:448
167
+ #, php-format
168
+ msgid ""
169
+ "Reach for support at the <a href=\"%1$s\" target=\"_blank\">Wordpress plug-"
170
+ "in repo</a>."
171
+ msgstr ""
172
+
173
+ #: home-preview.php:2 post-preview.php:15
174
+ msgid "Debug"
175
+ msgstr ""
176
+
177
+ #: home-preview.php:3
178
+ msgid "View an approximate preview of your homepage when shared on Facebook."
179
+ msgstr ""
180
+
181
+ #: post-preview.php:9
182
+ msgid "View an approximate preview of your post when shared on Facebook."
183
+ msgstr ""
184
+
185
+ #: post-preview.php:14
186
+ msgid ""
187
+ "If in doubt, try forcing Facebook to fetch your page with their debugging "
188
+ "tool."
189
+ msgstr ""
190
+
191
+ #: post-preview.php:18
192
+ #, php-format
193
+ msgid ""
194
+ "<strong>Oops! </strong>Your featured image dimensions are %1$s x %2$s which "
195
+ "is smaller than the minimum 600 x 315 <a href=\"%3$s\" target=\"_blank"
196
+ "\">recommended</a> by Facebook."
197
+ msgstr ""
198
+
199
+ #: post-preview.php:23
200
+ msgid "Preview Not Available"
201
+ msgstr ""
202
+
203
+ #: post-preview.php:24
204
+ msgid ""
205
+ "You can't preview until you set a featured image and update this post/page."
206
+ msgstr ""
207
+
208
+ #. Plugin Name of the plugin/theme
209
+ msgid "Facebook Thumb Fixer"
210
+ msgstr ""
211
+
212
+ #. Plugin URI of the plugin/theme
213
+ msgid "https://wordpress.org/support/plugin/facebook-thumb-fixer"
214
+ msgstr ""
215
+
216
+ #. Description of the plugin/theme
217
+ msgid ""
218
+ "Control how your thumbnails are viewed when a post is shared on Facebook, "
219
+ "Twitter and Google+."
220
+ msgstr ""
221
+
222
+ #. Author of the plugin/theme
223
+ msgid "Michael Ott"
224
+ msgstr ""
225
+
226
+ #. Author URI of the plugin/theme
227
+ msgid "http://michaelott.id.au"
228
+ msgstr ""
my-tools.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="my-stuff">
2
+ <div class="valign">
3
+ <p><strong><?php _e("My other WordPress tools", 'log-cleaner'); ?></strong></p>
4
+ <!-- <ul>
5
+ <li><a href="https://rocketapps.com.au/task-rocket?source=itseclogcleaner" rel="noopener" target="_blank"><img src="<?php echo plugins_url('images/', __FILE__ ); ?>/task-rocket.png" alt="Task Rocket" /><span>Task Rocket</span></a></li>
6
+ <li><a href="https://rocketapps.com.au/invoice-rocket?source=itseclogcleaner" rel="noopener" target="_blank"><img src="<?php echo plugins_url('images/', __FILE__ ); ?>/invoice-rocket.png" alt="Invoice Rocket" /><span>Invoice Rocket</span></a></li>
7
+ </ul> -->
8
+ <a href="https://rocketapps.com.au/?source=itseclogcleaner" rel="noopener" target="_blank"><img src="<?php echo plugins_url('images/', __FILE__ ); ?>/logo-rocket-apps.svg" alt="Rocket Apps" class="rocket-apps-logo" /></a>
9
+ <div>
10
+ <p class="testimonial">
11
+ <img src="<?php echo plugins_url('images/', __FILE__ ); ?>/matt.png" />
12
+ <em>"The coolest thing I've seen on WordPress. Top Marks."</em>
13
+ <span class="name">Matthew Woods</span>
14
+ <span class="title">Tour Administrator at <a href="https://www.perthobservatory.com.au/" rel="noopener" target="_blank">Perth Observatory</a></span>
15
+ </p>
16
+ <p class="testimonial">
17
+ <img src="<?php echo plugins_url('images/', __FILE__ ); ?>/rob.png" />
18
+ <em>"Awesome product. So simple and yet does so much."</em>
19
+ <span class="name">Rob Lovett</span>
20
+ <span class="title">MD at <a href="https://elite.com.au/" rel="noopener" target="_blank">Elite Carpet Dry Cleaning</a></span>
21
+ </p>
22
+ <p class="testimonial">
23
+ <img src="<?php echo plugins_url('images/', __FILE__ ); ?>/facundo.png" />
24
+ <em>"Thank you for this great and awesome system."</em>
25
+ <span class="name">Facundo Decaminada</span>
26
+ <span class="title">Founder/Project Manager of <a href="http://www.dexjobs.com/" rel="noopener" target="_blank">DexJobs</a></span>
27
+ </p>
28
+ <a href="https://rocketapps.com.au/?source=itseclogcleaner" rel="noopener" target="_blank" class="cta"><?php _e("Get Rocket Apps", 'log-cleaner'); ?></a>
29
+ </div>
30
+ </div>
31
+ </div>
output-logic.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $post;
3
+ $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'Full');
4
+ $post_thumbnail_id = get_post_thumbnail_id( $post_id );
5
+ $ftf_description = get_the_excerpt($post);
6
+ $ot = get_post_meta($post->ID, 'ftf_open_type', true);
7
+ $title = get_the_title($post->ID);
8
+ $blog_name = get_bloginfo('name');
9
+ $post_page_description = wp_kses($ftf_description, array ());
10
+ $home_description = get_bloginfo('description');
11
+ $homepage_object_type = get_option( 'homepage_object_type');
12
+ $post_page_object_type = get_post_meta($post->ID, 'ftf_open_type', true);
13
+ $dog = get_post_meta($post->ID, "disable_open_graph", TRUE);
14
+ $home_thumb_path = get_option('default_fb_thumb');
15
+ $home_thumb_id = attachment_url_to_postid($home_thumb_path);
16
+
17
+
18
+
19
+ if(is_home()) {
20
+ $alt = get_post_meta($home_thumb_id, '_wp_attachment_image_alt', true);
21
+ $image_width = wp_get_attachment_image_src($home_thumb_id, 'Full');
22
+ $image_height = wp_get_attachment_image_src($home_thumb_id, 'Full');
23
+ } else {
24
+ $alt = get_post_meta($post_thumbnail_id, '_wp_attachment_image_alt', true);
25
+ $image_width = wp_get_attachment_image_src($post_thumbnail_id, 'Full');
26
+ $image_height = wp_get_attachment_image_src($post_thumbnail_id, 'Full');
27
+ }
28
+
29
+ if($post_page_description) {
30
+ $post_page_description = $post_page_description;
31
+ } else {
32
+ $post = get_post($post->ID);
33
+ $content = apply_filters('get_the_content', $post->post_content);
34
+ $content_chars = substr($content, 0, 300);
35
+ $page_description = strip_tags($content_chars);
36
+ $post_page_description = str_replace(array("\n", "\t", "\r"), '', $page_description);
37
+ }
38
+
39
+ if($homepage_object_type) {
40
+ $homepage_object_type = get_option( 'homepage_object_type');
41
+ } else {
42
+ $homepage_object_type = "website";
43
+ }
44
+
45
+ if($post_page_object_type) {
46
+ $post_page_object_type = get_post_meta($post->ID, 'ftf_open_type', true);
47
+ } else {
48
+ $post_page_object_type = "article";
49
+ }
50
+
51
+ // If not the homepage
52
+ if ( !is_home() ) {
53
+
54
+ // If not disabled
55
+ if($dog !== "1") {
56
+
57
+ // If there is a post image...
58
+ if (has_post_thumbnail()) {
59
+
60
+ $ftf_head = '
61
+ <!--/ Facebook Thumb Fixer Open Graph /-->
62
+ <meta property="og:type" content="'. $post_page_object_type . '" />
63
+ <meta property="og:url" content="' . get_permalink() . '" />
64
+ <meta property="og:title" content="' . str_replace('"', '', $title) . '" />
65
+ <meta property="og:description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" />
66
+ <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" />
67
+ <meta property="og:image" content="' . $featured_image[0] . '" />
68
+ <meta property="og:image:alt" content="' . $alt . '" />
69
+ <meta property="og:image:width" content="' . $image_width[1] . '" />
70
+ <meta property="og:image:height" content="' . $image_height[2] . '" />
71
+
72
+ <meta itemscope itemtype="'. $post_page_object_type . '" />
73
+ <meta itemprop="description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" />
74
+ <meta itemprop="image" content="' . $featured_image[0] . '" />
75
+
76
+ <meta name="twitter:card" content="summary_large_image" />
77
+ <meta name="twitter:url" content="' . get_permalink() . '" />
78
+ <meta name="twitter:title" content="' . str_replace('"', '', $title) . '" />
79
+ <meta name="twitter:description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" />
80
+ <meta name="twitter:image" content="' . $featured_image[0] . '" />
81
+
82
+ ';
83
+ } else { //...otherwise, if there is no post image.
84
+ $ftf_head = '
85
+ <!--/ Facebook Thumb Fixer Open Graph /-->
86
+ <meta property="og:type" content="'. $post_page_object_type . '" />
87
+ <meta property="og:url" content="' . get_permalink() . '" />
88
+ <meta property="og:title" content="' . str_replace('"', '', $title) . '" />
89
+ <meta property="og:description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" />
90
+ <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" />
91
+ <meta property="og:image" content="' . get_option('default_fb_thumb') . '" />
92
+ <meta property="og:image:alt" content="' . $alt . '" />
93
+ <meta property="og:image:width" content="' . $image_width[1] . '" />
94
+ <meta property="og:image:height" content="' . $image_height[2] . '" />
95
+
96
+ <meta itemscope itemtype="'. $post_page_object_type . '" />
97
+ <meta itemprop="description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" />
98
+ <meta itemprop="image" content="' . get_option('default_fb_thumb') . '" />
99
+
100
+ <meta name="twitter:card" content="summary_large_image" />
101
+ <meta name="twitter:url" content="' . get_permalink() . '" />
102
+ <meta name="twitter:title" content="' . str_replace('"', '', $title) . '" />
103
+ <meta name="twitter:description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" />
104
+ <meta name="twitter:image" content="' . $featured_image[0] . '" />
105
+ ';
106
+ }
107
+
108
+ } // End if not disabled
109
+
110
+ } else { //...otherwise, it must be the homepage so do this:
111
+
112
+ $ftf_head = '
113
+ <!--/ Facebook Thumb Fixer Open Graph /-->
114
+ <meta property="og:type" content="' . $homepage_object_type . '" />
115
+ <meta property="og:url" content="' . get_option('home') . '" />
116
+ <meta property="og:title" content="' . str_replace('"', '', $blog_name) . '" />
117
+ <meta property="og:description" content="' . strip_shortcodes(str_replace('"', '', $home_description)) . '" />
118
+ <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" />
119
+ <meta property="og:image" content="' . get_option('default_fb_thumb') . '" />
120
+ <meta property="og:image:alt" content="' . $alt . '" />
121
+ <meta property="og:image:width" content="' . $image_width[1] . '" />
122
+ <meta property="og:image:height" content="' . $image_height[2] . '" />
123
+
124
+ <meta itemscope itemtype="'. $homepage_object_type . '" />
125
+ <meta itemprop="description" content="' . strip_shortcodes(str_replace('"', '', $home_description)) . '" />
126
+ <meta itemprop="image" content="' . get_option('default_fb_thumb') . '" />
127
+
128
+ <meta name="twitter:card" content="summary_large_image" />
129
+ <meta name="twitter:url" content="' . get_option('home') . '" />
130
+ <meta name="twitter:title" content="' . str_replace('"', '', $blog_name) . '" />
131
+ <meta name="twitter:description" content="' . strip_shortcodes(str_replace('"', '', $home_description)) . '" />
132
+ <meta name="twitter:image" content="' . get_option('default_fb_thumb') . '" />
133
+ ';
134
+ }
post-preview.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $fb_URL = 'https://developers.facebook.com/docs/sharing/best-practices#images';
3
+ $image_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "full" );
4
+ $image_width = $image_data[1];
5
+ $image_height = $image_data[2];
6
+ if ( has_post_thumbnail() ) { ?>
7
+ <hr class="ftf-rule" />
8
+
9
+ <p><?php _e( 'View an approximate preview of your post when shared on Facebook.', 'facebook-thumb-fixer' ); ?></p>
10
+ <a class="open-ftf-preview">Preview</a>
11
+
12
+ <hr class="ftf-rule" />
13
+
14
+ <p><?php _e( 'If in doubt, try forcing Facebook to fetch your page with their debugging tool.', 'facebook-thumb-fixer' ); ?></p>
15
+ <p><a href="https://developers.facebook.com/tools/debug/sharing/?q=<?php echo get_the_permalink(); ?>" target="_blank" class="debugger-button"><?php _e( 'Debug', 'facebook-thumb-fixer' ); ?></a></p>
16
+
17
+ <?php if ($image_width < 600 || $image_height < 315) { ?>
18
+ <p class="ftf-warning"><?php echo sprintf( __( '<strong>Oops! </strong>Your featured image dimensions are %1$s x %2$s which is smaller than the minimum 600 x 315 <a href="%3$s" target="_blank">recommended</a> by Facebook.', 'facebook-thumb-fixer' ), $image_width, $image_height, $fb_URL); ?></p>
19
+ <?php } ?>
20
+
21
+ <?php } else { ?>
22
+
23
+ <a class="no-thumb-set"><?php _e( 'Preview Not Available', 'facebook-thumb-fixer' ); ?></a>
24
+ <p><?php _e( "You can't preview until you set a featured image and update this post/page.", "facebook-thumb-fixer" ); ?></p>
25
+
26
+ <?php } ?>
27
+
28
+ <div class="ftf-live-preview">
29
+ <img src="<?php echo get_option('siteurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/images/preview-top.png'; ?>" />
30
+
31
+ <div class="ftf-preview-details">
32
+
33
+ <div class="overflow<?php if ($image_width < 600 || $image_height < 315) { echo " too-small"; } ?>">
34
+ <?php echo the_post_thumbnail( $post->ID, 'full' ); ?>
35
+ </div>
36
+
37
+ <h1><?php echo the_title(); ?></h1>
38
+
39
+ <p>
40
+ <?php
41
+ if ( has_excerpt( $post->ID ) ) {
42
+ $excerpt = get_the_excerpt();
43
+ $excerpt_chars = substr($excerpt, 0, 150);
44
+ echo strip_tags($excerpt_chars);
45
+ } else {
46
+ $post = get_post($post->ID);
47
+ $content = strip_shortcodes(apply_filters('get_the_content', $post->post_content));
48
+ $content_chars = substr($content, 0, 150);
49
+ echo strip_tags($content_chars);
50
+ }
51
+ ?>
52
+ </p>
53
+ <span class="ftf-domain"><?php echo $_SERVER['SERVER_NAME']; ?></span>
54
+ </div>
55
+ </div>
56
+
57
+ <div class="ftf-mask"></div>
58
+
59
+ <script>
60
+ // Popup
61
+ jQuery(function($) {
62
+ $('.open-ftf-preview').click(function(){
63
+ $(".ftf-live-preview").toggleClass("show-ftf-live-preview");
64
+ $(".ftf-mask").toggleClass("show-ftf-mask");
65
+ });
66
+ $('.ftf-mask').click(function(){
67
+ $(this).toggleClass("show-ftf-mask");
68
+ $(".ftf-live-preview").toggleClass("show-ftf-live-preview");
69
+ });
70
+ });
71
+ </script>
readme.txt ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Thumb Fixer for Facebook ===
2
+ Contributors: mikeyott
3
+ Tags: facebook, thumb, fixer, default, thumbnail, thumbnails, thumbs, og:image, og:description, og:title, open, graph, open graph
4
+ Requires at least: 4.0
5
+ Tested up to: 5.2.1
6
+ Stable tag: trunk
7
+
8
+ Control how your thumbnails are viewed when a post is shared on social media platfoms, such as Facebook and Twitter.
9
+
10
+ == End Of Life Notice ==
11
+
12
+ Please be advised that this plugin will soon no longer be maintained. It is recommended you switch to the free (and better) <a href="https://wordpress.org/plugins/open-graphite/">Open Graphite</a> plugin instead. I've spent over 12 months building and testing Open Graphite, and I know you'll find it far more useful. If you prefer to try something else, no worries, and I sincerely thank you for using this plugin all the same.
13
+ If you have any questions about this, I'll personally respond to any messages sent <a href="https://rocketapps.com.au/contact/">here</a>. Have fun!
14
+
15
+ == Description ==
16
+
17
+ This plug-in is for those who have the problem where sharing a post on Facebook shows the wrong (or no) thumbnail image.
18
+
19
+ It works by making sure the thumbnail is derived from the featured image of your post. If your post doesn't have a featured image then it will use a fall-back image that you can specify.
20
+
21
+ The plug-in inserts the open graph meta properties which Facebook and other social services look for when someone shares your page. These properties contain information such as the title, description (content), and of course the image you specify.
22
+
23
+ == Installation ==
24
+
25
+ Install, activate, done.
26
+
27
+ == Uninstall ==
28
+
29
+ Deactivate the plugin, delete if desired.
30
+
31
+ == Official Web Site (and support) ==
32
+
33
+ <a href="https://wordpress.org/support/plugin/facebook-thumb-fixer">Facebook Thumb Fixer Support</a> at the official Wordpress repository.
34
+
35
+ == How to set a fall-back image ==
36
+
37
+ Go to Settings -> General and scroll down until you find 'Default Facebook Thumb'. Choose or upload a fall-back image. Make sure it's at least 1200x630 or 600x315.
38
+
39
+ == How to set a Facebook App ID ==
40
+
41
+ If you have a Facebook App, you can get the App ID from <a href="https://developers.facebook.com/apps/" target="_blank">your developer dashboard</a>.
42
+
43
+ Specify your Facebook App ID Settings -> General and scroll down until you find 'Facebook App ID'.
44
+
45
+ == How to set an object type ==
46
+
47
+ <strong>Posts and pages</strong>
48
+
49
+ On each page or post you edit there is an 'Open Graph Object Type' meta box. Simply make a section from there to specify what Object Type the page or post is. Example: If the it's an article, then choose 'article'. If it's a product, choose 'product'. To help you decide what Object Type to choose, go <a href="https://developers.facebook.com/docs/reference/opengraph" target="_blank">here</a> to learn the differences between them all.
50
+
51
+ Note: If no selection is made for posts or pages then the Object Type will be 'article', which in most cases is fine.
52
+
53
+ <strong>Home page</strong>
54
+
55
+ To specify what Object Type your homepage is, go to Settings -> General, scroll down until you find 'Homepage Object Type' and make a selection. After you've specified a Default Facebook Thumb, Homepage Object Type and saved the options, you'll then be able to view an approximate preview of your homepage when shared on Facebook.
56
+
57
+ Note: If no selection is made for the home page then the Object Type will default to 'webpage', which in most cases is probably what you want.
58
+
59
+ <strong>Known issues</strong>
60
+
61
+ Divi theme is not houring the WordPress strip_shortcodes() function, and so if you have a shortcode early on in a post you may see unexpected results when sharing on social media.
62
+
63
+ == Changelog ==
64
+
65
+ = 1.7.8 =
66
+
67
+ End of life notice.
68
+
69
+ = 1.7.7 =
70
+
71
+ Open Graph image ALT attribute (og:image:alt)
72
+ Open Graph image width and height attributes (og:image:width and og:image:height)
73
+ Added Twitter card support
74
+
75
+ = 1.7.6 =
76
+
77
+ Changed plugin name
78
+ Branding changes to satisfy Facebook legal
79
+ Testing on WP 4.9.4
80
+
81
+ = 1.7.5 =
82
+
83
+ Added new object types: business.business
84
+ Added new object types: place
85
+ Removed incorrect object type: object
86
+ Fixed malformed anchor in readme
87
+ Fixed typos
88
+
89
+ = 1.7.4 =
90
+
91
+ Added option to disable meta tags for specific posts and pages.
92
+ Fixed issue related to shortcodes in the content.
93
+ Fixed incorrect text domain.
94
+
95
+ = 1.7.3 =
96
+
97
+ POT file renamed.
98
+
99
+ = 1.7.2 =
100
+
101
+ Fixed incorrect text domain.
102
+
103
+ = 1.7.1 =
104
+
105
+ Employed more reliable method for determining image dimensions.
106
+ Added debug button for homepage testing.
107
+ Added missing translation strings.
108
+
109
+ = 1.7 =
110
+
111
+ Fixed Facebook scraping issue caused by double quotes in excerpts.
112
+ Pages now use truncated main content when excerpt does not exist.
113
+ Added media galley browsing button for when choosing a default image.
114
+ Added plugin activation message prompting users to set default thumbnail image.
115
+ Added translation support.
116
+
117
+ = 1.6 =
118
+
119
+ Added Facebook App ID field.
120
+ Added a convenient FB Debug button for easier troubleshooting.
121
+ Preview of homepage for when shared on Facebook.
122
+ Fixed some errors.
123
+ Updated help topics.
124
+
125
+ = 1.5.1 =
126
+
127
+ Fixed Undefined variables issue.
128
+ Confirmed WP 4.2.3 compatibility.
129
+ Updated support link.
130
+
131
+ = 1.5 =
132
+
133
+ Added Facebook preview.
134
+
135
+ = 1.4.9 =
136
+
137
+ Updated help topics with answers to some common questions.
138
+
139
+ = 1.4.8 =
140
+
141
+ Suppressed unnecessary warning when fall-back image is missing.
142
+
143
+ = 1.4.7 =
144
+
145
+ Fixed extremely rare conflict with other plug-ins. No need to update unless this plug-in is causing a conflict with another.
146
+
147
+ = 1.4.6 =
148
+
149
+ Non-critical updates:
150
+ Fixed incorrect reference in help/tips of recommended Facebook image sizes.
151
+ Added help topic and suggested fix for those experiencing rare issue of image dimensions not showing in plug-in.
152
+
153
+ = 1.4.5 =
154
+
155
+ Full sized default thumbnail image preview.
156
+ Updated help topics and tips to reflect latest Facebook recommendations.
157
+ Presentation tweaks.
158
+
159
+ = 1.4.4 =
160
+
161
+ Prevented open graph from outputting on BuddyPress members pages to 'fix' malformed HTML issue.
162
+
163
+ = 1.4.3 =
164
+
165
+ Updated version compatibility for Wordpress 4.0.
166
+
167
+ = 1.4.2 =
168
+
169
+ Updated documentation page.
170
+
171
+ = 1.4.1 =
172
+
173
+ Added Google+ full bleed image support.
174
+
175
+ = 1.4 =
176
+
177
+ Added the ability to specify a unique Object Type for each post, page and the home page.
178
+ Updated documentation.
179
+
180
+ = 1.3.5 =
181
+
182
+ Replaced strip_tags with preferable wp_kses function.
183
+ HTML is now stripped from excerpts.
184
+ Fixed issue where title sometimes wasn't being output into og:title on posts.
185
+
186
+ = 1.3.4 =
187
+
188
+ 'Tested up to' compatibility with Wordpress 3.8.
189
+ Wordpress 3.8 notification UI.
190
+ Updated documentation to reflect current Facebook requirements, removed document redundancy.
191
+ Typo corrections.
192
+
193
+ = 1.3.3 =
194
+
195
+ * Minor update: Added strip_tags in more places to prevent potential conflict issue.
196
+
197
+ = 1.3.2 =
198
+
199
+ * Changed function name to something less generic to avoid potential conflict with other plugins.
200
+
201
+ = 1.3.1 =
202
+
203
+ * Updated recommended og:image dimensions.
204
+
205
+ = 1.3 =
206
+
207
+ * Included new open graph properties for og:description, og:site_name and og:type.
208
+ * Added visual indication of the field on the settings page.
209
+ * Fixed width on preview image (for when someone accidentally uses a massive image).
210
+ * Updated help guide.
211
+
212
+ = 1.2.3 =
213
+
214
+ * Changed comment output in head to 'Open Graph' instead of 'Facebook Open Graph'.
215
+ * Clarification on how the plugin works.
216
+
217
+ = 1.2.2 =
218
+
219
+ * Added og:url meta property (according to Facebook debugger, now required).
220
+
221
+ = 1.2.1 =
222
+
223
+ * Updated documentation page, suggesting default thumbnail to be 155x155 (because thumbs are that size on Facebook brand pages).
224
+
225
+ = 1.2 =
226
+
227
+ * Minor edits, nothing important.
228
+
229
+ = 1.1 =
230
+
231
+ * Updated tags.
232
+ * Fixed typos.
233
+
234
+ = 1.0 =
235
+
236
+ * Release candidate finished.
237
+ * Added support information under admin Settings -> Facebook Thumb Fixer
238
+ * Updated support information.
239
+
240
+ = 0.9 =
241
+
242
+ * Swapped out deprecated Wordpress variables.