WordPress.org

Plugin Directory

Changeset 1700669


Ignore:
Timestamp:
07/22/17 07:51:07 (3 months ago)
Author:
mikeyott
Message:

Added option to disable meta tags for specific posts and pages.
Fixed issue related to shortcodes in the content.
Fixed incorrect text domain.

Location:
facebook-thumb-fixer/trunk
Files:
1 added
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • facebook-thumb-fixer/trunk/_facebook-thumb-fixer.php

    r1695506 r1700669  
    55Description: Control how your thumbnails are viewed when a post is shared on Facebook, Twitter and Google+. 
    66Author: Michael Ott 
    7 Version: 1.7.3 
     7Version: 1.7.4 
    88Author URI: http://michaelott.id.au 
    9 Text Domain: facebook-thumbnail-fixer 
     9Text Domain: facebook-thumb-fixer 
    1010Domain Path: /languages/ 
    1111*/ 
     
    1313// Look for translation file. 
    1414function load_fbtf_textdomain() { 
    15     load_plugin_textdomain( 'facebook-thumbnail-fixer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 
     15    load_plugin_textdomain( 'facebook-thumb-fixer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 
    1616} 
    1717add_action( 'plugins_loaded', 'load_fbtf_textdomain' ); 
     18 
    1819// Add HELP link from the plugin page 
    1920add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'link_action_on_plugin' ); 
    2021function link_action_on_plugin( $links ) { 
    21     return array_merge(array('settings' => '<a href="' . admin_url( '/options-general.php' ) . '">' . __( 'Settings', 'facebook-thumbnail-fixer' ) . '</a> | <a href="' . admin_url( '/options-general.php?page=facebook-thumb-fixer' ) . '">' . __( 'Help', 'facebook-thumbnail-fixer' ) . '</a>'), $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); 
    2223} 
    2324 
     
    5051        <div class="updated notice is-dismissible ir-admin-message"> 
    5152            <?php $presentation_options_url = admin_url() . 'options-general.php#dfb'; ?> 
    52             <p><?php printf( __( "Awesome! Don't forget to set a default facebook thumbnail  <a href='%s'>here</a>.", "facebook-thumbnail-fixer" ), $presentation_options_url); ?></p> 
     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> 
    5354        </div> 
    5455        <?php 
     
    6667    function register_fields() { 
    6768        register_setting( 'general', 'default_fb_thumb', 'esc_attr' ); 
    68         add_settings_field('dft', '<label for="default_fb_thumb" id="dfb">' . __('Default Facebook Thumb' , 'facebook-thumbnail-fixer' ) . '</label>' , array(&$this, 'fields_html') , 'general' ); 
     69        add_settings_field('dft', '<label for="default_fb_thumb" id="dfb">' . __('Default Facebook Thumb' , 'facebook-thumb-fixer' ) . '</label>' , array(&$this, 'fields_html') , 'general' ); 
    6970    } 
    7071    function fields_html() { 
     
    7980 
    8081        <input id="default_fb_thumb" name="default_fb_thumb" type="text" value="<?php if($fbt_value) { esc_attr_e( $fbt_value ); } ?>" /> 
    81         <input id="default_fb_thumb_button" class="upload-button button" name="default_fb_thumb_button" type="text" value="<?php _e( 'Browse', 'facebook-thumbnail-fixer' ); ?>" /> 
     82        <input id="default_fb_thumb_button" class="upload-button button" name="default_fb_thumb_button" type="text" value="<?php _e( 'Browse', 'facebook-thumb-fixer' ); ?>" /> 
    8283        <script> 
    8384            // Media uploader 
     
    111112 
    112113        <p class="description"> 
    113             <?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-thumbnail-fixer' ), $fb_URL) ?> 
     114            <?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) ?> 
    114115        </p> 
    115116         
     
    121122        <?php if ($width < 600 || $height < 315) { ?> 
    122123            <p class="ftf-warning"> 
    123                 <?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-thumbnail-fixer' ), $fb_URL) ?> 
     124                <?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) ?> 
    124125            </p> 
    125126        <?php } else { ?> 
    126127            <p class="description good"> 
    127                 <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-thumbnail-fixer' ), $width, $height) ?> 
     128                <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) ?> 
    128129            </p> 
    129130        <?php } 
     
    140141    function register_fields() { 
    141142        register_setting( 'general', 'fb_app_ID', 'esc_attr' ); 
    142         add_settings_field('faid', '<label for="fb_app_ID" id="fb_app_ID">' . __('Facebook App ID' , 'facebook-thumbnail-fixer' ).'</label>' , array(&$this, 'fb_app_ID_field') , 'general' ); 
     143        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' ); 
    143144    } 
    144145    function fb_app_ID_field() { 
     
    147148    <input type="text" id="fb_app_ID" class="regular-text ltr" name="fb_app_ID" value="<?php echo $fbaid_value; ?>" /> 
    148149    <?php $fb_app_ID_URL = 'https://developers.facebook.com/apps/'; ?> 
    149     <p class="description"><?php echo sprintf( __( 'Find your Facebook App ID <a href="%1$s" target="_blank">here</a>.', 'facebook-thumbnail-fixer' ), $fb_app_ID_URL); ?></p> 
     150    <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> 
    150151     
    151152    <?php } 
     
    161162    function register_object_type() { 
    162163        register_setting( 'general', 'homepage_object_type', 'esc_attr' ); 
    163         add_settings_field('object_type', '<label for="homepage_object_type">' . __('Homepage Object Type' , 'facebook-thumbnail-fixer' ) . '</label>' , array(&$this, 'ot_fields_html') , 'general' ); 
     164        add_settings_field('object_type', '<label for="homepage_object_type">' . __('Homepage Object Type' , 'facebook-thumb-fixer' ) . '</label>' , array(&$this, 'ot_fields_html') , 'general' ); 
    164165    } 
    165166    function ot_fields_html() { ?> 
     
    192193 
    193194        <?php $fb_object_types_URL = 'https://developers.facebook.com/docs/reference/opengraph'; ?> 
    194         <p><?php echo sprintf( __( 'Learn about Object Types <a href="%1$s" target="_blank">here</a>.', 'facebook-thumbnail-fixer' ), $fb_object_types_URL); ?></p> 
    195  
     195        <p><?php echo sprintf( __( 'Learn about Object Types <a href="%1$s" target="_blank">here</a>.', 'facebook-thumb-fixer' ), $fb_object_types_URL); ?></p> 
    196196     
    197197        <?php  
     
    201201            <?php include(locate_template(plugin_basename( __FILE__ ))) . 'home-preview.php'; ?> 
    202202        <?php } else {  ?> 
    203             <p class="howto"><?php _e( '<strong>Note: </strong>If no selction is made, the Object Type for your home page will be "website".', 'facebook-thumbnail-fixer' ); ?></p> 
     203            <p class="howto"><?php _e( '<strong>Note: </strong>If no selction is made, the Object Type for your home page will be "website".', 'facebook-thumb-fixer' ); ?></p> 
    204204        <?php } ?> 
    205205 
     
    250250 
    251251        <?php 
    252             $ot = get_post_meta($post->ID, "ftf_open_type", TRUE); 
     252            $ot     = get_post_meta($post->ID, "ftf_open_type", TRUE); 
     253            $dog    = get_post_meta($post->ID, "disable_open_graph", TRUE); 
     254            $current_screen = get_current_screen(); 
     255 
     256            if ($current_screen ->id === 'post') { 
     257                $post_type_label = 'post'; 
     258            } else if ($current_screen ->id === 'page') { 
     259                $post_type_label = 'page'; 
     260            } else { 
     261                $post_type_label = ''; 
     262            } 
    253263        ?> 
    254264        <p><strong>Object Type</strong></p> 
    255         <select value="ftf_open_type_field" name="ftf_open_type_field" style="width:100%;"> 
     265        <select name="ftf_open_type_field" style="width:100%;"> 
    256266            <option></option> 
    257267            <option value="article"<?php if($ot == "article") { echo " selected"; } ?>>article</option> 
     
    276286        </select> 
    277287 
    278         <p class="howto"><?php _e( '<strong>Note: </strong>If no selction is made, the Object Type for this post/page will be "article".', 'facebook-thumbnail-fixer' ); ?></p> 
     288        <?php $fb_object_types_URL = 'https://developers.facebook.com/docs/reference/opengraph/'; ?> 
     289        <p><?php echo sprintf( __( 'If no selction 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> 
     290     
     291     
     292        <div class="preview-container <?php if($dog == "1") { echo 'hide'; } ?>"> 
     293        <?php include(locate_template(plugin_basename( __FILE__ ))) . 'post-preview.php'; ?> 
     294        </div> 
     295 
     296        <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> 
     297 
     298        <p> 
     299            <input type="checkbox" name="disable_open_graph" class="disable_open_graph" value="1" <?php if($dog == "1") { echo " checked"; } ?>> 
     300            <label for="disable_open_graph"><?php echo sprintf( __( "Disable for this %s", "facebook-thumb-fixer" ), $post_type_label); ?></label> 
     301        </p> 
     302 
     303        <script type="text/javascript"> 
     304            jQuery(".disable_open_graph").click(function() { 
     305                if(jQuery(this).is(":checked")) { 
     306                    jQuery(".preview-container").fadeOut(); 
     307                    jQuery(".disabled-container").fadeIn(); 
     308                } else { 
     309                    jQuery(".preview-container").fadeIn(); 
     310                    jQuery(".disabled-container").fadeOut(); 
     311                } 
     312            }); 
     313        </script> 
     314 
     315<?php  } 
     316 
     317 
     318    function save_data($post_id) { 
    279319         
    280         <?php $fb_object_types_URL = 'https://developers.facebook.com/docs/reference/opengraph/'; ?> 
    281         <p><?php echo sprintf( __( 'Learn about Object Types <a href="%1$s" target="_blank">here</a>.', 'facebook-thumbnail-fixer' ), $fb_object_types_URL); ?></p> 
    282      
    283         <?php include(locate_template(plugin_basename( __FILE__ ))) . 'post-preview.php'; ?> 
    284  
    285 <?php  } 
    286  
    287  
    288     function save_data($post_id){ 
    289320        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) 
    290321            return; 
     
    297328            if ( !current_user_can( 'edit_page', $post_id ) ) 
    298329                return; 
    299         }else{ 
     330        } else { 
    300331            if ( !current_user_can( 'edit_post', $post_id ) ) 
    301332                return; 
    302333        } 
    303         $data = $_POST['ftf_open_type_field']; 
    304         update_post_meta($post_id, 'ftf_open_type', $data, get_post_meta($post_id, 'ftf_open_type', TRUE)); 
    305         return $data; 
    306     } 
     334         
     335        $ftf_open_type_field_data = $_POST['ftf_open_type_field']; 
     336        update_post_meta($post_id, 'ftf_open_type', $ftf_open_type_field_data, $ot); 
     337        //return $ftf_open_type_field_data; 
     338 
     339        $disable_open_graph_data = $_POST['disable_open_graph']; 
     340        update_post_meta($post_id, 'disable_open_graph', $disable_open_graph_data, $dog); 
     341        //return $disable_open_graph_data; 
     342    } 
     343 
    307344} 
    308345$ftf_otmeta = new ftf_otmeta; 
    309  
    310346 
    311347// Add page into the SETTINGS menu 
     
    330366 
    331367    <?php $settings_URL = get_admin_url() . 'options-general.php#dfb'; ?> 
    332     <p class="ftf-good"><?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-thumbnail-fixer' ), $settings_URL); ?></p> 
     368    <p class="ftf-good"><?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> 
    333369     
    334     <h2><?php _e( 'Homepage Preview', 'facebook-thumbnail-fixer' ); ?></h2> 
    335     <p><?php _e( 'This is an approximate preview of your homepage when shared on Facebook:', 'facebook-thumbnail-fixer' ); ?></p> 
     370    <h2><?php _e( 'Homepage Preview', 'facebook-thumb-fixer' ); ?></h2> 
     371    <p><?php _e( 'This is an approximate preview of your homepage when shared on Facebook:', 'facebook-thumb-fixer' ); ?></p> 
    336372 
    337373    <div class="ftf-live-home-preview"> 
     
    368404    ?> 
    369405    <p class="description"> 
    370         <?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-thumbnail-fixer' ), $fb_URL); ?> 
     406        <?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); ?> 
    371407        <?php if ($width >= 600 && $height >= 315) { ?> 
    372         <?php echo sprintf( __( 'Your image (shown here scaled down) appears to be good at %1$s x %2$s.', 'facebook-thumbnail-fixer' ), $width, $height); ?> 
     408        <?php echo sprintf( __( 'Your image (shown here scaled down) appears to be good at %1$s x %2$s.', 'facebook-thumb-fixer' ), $width, $height); ?> 
    373409        <?php } ?> 
    374410    </p> 
     
    377413    if ($width < 600 || $height < 315) { ?> 
    378414        <p class="ftf-warning"> 
    379             <?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-thumbnail-fixer' ), $fb_URL); ?> 
     415            <?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); ?> 
    380416        </p> 
    381417    <?php }  
     
    384420    ?> 
    385421 
    386         <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-thumbnail-fixer' ), $settings_URL); ?></p> 
     422        <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> 
    387423 
    388424    <?php } ?> 
     
    406442    }); 
    407443    </script> 
    408     <h3><?php _e( 'Where can I get support?', 'facebook-thumbnail-fixer' ); ?></h3> 
     444    <h3><?php _e( 'Where can I get support?', 'facebook-thumb-fixer' ); ?></h3> 
    409445    <?php $support_URL = 'https://wordpress.org/support/plugin/facebook-thumb-fixer'; ?> 
    410     <p><?php echo sprintf( __( 'Reach for support at the <a href="%1$s" target="_blank">Wordpress plug-in repo</a>.', 'facebook-thumbnail-fixer' ), $support_URL) ?></p> 
     446    <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> 
    411447 
    412448</div> 
  • facebook-thumb-fixer/trunk/css/ftf.css

    r1695503 r1700669  
    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%)}.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:#2CBB5F;color:#fff;padding:15px}.ftf-good a{color:#fff}.ftf-bad{background:#e34c6b;color:#fff;padding:15px}.ftf-bad a{color:#fff} 
     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:#2CBB5F;color:#fff;padding:15px}.ftf-good a{color:#fff}.ftf-bad{background:#e34c6b;color:#fff;padding:15px}.ftf-bad a{color:#fff} 
  • facebook-thumb-fixer/trunk/home-preview.php

    r1695503 r1700669  
    11<br /> 
    2 <p><a class="open-ftf-preview"><?php _e( 'Homepage Preview', 'facebook-thumbnail-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-thumbnail-fixer' ); ?></a></p> 
    3 <p class="description"><?php _e( 'View an approximate preview of your homepage when shared on Facebook.', 'facebook-thumbnail-fixer' ); ?></p> 
     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> 
    44 
    55<div class="ftf-live-preview"> 
  • facebook-thumb-fixer/trunk/output-logic.php

    r1695009 r1700669  
    1010$homepage_object_type   = get_option( 'homepage_object_type'); 
    1111$post_page_object_type  = get_post_meta($post->ID, 'ftf_open_type', true); 
     12$dog                    = get_post_meta($post->ID, "disable_open_graph", TRUE); 
    1213 
    1314if($post_page_description) { 
     
    1516} else { 
    1617    $post = get_post($post->ID); 
    17     $content = apply_filters('the_content', $post->post_content); 
     18    $content = apply_filters('get_the_content', $post->post_content); 
    1819    $content_chars = substr($content, 0, 300); 
    1920    $page_description = strip_tags($content_chars); 
     
    3637if ( !is_home() ) { 
    3738 
    38     // If there is a post image... 
    39     if (has_post_thumbnail()) { 
    40          
    41         $ftf_head = ' 
    42         <!--/ Facebook Thumb Fixer Open Graph /--> 
    43         <meta property="og:type" content="'. $post_page_object_type . '" /> 
    44         <meta property="og:url" content="' . get_permalink() . '" /> 
    45         <meta property="og:title" content="' . str_replace('"', '', $title) . '" /> 
    46         <meta property="og:description" content="' . str_replace('"', '', $post_page_description) . '" /> 
    47         <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" /> 
    48         <meta property="og:image" content="' . $featuredimg[0] . '" /> 
     39    // If not disabled 
     40    if($dog !== "1") { 
    4941 
    50         <meta itemscope itemtype="'. $post_page_object_type . '" /> 
    51         <meta itemprop="description" content="' . str_replace('"', '', $post_page_description) . '" /> 
    52         <meta itemprop="image" content="' . $featuredimg[0] . '" /> 
    53         '; 
    54     } else { //...otherwise, if there is no post image. 
    55         $ftf_head = ' 
    56         <!--/ Facebook Thumb Fixer Open Graph /--> 
    57         <meta property="og:type" content="'. $post_page_object_type . '" /> 
    58         <meta property="og:url" content="' . get_permalink() . '" /> 
    59         <meta property="og:title" content="' . str_replace('"', '', $title) . '" /> 
    60         <meta property="og:description" content="' . str_replace('"', '', $post_page_description) . '" /> 
    61         <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" /> 
    62         <meta property="og:image" content="' . get_option('default_fb_thumb') . '" /> 
     42        // If there is a post image... 
     43        if (has_post_thumbnail()) { 
     44             
     45            $ftf_head = ' 
     46            <!--/ Facebook Thumb Fixer Open Graph /--> 
     47            <meta property="og:type" content="'. $post_page_object_type . '" /> 
     48            <meta property="og:url" content="' . get_permalink() . '" /> 
     49            <meta property="og:title" content="' . str_replace('"', '', $title) . '" /> 
     50            <meta property="og:description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" /> 
     51            <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" /> 
     52            <meta property="og:image" content="' . $featuredimg[0] . '" /> 
    6353 
    64         <meta itemscope itemtype="'. $post_page_object_type . '" /> 
    65         <meta itemprop="description" content="' . str_replace('"', '', $post_page_description) . '" /> 
    66         <meta itemprop="image" content="' . get_option('default_fb_thumb') . '" /> 
    67         '; 
    68     } 
     54            <meta itemscope itemtype="'. $post_page_object_type . '" /> 
     55            <meta itemprop="description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" /> 
     56            <meta itemprop="image" content="' . $featuredimg[0] . '" /> 
     57            '; 
     58        } else { //...otherwise, if there is no post image. 
     59            $ftf_head = ' 
     60            <!--/ Facebook Thumb Fixer Open Graph /--> 
     61            <meta property="og:type" content="'. $post_page_object_type . '" /> 
     62            <meta property="og:url" content="' . get_permalink() . '" /> 
     63            <meta property="og:title" content="' . str_replace('"', '', $title) . '" /> 
     64            <meta property="og:description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" /> 
     65            <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" /> 
     66            <meta property="og:image" content="' . get_option('default_fb_thumb') . '" /> 
     67 
     68            <meta itemscope itemtype="'. $post_page_object_type . '" /> 
     69            <meta itemprop="description" content="' . strip_shortcodes(str_replace('"', '', $post_page_description)) . '" /> 
     70            <meta itemprop="image" content="' . get_option('default_fb_thumb') . '" /> 
     71            '; 
     72        } 
     73 
     74    } // End if not disabled 
    6975 
    7076} else { //...otherwise, it must be the homepage so do this: 
     
    7581    <meta property="og:url" content="' . get_option('home') . '" /> 
    7682    <meta property="og:title" content="' . str_replace('"', '', $blog_name) . '" /> 
    77     <meta property="og:description" content="' . str_replace('"', '', $home_description) . '" /> 
     83    <meta property="og:description" content="' . strip_shortcodes(str_replace('"', '', $home_description)) . '" /> 
    7884    <meta property="og:site_name" content="' . str_replace('"', '', $blog_name) . '" /> 
    7985    <meta property="og:image" content="' . get_option('default_fb_thumb') . '" /> 
    8086 
    8187    <meta itemscope itemtype="'. $homepage_object_type . '" /> 
    82     <meta itemprop="description" content="' . str_replace('"', '', $home_description) . '" /> 
     88    <meta itemprop="description" content="' . strip_shortcodes(str_replace('"', '', $home_description)) . '" /> 
    8389    <meta itemprop="image" content="' . get_option('default_fb_thumb') . '" /> 
    8490    '; 
  • facebook-thumb-fixer/trunk/post-preview.php

    r1695503 r1700669  
    66if ( has_post_thumbnail() ) { ?> 
    77    <hr class="ftf-rule" /> 
     8     
     9    <p><?php _e( 'View an approximate preview of your post when shared on Facebook.', 'facebook-thumb-fixer' ); ?></p> 
    810    <a class="open-ftf-preview">Preview</a> 
    9     <p><?php _e( 'View an approximate preview of your post when shared on Facebook.', 'facebook-thumbnail-fixer' ); ?></p> 
     11 
    1012    <hr class="ftf-rule" /> 
    11     <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-thumbnail-fixer' ); ?></a></p> 
    12     <p><?php _e( 'If in doubt, try forcing Facebook to fetch your page with their debugging tool.', 'facebook-thumbnail-fixer' ); ?></p> 
     13     
     14    <?php _e( 'If in doubt, try forcing Facebook to fetch your page with their debugging tool.', 'facebook-thumb-fixer' ); ?> 
     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> 
    1316     
    1417    <?php if ($image_width < 600 || $image_height < 315) { ?> 
    15         <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-thumbnail-fixer' ), $image_width, $image_height, $fb_URL); ?></p> 
     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> 
    1619    <?php } ?> 
    1720 
    1821<?php } else { ?> 
    1922 
    20     <a class="no-thumb-set"><?php _e( 'Preview Not Available', 'facebook-thumbnail-fixer' ); ?></a> 
    21     <p><?php _e( "You can't preview until you set a featured image and update this post/page.", "facebook-thumbnail-fixer" ); ?></p> 
     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> 
    2225     
    2326<?php } ?> 
     
    4245                } else { 
    4346                    $post = get_post($post->ID); 
    44                     $content = apply_filters('the_content', $post->post_content); 
     47                    $content = strip_shortcodes(apply_filters('get_the_content', $post->post_content)); 
    4548                    $content_chars = substr($content, 0, 150); 
    4649                    echo strip_tags($content_chars); 
  • facebook-thumb-fixer/trunk/readme.txt

    r1695506 r1700669  
    5454== Changelog == 
    5555 
     56= 1.7.4 = 
     57 
     58Added option to disable meta tags for specific posts and pages. 
     59Fixed issue related to shortcodes in the content. 
     60Fixed incorrect text domain. 
     61 
    5662= 1.7.3 = 
    5763 
Note: See TracChangeset for help on using the changeset viewer.