78% jt-express

Code Review | J&T Express Malaysia

WordPress plugin J&T Express Malaysia scored78%from 54 tests.

About plugin

  • Plugin page: jt-express
  • Plugin version: 2.0.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 12, 2020
  • Latest release: Nov 20, 2023
  • Number of updates: 53
  • Update frequency: every 26.0 days
  • Top authors: jtexpress (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /5,876 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.15MB] [CPU: ▼1.27ms] Passed 4 tests

Analyzing server-side resources used by J&T Express Malaysia
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1639.59 ▼0.30
Dashboard /wp-admin3.46 ▲0.1547.97 ▲0.05
Posts /wp-admin/edit.php3.57 ▲0.2143.80 ▼1.16
Add New Post /wp-admin/post-new.php6.04 ▲0.1590.27 ▼3.65
Media Library /wp-admin/upload.php3.38 ▲0.1533.34 ▲1.43

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

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

Browser metrics Passed 4 tests

Checking browser requirements for J&T Express Malaysia
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲5914.67 ▲0.332.00 ▲0.3043.78 ▼0.25
Dashboard /wp-admin2,204 ▲275.62 ▼0.0288.84 ▲0.8138.74 ▲1.66
Posts /wp-admin/edit.php2,107 ▲102.01 ▲0.0737.76 ▼1.0235.74 ▲2.34
Add New Post /wp-admin/post-new.php1,532 ▼1323.10 ▼2.02667.07 ▲31.8255.46 ▼8.36
Media Library /wp-admin/upload.php1,406 ▲124.18 ▲0.0197.20 ▼2.4843.59 ▲1.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/jt-express/admin/view/tracking.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: res in wp-content/plugins/jt-express/admin/view/tracking.php on line 70
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/jt-express/admin/view/thermal-new.php:2
    • > PHP Notice
      Undefined variable: res in wp-content/plugins/jt-express/admin/view/tracking.php on line 140
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/jt-express/includes/class-jnt-shipping.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: jt malaysia, jnt, jtexpress, jt express

jt-express/jnt.php 92% from 13 tests

"J&T Express Malaysia" version 2.0.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("jt-express.php" instead of "jnt.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,416 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP17370851,666
SVG101750

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.38
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods57
▷ Static methods47.02%
▷ Public methods5189.47%
▷ Protected methods610.53%
▷ Private methods00.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants2
▷ Global constants2100.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