72% map-visualizer

Code Review | Map Visualizer

WordPress plugin Map Visualizer scored72%from 54 tests.

About plugin

  • Plugin page: map-visualizer
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.5-4.7
  • WordPress version: 6.3.1
  • First release: Dec 18, 2016
  • Latest release: Dec 21, 2016
  • Number of updates: 4
  • Update frequency: every 1.0 days
  • Top authors: dsamourkasidis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,429 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼2.84ms] Passed 4 tests

Server-side resources used by Map Visualizer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0537.29 ▲0.90
Dashboard /wp-admin3.44 ▲0.1445.38 ▼2.34
Posts /wp-admin/edit.php3.50 ▲0.1450.30 ▼1.35
Add New Post /wp-admin/post-new.php6.04 ▲0.1684.30 ▼8.57
Media Library /wp-admin/upload.php3.37 ▲0.1435.60 ▲2.06
Map Visualizer /wp-admin/admin.php?page=map_visualizer_menu3.3331.92
Import CSV File /wp-admin/admin.php?page=map_visualizer_import_page3.3629.29
List All Files /wp-admin/admin.php?page=map_visualizer_list_page3.3130.31
Create New File /wp-admin/admin.php?page=map_visualizer_creation_page3.3134.32

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 14 new files
Database: 1 new table, 6 new options
New tables
Imported_files
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Map Visualizer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10114.38 ▲0.014.16 ▲2.6040.16 ▼5.55
Dashboard /wp-admin2,238 ▲475.94 ▲0.04109.01 ▲3.7141.28 ▼3.21
Posts /wp-admin/edit.php2,090 ▲12.89 ▲0.8339.60 ▼6.2733.31 ▼2.43
Add New Post /wp-admin/post-new.php1,546 ▲2223.93 ▲0.63683.76 ▼27.8157.05 ▼5.06
Media Library /wp-admin/upload.php1,432 ▲475.20 ▲0.98100.49 ▼4.6143.88 ▲1.45
Map Visualizer /wp-admin/admin.php?page=map_visualizer_menu1,0202.9849.9851.65
Import CSV File /wp-admin/admin.php?page=map_visualizer_import_page8932.3425.2031.51
List All Files /wp-admin/admin.php?page=map_visualizer_list_page9232.3329.1729.83
Create New File /wp-admin/admin.php?page=map_visualizer_creation_page8862.3325.9925.99

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=map_visualizer_import_page
    • > Deprecated in wp-content/plugins/map-visualizer/submenu-pages/CSV-import/map_visualizer_Quick-CSV-import.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; map_visualizer_Quick_CSV_import has a deprecated constructor
    • > GET request to /wp-admin/admin.php?page=map_visualizer_list_page
    • > Notice in wp-content/plugins/map-visualizer/submenu-pages/map_visualizer_list_all_files.php+15
    Undefined index: delete
    • > GET request to /wp-admin/admin.php?page=map_visualizer_list_page
    • > Notice in wp-content/plugins/map-visualizer/submenu-pages/map_visualizer_list_all_files.php+16
    Undefined index: copy
    • > GET request to /wp-admin/admin.php?page=map_visualizer_creation_page
    • > Notice in wp-content/plugins/map-visualizer/submenu-pages/map_visualizer_create_file_page.php+14
    Undefined index: Step

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/map-visualizer/Map-Visualizer.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/map-visualizer/submenu-pages/map_visualizer_list_all_files.php:9
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/map-visualizer/Map-Visualizer.php on line 9
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/map-visualizer/Map-Visualizer.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/map-visualizer/Map-Visualizer.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    wp-content/plugins/map-visualizer/Scripts/images/marker-icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    wp-content/plugins/map-visualizer/Scripts/images/marker-shadow.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://b.tiles.mapbox.com/v4/dsam.m3en6deb/1/0/1.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://b.tiles.mapbox.com/v4/dsam.llp7bo02/1/1/0.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://b.tiles.mapbox.com/v4/dsam.llp7bo02/1/0/1.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://b.tiles.mapbox.com/v4/dsam.m3en6deb/1/1/0.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://a.tiles.mapbox.com/v4/dsam.m3en6deb/1/0/0.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://c.tiles.mapbox.com/v4/dsam.m3en6deb/1/1/1.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://c.tiles.mapbox.com/v4/dsam.llp7bo02/1/1/1.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)
    • > GET request to /wp-admin/admin.php?page=map_visualizer_menu
    • > Network (severe)
    https://a.tiles.mapbox.com/v4/dsam.llp7bo02/1/0/0.png?access_token=pk.eyJ1IjoiZHNhbSIsImEiOiJrTGdOSjhVIn0.zlpcBqn7P2TQyzQVNBCU7w - Failed to load resource: the server responded with a status of 410 (Gone)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: leaflet, geocode, visualization, map, csv

map-visualizer/Map-Visualizer.php 92% from 13 tests

The principal PHP file in "Map Visualizer" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("map-visualizer.php" instead of "Map-Visualizer.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 plugin1,741 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP768951,188
CSS15422548
JavaScript1045

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity8.00
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected