Why does the Favicon by RealFaviconGenerator WordPress plugin need to be activated all the time?

Here is how to use the Favicon by RealFaviconGenerator WordPress plugin:

  • Install and activate the plugin
  • Go to Appearance > Favicon
  • Design and setup the favicon. Well done!
  • Forget about it

Now, it is tempting to say “Hey, the mission of the plugin is completed. Let’s deactivate it”. Bad move. The plugin needs to be active all the time.

Granted: most of the work is done at creation time, when the favicon is setup. However, the plugin has something to do every time to fulfill its purpose: it must inject special HTML markups in all pages served by WordPress. This is done dynamically. In other words, each time a visitor views a page of your site, Favicon by RealFaviconGenerator is triggered and sends him the favicon markups.

“Wait, doesn’t it slow down my site?” you are wondering. Don’t worry, the plugin was designed to be extremely lightweight and does not affect the performance of WordPress.

If you ever install a favicon manually in WordPress, you may have edited a file called header.php. So you may wonder why the plugin does not behave in a similar fashion. Modifying header.php is actually a bad practice. The major issue is a theme switch. Because header.php comes from the current theme, it is changed whenever you change or update your theme. This is when things start to be messy and you wish your plugins had a better, modular design.

We aim at providing the best experience for favicon on WordPress. If you have questions, please leave us a comment.

RFG’s WordPress plugin and performance

RealFaviconGenerator’s favicon plugin for WordPress is the most convenient way to install a favicon in a WordPress site with RFG. But it regularly raises a question: how does the plugin affect performance? This is a legit question. You certainly don’t want to slow down your site just for a neat favicon.

TL; DR

RFG’s plugin itself doesn’t affect the performance of a WordPress site. The public side was designed to be very lightweight, so your visitors won’t notice any change before/after you installed the plugin.

As an aside: for the favicon to work, the plugin must be kept activated. As soon as you deactivate it, the favicon markups are not injected anymore. From your visitors point of view, this is as if you didn’t have favicon at all.

Benchmark

Never trust a developer who simply tells you he has written efficient code. Ask for a proof.

The methodology for this benchmark is:

  • Install a vanilla WordPress 4.6.1. No additional plugins or theme, no fresh content. Just an up-and-running, minimalist WordPress.
  • Benchmark the homepage and the default post page.
  • Install and activate Favicon by RealFaviconGenerator. Setup a favicon.
  • Benchmark the homepage and the default post page again.

… and compare the “without plugin” and “with plugin” results.

As expected, the site is a bit slower when the plugin is installed and active. This is normal: it asks for a bit of processing time to inject the favicon markups in the page and the page becomes larger, taking more time to be transmitted.

And now, some figures. The original homepage is 11497 bytes large. In my benchmark, the average time per request is 26.366ms. Once the favicon is setup, the homepage is 12304 bytes large, a 7% gain. That sounds like a huge increase but it’s not considering how light the original homepage is. Plus, the plugin had no real influence at that point: this is just a reasonable amount of code to declare a Touch icon, a manifest file for Android, etc. Any other solution (like hacking wp-header.php) would do the same. What about the response time? With the favicon installed, it is 26.669ms. The increase is about 1.1%, a small increase probably mostly due to the additional amount of transmitted data.

As a comparison, when Yoast SEO is installed (along with Favicon by RealFaviconGenerator, still active), the page is now 13533 bytes (17.7% increase) and the average response time is 35.597ms (35% increase). This time, the augmentation is significant, although widely accepted across the WordPress community.

Appendix

The following outputs were obtained by running ab -n 1000 -c 5 http://mylocalsite.com/ or ab -n 1000 -c 5 http://mylocalsite.com/index.php/2016/09/19/hello-world/.

Vanilly WordPress

Fresh install, absolutely no plugin.

Homepage

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.0.0.87 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.7
Server Hostname:        10.0.0.87
Server Port:            80

Document Path:          /wordpress4benchmark/
Document Length:        11497 bytes

Concurrency Level:      5
Time taken for tests:   26.366 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      11784000 bytes
HTML transferred:       11497000 bytes
Requests per second:    37.93 [#/sec] (mean)
Time per request:       131.832 [ms] (mean)
Time per request:       26.366 [ms] (mean, across all concurrent requests)
Transfer rate:          436.46 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       4
Processing:    57  132  11.6    130     249
Waiting:       50   91  12.1     90     171
Total:         57  132  11.6    130     249

Percentage of the requests served within a certain time (ms)
  50%    130
  66%    134
  75%    136
  80%    138
  90%    144
  95%    151
  98%    160
  99%    168
 100%    249 (longest request)

Default post

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.0.0.87 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.7
Server Hostname:        10.0.0.87
Server Port:            80

Document Path:          /wordpress4benchmark/index.php/2016/09/19/hello-world/
Document Length:        15825 bytes

Concurrency Level:      5
Time taken for tests:   30.330 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      16239000 bytes
HTML transferred:       15825000 bytes
Requests per second:    32.97 [#/sec] (mean)
Time per request:       151.652 [ms] (mean)
Time per request:       30.330 [ms] (mean, across all concurrent requests)
Transfer rate:          522.85 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       3
Processing:    57  151  13.6    149     284
Waiting:       48   93  12.1     91     212
Total:         57  152  13.6    149     284

Percentage of the requests served within a certain time (ms)
  50%    149
  66%    153
  75%    156
  80%    159
  90%    166
  95%    173
  98%    186
  99%    213
 100%    284 (longest request)

WordPress + Favicon by RealFaviconGenerator

Favicon by RealFaviconGenerator is installed and enabled.

Homepage

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.0.0.87 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.7
Server Hostname:        10.0.0.87
Server Port:            80

Document Path:          /wordpress4benchmark/
Document Length:        12304 bytes

Concurrency Level:      5
Time taken for tests:   26.669 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      12591000 bytes
HTML transferred:       12304000 bytes
Requests per second:    37.50 [#/sec] (mean)
Time per request:       133.345 [ms] (mean)
Time per request:       26.669 [ms] (mean, across all concurrent requests)
Transfer rate:          461.05 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       6
Processing:    78  133   9.4    132     210
Waiting:       60   85   9.3     85     165
Total:         78  133   9.4    132     215

Percentage of the requests served within a certain time (ms)
  50%    132
  66%    136
  75%    138
  80%    140
  90%    144
  95%    148
  98%    153
  99%    160
 100%    215 (longest request)

Default post

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.0.0.87 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.7
Server Hostname:        10.0.0.87
Server Port:            80

Document Path:          /wordpress4benchmark/index.php/2016/09/19/hello-world/
Document Length:        16632 bytes

Concurrency Level:      5
Time taken for tests:   30.391 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      17046000 bytes
HTML transferred:       16632000 bytes
Requests per second:    32.90 [#/sec] (mean)
Time per request:       151.955 [ms] (mean)
Time per request:       30.391 [ms] (mean, across all concurrent requests)
Transfer rate:          547.74 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   113  152  12.4    150     246
Waiting:       71   94  11.5     93     189
Total:        113  152  12.4    150     246

Percentage of the requests served within a certain time (ms)
  50%    150
  66%    154
  75%    156
  80%    157
  90%    163
  95%    169
  98%    192
  99%    208
 100%    246 (longest request)

WordPress + Favicon by RealFaviconGenerator + Yoast SEO

Favicon by RealFaviconGenerator and Yoast SEO are installed and enabled.

Homepage

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.0.0.87 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.7
Server Hostname:        10.0.0.87
Server Port:            80

Document Path:          /wordpress4benchmark/
Document Length:        13533 bytes

Concurrency Level:      5
Time taken for tests:   35.597 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      13820000 bytes
HTML transferred:       13533000 bytes
Requests per second:    28.09 [#/sec] (mean)
Time per request:       177.985 [ms] (mean)
Time per request:       35.597 [ms] (mean, across all concurrent requests)
Transfer rate:          379.14 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       4
Processing:   116  178  13.6    176     262
Waiting:       87  114  12.1    112     186
Total:        116  178  13.6    176     262

Percentage of the requests served within a certain time (ms)
  50%    176
  66%    180
  75%    184
  80%    185
  90%    194
  95%    200
  98%    220
  99%    227
 100%    262 (longest request)

Default post

This is ApacheBench, Version 2.3 <$Revision: 1528965 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.0.0.87 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software:        Apache/2.4.7
Server Hostname:        10.0.0.87
Server Port:            80

Document Path:          /wordpress4benchmark/index.php/2016/09/19/hello-world/
Document Length:        17630 bytes

Concurrency Level:      5
Time taken for tests:   40.536 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      18044000 bytes
HTML transferred:       17630000 bytes
Requests per second:    24.67 [#/sec] (mean)
Time per request:       202.682 [ms] (mean)
Time per request:       40.536 [ms] (mean, across all concurrent requests)
Transfer rate:          434.70 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   128  203  14.5    201     289
Waiting:       90  122  12.4    121     199
Total:        128  203  14.5    201     289

Percentage of the requests served within a certain time (ms)
  50%    201
  66%    205
  75%    209
  80%    212
  90%    220
  95%    229
  98%    242
  99%    250
 100%    289 (longest request)

WordPress users: your favicon up-to-date. Automatically.

With 60,000 active installs, Favicon by RealFaviconGenerator WordPress plugin is the most favicon-related WordPress plugin. Since a few months, the plugin looks for updates and notifies you whenever the favicon should be refreshed.

There is new stuff. The plugin is now able to update the favicon automatically. Next time Apple introduces a new Touch icon resolution for its latest iPhone, your favicon will be regenerated overnight.

Automatic update notice

This feature relies on the non_interactive_request parameter of the interactive request API. Each time you use the plugin to create a favicon, it not only installs the generated package. It also saves all settings: the iOS design, the compression rate… So whenever an update is available, the plugin is autonomous and can create your favicon update, yet taking advantage of the improvements of RealFaviconGenerator.

Is it the end of manual updates? Nope. Some updates require human interactions. For example, RealFaviconGenerator will someday supports Coast by Opera. This update does not make sense in an automated fashion. It requires you to pick the design that matches your icon and site. So still expect to work on your favicon again from time to time.

Favicon update notification for WordPress plugin

With the help of RealFaviconGenerator’s WordPress plugin, your WordPress blog has a shiny favicon, compatible with all platforms. Congratulations! But will this still be true in a week? A month? A year? Fear no more. The plugin now automatically checks for updates and let you know whenever a new version of the generated pictures and code is available.

WordPress plugin favicon update notification

Ok but does the update worth it? Follow the white rabbit and find out.

Favicon update change log

What will be the next release of RealFaviconGenerator? Safari for OS X Yosemite maybe? Stay tuned!

Check your favicon from your WordPress admin interface

Wanna check your favicon? Don’t leave the comfort of your WordPress administration interface anymore. You can now trigger the RealFaviconGenerator’s favicon checker right from Appearance > Favicon.

Invoke the favicon checker from the WordPress administration interface

Install the Favicon by RealFaviconGenerator WordPress plugin to take advantage of RealFaviconGenerator in your WordPress blog.

RealFaviconGenerator WordPress plugin is available!

There is now a WordPress plugin for RealFaviconGenerator! No more tedious HTML, you can now create and setup your favicon in a matter of seconds.

The plugin in a nutshell:

  • Go to Settings > Favicon.
    WordPress plugin settings screen
  • Select the master picture from your Media Library.
    Select a master picture
  • You are redirected to RealFaviconGenerator. Customize your favicon with the classic favicon editor.
    Edit your favicon
  • You are redirected to the WordPress dashboard again. Your favicon is installed automatically.
    Favicon installed, mission completed!

How hard was that? 🙂

The WordPress plugin is the first client of the RealFaviconGenerator API. It paves the way for the future of RealFaviconGenerator: an integrated tool you can plug in your existing workflow. Favicon is a small part of your web project, but it deserves to be done well, just like coding, testing, deployment…

As a first release, this plugin lacks some features and should be improved here and there. If you see something missing, please drop a comment!