62% shipcost-with-googlemap

Code Review | shipcost plugin with googleMap

WordPress plugin shipcost plugin with googleMap scored 62% from 54 tests.

About plugin

  • Plugin page: shipcost-with-goo...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Apr 18, 2020
  • Latest release: Apr 23, 2020
  • Number of updates: 10
  • Update frequency: every 0.5 days
  • Top authors: nekoto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 146 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.56MB] [CPU: ▼187.39ms] Passed 4 tests

An overview of server-side resources used by shipcost plugin with googleMap
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.00 ▼0.728.99 ▼9.37
Dashboard /wp-admin2.09 ▼0.978.61 ▼37.95
Posts /wp-admin/edit.php2.09 ▼1.0213.27 ▼33.65
Add New Post /wp-admin/post-new.php2.09 ▼3.348.83 ▼651.62
Media Library /wp-admin/upload.php2.09 ▼0.917.51 ▼26.32
訂單檢視 /wp-admin/admin.php?page=GMSC-plugin_order_check2.098.92
運費計算模組 /wp-admin/admin.php?page=GMSC-plugin_main2.099.11
設定 /wp-admin/admin.php?page=GMSC_setting2.098.60

Server storage [IO: ▲0.45MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • Illegal file modification found: 4 files (54.12KB) outside of "wp-content/plugins/shipcost-with-googlemap/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/shipcost-with-googlemap/doc/Google Map API Key\347\224\263\350\253\213\346\226\271\345\274\217.docx"
    • (new file) "wp-content/plugins/shipcost-with-googlemap/doc/\347\266\240\347\225\214\344\273\230\350\262\273\346\250\241\347\265\204\345\233\236\345\202\263\351\240\201\351\235\242\350\250\255\345\256\232.docx"
    • (new file) wp-content/themes/twentytwentyone/ECPay.Payment.Integration.php
    • (new file) wp-content/themes/twentytwentyone/ECPay-template.php
Filesystem: 22 new files
Database: 1 new table, no new options
New tables
wp_ship_custom_order

Browser metrics Passed 4 tests

This is an overview of browser requirements for shipcost plugin with googleMap
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,935 ▲33919.81 ▲4.1830.11 ▲19.6543.65 ▼2.67
Dashboard /wp-admin3,005 ▲715.92 ▼0.01154.79 ▲7.45125.13 ▲19.32
Posts /wp-admin/edit.php2,774 ▲352.73 ▲0.0364.28 ▼0.5296.29 ▲10.17
Add New Post /wp-admin/post-new.php1,524 ▼2,20018.54 ▲3.33375.93 ▼113.48106.48 ▼1.49
Media Library /wp-admin/upload.php1,770 ▼375.07 ▲0.08160.96 ▲12.15129.07 ▲19.06
訂單檢視 /wp-admin/admin.php?page=GMSC-plugin_order_check1,2832.8474.46124.14
運費計算模組 /wp-admin/admin.php?page=GMSC-plugin_main1,2262.4359.91122.23
設定 /wp-admin/admin.php?page=GMSC_setting1,4102.9981.95132.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-tabs handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_ship_custom_order

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=GMSC_setting
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-tabs handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=GMSC_setting
    • > Deprecated in wp-content/plugins/shipcost-with-googlemap/includes/class_GMSCplugin-main.php+120
    Function create_function() is deprecated

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
Please fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/shipcost-with-googlemap/templates/GMSC-plugin_order_check.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/shipcost-with-googlemap/templates/GMSC-plugin_admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/shipcost-with-googlemap/googleMap_ShipCostPlugin.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shipcost-with-googlemap/includes/class_GMSCplugin-setting.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GMSC_Translation' not found in wp-content/plugins/shipcost-with-googlemap/templates/mainmap_page.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=GMSC_setting
    • > Network (severe)
    wp-content/plugins/shipcost-with-googlemap//js/colpick/css/colpick.css?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=GMSC_setting
    • > Network (severe)
    wp-content/plugins/shipcost-with-googlemap//js/colpick/js/colpick.js?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=GMSC-plugin_order_check
    • > Network (severe)
    wp-content/plugins/shipcost-with-googlemap//css/DataTables-1.10.20/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=GMSC-plugin_order_check
    • > Network (severe)
    wp-content/plugins/shipcost-with-googlemap//css/DataTables-1.10.20/images/sort_desc.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=GMSC_setting
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=GMSC_setting 260:55 Uncaught TypeError: jQuery(...).colpick is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: The official readme.txt is a good inspiration

shipcost-with-googlemap/googleMap_ShipCostPlugin.php 92% from 13 tests

The primary PHP file in "shipcost plugin with googleMap" version 1.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("shipcost-with-googlemap.php" instead of "googleMap_ShipCostPlugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin8,697 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
CSS5603543,978
JavaScript43987482,443
PHP93514312,276

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.30
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes37
▷ Abstract classes1643.24%
▷ Concrete classes2156.76%
▷ Final classes00.00%
Methods55
▷ Static methods2036.36%
▷ Public methods4989.09%
▷ Protected methods47.27%
▷ Private methods23.64%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants76
▷ Global constants33.95%
▷ Class constants7396.05%
▷ Public constants73100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin