WordPress.org

Plugin Directory

Changeset 1695503


Ignore:
Timestamp:
07/13/17 03:30:02 (6 weeks ago)
Author:
mikeyott
Message:

Employed more reliable method for determining image dimensions.
Added debug button for homepage testing.
Added missing translation strings.

Location:
facebook-thumb-fixer/trunk
Files:
7 edited

Legend:

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

    r1695009 r1695503  
    55Description: Control how your thumbnails are viewed when a post is shared on Facebook, Twitter and Google+. 
    66Author: Michael Ott 
    7 Version: 1.7 
     7Version: 1.7.1 
    88Author URI: http://michaelott.id.au 
    99Text Domain: fb-thumb-fixer 
     
    6969    } 
    7070    function fields_html() { 
    71         $fbt_value = get_option( 'default_fb_thumb');?> 
     71        $fbt_value          = get_option( 'default_fb_thumb'); 
     72        $fb_URL             = 'https://developers.facebook.com/docs/sharing/best-practices#images'; 
     73        $settings_URL       = admin_url( '/options-general.php?page=facebook-thumb-fixer' ); 
     74        $home_image_ID      = attachment_url_to_postid( $fbt_value );                                   // Get the ID of the default image 
     75        $image_attributes   = wp_get_attachment_image_src( $attachment_id = $home_image_ID, 'full' );   // Get the image attributes of the default image 
     76        $width              = $image_attributes[1];                                                     // Get the width 
     77        $height             = $image_attributes[2];                                                     // Get the height 
     78        ?> 
    7279 
    7380        <input id="default_fb_thumb" name="default_fb_thumb" type="text" value="<?php if($fbt_value) { esc_attr_e( $fbt_value ); } ?>" /> 
     
    103110        <?php wp_enqueue_media(); ?> 
    104111 
    105         <?php if ($fbt_value) { 
    106             list($width, $height) = @getimagesize($fbt_value); 
    107         } ?> 
    108  
    109112        <p class="description"> 
    110             <?php  
    111                 $fb_URL       = 'https://developers.facebook.com/docs/sharing/best-practices#images'; 
    112                 $settings_URL = admin_url( '/options-general.php?page=facebook-thumb-fixer' ); 
    113             ?> 
    114113            <?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) ?> 
    115114        </p> 
    116115         
    117116        <?php if ($fbt_value) { ?> 
     117 
    118118        <a href="<?php echo $fbt_value; ?>?TB_iframe=true&width=600&height=550" class="thickbox"> 
    119119        <img src="<?php echo $fbt_value; ?>" class="thickbox ftf-preview" /></a> 
    120120 
    121         <p class="description"> 
    122             <?php echo sprintf( __( ' Note: The image shown above is scaled down. The real dimensions are actually %1$s x %2$s.', 'facebook-thumbnail-fixer' ), $width, $height) ?> 
    123         </p> 
    124121        <?php if ($width < 600 || $height < 315) { ?> 
    125122            <p class="ftf-warning"> 
    126                 <?php echo sprintf( __( ' <strong>WARNING: </strong>Your default Facebook thumbnail image dimensions are smaller than the minimum 600 x 315 <a href="%1$s" target="_blank">recommended</a> by Facebook.', 'facebook-thumbnail-fixer' ), $fb_URL) ?> 
     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            </p> 
     125        <?php } else { ?> 
     126            <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) ?> 
    127128            </p> 
    128129        <?php } 
     
    324325    <h2>Facebook Thumb Fixer</h2> 
    325326    <?php 
    326     $fbt_value = get_option( 'default_fb_thumb', '' ); 
     327    $fbt_value = get_option( 'default_fb_thumb'); 
    327328    if ($fbt_value) { 
    328329    list($width, $height) = @getimagesize($fbt_value); ?> 
     
    333334    <h2><?php _e( 'Homepage Preview', 'facebook-thumbnail-fixer' ); ?></h2> 
    334335    <p><?php _e( 'This is an approximate preview of your homepage when shared on Facebook:', 'facebook-thumbnail-fixer' ); ?></p> 
    335      
     336 
    336337    <div class="ftf-live-home-preview"> 
    337338        <img src="<?php echo plugins_url('images/', __FILE__ ) . 'preview-top.png'; ?>" /> 
     
    359360     
    360361    <?php  
    361         $fb_URL       = 'https://developers.facebook.com/docs/sharing/best-practices#images'; 
     362        $fbt_value          = get_option( 'default_fb_thumb'); 
     363        $fb_URL             = 'https://developers.facebook.com/docs/sharing/best-practices#images'; 
     364        $home_image_ID      = attachment_url_to_postid( $fbt_value );                                   // Get the ID of the default image 
     365        $image_attributes   = wp_get_attachment_image_src( $attachment_id = $home_image_ID, 'full' );   // Get the image attributes of the default image 
     366        $width              = $image_attributes[1];                                                     // Get the width 
     367        $height             = $image_attributes[2];                                                     // Get the height 
    362368    ?> 
    363     <p class="description"><?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. Your image (show here scaled down) is %2$s x %3$s.', 'facebook-thumbnail-fixer' ), $fb_URL, $width, $height) ?></p> 
    364  
    365     <?php $fb_URL     = 'https://developers.facebook.com/docs/sharing/best-practices#images';  
     369    <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); ?> 
     371        <?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); ?> 
     373        <?php } ?> 
     374    </p> 
     375 
     376    <?php 
    366377    if ($width < 600 || $height < 315) { ?> 
    367378        <p class="ftf-warning"> 
    368             <?php echo sprintf( __( '<strong>WARNING:</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) ?> 
     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); ?> 
    369380        </p> 
    370381    <?php }  
     
    373384    ?> 
    374385 
    375         <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> 
     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> 
    376387 
    377388    <?php } ?> 
  • facebook-thumb-fixer/trunk/css/ftf.css

    r1695009 r1695503  
    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}.ftf-rule{margin:15px 0;height:1px;border-top:dashed 1px #ccc}.ftf-warning strong{color:#ff0000}.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%)}.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/css/ftf.scss

    r1695009 r1695503  
    207207} 
    208208 
     209.homepage-debug { 
     210    background: #ce3895; 
     211 
     212    color:#fff; 
     213    padding:5px 10px; 
     214    text-decoration: none; 
     215    border-radius: 3px; 
     216    text-align: center; 
     217    cursor: pointer; 
     218    display: inline-block; 
     219 
     220    &:hover { 
     221        color: #fff; 
     222        background: #f058b6; 
     223    } 
     224     
     225    &:active { 
     226        color: #fff; 
     227    } 
     228     
     229    &::selection { 
     230        color: #fff; 
     231    } 
     232} 
     233 
    209234.ftf-rule { 
    210235    margin: 15px 0; 
     
    214239 
    215240.ftf-warning { 
    216     strong { 
    217         color: #ff0000; 
     241    padding: 10px; 
     242    color: #fff; 
     243    background: #e81144; 
     244    border-radius: 2px; 
     245 
     246    a { 
     247        color: #fff; 
     248    } 
     249} 
     250 
     251.good { 
     252    span { 
     253        display: inline-block; 
     254        width: 15px; 
     255        height: 15px; 
     256        border-radius: 100%; 
     257        background: #2CBB5F; 
     258        color: #fff; 
     259        font-size: .8em; 
     260        font-style: normal; 
     261        text-align: center; 
    218262    } 
    219263} 
  • facebook-thumb-fixer/trunk/home-preview.php

    r1695009 r1695503  
    1 <p><a class="open-ftf-preview">Homepage Preview</a></p> 
    2 <p class="description">View an approximate preview of your homepage when shared on Facebook.</p> 
     1<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> 
    34 
    45<div class="ftf-live-preview"> 
  • facebook-thumb-fixer/trunk/languages/fb-thumb-fixer.pot

    r1695009 r1695503  
    44"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 
    55"Project-Id-Version: Facebook Thumb Fixer\n" 
    6 "POT-Creation-Date: 2017-07-12 16:38+0800\n" 
    7 "PO-Revision-Date: 2017-07-12 16:38+0800\n" 
     6"POT-Creation-Date: 2017-07-13 11:10+0800\n" 
     7"PO-Revision-Date: 2017-07-13 11:05+0800\n" 
    88"Last-Translator: Michael Ott <hello@michaelott.id.au>\n" 
    99"Language-Team: Michael Ott <hello@michaelott.id.au>\n" 
     
    4141msgstr "" 
    4242 
    43 #: _facebook-thumb-fixer.php:74 
     43#: _facebook-thumb-fixer.php:81 
    4444msgid "Browse" 
    4545msgstr "" 
    4646 
    47 #: _facebook-thumb-fixer.php:114 
     47#: _facebook-thumb-fixer.php:113 
    4848#, php-format 
    4949msgid "" 
     
    5353msgstr "" 
    5454 
    55 #: _facebook-thumb-fixer.php:122 
    56 #, php-format 
    57 msgid "" 
    58 " Note: The image shown above is scaled down. The real dimensions are " 
    59 "actually %1$s x %2$s." 
    60 msgstr "" 
    61  
    62 #: _facebook-thumb-fixer.php:126 
    63 #, php-format 
    64 msgid "" 
    65 " <strong>WARNING: </strong>Your default Facebook thumbnail image dimensions " 
    66 "are smaller than the minimum 600 x 315 <a href=\"%1$s\" target=\"_blank" 
    67 "\">recommended</a> by Facebook." 
    68 msgstr "" 
    69  
    70 #: _facebook-thumb-fixer.php:141 
     55#: _facebook-thumb-fixer.php:123 
     56#, php-format 
     57msgid "" 
     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." 
     61msgstr "" 
     62 
     63#: _facebook-thumb-fixer.php:127 
     64#, php-format 
     65msgid "" 
     66"Your default Facebook image has dimensions of at least 600 x 315 (actual " 
     67"dimensions are %1$s x %2$s)." 
     68msgstr "" 
     69 
     70#: _facebook-thumb-fixer.php:142 
    7171msgid "Facebook App ID" 
    7272msgstr "" 
    7373 
    74 #: _facebook-thumb-fixer.php:148 
     74#: _facebook-thumb-fixer.php:149 
    7575#, php-format 
    7676msgid "Find your Facebook App ID <a href=\"%1$s\" target=\"_blank\">here</a>." 
    7777msgstr "" 
    7878 
    79 #: _facebook-thumb-fixer.php:162 
     79#: _facebook-thumb-fixer.php:163 
    8080msgid "Homepage Object Type" 
    8181msgstr "" 
    8282 
    83 #: _facebook-thumb-fixer.php:193 _facebook-thumb-fixer.php:280 
     83#: _facebook-thumb-fixer.php:194 _facebook-thumb-fixer.php:281 
    8484#, php-format 
    8585msgid "Learn about Object Types <a href=\"%1$s\" target=\"_blank\">here</a>." 
    8686msgstr "" 
    8787 
    88 #: _facebook-thumb-fixer.php:202 
     88#: _facebook-thumb-fixer.php:203 
    8989msgid "" 
    9090"<strong>Note: </strong>If no selction is made, the Object Type for your home " 
     
    9292msgstr "" 
    9393 
    94 #: _facebook-thumb-fixer.php:277 
     94#: _facebook-thumb-fixer.php:278 
    9595msgid "" 
    9696"<strong>Note: </strong>If no selction is made, the Object Type for this post/" 
     
    9898msgstr "" 
    9999 
    100 #: _facebook-thumb-fixer.php:314 
     100#: _facebook-thumb-fixer.php:315 
    101101msgid "FB Thumb Fixer" 
    102102msgstr "" 
    103103 
    104 #: _facebook-thumb-fixer.php:318 
     104#: _facebook-thumb-fixer.php:319 
    105105msgid "You do not have sufficient permissions to access this page." 
    106106msgstr "" 
    107107 
    108 #: _facebook-thumb-fixer.php:331 
     108#: _facebook-thumb-fixer.php:332 
    109109#, php-format 
    110110msgid "" 
     
    113113msgstr "" 
    114114 
    115 #: _facebook-thumb-fixer.php:333 
     115#: _facebook-thumb-fixer.php:334 home-preview.php:2 
    116116msgid "Homepage Preview" 
    117117msgstr "" 
    118118 
    119 #: _facebook-thumb-fixer.php:334 
     119#: _facebook-thumb-fixer.php:335 
    120120msgid "" 
    121121"This is an approximate preview of your homepage when shared on Facebook:" 
    122122msgstr "" 
    123123 
    124 #: _facebook-thumb-fixer.php:363 
    125 #, php-format 
    126 msgid "" 
    127 "<strong>Note:</strong> Facebook <a href=\"%1$s\" target=\"_blank" 
    128 "\">recommends</a> your image be 1200 x 630 or 600 x 315. Your image (show " 
    129 "here scaled down) is %2$s x %3$s." 
    130 msgstr "" 
    131  
    132 #: _facebook-thumb-fixer.php:368 
    133 #, php-format 
    134 msgid "" 
    135 "<strong>WARNING:</strong> Although you do have a default Facebook thumbnail, " 
     124#: _facebook-thumb-fixer.php:370 
     125#, php-format 
     126msgid "" 
     127"<strong>Note: </strong>Facebook <a href=\"%1$s\" target=\"_blank" 
     128"\">recommends</a> your image be 1200 x 630 or 600 x 315." 
     129msgstr "" 
     130 
     131#: _facebook-thumb-fixer.php:372 
     132#, php-format 
     133msgid "Your image (shown here scaled down) appears to be good at %1$s x %2$s." 
     134msgstr "" 
     135 
     136#: _facebook-thumb-fixer.php:379 
     137#, php-format 
     138msgid "" 
     139"<strong>Oops! </strong>Although you do have a default Facebook thumbnail, " 
    136140"the dimensions are smaller than the minimum 600 x 315 <a href=\"%1$s\" " 
    137141"target=\"_blank\">recommended</a> by Facebook." 
    138142msgstr "" 
    139143 
    140 #: _facebook-thumb-fixer.php:375 
     144#: _facebook-thumb-fixer.php:386 
    141145#, php-format 
    142146msgid "" 
     
    145149msgstr "" 
    146150 
    147 #: _facebook-thumb-fixer.php:397 
     151#: _facebook-thumb-fixer.php:408 
    148152msgid "Where can I get support?" 
    149153msgstr "" 
    150154 
    151 #: _facebook-thumb-fixer.php:399 
     155#: _facebook-thumb-fixer.php:410 
    152156#, php-format 
    153157msgid "" 
     
    156160msgstr "" 
    157161 
     162#: home-preview.php:2 post-preview.php:11 
     163msgid "Debug" 
     164msgstr "" 
     165 
     166#: home-preview.php:3 
     167msgid "View an approximate preview of your homepage when shared on Facebook." 
     168msgstr "" 
     169 
     170#: post-preview.php:9 
     171msgid "View an approximate preview of your post when shared on Facebook." 
     172msgstr "" 
     173 
     174#: post-preview.php:12 
     175msgid "" 
     176"If in doubt, try forcing Facebook to fetch your page with their debugging " 
     177"tool." 
     178msgstr "" 
     179 
     180#: post-preview.php:15 
     181#, php-format 
     182msgid "" 
     183"<strong>Oops! </strong>Your featured image dimensions are %1$s x %2$s which " 
     184"is smaller than the minimum 600 x 315 <a href=\"%3$s\" target=\"_blank" 
     185"\">recommended</a> by Facebook." 
     186msgstr "" 
     187 
     188#: post-preview.php:20 
     189msgid "Preview Not Available" 
     190msgstr "" 
     191 
     192#: post-preview.php:21 
     193msgid "" 
     194"You can't preview until you set a featured image and update this post/page." 
     195msgstr "" 
     196 
    158197#. Plugin Name of the plugin/theme 
    159198msgid "Facebook Thumb Fixer" 
  • facebook-thumb-fixer/trunk/post-preview.php

    r1695009 r1695503  
    11<?php 
    2 if ( has_post_thumbnail() ) { 
    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 ?> 
     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]; 
     6if ( has_post_thumbnail() ) { ?> 
    77    <hr class="ftf-rule" /> 
    88    <a class="open-ftf-preview">Preview</a> 
    9     <p>View an approximate preview of your post when shared on Facebook.</p> 
     9    <p><?php _e( 'View an approximate preview of your post when shared on Facebook.', 'facebook-thumbnail-fixer' ); ?></p> 
    1010    <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">Debug</a></p> 
    12     <p>If in doubt, try forcing Facebook to fetch your page with their debugging tool.</p> 
     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> 
    1313     
    1414    <?php if ($image_width < 600 || $image_height < 315) { ?> 
    15         <p class="ftf-warning"><strong>WARNING:</strong> Your featured image dimensions are <?php echo $image_width . " x " . $image_height; ?> which is smaller than the minimum 600 x 315 <a href="https://developers.facebook.com/docs/sharing/best-practices#images" target="_blank">recommended</a> by Facebook.</p> 
     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> 
    1616    <?php } ?> 
    1717 
    1818<?php } else { ?> 
    1919 
    20     <a class="no-thumb-set">Preview Not Available</a> 
    21     <p>You can't preview until you set a featured image and update this post/page.</p> 
     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> 
    2222     
    2323<?php } ?> 
  • facebook-thumb-fixer/trunk/readme.txt

    r1695009 r1695503  
    5353 
    5454== Changelog == 
     55 
     56= 1.7.1 = 
     57 
     58Employed more reliable method for determining image dimensions. 
     59Added debug button for homepage testing. 
     60Added missing translation strings. 
    5561 
    5662= 1.7 = 
Note: See TracChangeset for help on using the changeset viewer.