Login Logo - Version 0.6

Version Description

  • You can provide login-logo-site-{$blog_id}.png to have a different logo per multisite site.
  • Support for WordPress 3.4
  • Changed the ideal image width to 312 pixels, and instituted a tighter crop policy.
Download this release

Release Info

Developer markjaquith
Plugin Icon wp plugin Login Logo
Version 0.6
Comparing to
See all releases

Code changes from version 0.5 to 0.6

Files changed (2) hide show
  1. login-logo.php +40 -5
  2. readme.txt +19 -7
login-logo.php CHANGED
@@ -1,16 +1,35 @@
1
  <?php
2
  /*
3
  Plugin Name: Login Logo
4
- Description: Drop a PNG file named <code>login-logo.png</code> into your <code>wp-content</code> directory. This simple plugin takes care of the rest, with zero configuration. Transparent backgrounds work best. Keep the width below 326 pixels.
5
- Version: 0.5
6
  License: GPL
 
7
  Author: Mark Jaquith
8
  Author URI: http://coveredwebservices.com/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
 
11
  class CWS_Login_Logo_Plugin {
12
  static $instance;
13
- const cutoff = 326;
14
  var $logo_locations;
15
  var $logo_location;
16
  var $width = 0;
@@ -26,8 +45,16 @@ class CWS_Login_Logo_Plugin {
26
  }
27
 
28
  public function init() {
 
29
  $this->logo_locations = array();
30
  if ( is_multisite() && function_exists( 'get_current_site' ) ) {
 
 
 
 
 
 
 
31
  $site = get_current_site(); // Site = Network? Ugh.
32
  if ( $site && isset( $site->id ) ) {
33
  $this->logo_locations['network'] = array(
@@ -36,6 +63,7 @@ class CWS_Login_Logo_Plugin {
36
  );
37
  }
38
  }
 
39
  $this->logo_locations['global'] = array(
40
  'path' => WP_CONTENT_DIR . '/login-logo.png',
41
  'url' => $this->maybe_ssl( WP_CONTENT_URL . '/login-logo.png' )
@@ -137,8 +165,15 @@ class CWS_Login_Logo_Plugin {
137
  .login h1 a {
138
  background: url(<?php echo esc_url_raw( $this->get_location( 'url' ) ); ?>) no-repeat top center;
139
  width: <?php echo self::cutoff; ?>px;
140
- height: <?php echo $this->get_height() + 3; ?>px;
141
- <?php if ( self::cutoff < $this->get_original_width() ) $this->css3( 'background-size', 'contain' ); ?>
 
 
 
 
 
 
 
142
  }
143
  </style>
144
  <?php if ( self::cutoff < $this->get_width() ) { ?>
1
  <?php
2
  /*
3
  Plugin Name: Login Logo
4
+ Description: Drop a PNG file named <code>login-logo.png</code> into your <code>wp-content</code> directory. This simple plugin takes care of the rest, with zero configuration. Transparent backgrounds work best. Crop it tight, with a width of 312 pixels, for best results.
5
+ Version: 0.6
6
  License: GPL
7
+ Plugin URI: http://txfx.net/wordpress-plugins/login-logo/
8
  Author: Mark Jaquith
9
  Author URI: http://coveredwebservices.com/
10
+
11
+ ==========================================================================
12
+
13
+ Copyright 2011-2012 Mark Jaquith
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License as published by
17
+ the Free Software Foundation; either version 2 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU General Public License for more details.
24
+
25
+ You should have received a copy of the GNU General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
  */
29
 
30
  class CWS_Login_Logo_Plugin {
31
  static $instance;
32
+ const cutoff = 312;
33
  var $logo_locations;
34
  var $logo_location;
35
  var $width = 0;
45
  }
46
 
47
  public function init() {
48
+ global $blog_id;
49
  $this->logo_locations = array();
50
  if ( is_multisite() && function_exists( 'get_current_site' ) ) {
51
+ // First, see if there is one for this specific site (blog)
52
+ $this->logo_locations['site'] = array(
53
+ 'path' => WP_CONTENT_DIR . '/login-logo-site-' . $blog_id . '.png',
54
+ 'url' => $this->maybe_ssl( WP_CONTENT_URL . '/login-logo-site-' . $blog_id . '.png' )
55
+ );
56
+
57
+ // Next, we see if there is one for this specific network
58
  $site = get_current_site(); // Site = Network? Ugh.
59
  if ( $site && isset( $site->id ) ) {
60
  $this->logo_locations['network'] = array(
63
  );
64
  }
65
  }
66
+ // Finally, we do a global lookup
67
  $this->logo_locations['global'] = array(
68
  'path' => WP_CONTENT_DIR . '/login-logo.png',
69
  'url' => $this->maybe_ssl( WP_CONTENT_URL . '/login-logo.png' )
165
  .login h1 a {
166
  background: url(<?php echo esc_url_raw( $this->get_location( 'url' ) ); ?>) no-repeat top center;
167
  width: <?php echo self::cutoff; ?>px;
168
+ height: <?php echo $this->get_height(); ?>px;
169
+ margin-left: 8px;
170
+ padding-bottom: 16px;
171
+ <?php
172
+ if ( self::cutoff < $this->get_original_width() )
173
+ $this->css3( 'background-size', 'contain' );
174
+ else
175
+ $this->css3( 'background-size', 'auto' );
176
+ ?>
177
  }
178
  </style>
179
  <?php if ( self::cutoff < $this->get_width() ) { ?>
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: markjaquith
3
  Donate link: http://txfx.net/wordpress-plugins/donate
4
  Tags: customize, login, login screen, logo, custom logo
5
- Requires at least: 3.0
6
- Tested up to: 3.3
7
- Stable tag: 0.5
8
 
9
  Customize the logo on the WP login screen by simply dropping a file named login-logo.png into your WP content directory. CSS is automatic!
10
 
@@ -12,7 +12,7 @@ Customize the logo on the WP login screen by simply dropping a file named login-
12
 
13
  This plugin allows you to customize the logo on the WordPress login screen. There is zero configuration. You just drop the logo file into your WordPress content directory, named `login-logo.png` and this plugin takes over.
14
 
15
- Note that you should use a transparent background on the PNG image and keep the width below 326 pixels for best results. Larger images will be downsized in modern browsers, but it isn't recommended to rely on that.
16
 
17
  This plugin also works in the `mu-plugins` directory.
18
 
@@ -20,13 +20,15 @@ This plugin also works in the `mu-plugins` directory.
20
 
21
  1. [Click here](http://coveredwebservices.com/wp-plugin-install/?plugin=login-logo) to install and activate.
22
 
23
- 2. Create a PNG image of less than 326 pixels wide, with a transparent background.
24
 
25
  3. Upload the PNG image to your WordPress content directory (`/wp-content/`, by default), and name the file `login-logo.png`.
26
 
27
  4. If you have a multisite install with more than one network, you can also use `login-logo-network-{NETWORK ID}.png` to assign a different login logo to each network.
28
 
29
- 5. Done! The login screen will now use your logo.
 
 
30
 
31
  == Screenshots ==
32
 
@@ -38,10 +40,16 @@ This plugin also works in the `mu-plugins` directory.
38
 
39
  = Why does my image look strange in IE or an outdated browser? =
40
 
41
- Your image is probably too wide. Wide images are scaled down in IE 9 or other modern browsers, but not in older browsers. Use an image that is no more than 326 pixels wide.
42
 
43
 
44
  == Changelog ==
 
 
 
 
 
 
45
  = 0.5 =
46
  * Support for WordPress 3.3
47
  * Fix a bug in CSS resizing of oversized images
@@ -61,6 +69,10 @@ Your image is probably too wide. Wide images are scaled down in IE 9 or other mo
61
  * Original version
62
 
63
  == Upgrade Notice ==
 
 
 
 
64
  = 0.5 =
65
  Upgrade immediately or the plugin will not work in WordPress 3.3!
66
 
2
  Contributors: markjaquith
3
  Donate link: http://txfx.net/wordpress-plugins/donate
4
  Tags: customize, login, login screen, logo, custom logo
5
+ Requires at least: 3.3
6
+ Tested up to: 3.4
7
+ Stable tag: 0.6
8
 
9
  Customize the logo on the WP login screen by simply dropping a file named login-logo.png into your WP content directory. CSS is automatic!
10
 
12
 
13
  This plugin allows you to customize the logo on the WordPress login screen. There is zero configuration. You just drop the logo file into your WordPress content directory, named `login-logo.png` and this plugin takes over.
14
 
15
+ Note that you should use a transparent background on the PNG image, crop it tightly (no padding pixels) and use a width of exactly 312 pixels for best results. Wider images will be downscaled in modern browsers, but it isn't recommended to rely on that.
16
 
17
  This plugin also works in the `mu-plugins` directory.
18
 
20
 
21
  1. [Click here](http://coveredwebservices.com/wp-plugin-install/?plugin=login-logo) to install and activate.
22
 
23
+ 2. Create a PNG image with a transparent background, tightly cropped, with a recommended width of 312 pixels.
24
 
25
  3. Upload the PNG image to your WordPress content directory (`/wp-content/`, by default), and name the file `login-logo.png`.
26
 
27
  4. If you have a multisite install with more than one network, you can also use `login-logo-network-{NETWORK ID}.png` to assign a different login logo to each network.
28
 
29
+ 5. If you have a multisite install, you can also use `login-logo-site-{$blog_id}.png` to assign a different login logo to each site.
30
+
31
+ 6. Done! The login screen will now use your logo.
32
 
33
  == Screenshots ==
34
 
40
 
41
  = Why does my image look strange in IE or an outdated browser? =
42
 
43
+ Your image is probably too wide. Wide images are scaled down in IE 9 or other modern browsers, but not in older browsers. Use an image that is no more than 312 pixels wide.
44
 
45
 
46
  == Changelog ==
47
+
48
+ = 0.6 =
49
+ * You can provide `login-logo-site-{$blog_id}.png` to have a different logo per multisite site.
50
+ * Support for WordPress 3.4
51
+ * Changed the ideal image width to 312 pixels, and instituted a tighter crop policy.
52
+
53
  = 0.5 =
54
  * Support for WordPress 3.3
55
  * Fix a bug in CSS resizing of oversized images
69
  * Original version
70
 
71
  == Upgrade Notice ==
72
+
73
+ = 0.6 =
74
+ Upgrade now for WordPress 3.4 support! Also adds the ability to set a custom logo per site on a network.
75
+
76
  = 0.5 =
77
  Upgrade immediately or the plugin will not work in WordPress 3.3!
78