10% simple-google-map-by-naf

Code Review | Wordpress Google Map Plugin

WordPress plugin Wordpress Google Map Plugin scored 10% from 54 tests.

About plugin

  • Plugin page: simple-google-map...
  • Plugin version: 2.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.7
  • WordPress version: 6.3.1
  • First release: Jan 10, 2017
  • Latest release: Aug 2, 2018
  • Number of updates: 89
  • Update frequency: every 6.4 days
  • Top authors: nafsinvk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 5,877 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/simple-google-map-by-naf/includes/class-nafs-gmap.php+94
    Undefined variable: options

Server metrics [RAM: ▼1.85MB] [CPU: ▼49.47ms] Passed 4 tests

Analyzing server-side resources used by Wordpress Google Map Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.336.96 ▼35.27
Dashboard /wp-admin2.15 ▼1.1513.09 ▼37.24
Posts /wp-admin/edit.php2.15 ▼1.209.37 ▼38.00
Add New Post /wp-admin/post-new.php2.15 ▼3.737.91 ▼87.37
Media Library /wp-admin/upload.php2.15 ▼1.089.85 ▼25.34
Gmap Settings /wp-admin/options-general.php?page=nafs-gmap-admin2.158.65

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wordpress Google Map Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,904 ▲16914.02 ▼0.374.95 ▲3.0939.45 ▼12.09
Dashboard /wp-admin2,224 ▲365.83 ▲0.97110.96 ▲2.9041.72 ▼5.57
Posts /wp-admin/edit.php2,113 ▲272.10 ▲0.0836.70 ▲1.4337.12 ▲0.01
Add New Post /wp-admin/post-new.php1,582 ▲4919.66 ▼3.39599.32 ▼56.1548.31 ▼11.45
Media Library /wp-admin/upload.php1,409 ▲214.25 ▲0.0598.14 ▲1.6542.40 ▲0.64
Gmap Settings /wp-admin/options-general.php?page=nafs-gmap-admin8162.0527.8927.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/simple-google-map-by-naf/includes/class-nafs-gmap.php+94
    Undefined variable: options
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=nafs-gmap-admin
    • > Notice in wp-content/plugins/simple-google-map-by-naf/includes/class-nafs-gmap.php+94
    Undefined variable: options

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/simple-google-map-by-naf/admin/partials/nafs-gmap-admin-display.php
    • > /wp-content/plugins/simple-google-map-by-naf/public/partials/nafs-gmap-public-display.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/simple-google-map-by-naf/tinymce-custom-class-master/tinymce-custom-class.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-google-map-by-naf/includes/class-nafs-gmap.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Donate link: Please fix this invalid URI: ""
You can look at the official readme.txt

simple-google-map-by-naf/nafs-gmap.php 85% from 13 tests

The entry point to "Wordpress Google Map Plugin" version 2.2.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-google-map-by-naf.php" instead of "nafs-gmap.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin972 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP13195631776
CSS3108114
JavaScript3116880
Markdown1002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods53
▷ Static methods23.77%
▷ Public methods4890.57%
▷ Protected methods00.00%
▷ Private methods59.43%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
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
11 PNG files occupy 0.28MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png17.24KB7.60KB▼ 55.89%
assets/insert-custom.png7.87KB4.21KB▼ 46.49%
tinymce-custom-class-master/icon.png0.39KB0.32KB▼ 17.75%
assets/insert-pre-built.png7.50KB4.78KB▼ 36.30%
assets/red.png5.68KB2.98KB▼ 47.45%