10% botpay

Code Review | BotPay

WordPress plugin BotPay scored10%from 54 tests.

About plugin

  • Plugin page: botpay
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 13, 2021
  • Latest release: Feb 2, 2022
  • Number of updates: 27
  • Update frequency: every 9.0 days
  • Top authors: lukaszturczyn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /840 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'KODA\TPay_Plugin\PluginLoader' does not have a method 'create_user'

Server metrics [RAM: ▲0.36MB] [CPU: ▲6.32ms] Passed 4 tests

This is a short check of server-side resources used by BotPay
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3848.87 ▲7.85
Dashboard /wp-admin3.68 ▲0.3852.48 ▲2.64
Posts /wp-admin/edit.php3.71 ▲0.3654.64 ▲7.08
Add New Post /wp-admin/post-new.php6.27 ▲0.39100.82 ▲7.69
Media Library /wp-admin/upload.php3.54 ▲0.3148.59 ▲15.11

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
settings_form
settings_api
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

BotPay: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6314.39 ▼0.031.57 ▼0.1937.26 ▼5.82
Dashboard /wp-admin2,216 ▲395.61 ▲0.0481.85 ▼12.0036.61 ▼4.38
Posts /wp-admin/edit.php2,118 ▲182.03 ▲0.0133.82 ▼2.4236.58 ▲1.94
Add New Post /wp-admin/post-new.php1,541 ▲1323.25 ▲0.29666.76 ▲10.9654.90 ▲3.07
Media Library /wp-admin/upload.php1,412 ▲184.19 ▲0.0397.53 ▲6.2842.96 ▲0.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method KODA\TPay_Plugin\PluginLoader::uninstall() should not be called statically
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots need descriptions #1, #2 in botpay/assets to your readme.txt
The official readme.txt is a good inspiration

botpay/botpay.php Passed 13 tests

The main PHP file in "BotPay" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
74 characters long description:
Quick and fast chatbot for Messenger with TPay and Woocommerce integration

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin2,424 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP205655921,895
JSON310386
PO File14343111
Markdown126032
CSS1050

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity18.25
▷ Minimum class complexity1.00
▷ Maximum class complexity70.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes325.00%
Methods120
▷ Static methods1411.67%
▷ Public methods11797.50%
▷ Protected methods00.00%
▷ Private methods32.50%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants11
▷ Global constants11100.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
No PNG images were found in this plugin