10% melipayamak

Code Review | Melipayamak

WordPress plugin Melipayamak scored10%from 54 tests.

About plugin

  • Plugin page: melipayamak
  • Plugin version: 2.2.12
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Jan 10, 2018
  • Latest release: Oct 29, 2018
  • Number of updates: 20
  • Update frequency: every 14.6 days
  • Top authors: melipayamak (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /20,917 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/melipayamak/includes/updates.php+12
    Undefined variable: wpdb

Server metrics [RAM: ▼1.22MB] [CPU: ▼42.99ms] Passed 4 tests

Analyzing server-side resources used by Melipayamak
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.77 ▼0.6918.26 ▼21.10
Dashboard /wp-admin2.80 ▼0.5521.27 ▼38.55
Posts /wp-admin/edit.php2.80 ▼0.5620.37 ▼30.85
Add New Post /wp-admin/post-new.php2.80 ▼3.0923.65 ▼81.47
Media Library /wp-admin/upload.php2.80 ▼0.4323.20 ▼8.30
پشتیبانی /wp-admin/admin.php?page=melipayamak_support2.8022.68
ملی پیامک /wp-admin/admin.php?page=melipayamak2.8021.95
پیام های ارسالی /wp-admin/admin.php?page=melipayamak_smessages2.8019.62
فرم عضویت خبرنامه /wp-admin/admin.php?page=melipayamak_form2.8020.05
دفترچه تلفن /wp-admin/admin.php?page=melipayamak_phonebook2.8020.98
پیام های دریافتی /wp-admin/admin.php?page=melipayamak_rmessages2.8021.21
گزارشات /wp-admin/admin.php?page=melipayamak_reports2.8019.08
تنظیمات /wp-admin/admin.php?page=melipayamak_setting2.8021.39
برون ریزی /wp-admin/admin.php?page=melipayamak_export2.8018.63
گروه های دفترچه تلفن /wp-admin/admin.php?page=melipayamak_groups2.8020.96

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 74 new files
Database: 4 new tables, 27 new options
New tables
wp_melipayamak_members
wp_melipayamak_messages
wp_melipayamak_GFVerification
wp_melipayamak_groups
New WordPress options
can_compress_scripts
melipayamak_iborder
recovery_mode_email_last_sent
melipayamak_shborder
melipayamak_sbg
melipayamak_fontc
melipayamak_ibg
melipayamak_radius
melipayamak_ilbg
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for Melipayamak
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲12714.18 ▼0.101.67 ▲0.1343.65 ▲3.50
Dashboard /wp-admin2,280 ▲1055.59 ▼0.0184.02 ▼21.2383.27 ▲41.73
Posts /wp-admin/edit.php2,179 ▲791.98 ▼0.0434.08 ▼6.4040.85 ▲1.84
Add New Post /wp-admin/post-new.php1,604 ▲7623.11 ▼0.11664.74 ▲45.45138.88 ▲86.67
Media Library /wp-admin/upload.php1,482 ▲824.17 ▼0.0697.55 ▼0.0282.23 ▲40.78
پشتیبانی /wp-admin/admin.php?page=melipayamak_support7461.517.1138.50
ملی پیامک /wp-admin/admin.php?page=melipayamak9852.2333.6374.23
پیام های ارسالی /wp-admin/admin.php?page=melipayamak_smessages7461.516.3632.03
فرم عضویت خبرنامه /wp-admin/admin.php?page=melipayamak_form7461.516.2827.35
دفترچه تلفن /wp-admin/admin.php?page=melipayamak_phonebook7461.126.1827.43
پیام های دریافتی /wp-admin/admin.php?page=melipayamak_rmessages7461.516.5828.45
گزارشات /wp-admin/admin.php?page=melipayamak_reports7461.516.2524.64
تنظیمات /wp-admin/admin.php?page=melipayamak_setting9321.537.8341.01
برون ریزی /wp-admin/admin.php?page=melipayamak_export7461.516.4228.33
گروه های دفترچه تلفن /wp-admin/admin.php?page=melipayamak_groups7461.516.2327.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method melipayamak_widget::register() should not be called statically
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_melipayamak_members
    • wp_melipayamak_groups
    • wp_melipayamak_GFVerification
    • wp_melipayamak_messages
  • This plugin does not fully uninstall, leaving 27 options in the database
    • db_upgraded
    • can_compress_scripts
    • melipayamak_border
    • melipayamak_sborder
    • melipayamak_shborder
    • melipayamak_ihborder
    • melipayamak_last_version
    • melipayamak_ilhbg
    • melipayamak_sbg
    • melipayamak_fontc
    • ...

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
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_groups
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method melipayamak_widget::register() should not be called statically
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_groups
    • > User deprecated in wp-includes/functions.php+5453
    Function register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead.
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_groups
    • > User deprecated in wp-includes/functions.php+5453
    Function register_widget_control is deprecated since version 2.8.0! Use wp_register_widget_control() instead.
  • 209 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_groups
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 30 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_groups
    • > User notice in wp-includes/functions.php+5905
    Function WP_Admin_Bar::add_node was called incorrectly. The menu ID should not be empty. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Notice in wp-content/plugins/melipayamak/includes/templates/head.php(13) : eval()'d code+1
    Constant mplogo already defined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Notice in wp-content/plugins/melipayamak/includes/templates/head.php+59
    Undefined variable: acerror
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Notice in wp-content/plugins/melipayamak/includes/templates/head.php+60
    Undefined variable: acok
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Notice in wp-content/plugins/melipayamak/includes/templates/head.php+58
    Undefined variable: acwarning
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Notice in wp-content/plugins/melipayamak/includes/templates/panel_settings.php+48
    Undefined index: tab
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Error in wp-content/plugins/melipayamak/includes/class.php+83
    Uncaught Error: Class 'SoapClient' not found in wp-content/plugins/melipayamak/includes/class.php:83
    Stack trace:
    #0 wp-content/plugins/melipayamak/includes/class.php(188): melipayamak->call()
    #1 wp-content/plugins/melipayamak/includes/class.php(122): melipayamak->update_groups()
    #2 wp-content/plugins/melipayamak/includes/templates/panel_settings.php(625): melipayamak->fetch_groups()
    #3 wp-content/plugins/melipayamak/includes/admin.php(28): include('/var/www/wordpr...')
    #4 wp-includes/class-wp-hook.php(310): melipayamak_admin_setting()
    #5 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #6 wp-includes/plugin.php(517): WP_Hook->do_action()
    #7 wp-admin/admin.php(259): do_action()
    #8 {main}
    thrown

SRP 50% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/melipayamak/includes/templates/assets/dialog.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=melipayamak_setting:159:23)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=melipayamak_setting
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
The official readme.txt might help

melipayamak/melipayamak.php Passed 13 tests

The main PHP file in "Melipayamak" ver. 2.2.12 adds more information about the plugin and also serves as the entry point for this plugin
76 characters long description:
A Persian plugin to connect WordPress/WooCommerce to Melipayamak SMS service

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 plugin6,675 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP344676216,015
JavaScript4159347
CSS130313

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity52.14
▷ Minimum class complexity4.00
▷ Maximum class complexity121.00
Average method complexity5.37
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods82
▷ Static methods4150.00%
▷ Public methods7692.68%
▷ Protected methods11.22%
▷ Private methods56.10%
Functions49
▷ Named functions49100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants1090.91%
▷ Class constants19.09%
▷ Public constants1100.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
22 PNG files occupy 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/templates/assets/mainimg/smessage.png1.93KB0.51KB▼ 73.48%
includes/images/logo2.png4.38KB2.34KB▼ 46.54%
includes/templates/assets/mainimg/support.png2.32KB0.61KB▼ 73.83%
includes/templates/form/images/melipayamak_gender.png1.47KB0.77KB▼ 47.41%
includes/templates/assets/mainimg/groups.png2.99KB0.90KB▼ 69.76%