84% widget-for-google-map

Code Review | Widget for Google Map

WordPress plugin Widget for Google Map scored84%from 54 tests.

About plugin

  • Plugin page: widget-for-google...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2021
  • Latest release: Aug 9, 2023
  • Number of updates: 14
  • Update frequency: every 45.0 days
  • Top authors: mdhadid (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /353 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.42ms] Passed 4 tests

Server-side resources used by Widget for Google Map
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0235.07 ▼5.52
Dashboard /wp-admin3.33 ▲0.0247.56 ▼1.11
Posts /wp-admin/edit.php3.38 ▲0.0245.66 ▲0.67
Add New Post /wp-admin/post-new.php5.91 ▲0.0289.13 ▲0.28
Media Library /wp-admin/upload.php3.25 ▲0.0233.36 ▲1.38

Server storage [IO: ▲0.01MB] [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: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_widget_for_google_map_embed
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Widget for Google Map: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲17313.54 ▼0.768.09 ▲6.2839.29 ▼7.02
Dashboard /wp-admin2,206 ▲185.84 ▼0.06105.19 ▼13.3238.18 ▼6.80
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0038.04 ▲0.8436.79 ▲3.83
Add New Post /wp-admin/post-new.php1,524 ▼923.34 ▲0.21632.34 ▼48.0466.98 ▲8.13
Media Library /wp-admin/upload.php1,382 ▼64.19 ▼0.0395.04 ▼11.8342.18 ▼3.22

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_widget_for_google_map_embed
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/widget-for-google-map/includes/widget-for-google-map-embed.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/widget-for-google-map/widget-for-google-map.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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
7 plugin tags: google map, maps, embed, map, widget...

widget-for-google-map/widget-for-google-map.php Passed 13 tests

The main file in "Widget for Google Map" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
125 characters long description:
It will embed your google map into a widget area. You can add a widget in any of your widget areas and It will show your map.

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
Good job! No executable or dangerous file extensions detected86 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2171454
PO File16629
JavaScript1203

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin