74% bykea-instant-delivery

Code Review | Bykea Instant Delivery

WordPress plugin Bykea Instant Delivery scored74%from 54 tests.

About plugin

  • Plugin page: bykea-instant-del...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6.28+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Nov 17, 2020
  • Latest release: Nov 18, 2020
  • Number of updates: 8
  • Update frequency: every 0.9 days
  • Top authors: dizyn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /629 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▲0.97ms] Passed 4 tests

An overview of server-side resources used by Bykea Instant Delivery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.92 ▲4.88
Dashboard /wp-admin3.32 ▲0.0248.99 ▲2.70
Posts /wp-admin/edit.php3.37 ▲0.0247.39 ▲0.25
Add New Post /wp-admin/post-new.php5.92 ▲0.0484.45 ▼2.87
Media Library /wp-admin/upload.php3.24 ▲0.0238.12 ▲3.79

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 31 new files
Database: 3 new tables, 6 new options
New tables
wp_bykea_webhooks_details
wp_bykea_pickup_addresses
wp_bykea_delivery_requests
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Bykea Instant Delivery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.58 ▼0.832.10 ▲0.4844.16 ▼4.47
Dashboard /wp-admin2,211 ▲195.90 ▲0.9498.74 ▼8.3639.53 ▼5.28
Posts /wp-admin/edit.php2,094 ▲52.04 ▲0.0534.48 ▼4.7831.30 ▼0.35
Add New Post /wp-admin/post-new.php1,530 ▼323.35 ▼0.13678.65 ▲17.3963.72 ▲7.18
Media Library /wp-admin/upload.php1,393 ▲54.12 ▼0.12110.01 ▲13.6844.04 ▲1.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_bykea_delivery_requests
    • wp_bykea_pickup_addresses
    • wp_bykea_webhooks_details
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • 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 everything seems fine, this is not an exhaustive test

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
  • 14× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bykea-instant-delivery/includes/meta-boxes/bykea-order-delivery-logs.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bykea_get_pickup_addresses() in wp-content/plugins/bykea-instant-delivery/templates/footer-html.php:106
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/bykea-instant-delivery/templates/header-html.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/bykea-instant-delivery/templates/admin-ui.php:78
    • > PHP Fatal error
      require(): Failed opening required 'BYDIZ_DIR/includes/database.php' (include_path='.:/usr/share/php') in wp-content/plugins/bykea-instant-delivery/includes/loader.php on line 2
    • > PHP Warning
      Use of undefined constant BYDIZ_DIR - assumed 'BYDIZ_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bykea-instant-delivery/includes/meta-boxes.php on line 2
    • > PHP Warning
      require(BYDIZ_DIR/includes/woocommerce-settings/bykea-pickup-addresses.php): failed to open stream: No such file or directory in wp-content/plugins/bykea-instant-delivery/includes/woocommerce-settings.php on line 2
    • > PHP Warning
      require(BYDIZ_DIR/includes/database.php): failed to open stream: No such file or directory in wp-content/plugins/bykea-instant-delivery/includes/loader.php on line 2
    • > PHP Warning
      Use of undefined constant BYDIZ_DIR - assumed 'BYDIZ_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bykea-instant-delivery/includes/woocommerce-settings.php on line 2
    • > PHP Fatal error
      require(): Failed opening required 'BYDIZ_DIR/includes/woocommerce-settings/bykea-pickup-addresses.php' (include_path='.:/usr/share/php') in wp-content/plugins/bykea-instant-delivery/includes/woocommerce-settings.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Pickup addresses - screenshot-1.png), #2 (API settings - screenshot-2.png), #3 (Request Delivery - screenshot-3.png)
The official readme.txt might help

bykea-instant-delivery/bykea-instant-delivery.php 92% from 13 tests

The main PHP script in "Bykea Instant Delivery" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 141 characters long)

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
Success! There were no dangerous files found in this plugin2,451 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17497112,421
JavaScript35030

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions61
▷ Named functions61100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png23.88KB14.29KB▼ 40.17%
assets/screenshot-2.png26.95KB16.26KB▼ 39.64%
assets/screenshot-3.png44.21KB24.47KB▼ 44.65%
assets/icon-256x256.png11.08KB5.40KB▼ 51.33%