83% order-notification-for-telegram-bot

Code Review | اطلاع رسانی سفارشات ووکامرس توسط ربات تلگرام (بدون نیاز به پراکسی برای هاست های ایران)

WordPress plugin اطلاع رسانی سفارشات ووکامرس توسط ربات تلگرام (بدون نیاز به پراکسی برای هاست های ایران) scored83%from 54 tests.

About plugin

  • Plugin page: order-notificatio...
  • Plugin version: 1.6.9.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 26, 2021
  • Latest release: Apr 7, 2023
  • Number of updates: 22
  • Update frequency: every 25.5 days
  • Top authors: mohammadmalekirad (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /2,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.82ms] Passed 4 tests

An overview of server-side resources used by اطلاع رسانی سفارشات ووکامرس توسط ربات تلگرام (بدون نیاز به پراکسی برای هاست های ایران)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.60 ▼6.66
Dashboard /wp-admin3.31 ▲0.0143.91 ▼1.54
Posts /wp-admin/edit.php3.42 ▲0.0747.17 ▲0.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.07 ▼11.19
Media Library /wp-admin/upload.php3.23 ▲0.0135.00 ▲1.82

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by اطلاع رسانی سفارشات ووکامرس توسط ربات تلگرام (بدون نیاز به پراکسی برای هاست های ایران)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6613.62 ▼0.801.81 ▼0.4642.35 ▼0.51
Dashboard /wp-admin2,218 ▲305.85 ▲0.99100.42 ▼0.6244.68 ▲5.94
Posts /wp-admin/edit.php2,100 ▲112.06 ▲0.0340.40 ▼1.6139.30 ▼0.78
Add New Post /wp-admin/post-new.php1,526 ▼1117.73 ▼0.36680.49 ▲68.9351.84 ▼2.09
Media Library /wp-admin/upload.php1,400 ▲154.26 ▲0.0993.57 ▼3.1245.56 ▲1.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'OrderNotificationForTelegramBot\\classes\\Singleton' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/Methods.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OrderNotificationForTelegramBot\\classes\\Singleton' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/Requester.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/OptionPanel.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OrderNotificationForTelegramBot\\classes\\Singleton' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/Init.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OrderNotificationForTelegramBot\\classes\\bots\\BotApi' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/bots/TelegramBotApi.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OrderNotificationForTelegramBot\\classes\\bots\\BotApi' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/bots/BaleBotApi.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OrderNotificationForTelegramBot\\classes\\Singleton' not found in wp-content/plugins/order-notification-for-telegram-bot/classes/bots/BotApi.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention: You can look at the official readme.txt

order-notification-for-telegram-bot/OrderNotificationForTelegramBot.php 77% from 13 tests

Analyzing the main PHP file in "اطلاع رسانی سفارشات ووکامرس توسط ربات تلگرام (بدون نیاز به پراکسی برای هاست های ایران)" version 1.6.9.1
You should first fix the following items:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.2" instead of "7.0")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("order-notification-for-telegram-bot.php" instead of "OrderNotificationForTelegramBot.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,880 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP223953171,838
JavaScript10037
JSON1005

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.52
Average class complexity24.47
▷ Minimum class complexity1.00
▷ Maximum class complexity222.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes15
▷ Abstract classes213.33%
▷ Concrete classes1386.67%
▷ Final classes00.00%
Methods110
▷ Static methods2724.55%
▷ Public methods9687.27%
▷ Protected methods32.73%
▷ Private methods1110.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ 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
PNG images were not found in this plugin