Favicon by RealFaviconGenerator - Version 1.0.5

Version Description

  • Do not try to rewrite the favicon files URL when .htaccess is not writable.
Download this release

Release Info

Developer phbernard
Plugin Icon 128x128 Favicon by RealFaviconGenerator
Version 1.0.5
Comparing to
See all releases

Code changes from version 1.0.4 to 1.0.5

README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: phbernard
3
  Tags: favicon, apple-touch-icon, realfavicongenerator
4
  Requires at least: 3.5
5
  Tested up to: 3.9.1
6
- Stable tag: 1.0.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -61,6 +61,10 @@ This screen presents you a preview of the favicon you various platforms, so you
61
 
62
  == Changelog ==
63
 
 
 
 
 
64
  = 1.0.4 =
65
 
66
  - Option to not rewrite the favicon files URL, even when this is possible.
3
  Tags: favicon, apple-touch-icon, realfavicongenerator
4
  Requires at least: 3.5
5
  Tested up to: 3.9.1
6
+ Stable tag: 1.0.5
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
61
 
62
  == Changelog ==
63
 
64
+ = 1.0.5 =
65
+
66
+ - Do not try to rewrite the favicon files URL when .htaccess is not writable.
67
+
68
  = 1.0.4 =
69
 
70
  - Option to not rewrite the favicon files URL, even when this is possible.
admin/class-favicon-by-realfavicongenerator-admin.php CHANGED
@@ -248,7 +248,18 @@ class Favicon_By_RealFaviconGenerator_Admin extends Favicon_By_RealFaviconGenera
248
 
249
  // If blog is in root AND rewriting is available (http://wordpress.stackexchange.com/questions/142273/checking-that-the-rewrite-api-is-available),
250
  // we can produce URLs such as /favicon.ico
251
- return ( $this->wp_in_root() && $wp_rewrite->using_permalinks() );
 
 
 
 
 
 
 
 
 
 
 
252
  }
253
 
254
  /**
248
 
249
  // If blog is in root AND rewriting is available (http://wordpress.stackexchange.com/questions/142273/checking-that-the-rewrite-api-is-available),
250
  // we can produce URLs such as /favicon.ico
251
+ $rewrite = ( $this->wp_in_root() && $wp_rewrite->using_permalinks() );
252
+ if ( ! $rewrite ) {
253
+ return false;
254
+ }
255
+
256
+ // See http://wordpress.org/support/topic/fbrfg-not-updating-htaccess-rewrite-rules
257
+ $htaccess = get_home_path() . DIRECTORY_SEPARATOR . '.htaccess';
258
+ // Two cases:
259
+ // - There is no .htaccess. Either we are not using Apache (so the Rewrite API is supposed to handle
260
+ // the rewriting differently) or there is a problem with Apache/WordPress config, but this is not our job.
261
+ // - .htaccess is present. If so, it should be writable.
262
+ return ( ( ! file_exists( $htaccess ) ) || is_writable( $htaccess ) );
263
  }
264
 
265
  /**
favicon-by-realfavicongenerator.php CHANGED
@@ -12,7 +12,7 @@
12
  * Plugin Name: Favicon by RealFaviconGenerator
13
  * Plugin URI: http://realfavicongenerator.net/extensions/wordpress
14
  * Description: Create and install your favicon for all platforms: PC/Mac of course, but also iPhone/iPad, Android devices, Windows 8 tablets, etc.
15
- * Version: 1.0.4
16
  * Author: Philippe Bernard
17
  * Author URI: http://realfavicongenerator.net/
18
  * License: GPLv2
12
  * Plugin Name: Favicon by RealFaviconGenerator
13
  * Plugin URI: http://realfavicongenerator.net/extensions/wordpress
14
  * Description: Create and install your favicon for all platforms: PC/Mac of course, but also iPhone/iPad, Android devices, Windows 8 tablets, etc.
15
+ * Version: 1.0.5
16
  * Author: Philippe Bernard
17
  * Author URI: http://realfavicongenerator.net/
18
  * License: GPLv2