Favicon by RealFaviconGenerator - Version 1.0.1

Version Description

  • Favicon admin settings are now in the Appearance menu.
  • Fix in favicon package download.
  • Fix in error management during favicon installation.
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.0.1

README.txt CHANGED
@@ -3,13 +3,11 @@ Contributors: phbernard
3
  Tags: favicon, apple-touch-icon, realfavicongenerator
4
  Requires at least: 3.5
5
  Tested up to: 3.9
6
- Stable tag: 1.0.0
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- Create and install your favicon for all platforms: PC/Mac of course, but also iPhone/iPad, Android devices, Windows 8 tablets, etc.
11
-
12
- In a few clicks, you generate all the pictures you need to get the best results on all devices, from an old Android phone to a shiny Retina iPad. In addition, you can easily enforce the various platforms guidelines, such as an opaque background for the Apple touch icon or a saturated icon for Windows Metro UI tile. Better your odds at being bookmarked by providing the best experience to your visitors.
13
 
14
  == Description ==
15
 
@@ -26,7 +24,7 @@ Save hours of research and image edition with RealFaviconGenerator and its compa
26
  - iOS (Safari, Chrome, Coast)
27
  - Android (Chrome, Firefox)
28
  - Surface (IE)
29
- - ANd more
30
 
31
  We take compatibility very seriously. See http://realfavicongenerator.net/favicon_compatibility for the full list.
32
 
@@ -38,7 +36,7 @@ We take compatibility very seriously. See http://realfavicongenerator.net/favico
38
  2. Search for 'Favicon by RealFaviconGenerator'
39
  3. Click 'Install Now'
40
  4. Activate the plugin on the Plugin dashboard
41
- 5. Navigate to the 'Favicon' entry in the Settings menu
42
  6. Select a master picture from the Media Library (optional)
43
  7. Click the 'Generate Favicon' button and follow the instructions.
44
 
@@ -48,7 +46,7 @@ We take compatibility very seriously. See http://realfavicongenerator.net/favico
48
  2. Extract the `favicon-by-realfavicongenerator` directory to your computer
49
  3. Upload the `favicon-by-realfavicongenerator` directory to the `/wp-content/plugins/` directory
50
  4. Activate the plugin on the Plugin dashboard
51
- 5. Navigate to the 'Favicon' entry in the Settings menu
52
  6. Select a master picture from the Media Library (optional)
53
  7. Click the 'Generate Favicon' button and follow the instructions.
54
 
@@ -63,5 +61,11 @@ This screen presents you a preview of the favicon you various platforms, so you
63
 
64
  == Changelog ==
65
 
 
 
 
 
 
 
66
  = 1.0 =
67
  Initial version.
3
  Tags: favicon, apple-touch-icon, realfavicongenerator
4
  Requires at least: 3.5
5
  Tested up to: 3.9
6
+ Stable tag: 1.0.1
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ Create and install your favicon for all platforms: PC/Mac of course, but also iPhone/iPad, Android devices, Windows 8 tablets...
 
 
11
 
12
  == Description ==
13
 
24
  - iOS (Safari, Chrome, Coast)
25
  - Android (Chrome, Firefox)
26
  - Surface (IE)
27
+ - And more
28
 
29
  We take compatibility very seriously. See http://realfavicongenerator.net/favicon_compatibility for the full list.
30
 
36
  2. Search for 'Favicon by RealFaviconGenerator'
37
  3. Click 'Install Now'
38
  4. Activate the plugin on the Plugin dashboard
39
+ 5. Navigate to the 'Favicon' entry in the Appearance menu
40
  6. Select a master picture from the Media Library (optional)
41
  7. Click the 'Generate Favicon' button and follow the instructions.
42
 
46
  2. Extract the `favicon-by-realfavicongenerator` directory to your computer
47
  3. Upload the `favicon-by-realfavicongenerator` directory to the `/wp-content/plugins/` directory
48
  4. Activate the plugin on the Plugin dashboard
49
+ 5. Navigate to the 'Favicon' entry in the Appearance menu
50
  6. Select a master picture from the Media Library (optional)
51
  7. Click the 'Generate Favicon' button and follow the instructions.
52
 
61
 
62
  == Changelog ==
63
 
64
+ = 1.0.1 =
65
+
66
+ - Favicon admin settings are now in the Appearance menu.
67
+ - Fix in favicon package download.
68
+ - Fix in error management during favicon installation.
69
+
70
  = 1.0 =
71
  Initial version.
admin/class-favicon-by-realfavicongenerator-admin.php CHANGED
@@ -45,7 +45,7 @@ class Favicon_By_RealFaviconGenerator_Admin extends Favicon_By_RealFaviconGenera
45
  }
46
 
47
  public function create_favicon_settings_menu() {
48
- add_options_page( __( 'Favicon Settings', Favicon_By_RealFaviconGenerator_Common::PLUGIN_SLUG ),
49
  __( 'Favicon', Favicon_By_RealFaviconGenerator_Common::PLUGIN_SLUG ), 'manage_options', __FILE__ . 'favicon_settings_menu',
50
  array( $this, 'create_favicon_settings_page' ) );
51
  }
@@ -99,7 +99,6 @@ class Favicon_By_RealFaviconGenerator_Admin extends Favicon_By_RealFaviconGenera
99
  $result = urldecode( stripslashes_deep( $_REQUEST['json_result'] ) );
100
 
101
  $response = new Favicon_By_RealFaviconGenerator_Api_Response( $result );
102
- update_option( Favicon_By_RealFaviconGenerator_Common::OPTION_HTML_CODE, $response->getHtmlCode() );
103
 
104
  $zip_path = Favicon_By_RealFaviconGenerator_Common::get_tmp_dir();
105
  if ( ! file_exists( $zip_path ) ) {
@@ -113,6 +112,8 @@ class Favicon_By_RealFaviconGenerator_Admin extends Favicon_By_RealFaviconGenera
113
 
114
  Favicon_By_RealFaviconGenerator_Common::remove_directory( $zip_path );
115
 
 
 
116
  $this->set_favicon_configured();
117
  ?>
118
  {
45
  }
46
 
47
  public function create_favicon_settings_menu() {
48
+ add_theme_page( __( 'Favicon Settings', Favicon_By_RealFaviconGenerator_Common::PLUGIN_SLUG ),
49
  __( 'Favicon', Favicon_By_RealFaviconGenerator_Common::PLUGIN_SLUG ), 'manage_options', __FILE__ . 'favicon_settings_menu',
50
  array( $this, 'create_favicon_settings_page' ) );
51
  }
99
  $result = urldecode( stripslashes_deep( $_REQUEST['json_result'] ) );
100
 
101
  $response = new Favicon_By_RealFaviconGenerator_Api_Response( $result );
 
102
 
103
  $zip_path = Favicon_By_RealFaviconGenerator_Common::get_tmp_dir();
104
  if ( ! file_exists( $zip_path ) ) {
112
 
113
  Favicon_By_RealFaviconGenerator_Common::remove_directory( $zip_path );
114
 
115
+ update_option( Favicon_By_RealFaviconGenerator_Common::OPTION_HTML_CODE, $response->getHtmlCode() );
116
+
117
  $this->set_favicon_configured();
118
  ?>
119
  {
admin/class-favicon-by-realfavicongenerator-api-response.php CHANGED
@@ -208,13 +208,13 @@ class Favicon_By_RealFaviconGenerator_Api_Response {
208
  }
209
 
210
  private function downloadFile( $localPath, $url ) {
211
- $content = file_get_contents( $url );
212
- if ( $content === FALSE ) {
 
213
  throw new InvalidArgumentException( "Cannot download file at " . $url );
214
  }
215
- $ret = file_put_contents( $localPath, $content );
216
- if ( $ret === FALSE ) {
217
- throw new InvalidArgumentException( "Cannot store content of " . $url . " to " . $localPath );
218
  }
219
  }
220
 
208
  }
209
 
210
  private function downloadFile( $localPath, $url ) {
211
+ $resp = wp_remote_get( $url, array( 'filename' => $localPath, 'stream' => true ) );
212
+ if ( ( $resp == NULL ) || ( $resp == false ) || ( $resp['response'] == NULL ) ||
213
+ ( $resp['response']['code'] == NULL ) || ( $resp['response']['code'] != 200 ) ) {
214
  throw new InvalidArgumentException( "Cannot download file at " . $url );
215
  }
216
+ if ( ( ! file_exists( $localPath ) ) || ( filesize( $localPath ) <= 0 ) ) {
217
+ throw new InvalidArgumentException( "Cannot store downloaded file locally" );
 
218
  }
219
  }
220
 
admin/views/settings.php CHANGED
@@ -116,7 +116,7 @@
116
  <?php } ?>
117
 
118
  params.favicon_generation.callback.type = 'url';
119
- params.favicon_generation.callback.url = "<?php echo admin_url('options-general.php?page=favicon-by-realfavicongenerator/admin/class-favicon-by-realfavicongenerator-admin.phpfavicon_settings_menu') ?>";
120
 
121
  return params;
122
  }
116
  <?php } ?>
117
 
118
  params.favicon_generation.callback.type = 'url';
119
+ params.favicon_generation.callback.url = "<?php echo admin_url('themes.php?page=favicon-by-realfavicongenerator/admin/class-favicon-by-realfavicongenerator-admin.phpfavicon_settings_menu') ?>";
120
 
121
  return params;
122
  }
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
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.1
16
  * Author: Philippe Bernard
17
  * Author URI: http://realfavicongenerator.net/
18
  * License: GPLv2