83% wp-font-resizer

Code Review | WP-Font-Resizer

WordPress plugin WP-Font-Resizer scored83%from 54 tests.

About plugin

  • Plugin page: wp-font-resizer
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-5.6
  • WordPress version: 6.3.1
  • First release: Jul 24, 2013
  • Latest release: Dec 27, 2020
  • Number of updates: 25
  • Update frequency: every 108.5 days
  • Top authors: arsho (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

800+ active /23,095 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.37MB] [CPU: ▼14.90ms] Passed 4 tests

This is a short check of server-side resources used by WP-Font-Resizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.454.76 ▼35.02
Dashboard /wp-admin3.36 ▼0.0349.96 ▼14.95
Posts /wp-admin/edit.php3.41 ▲0.0148.70 ▼0.72
Add New Post /wp-admin/post-new.php5.94 ▲0.0186.75 ▼6.24
Media Library /wp-admin/upload.php3.28 ▲0.0134.95 ▼3.38

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP-Font-Resizer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲13413.45 ▼0.709.54 ▲8.0544.19 ▲2.82
Dashboard /wp-admin2,195 ▲185.64 ▼0.0295.22 ▲5.1241.98 ▲2.66
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0436.90 ▲1.4334.48 ▼7.93
Add New Post /wp-admin/post-new.php1,526 ▼223.12 ▲0.00672.70 ▼9.6267.88 ▲10.53
Media Library /wp-admin/upload.php1,403 ▲34.16 ▼0.0096.94 ▼3.1743.95 ▼3.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-font-resizer/WP-Font-Resizer.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid url: "none"
  • Screenshots: Screenshot #1 (Font Resizer Option on posts.) image not found
The official readme.txt is a good inspiration

wp-font-resizer/WP-Font-Resizer.php 92% from 13 tests

"WP-Font-Resizer" version 2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-font-resizer.php" instead of "WP-Font-Resizer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected116 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1252944
CSS10039
JavaScript11033

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods240.00%
▷ Protected methods00.00%
▷ Private methods360.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/minus.png0.82KB0.70KB▼ 14.47%
images/reload.png2.92KB2.34KB▼ 19.83%
screenshot-1.png60.67KB23.76KB▼ 60.84%
images/plus.png1.18KB1.03KB▼ 12.53%