72% simple-kml-generator

Code Review | Simple KML Generator

WordPress plugin Simple KML Generator scored 72% from 54 tests.

About plugin

  • Plugin page: simple-kml-generator
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.2-3.6
  • WordPress version: 5.8.1
  • First release: Aug 26, 2013
  • Latest release: Sep 4, 2013
  • Number of updates: 11
  • Update frequency: every 0.9 days
  • Top authors: kingkong123 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,645 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼138.78ms] Passed 4 tests

Server-side resources used by Simple KML Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.07 ▲0.2435.18 ▼3.76
Dashboard /wp-admin3.30 ▲0.2543.12 ▲5.66
Posts /wp-admin/edit.php3.41 ▲0.3148.60 ▲5.11
Add New Post /wp-admin/post-new.php5.66 ▲0.2398.02 ▼556.59
Media Library /wp-admin/upload.php3.25 ▲0.2432.70 ▲0.14
Simple KML Generator /wp-admin/admin.php?page=kml_generate-index3.3129.68
Settings /wp-admin/admin.php?page=kml_generate-settings3.2130.05
Create KML List /wp-admin/admin.php?page=kml_generate-add3.5633.99

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 457 new files
Database: 3 new tables, 6 new options
New tables
wp_wkg_kml_cache
wp_wkg_kml_list
wp_wkg_kml_index
New WordPress options
wkg_enable_cache
wkg_rm_cache_size
wkg_show_support
wkg_cache_time
widget_wkg_show_list
widget_wkg_dl_link

Browser metrics Passed 4 tests

Checking browser requirements for Simple KML Generator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,743 ▲14715.91 ▲0.439.10 ▼0.5647.18 ▼6.55
Dashboard /wp-admin3,000 ▲665.96 ▲0.02140.19 ▼10.95131.36 ▲9.59
Posts /wp-admin/edit.php2,794 ▲552.71 ▼0.0165.29 ▼0.9692.49 ▼2.73
Add New Post /wp-admin/post-new.php1,642 ▼2821.78 ▲2.63284.62 ▼95.25104.02 ▼9.12
Media Library /wp-admin/upload.php1,791 ▼165.00 ▲0.01132.25 ▼15.03130.64 ▲6.96
Simple KML Generator /wp-admin/admin.php?page=kml_generate-index1,0852.1151.1665.51
Settings /wp-admin/admin.php?page=kml_generate-settings1,1972.0957.4070.06
Create KML List /wp-admin/admin.php?page=kml_generate-add3,9206.63141.71290.81

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 does not fully uninstall, leaving 2 options in the database
    • widget_wkg_show_list
    • widget_wkg_dl_link

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=kml_generate-index
    • > Deprecated in wp-content/plugins/simple-kml-generator/functions/pagination.class.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; pagination has a deprecated constructor

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
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/simple-kml-generator/functions/shortcodes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-kml-generator/functions/constants.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-kml-generator/functions/widgets.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-kml-generator/functions/constants.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/simple-kml-generator/functions/constants.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-kml-generator/functions/admin-functions.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=kml_generate-add
    • > Network (severe)
    http://maps.googleapis.com/maps/api/mapsjs/gen_204?csp_test=true - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% from 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
10 plugin tags: google earth, map, kml, location, google maps...

simple-kml-generator/wp-kml-generator.php 92% from 13 tests

The main file in "Simple KML Generator" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-kml-generator.php" instead of "wp-kml-generator.php")

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
There were no executable files found in this plugin2,017 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP10364811,394
JavaScript48429330
CSS3318276
Markdown14017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity20.50
▷ Minimum class complexity4.00
▷ Maximum class complexity39.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods4495.65%
▷ Protected methods00.00%
▷ Private methods24.35%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
438 PNG files occupy 0.53MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icons/3-default.png6.80KB0.97KB▼ 85.67%
img/icons/sumo-2.png1.16KB0.68KB▼ 41.86%
img/icons/foodtruck.png0.95KB0.58KB▼ 38.52%
img/icons/candy.png1.46KB1.02KB▼ 30.19%
img/icons/lingerie.png1.26KB0.72KB▼ 42.89%