72% inax-ir

Code Review | inax-ir

WordPress plugin inax-ir scored72%from 54 tests.

About plugin

  • Plugin page: inax-ir
  • Plugin version: 3.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Apr 28, 2020
  • Latest release: Mar 20, 2023
  • Number of updates: 63
  • Update frequency: every 16.8 days
  • Top authors: mohammad50 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /4,875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▲1.82ms] Passed 4 tests

This is a short check of server-side resources used by inax-ir
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2746.50 ▲2.10
Dashboard /wp-admin3.57 ▲0.2759.09 ▼0.62
Posts /wp-admin/edit.php3.68 ▲0.3358.74 ▲7.42
Add New Post /wp-admin/post-new.php6.17 ▲0.2898.72 ▲3.52
Media Library /wp-admin/upload.php3.49 ▲0.2639.84 ▲2.29
درباره آینکس /wp-admin/admin.php?page=inax_about3.9038.70
تنظیمات آینکس /wp-admin/admin.php?page=inaxir3.9241.36
درگاه های بانکی /wp-admin/admin.php?page=inax_gateway3.9137.87
جزئیات سیستم /wp-admin/admin.php?page=inax_system3.9139.86
تراکنش ها /wp-admin/admin.php?page=inax_trans3.9339.83
صفحات خرید /wp-admin/admin.php?page=inax_page3.9239.62
موجودی آینکس /wp-admin/admin.php?page=inax_credit3.9140.41

Server storage [IO: ▲5.70MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 357 new files
Database: 1 new table, 10 new options
New tables
wp_inax_charge
New WordPress options
theysaidso_admin_options
db_upgraded
inax_options
inax_db_version
inax_version
widget_theysaidso_widget
inax_do_activation
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for inax-ir
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.24 ▲0.081.74 ▼0.1343.57 ▲0.11
Dashboard /wp-admin2,231 ▲545.56 ▲0.0385.80 ▼12.9369.73 ▲25.50
Posts /wp-admin/edit.php2,151 ▲511.98 ▲0.0333.66 ▼1.8240.05 ▲1.58
Add New Post /wp-admin/post-new.php1,583 ▲4522.87 ▲4.59716.46 ▲58.4854.83 ▼6.51
Media Library /wp-admin/upload.php1,451 ▲544.28 ▼0.02102.18 ▼10.4672.18 ▲21.99
درباره آینکس /wp-admin/admin.php?page=inax_about1,0432.0124.7870.19
تنظیمات آینکس /wp-admin/admin.php?page=inaxir1,2671.8639.9844.45
درگاه های بانکی /wp-admin/admin.php?page=inax_gateway8871.9327.9424.79
جزئیات سیستم /wp-admin/admin.php?page=inax_system9242.1623.5529.96
تراکنش ها /wp-admin/admin.php?page=inax_trans1,0311.8727.2934.07
صفحات خرید /wp-admin/admin.php?page=inax_page1,1862.0525.9635.24
موجودی آینکس /wp-admin/admin.php?page=inax_credit9592.0525.9928.56

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% 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)
These errors were triggered by the plugin
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=inax_credit
    • > Notice in wp-content/plugins/inax-ir/inc/load.php+52
    date_default_timezone_set(): Timezone ID '' is invalid

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 23× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/inax-ir/inc/inax-functions.php
    • > /wp-content/plugins/inax-ir/inc/validation.php
    • > /wp-content/plugins/inax-ir/internet.php
    • > /wp-content/plugins/inax-ir/inax-system.php
    • > /wp-content/plugins/inax-ir/gateways.php
    • > /wp-content/plugins/inax-ir/inc/inax-admin.php
    • > /wp-content/plugins/inax-ir/inax-credit.php
    • > /wp-content/plugins/inax-ir/inax-pages.php
    • > /wp-content/plugins/inax-ir/inc/ajax_check_bill.php
    • > /wp-content/plugins/inax-ir/inc/load.php
  • 90× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Resource_Recompiled' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_internal_resource_stream.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_CacheResource' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_cacheresource_keyvaluestore.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Compile_Shared_Inheritance' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_internal_compile_extends.php:17
    • > PHP Fatal error
      Uncaught Error: Call to a member function _decodeProperties() on null in wp-content/plugins/inax-ir/inc/templates_c/7449ed3703dfdcbc4496a63cb8ec5869db09c0f3_0.file.gateways.tpl.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Resource' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_internal_resource_extends.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_ParseTree' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_internal_parsetree_code.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_Method_CompileAllTemplates' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_internal_method_compileallconfig.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function _decodeProperties() on null in wp-content/plugins/inax-ir/inc/templates_c/10ff1164ccf1a1a93848d311a427504350d48d69_0.file.header.tpl.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Internal_CompileBase' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_internal_compile_eval.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Smarty_Variable' not found in wp-content/plugins/inax-ir/inc/smarty-4.3.0/libs/sysplugins/smarty_undefined_variable.php:10

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 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (پیش نمایش صفحه مدیریت آینکس) image missing
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
You can look at the official readme.txt

inax-ir/inax-ir.php 85% from 13 tests

The main file in "inax-ir" v. 3.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 204 characters long)
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin40,909 lines of code in 292 files:
LanguageFilesBlank linesComment linesLines of code
PHP2432,34612,37823,871
CSS235,79620913,258
Smarty19284252,400
PO File45676521,200
JavaScript33739180

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity15.36
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes171
▷ Abstract classes137.60%
▷ Concrete classes15892.40%
▷ Final classes00.00%
Methods875
▷ Static methods262.97%
▷ Public methods82894.63%
▷ Protected methods242.74%
▷ Private methods232.63%
Functions141
▷ Named functions13998.58%
▷ Anonymous functions21.42%
Constants161
▷ Global constants127.45%
▷ Class constants14992.55%
▷ Public constants149100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
36 PNG files occupy 0.37MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/mci.png6.16KB6.06KB▼ 1.62%
assets/images/pin_en.png17.98KB12.35KB▼ 31.33%
assets/images/sht_en.png6.13KB4.09KB▼ 33.30%
assets/images/bill_en.png7.14KB4.63KB▼ 35.24%
assets/images/internet.png20.56KB20.27KB▼ 1.42%