79% vietnam-map

Code Review | eKMap Contact Map

WordPress plugin eKMap Contact Map scored 79% from 54 tests.

About plugin

  • Plugin page: vietnam-map
  • Plugin version: 2.0.8
  • PHP compatiblity: 5.7+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 30, 2022
  • Latest release: Nov 18, 2022
  • Number of updates: 32
  • Update frequency: every 4.4 days
  • Top authors: hubworksvn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 370 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.32MB] [CPU: ▲1.18ms] Passed 4 tests

Server-side resources used by eKMap Contact Map
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3359.33 ▲7.22
Dashboard /wp-admin3.62 ▲0.3162.38 ▼1.56
Posts /wp-admin/edit.php3.73 ▲0.3861.77 ▼1.11
Add New Post /wp-admin/post-new.php6.22 ▲0.34119.69 ▲9.51
Media Library /wp-admin/upload.php3.54 ▲0.3148.61 ▲0.18
Sửa /wp-admin/admin.php?page=edit-vietnam-map3.7451.17
Api Key /wp-admin/admin.php?page=vietnam-map-api-key3.5151.78
Danh sách bản đồ /wp-admin/admin.php?page=vietnam-map3.5652.48
Thêm /wp-admin/admin.php?page=add-vietnam-map3.5848.73

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

eKMap Contact Map: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,975 ▲15017.34 ▲2.6015.78 ▲13.6348.00 ▼2.80
Dashboard /wp-admin2,250 ▲476.79 ▲1.96133.68 ▼10.55101.65 ▲48.71
Posts /wp-admin/edit.php2,144 ▲524.21 ▲2.2163.06 ▲11.5243.18 ▼0.67
Add New Post /wp-admin/post-new.php1,560 ▲2622.77 ▲1.89732.66 ▼3.6541.23 ▼12.34
Media Library /wp-admin/upload.php1,436 ▲486.12 ▲1.98125.64 ▼3.52104.14 ▲50.97
Sửa /wp-admin/admin.php?page=edit-vietnam-map1,7076.04101.50136.47
Api Key /wp-admin/admin.php?page=vietnam-map-api-key8623.1749.0536.18
Danh sách bản đồ /wp-admin/admin.php?page=vietnam-map1,0344.3964.4285.02
Thêm /wp-admin/admin.php?page=add-vietnam-map2,0277.32234.2754.40

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/vietnam-map/inc/admin/menu_add_ekmap.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vietnam-map/inc/ajax/ajax.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vietnam-map/inc/metabox/metabox-marker.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/vietnam-map/inc/admin/menu_ekmap.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/vietnam-map/inc/admin/menu_api_key_ekmap.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vietnam-map/inc/metabox/metabox-ekmap.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vietnam-map/inc/posttype/marker-posttype.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vietnam-map/inc/posttype/ekmap-posttype.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/vietnam-map/inc/admin/menu_edit_ekmap.php:385
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vietnam-map/inc/admin/menu.php:44

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=vietnam-map-api-key
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'model')" "TypeError: Cannot read properties of undefined (reading 'model')\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=vietnam-map-api-key:185:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-vietnam-map
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'model')
    • > GET request to /wp-admin/admin.php?page=add-vietnam-map
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'model')" "TypeError: Cannot read properties of undefined (reading 'model')\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=add-vietnam-map:407:45)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=add-vietnam-map
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=add-vietnam-map - [.WebGL-0x1b2c01119400]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: bn wordpress vit nam, vit nam wp map, vit nam map for wordpress, ekmap map for wordpress, vit nam map...

vietnam-map/vietnam-map.php Passed 13 tests

The main PHP script in "eKMap Contact Map" version 2.0.8 is automatically included on every request by WordPress
58 characters long description:
Design by eK Geoinformation Technology Joint Stock Company

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected8,032 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
PHP121301552,448
JavaScript277552,177
CSS211811736

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions1982.61%
▷ Anonymous functions417.39%
Constants2
▷ Global constants2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png1.60KB1.54KB▼ 3.71%