66% fontiran-font-changer

Code Review | FontIran Font Changer

WordPress plugin FontIran Font Changer scored66%from 54 tests.

About plugin

  • Plugin page: fontiran-font-cha...
  • Plugin version: 3...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.7
  • WordPress version: 6.3.1
  • First release: Apr 10, 2021
  • Latest release: Apr 19, 2021
  • Number of updates: 12
  • Update frequency: every 1.0 days
  • Top authors: fontiran (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /2,557 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.14MB] [CPU: ▼5.82ms] Passed 4 tests

An overview of server-side resources used by FontIran Font Changer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.54 ▼3.55
Dashboard /wp-admin3.48 ▲0.1745.66 ▼3.05
Posts /wp-admin/edit.php3.59 ▲0.2354.10 ▲7.11
Add New Post /wp-admin/post-new.php6.06 ▲0.1784.15 ▼16.30
Media Library /wp-admin/upload.php3.40 ▲0.1734.08 ▼0.38
پیشخوان /wp-admin/admin.php?page=wpfi3.3834.09
مدیریت تایپوگرافی /wp-admin/admin.php?page=wpfi-fimf3.4251.27
نصب فونت /wp-admin/admin.php?page=wpfi-finuf3.3933.10
فونت ها /wp-admin/admin.php?page=wpfi-fiafi3.3831.18
پیکربندی /wp-admin/admin.php?page=wpfi-options3.3832.38

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
fontiran_default_options
fontiran_new_option
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by FontIran Font Changer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9513.21 ▼1.151.56 ▼0.1239.51 ▼4.94
Dashboard /wp-admin2,247 ▲625.82 ▼0.04102.75 ▲2.0246.41 ▲8.35
Posts /wp-admin/edit.php2,133 ▲412.02 ▼0.0334.59 ▼6.2038.80 ▼1.94
Add New Post /wp-admin/post-new.php1,566 ▲5223.22 ▲5.59693.87 ▲10.3557.83 ▲0.77
Media Library /wp-admin/upload.php1,429 ▲444.22 ▲0.0696.73 ▲3.1149.57 ▲6.19
پیشخوان /wp-admin/admin.php?page=wpfi1,4589.37280.34115.42
مدیریت تایپوگرافی /wp-admin/admin.php?page=wpfi-fimf3,1142.4749.4879.73
نصب فونت /wp-admin/admin.php?page=wpfi-finuf1,0501.9624.2444.02
فونت ها /wp-admin/admin.php?page=wpfi-fiafi8521.8625.3445.20
پیکربندی /wp-admin/admin.php?page=wpfi-options8601.8425.3253.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • db_upgraded
    • fontiran_default_options
    • widget_theysaidso_widget
    • fontiran_new_option
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wpfi-fimf
    • > Notice in wp-content/plugins/fontiran-font-changer/core/views/wpfi-fimf-page.php+30
    Undefined index: class

SRP 0% 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
Please fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/fontiran-font-changer/core/views/wpfi-fimf-side-page.php
    • > /wp-content/plugins/fontiran-font-changer/core/views/wpfi-page.php
    • > /wp-content/plugins/fontiran-font-changer/core/views/wpfi-fiafi-page.php
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      mkdir(): No such file or directory in wp-content/plugins/fontiran-font-changer/core/views/wpfi-finuf-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Fontiran_Admin_Page' not found in wp-content/plugins/fontiran-font-changer/core/class-manager-page.php:6
    • > PHP Warning
      Use of undefined constant FIRAN_URL - assumed 'FIRAN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/fontiran-font-changer/core/views/wpfi-page.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/fontiran-font-changer/core/views/wpfi-finuf-page.php:10
    • > PHP Warning
      Use of undefined constant FIRAN_DATA - assumed 'FIRAN_DATA' (this will throw an Error in a future version of PHP) in wp-content/plugins/fontiran-font-changer/core/views/wpfi-finuf-page.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Fontiran_Admin_Page' not found in wp-content/plugins/fontiran-font-changer/core/class-fonts-page.php:6
    • > PHP Warning
      Use of undefined constant FIRAN_DATA - assumed 'FIRAN_DATA' (this will throw an Error in a future version of PHP) in wp-content/plugins/fontiran-font-changer/core/views/wpfi-finuf-page.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/fontiran-font-changer/helpers/functions.php:136
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/fontiran-font-changer/core/views/wpfi-options-page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Fontiran_Admin_Page' not found in wp-content/plugins/fontiran-font-changer/core/class-upload-page.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=wpfi-fiafi
    • > Network (severe)
    wp-content/plugins/fontiran-font-changer/fontiran.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Add Font), #2 (preview installed font), #3 (rules and options)
You can look at the official readme.txt

fontiran-font-changer/fontiran.php 85% from 13 tests

Analyzing the main PHP file in "FontIran Font Changer" version 3...
Please make the necessary changes and fix the following:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "3...")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("fontiran-font-changer.php" instead of "fontiran.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin2,152 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP164091291,086
CSS4940940
JavaScript232190
SVG10036

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity13.88
▷ Minimum class complexity1.00
▷ Maximum class complexity55.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes00.00%
Methods56
▷ Static methods11.79%
▷ Public methods2544.64%
▷ Protected methods2239.29%
▷ Private methods916.07%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
4 PNG files occupy 0.11MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/yektadg.png5.60KB2.98KB▼ 46.74%
screenshot-1.png36.18KB34.60KB▼ 4.35%
screenshot-2.png17.39KB14.62KB▼ 15.91%
screenshot-3.png53.95KB53.10KB▼ 1.58%