89% fontsize-selector

Code Review | Fontsize Selector Widget

WordPress plugin Fontsize Selector Widget scored 89% from 54 tests.

About plugin

  • Plugin page: fontsize-selector
  • Plugin version: 0.51
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.9
  • WordPress version: 6.3.1
  • First release: Feb 17, 2015
  • Latest release: Jan 27, 2022
  • Number of updates: 23
  • Update frequency: every 110.3 days
  • Top authors: tradesouthwest@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,620 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.09ms] Passed 4 tests

Analyzing server-side resources used by Fontsize Selector Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0130.18 ▼12.91
Dashboard /wp-admin3.39 ▲0.0948.50 ▲1.02
Posts /wp-admin/edit.php3.44 ▲0.0948.52 ▼0.80
Add New Post /wp-admin/post-new.php5.98 ▲0.0998.74 ▲4.34
Media Library /wp-admin/upload.php3.32 ▲0.0938.12 ▲5.70
Fontsize Selector /wp-admin/options-general.php?page=fontsize_selector3.2830.89

Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 24 new options
New WordPress options
interval
active_post_lock
_nonce
db_upgraded
wp-submit
can_compress_scripts
widget_fontsize_selector_widget
widget_recent-posts
_wpnonce
has_focus
...

Browser metrics Passed 4 tests

A check of browser resources used by Fontsize Selector Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7113.22 ▼1.151.96 ▼0.1437.32 ▼4.57
Dashboard /wp-admin2,213 ▲255.05 ▼0.81109.55 ▼1.8842.93 ▼1.94
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0540.22 ▼1.0039.81 ▲2.44
Add New Post /wp-admin/post-new.php1,357 ▼16217.17 ▼6.05588.22 ▼38.4346.12 ▼3.36
Media Library /wp-admin/upload.php1,395 ▲44.15 ▼0.0997.36 ▼1.4541.93 ▼3.25
Fontsize Selector /wp-admin/options-general.php?page=fontsize_selector9992.0224.5548.39

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 24 options in the database
    • testcookie
    • theysaidso_admin_options
    • query
    • widget_theysaidso_widget
    • can_compress_scripts
    • redirect_to
    • widget_recent-posts
    • post_ID
    • interval
    • has_focus
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

fontsize-selector/fontsize-selector-widget.php 92% from 13 tests

The main PHP script in "Fontsize Selector Widget" version 0.51 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("fontsize-selector.php" instead of "fontsize-selector-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected556 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP48075428
CSS10290
JavaScript15723
PO File12315

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected