10% persian-fonts

Code Review | Persian Fonts

WordPress plugin Persian Fonts scored10%from 54 tests.

About plugin

  • Plugin page: persian-fonts
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.7
  • WordPress version: 6.3.1
  • First release: Jul 3, 2013
  • Latest release: Nov 15, 2013
  • Number of updates: 31
  • Update frequency: every 4.4 days
  • Top authors: boyfa (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

400+ active /38,365 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/persian-fonts/uploader.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; PersianFontsUploader has a deprecated constructor

Server metrics [RAM: ▼1.65MB] [CPU: ▼50.73ms] Passed 4 tests

This is a short check of server-side resources used by Persian Fonts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.35 ▼1.124.70 ▼31.71
Dashboard /wp-admin2.37 ▼0.986.47 ▼50.17
Posts /wp-admin/edit.php2.37 ▼0.996.66 ▼41.61
Add New Post /wp-admin/post-new.php2.37 ▼3.527.43 ▼79.41
Media Library /wp-admin/upload.php2.37 ▼0.866.06 ▼24.57

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 86 new files
Database: no new tables, 13 new options
New WordPress options
widget_recent-comments
persianfonts_font_list
theysaidso_admin_options
persianfonts-load-css-in-tinymce
widget_theysaidso_widget
persianfonts-load-css-style-in-tinymce
widget_recent-posts
persianfonts-load-in-admin
persianfonts-gen-css-class
wp-easy-uploader
...

Browser metrics Passed 4 tests

Persian Fonts: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,860 ▲9914.43 ▲0.031.93 ▲0.2235.70 ▼4.38
Dashboard /wp-admin2,216 ▲365.56 ▼0.0685.52 ▼4.3178.92 ▲39.32
Posts /wp-admin/edit.php2,139 ▲391.97 ▼0.0132.86 ▼3.2138.71 ▲2.23
Add New Post /wp-admin/post-new.php1,712 ▲18622.18 ▼1.14759.40 ▲79.1849.96 ▼12.03
Media Library /wp-admin/upload.php1,427 ▲334.23 ▲0.0699.01 ▲0.3287.38 ▲43.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/persian-fonts/uploader.php+6
    Methods with the same name as their class will not be constructors in a future version of PHP; PersianFontsUploader has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 13 options
    • persianfonts-gen-css-class
    • persianfonts_font_list
    • theysaidso_admin_options
    • widget_recent-posts
    • wp-easy-uploader
    • db_upgraded
    • persianfonts-load-in-admin
    • widget_recent-comments
    • persianfonts-load-css-in-tinymce
    • can_compress_scripts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 112× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'File/Archive/Reader/ChangeName.php' (include_path='.:/usr/share/php') in wp-content/plugins/persian-fonts/pear/File/Archive/Reader/ChangeName/Callback.php on line 32
    • > PHP Fatal error
      require_once(): Failed opening required 'File/Archive/Writer/Archive.php' (include_path='.:/usr/share/php') in wp-content/plugins/persian-fonts/pear/File/Archive/Writer/Ar.php on line 30
    • > PHP Warning
      require_once(File/Archive/Predicate.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/Archive/Predicate/MinTime.php on line 33
    • > PHP Warning
      require_once(File/Archive.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/tests/test.php on line 3
    • > PHP Warning
      require_once(File/Archive/Reader.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/Archive/Reader/Cache.php on line 34
    • > PHP Warning
      require_once(File/Archive/Predicate.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/Archive/Predicate/Duplicate.php on line 36
    • > PHP Warning
      require_once(File/Archive/Writer/Archive.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/Archive/Writer/Tar.php on line 32
    • > PHP Warning
      require_once(File/Archive/Reader.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/Archive/Reader/Relay.php on line 32
    • > PHP Warning
      require_once(File/Archive/Reader/Archive.php): failed to open stream: No such file or directory in wp-content/plugins/persian-fonts/pear/File/Archive/Reader/Gzip.php on line 32
    • > PHP Fatal error
      require_once(): Failed opening required 'File/Archive/Writer/MemoryArchive.php' (include_path='.:/usr/share/php') in wp-content/plugins/persian-fonts/pear/File/Archive/Writer/Zip.php on line 32

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: font replace, font uploader, theme, fonts, fontface...

persian-fonts/persian-fonts.php Passed 13 tests

"Persian Fonts" version 1.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
99 characters long description:
فونت‌های وب‌سایت خود را به سادگی چند کلیک تغییر دهید !

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
Everything looks great! No dangerous files found in this plugin9,985 lines of code in 69 files:
LanguageFilesBlank linesComment linesLines of code
PHP611,2994,9437,519
SVG3002,038
XML180402
CSS42026

PHP code Passed 2 tests

An overview 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.46
Average class complexity17.13
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes00.00%
▷ Concrete classes62100.00%
▷ Final classes00.00%
Methods505
▷ Static methods00.00%
▷ Public methods505100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
logo.png2.94KB0.24KB▼ 91.84%
add.png2.92KB0.22KB▼ 92.55%