10% companion-map

Code Review | Companion-Map

WordPress plugin Companion-Map scored10%from 54 tests.

About plugin

  • Plugin page: companion-map
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.0.0
  • WordPress version: 6.3.1
  • First release: Jul 29, 2011
  • Latest release: Dec 10, 2018
  • Number of updates: 47
  • Update frequency: every 57.3 days
  • Top authors: maennchen1.de (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,508 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/companion-map/scripts/db.inc+12
    Undefined variable: table_prefix

Server metrics [RAM: ▲0.03MB] [CPU: ▲2.79ms] Passed 4 tests

Server-side resources used by Companion-Map
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1544.60 ▲4.30
Dashboard /wp-admin3.33 ▲0.0348.93 ▲4.89
Posts /wp-admin/edit.php3.38 ▲0.0252.62 ▲1.48
Add New Post /wp-admin/post-new.php5.93 ▲0.0499.02 ▲0.47
Media Library /wp-admin/upload.php3.25 ▲0.0245.53 ▲11.62
csv-Datei importieren /wp-admin/admin.php?page=companion_map-Import3.2957.88
Übersicht /wp-admin/admin.php?page=companion_map-Mitglieder3.2936.05
Neue Firma hinzufügen /wp-admin/admin.php?page=companion_map-Mitglieder&action=add3.2833.20
Konfiguration /wp-admin/admin.php?page=companion_map-Config3.2831.68

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

Filesystem and database footprint
These are issues you should consider
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/companion-map/" and "wp-content/uploads/"
    • (new file) wp-content/data/companion-map/.empty
Filesystem: 24 new files
Database: 4 new tables, 6 new options
New tables
wp_companion_map_mitglieder
companion_map_mitglieder
companion_map_config
wp_companion_map_config
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Companion-Map: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲10914.49 ▲0.116.46 ▲4.7244.63 ▼4.07
Dashboard /wp-admin2,231 ▲435.90 ▲1.01101.96 ▼6.8078.17 ▲36.11
Posts /wp-admin/edit.php2,129 ▲402.66 ▲0.5143.91 ▲1.2330.93 ▼4.34
Add New Post /wp-admin/post-new.php1,700 ▲16723.27 ▲0.01605.94 ▼71.5738.19 ▼12.44
Media Library /wp-admin/upload.php1,419 ▲315.01 ▲0.80107.32 ▲9.4667.64 ▲20.11
csv-Datei importieren /wp-admin/admin.php?page=companion_map-Import8992.2438.2131.42
Übersicht /wp-admin/admin.php?page=companion_map-Mitglieder1,0502.2731.3623.63
Neue Firma hinzufügen /wp-admin/admin.php?page=companion_map-Mitglieder&action=add1,0102.4133.9425.85
Konfiguration /wp-admin/admin.php?page=companion_map-Config9942.5730.8230.61

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Zombie tables were found after uninstall: 4 tables
    • companion_map_config
    • companion_map_mitglieder
    • wp_companion_map_mitglieder
    • wp_companion_map_config
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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 server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/index.phtml+22
    Undefined index: search
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+51
    Undefined index: unternehmen
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+56
    Undefined index: ansprechpartner
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+61
    Undefined index: strasse
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+66
    Undefined index: plz
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+71
    Undefined index: ort
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+76
    Undefined index: telefon
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+81
    Undefined index: fax
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+86
    Undefined index: email
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+91
    Undefined property: m1\usv\MitgliederController::$arData
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=companion_map-Config
    • > Notice in wp-content/plugins/companion-map/views/Config/index.phtml+110
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+100
    Undefined index: gps-lat
    • > GET request to /wp-admin/admin.php?page=companion_map-Mitglieder&action=add
    • > Notice in wp-content/plugins/companion-map/views/Mitglieder/add.phtml+105
    Undefined index: gps-lon
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=companion_map-Config
    • > Notice in wp-content/plugins/companion-map/views/Config/index.phtml+110
    Undefined property: m1\usv\ConfigController::$arData

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
The following issues need your attention
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'm1\\usv\\SystemController' not found in wp-content/plugins/companion-map/controllers/ConfigController.class.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/companion-map/companion-map.php on line 13
    • > PHP Warning
      require_once(ABSPATHwp-content/plugins/companion-map/scripts/db.inc): failed to open stream: No such file or directory in wp-content/plugins/companion-map/companion-map.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'm1\\usv\\SystemController' not found in wp-content/plugins/companion-map/controllers/MitgliederController.class.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-content/plugins/companion-map/scripts/db.inc' (include_path='.:/usr/share/php') in wp-content/plugins/companion-map/companion-map.php on line 20
    • > PHP Fatal error
      Uncaught Error: Class 'm1\\usv\\SystemController' not found in wp-content/plugins/companion-map/controllers/ImportController.class.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=companion_map-Config
    • > Console-api (warning) in unknown
    http://maps.google.com/maps/api/js?key&ver=6.3.1 210:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Plugin Backend new), #2 (Plugin Frontend Overview), #3 (CSV-Import upload form)
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

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

"Companion-Map" version 2.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
122 characters long description:
Darstellung von hinterlegten Adressen unterschiedlicher Filialstandorte in einer GoogleMaps-Karte und/oder in Tabellenform

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
Everything looks great! No dangerous files found in this plugin1,555 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP166281901,513
CSS1111738
INI1004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity19.33
▷ Minimum class complexity10.00
▷ Maximum class complexity27.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods39
▷ Static methods00.00%
▷ Public methods39100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
gfx/logo.png0.38KB0.32KB▼ 15.17%