TCO White Label wont work on CDN or AWS

I have been experiencing issues with white labeling the WP login with company logos.

If sites use a CDN or AWS then it wont actually be able to pull in the image size, and therefore sets the dimensions of the image to ’ px’ or ‘0px’ if set to use retina support for logo. It will then give an error (see the screen shot attached). If you leave retina off it will at least use the default background-size: 84px; from the core style setting.

So it would be helpful to add in a field to set the width of the logo like you do for the main logo of the website. Because the code $image = getimagesize( $tco_white_label_login_image );

Here is your function that tries to pull in the image size. But this is a limitation of AWS and you cannot get that info directly.

function tco_white_label_output_login_styles() {

  require( TCO_WHITE_LABEL_PATH . '/functions/options.php' );

  if ( isset( $tco_white_label_enable ) && $tco_white_label_enable == 1 ) {
    if ( $tco_white_label_login_image != '' ) {

  $image  = getimagesize( $tco_white_label_login_image );
  $width   = ( ( $tco_white_label_retina_enabled ) ? $image[0] / 2 : $image[0] ) . 'px';
  $height  = ( ( $tco_white_label_retina_enabled ) ? $image[1] / 2 : $image[1] ) . 'px';
  $size   = $width . ' ' . $height;

  ?>

  <style id="tco-white-label-login-css" type="text/css">

    body.login div#login h1 a {
      width: <?php echo $width; ?>;
      height: <?php echo $height; ?>;
      background-image: url(<?php echo $tco_white_label_login_image; ?>);
          -webkit-background-size: <?php echo $size; ?>;
                  background-size: <?php echo $size; ?>;
        }

      </style>

    <?php }
  }

}

Hey @designerken,

Thanks for reporting. I’ll post this in our issue tracker so our development team could be made aware.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.