10% justin

Code Review | Justin

WordPress plugin Justin scored10%from 54 tests.

About plugin

  • Plugin page: justin
  • Plugin version: 1.5.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Mar 25, 2020
  • Latest release: Dec 15, 2021
  • Number of updates: 27
  • Update frequency: every 23.4 days
  • Top authors: bandido (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

70+ active /2,330 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
You still need to fix the following installer errors
  • Install procedure had errors
    • > Error in wp-content/plugins/justin/classes/JustinApiNew.php+87
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/justin/classes/JustinApiNew.php:87
    Stack trace:
    #0 wp-content/plugins/justin/classes/Activator.php(83): morkva\JustinShip\classes\JustinApiNew->getCity()
    #1 wp-content/plugins/justin/classes/Activator.php(68): morkva\JustinShip\classes\Activator->db_cities_update()
    #2 wp-includes/class-wp-hook.php(310): morkva\JustinShip\classes\Activator->activate()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.73ms] Passed 4 tests

Analyzing server-side resources used by Justin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.24 ▼3.67
Dashboard /wp-admin3.31 ▲0.0051.94 ▲0.41
Posts /wp-admin/edit.php3.36 ▲0.0053.13 ▲3.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.01 ▼7.01
Media Library /wp-admin/upload.php3.23 ▲0.0041.06 ▲5.15

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 77 new files
Database: 4 new tables, 6 new options
New tables
wp_woo_justin_ru_warehouses
wp_woo_justin_ua_warehouses
wp_woo_justin_ua_cities
wp_woo_justin_ru_cities
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Justin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.50 ▼1.094.81 ▲2.7343.38 ▼0.72
Dashboard /wp-admin2,206 ▲184.85 ▼0.03111.86 ▼8.6441.59 ▼1.90
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0236.22 ▼0.5030.70 ▼5.10
Add New Post /wp-admin/post-new.php1,524 ▼923.38 ▲0.08661.64 ▲60.2366.29 ▲16.77
Media Library /wp-admin/upload.php1,391 ▲34.14 ▲0.0193.52 ▼9.9543.70 ▼6.13

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 uninstall procedure failed, leaving 4 tables in the database
    • wp_woo_justin_ua_cities
    • wp_woo_justin_ru_warehouses
    • wp_woo_justin_ua_warehouses
    • wp_woo_justin_ru_cities
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/justin/admin/partials/morkvajustin-plugin-invoices-page-demo.php
    • > /wp-content/plugins/justin/admin/partials/morkvajustin-plugin-about-page.php
    • > /wp-content/plugins/justin/admin/partials/morkvajustin-plugin-invoices-page.php
  • 29× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant MJS_PLUGIN_VERSION - assumed 'MJS_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/justin/admin/partials/morkvajustin-plugin-about-page.php on line 8
    • > PHP Notice
      Undefined index: invoice_sender_name in wp-content/plugins/justin/admin/partials/create_senddata.php on line 21
    • > PHP Notice
      Undefined index: invoice_recipient_phone in wp-content/plugins/justin/admin/partials/create_senddata.php on line 46
    • > PHP Notice
      Undefined index: invoice_price in wp-content/plugins/justin/admin/partials/create_senddata.php on line 65
    • > PHP Notice
      Undefined variable: sender_city_uuid in wp-content/plugins/justin/admin/partials/create_senddata.php on line 18
    • > PHP Notice
      Undefined index: invoice_volume in wp-content/plugins/justin/admin/partials/create_senddata.php on line 56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_user_locale() in wp-content/plugins/justin/admin/partials/morkvajustin-plugin-form.php:6
    • > PHP Notice
      Undefined index: invoice_recipient_name in wp-content/plugins/justin/admin/partials/create_senddata.php on line 43
    • > PHP Notice
      Undefined index: invoice_cargo_mass in wp-content/plugins/justin/admin/partials/create_senddata.php on line 59
    • > PHP Notice
      Undefined index: page in wp-content/plugins/justin/admin/partials/functions.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7, #8 in justin/assets to your readme.txt
Please take inspiration from this readme.txt

justin/justin.php Passed 13 tests

The main PHP file in "Justin" ver. 1.5.5 adds more information about the plugin and also serves as the entry point for this plugin
55 characters long description:
Плагін доставки Justin для WooCommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin5,100 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP436648103,432
CSS567111,189
JavaScript66952448
Markdown116029
JSON2002

PHP code Passed 2 tests

An short overview of 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.21
Average class complexity5.47
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity1.79
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes13.33%
Methods170
▷ Static methods74.12%
▷ Public methods15390.00%
▷ Protected methods00.00%
▷ Private methods1710.00%
Functions18
▷ Named functions1266.67%
▷ Anonymous functions633.33%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
17 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/partials/img/fbmessenger_logo.png4.69KB4.70KB0.00%
admin/partials/img/003-barcode.png0.26KB0.26KB0.00%
admin/partials/img/007-heart.png0.30KB0.31KB0.00%
includes/justin.png1.46KB1.10KB▼ 25.15%
admin/partials/img/006-user-1.png0.34KB0.34KB0.00%