78% wp-comments-google-map-for-posts-wpcgmp

Code Review | WP Comments Google Map for Posts

WordPress plugin WP Comments Google Map for Posts scored78%from 54 tests.

About plugin

  • Plugin page: wp-comments-googl...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-3.3.1
  • WordPress version: 6.3.1
  • First release: Apr 26, 2012
  • Latest release: Apr 26, 2012
  • Number of updates: 10
  • Update frequency: N/A
  • Top authors: cmstactics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,579 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.00MB] [CPU: ▲1.28ms] Passed 4 tests

Server-side resources used by WP Comments Google Map for Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1451.17 ▲12.18
Dashboard /wp-admin3.31 ▲0.0148.05 ▼2.04
Posts /wp-admin/edit.php3.36 ▲0.0045.53 ▼3.99
Add New Post /wp-admin/post-new.php5.89 ▲0.01111.90 ▲24.97
Media Library /wp-admin/upload.php3.23 ▲0.0036.19 ▼1.05
Comments Map Options /wp-admin/options-general.php?page=comments-map-options3.2732.79

Server storage [IO: ▲0.27MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Comments Google Map for Posts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.28 ▼0.122.79 ▲1.1043.52 ▼5.50
Dashboard /wp-admin2,193 ▲135.58 ▼0.0685.77 ▼14.0840.20 ▼2.93
Posts /wp-admin/edit.php2,104 ▲41.96 ▲0.0133.36 ▼5.2835.44 ▲0.57
Add New Post /wp-admin/post-new.php1,534 ▲823.19 ▼0.31658.57 ▼39.5756.83 ▼1.94
Media Library /wp-admin/upload.php1,404 ▲14.18 ▲0.03108.49 ▲10.0845.92 ▲3.05
Comments Map Options /wp-admin/options-general.php?page=comments-map-options1,0961.9334.2930.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=comments-map-options
    • > Notice in wp-content/plugins/wp-comments-google-map-for-posts-wpcgmp/wpcgmp_admin.php+4
    Undefined index: wpcgmp_hidden

SRP 50% 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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-comments-google-map-for-posts-wpcgmp/wpcgmp_admin.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-comments-google-map-for-posts-wpcgmp/wpcgmp.php:27
    • > PHP Notice
      Undefined index: wpcgmp_hidden in wp-content/plugins/wp-comments-google-map-for-posts-wpcgmp/wpcgmp_admin.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (**Sample of WPCGMP** - Once all is set correctly in the WPCGMP settings, you should see a Google Map with markers plotted for the estimated location of the commenter.), #2 (**WPCGMP Options** - Setting for WPCGMP illustrated here can be found by going to the Settings menu in the dashboard and clicking on Comments Map Options.)
You can take inspiration from this readme.txt

wp-comments-google-map-for-posts-wpcgmp/wpcgmp.php 85% from 13 tests

The main PHP file in "WP Comments Google Map for Posts" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-comments-google-map-for-posts-wpcgmp.php" instead of "wpcgmp.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 152 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin688 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46929545
JavaScript24346143

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.57
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions15
▷ Named functions15100.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
4 PNG files occupy 0.23MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png73.75KB27.64KB▼ 62.52%
images/marker.png2.18KB1.67KB▼ 23.38%
screenshot-1.png160.09KB57.12KB▼ 64.32%
images/marker_count.png3.68KB2.13KB▼ 42.14%