73% andreadb-google-maps

Code Review | Andreadb Google Maps

WordPress plugin Andreadb Google Maps scored73%from 54 tests.

About plugin

  • Plugin page: andreadb-google-maps
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.7
  • WordPress version: 6.3.1
  • First release: Dec 17, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: andreadb91 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /793 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
Install script ran successfully

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

Analyzing server-side resources used by Andreadb Google Maps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2141.25 ▼4.64
Dashboard /wp-admin3.60 ▲0.2958.35 ▲9.87
Posts /wp-admin/edit.php3.65 ▲0.3054.29 ▼3.51
Add New Post /wp-admin/post-new.php6.12 ▲0.2483.45 ▼20.37
Media Library /wp-admin/upload.php3.44 ▲0.2139.00 ▼0.81
Add Google Maps /wp-admin/post-new.php?post_type=dba_google_maps3.4946.09
Settings /wp-admin/edit.php?post_type=dba_google_maps&page=andreadb-google-maps-settings3.4439.18
Donate /wp-admin/edit.php?post_type=dba_google_maps&page=andreadb-google-maps-donate3.4436.05
Google Maps /wp-admin/edit.php?post_type=dba_google_maps3.5141.71

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_andreadb_google_maps_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Andreadb Google Maps
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,110 ▲34915.99 ▲1.3124.65 ▲22.8037.59 ▼4.92
Dashboard /wp-admin2,407 ▲2046.44 ▲1.55123.12 ▲17.9339.08 ▼6.36
Posts /wp-admin/edit.php2,306 ▲2063.35 ▲1.3850.44 ▲10.0035.45 ▼1.93
Add New Post /wp-admin/post-new.php1,565 ▲3423.33 ▼0.08659.67 ▼20.0637.41 ▼24.05
Media Library /wp-admin/upload.php1,446 ▲434.17 ▼0.0280.65 ▼21.8847.12 ▲3.36
Add Google Maps /wp-admin/post-new.php?post_type=dba_google_maps3,2627.31159.20136.14
Settings /wp-admin/edit.php?post_type=dba_google_maps&page=andreadb-google-maps-settings1,0263.1538.3425.73
Donate /wp-admin/edit.php?post_type=dba_google_maps&page=andreadb-google-maps-donate9963.0137.8225.96
Google Maps /wp-admin/edit.php?post_type=dba_google_maps1,2943.4442.3128.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_andreadb_google_maps_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

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
Smoke test failed, please fix the following
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=dba_google_maps
    • > Notice in wp-content/plugins/andreadb-google-maps/admin/class-andreadb-google-maps-admin.php+537
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/andreadb-google-maps/public/display/andreadb-google-maps-public.php
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-general.php:19
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-general.php on line 15
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-general.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/andreadb-google-maps/includes/class-andreadb-google-maps-widget.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-settings.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-markers.php:13
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-markers.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-shortcodes.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-donate.php:14
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/andreadb-google-maps/admin/display/andreadb-google-maps-admin-general.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: google maps, maps

andreadb-google-maps/andreadb-google-maps.php Passed 13 tests

The main PHP file in "Andreadb Google Maps" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
The easiest way to create responsive Google Maps with multiple markers.

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
Success! There were no dangerous files found in this plugin1,602 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP182088041,192
CSS1580307
JavaScript11116103

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods53
▷ Static methods35.66%
▷ Public methods4890.57%
▷ Protected methods00.00%
▷ Private methods59.43%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/marker.png0.79KB0.77KB▼ 2.11%