88% font-farsi

Code Review | Font Farsi

WordPress plugin Font Farsi scored 88% from 54 tests.

About plugin

  • Plugin page: font-farsi
  • Plugin version: 1.6.4
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8.2
  • WordPress version: 5.8.1
  • First release: Apr 22, 2020
  • Latest release: Nov 19, 2021
  • Number of updates: 88
  • Update frequency: every 6.6 days
  • Top authors: khl32 (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active / 11,857 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.91MB] [CPU: ▼125.65ms] Passed 4 tests

An overview of server-side resources used by Font Farsi
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.55 ▲3.7173.87 ▲36.93
Dashboard /wp-admin7.08 ▲4.0369.04 ▲12.84
Posts /wp-admin/edit.php7.13 ▲4.0267.29 ▲15.31
Add New Post /wp-admin/post-new.php9.37 ▲3.94115.39 ▼541.70
Media Library /wp-admin/upload.php6.96 ▲3.9556.32 ▲10.95
فونت سفارشی /wp-admin/admin.php?page=font-farsi-custom-font7.01197.03
فونت فارسی /wp-admin/admin.php?page=font-farsi-main7.01121.12
راهنما /wp-admin/admin.php?page=font-farsi-help6.9352.14

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 63 new files
Database: no new tables, no new options

Browser metrics 75% from 4 tests

This is an overview of browser requirements for Font Farsi
Having an awesome user experience is important, so please improve the following
  • Nodes: Try to keep the DOM nodes under 25,000 (currently 29,876 on /wp-admin/admin.php?page=font-farsi-custom-font)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,764 ▲16816.78 ▲1.2511.57 ▲1.3547.59 ▼0.29
Dashboard /wp-admin3,025 ▲916.86 ▲0.71166.30 ▲10.58120.83 ▲1.19
Posts /wp-admin/edit.php2,797 ▲583.07 ▲0.3585.25 ▲15.3594.68 ▲5.63
Add New Post /wp-admin/post-new.php1,724 ▲4115.83 ▼0.56423.91 ▼58.63131.77 ▲19.78
Media Library /wp-admin/upload.php1,865 ▲585.78 ▲0.76156.65 ▼16.28141.84 ▲9.13
فونت سفارشی /wp-admin/admin.php?page=font-farsi-custom-font29,8764.21260.46261.88
فونت فارسی /wp-admin/admin.php?page=font-farsi-main14,6134.41159.89165.36
راهنما /wp-admin/admin.php?page=font-farsi-help1,1582.9074.9379.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/font-farsi/class/class-custom-font-panel-cb.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=font-farsi-main
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=font-farsi-main 177 The specified value "/" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=font-farsi-main
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=font-farsi-main 580 The specified value "/" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=font-farsi-main
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=font-farsi-main 979 The specified value "/" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=font-farsi-main
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=font-farsi-main 1378 The specified value "/" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=font-farsi-main
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=font-farsi-main 1778 The specified value "/" cannot be parsed, or is out of range.
    • > GET request to /wp-admin/admin.php?page=font-farsi-main
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=font-farsi-main 2176 The specified value "/" cannot be parsed, or is out of range.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: custom css, persian, farsi, site font, persian font...

font-farsi/font-farsi.php Passed 13 tests

"Font Farsi" version 1.6.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
31 characters long description:
Add Persian Fonts To Your Site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin31,234 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript162,5062,22617,304
PHP241,02849511,386
CSS10150981,668
SVG100643
PO File1104584233

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.02
Average class complexity5.77
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes00.00%
Methods81
▷ Static methods22.47%
▷ Public methods7997.53%
▷ Protected methods22.47%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/plus.png6.00KB2.03KB▼ 66.21%
assets/img/toggle-close.png0.23KB0.23KB▼ 2.11%
assets/img/negative.png5.82KB1.95KB▼ 66.47%
assets/img/toggle-open.png0.23KB0.23KB▼ 1.28%