78% ongkoskirim-id

Code Review | Plugin Ongkos Kirim JNE Tiki Sicepat Wahana J&T POS for Woocommerce

WordPress plugin Plugin Ongkos Kirim JNE Tiki Sicepat Wahana J&T POS for Woocommerce scored 78% from 54 tests.

About plugin

  • Plugin page: ongkoskirim-id
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 5.8.1
  • First release: Feb 5, 2018
  • Latest release: Apr 15, 2020
  • Number of updates: 13
  • Update frequency: every 68.7 days
  • Top authors: oggix (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

7,000+ active / 53,552 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
Install script ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼139.97ms] Passed 4 tests

This is a short check of server-side resources used by Plugin Ongkos Kirim JNE Tiki Sicepat Wahana J&T POS for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.1524.70 ▼10.82
Dashboard /wp-admin3.38 ▲0.3349.25 ▲2.53
Posts /wp-admin/edit.php3.43 ▲0.3345.97 ▲0.94
Add New Post /wp-admin/post-new.php5.68 ▲0.2592.71 ▼551.44
Media Library /wp-admin/upload.php3.26 ▲0.2634.65 ▲1.46

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 12 new options
New WordPress options
ongkoskirim_id_is_show_weight
ongkoskirim_id_shipping_company_enabled
ongkoskirim_id_default_weight
ongkoskirim_id_is_unique_code
ongkoskirim_id_is_added_cost_enable
ongkoskirim_id_store_city_id
ongkoskirim_id_license_status
ongkoskirim_id_version_type
ongkoskirim_id_license_key
ongkoskirim_id_unique_code_length
...

Browser metrics Passed 4 tests

Checking browser requirements for Plugin Ongkos Kirim JNE Tiki Sicepat Wahana J&T POS for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,302 ▼29415.86 ▲0.241.18 ▼7.379.99 ▼40.93
Dashboard /wp-admin3,008 ▲776.17 ▲0.16144.97 ▲0.54103.89 ▼4.61
Posts /wp-admin/edit.php2,779 ▲402.71 ▼0.0068.16 ▼1.6584.80 ▲0.20
Add New Post /wp-admin/post-new.php1,523 ▼34918.88 ▼0.25399.92 ▼10.71101.82 ▼4.42
Media Library /wp-admin/upload.php1,845 ▲385.06 ▲0.02171.33 ▲13.57144.63 ▲26.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • ongkoskirim_id_is_show_weight
    • ongkoskirim_id_weight_tolerance
    • ongkoskirim_id_added_cost
    • ongkoskirim_id_shipping_company_enabled
    • ongkoskirim_id_license_key
    • ongkoskirim_id_is_unique_code
    • ongkoskirim_id_unique_code_length
    • ongkoskirim_id_is_added_cost_enable
    • ongkoskirim_id_default_weight
    • ongkoskirim_id_version_type
    • ...

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
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ongkoskirim-id/public/partials/ongkoskirim-id-public-display.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ongkoskirim-id/admin/partials/ongkoskirim-id-admin-settings-page-header.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ongkoskirim-id/admin/partials/ongkoskirim-id-admin-welcome-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ongkoskirim-id/admin/partials/ongkoskirim-id-admin-settings-page.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Shipping_Method' not found in wp-content/plugins/ongkoskirim-id/includes/class-ongkoskirim-id-shipping-method.php:16

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 on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 20 tag instead of maximum 10
You can take inspiration from this readme.txt

ongkoskirim-id/ongkoskirim-id.php Passed 13 tests

The primary PHP file in "Plugin Ongkos Kirim JNE Tiki Sicepat Wahana J&T POS for Woocommerce" version 1.0.6 is used by WordPress to initiate all plugin functionality
91 characters long description:
Plugin woocommerce untuk menambahkan ongkos kirim JNE, TIKI, Sicepat, Wahana dan lain-lain.

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
Success! There were no dangerous files found in this plugin2,572 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP174736761,575
CSS412414661
JavaScript25532191
PO File15564145

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity14.60
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods91
▷ Static methods22.20%
▷ Public methods7885.71%
▷ Protected methods00.00%
▷ Private methods1314.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.36MB with 0.25MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/logos.png10.88KB5.48KB▼ 49.66%
admin/images/dashboard.png114.30KB39.04KB▼ 65.84%
admin/images/screen.png186.00KB37.10KB▼ 80.05%
admin/images/strips.png59.98KB9.54KB▼ 84.10%