52% google-map-professional

Code Review | Wordpress Google Map Professional (Map In Your Language)

WordPress plugin Wordpress Google Map Professional (Map In Your Language) scored 52% from 54 tests.

About plugin

  • Plugin page: google-map-profes...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Jan 22, 2014
  • Latest release: Jan 29, 2014
  • Number of updates: 8
  • Update frequency: every 1.1 days
  • Top authors: pankajpragma (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active / 9,884 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.87MB] [CPU: ▼52.38ms] Passed 4 tests

A check of server-side resources used by Wordpress Google Map Professional (Map In Your Language)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.355.14 ▼40.81
Dashboard /wp-admin2.13 ▼1.175.88 ▼41.15
Posts /wp-admin/edit.php2.13 ▼1.227.32 ▼37.03
Add New Post /wp-admin/post-new.php2.13 ▼3.755.67 ▼90.52
Media Library /wp-admin/upload.php2.13 ▼1.106.91 ▼28.29
Manage Map /wp-admin/admin.php?page=googlemarker-manage-markers2.136.80
Create New Map /wp-admin/admin.php?page=googlemarker-admin2.136.63
Settings /wp-admin/admin.php?page=googlemarker-manage-settings2.136.11

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 69 new files
Database: 2 new tables, 7 new options
New tables
wp_google_markers
wp_google_marker_settings
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
googlemarker_db_version

Browser metrics Passed 4 tests

Wordpress Google Map Professional (Map In Your Language): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11813.73 ▼0.651.99 ▼0.5544.94 ▼0.38
Dashboard /wp-admin2,255 ▲705.23 ▲0.34100.48 ▼1.9279.75 ▲38.79
Posts /wp-admin/edit.php2,138 ▲492.25 ▲0.2142.37 ▲5.0438.44 ▲2.71
Add New Post /wp-admin/post-new.php1,710 ▲16822.58 ▲4.38653.78 ▼10.1936.53 ▼24.33
Media Library /wp-admin/upload.php1,429 ▲414.47 ▲0.2195.55 ▼15.7276.68 ▲30.02
Manage Map /wp-admin/admin.php?page=googlemarker-manage-markers9352.0031.3452.90
Create New Map /wp-admin/admin.php?page=googlemarker-admin1,5292.0228.7550.00
Settings /wp-admin/admin.php?page=googlemarker-manage-settings1,2172.4240.5433.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie tables were found after uninstall: 2 tables
    • wp_google_markers
    • wp_google_marker_settings
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • googlemarker_db_version
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=googlemarker-manage-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=googlemarker-manage-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=googlemarker-manage-markers
    • > Notice in wp-content/plugins/google-map-professional/includes/pannel.manage_markers.php+5
    Undefined index: action
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=googlemarker-admin
    • > Notice in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php+12
    Undefined index: marker_id
    • > GET request to /wp-admin/admin.php?page=googlemarker-admin
    • > Warning in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php+85
    Creating default object from empty value
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=googlemarker-admin
    • > Notice in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php+176
    getimagesize(): read of 8192 bytes failed with errno=21 Is a directory
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=googlemarker-admin
    • > Notice in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php+176
    getimagesize(): Read error!
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=googlemarker-admin
    • > Notice in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php+246
    Undefined variable: setDef

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/google-map-professional/includes/pannel.footer.php
  • 20× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'GOOGLEMARKER_PLUGIN_DIR/includes/pannel.header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/google-map-professional/includes/pannel.manage_markers.php on line 1
    • > PHP Notice
      Undefined index: action in wp-content/plugins/google-map-professional/includes/pannel.manage_markers.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/google-map-professional/includes/preview_map.php:3
    • > PHP Warning
      include_once(GOOGLEMARKER_PLUGIN_DIR/includes/pannel.header.php): failed to open stream: No such file or directory in wp-content/plugins/google-map-professional/includes/pannel.manage_settings.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/google-map-professional/googlemarker.php:17
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/google-map-professional/includes/pannel.manage_markers.php on line 4
    • > PHP Notice
      Undefined index: marker_id in wp-content/plugins/google-map-professional/includes/preview_map.php on line 2
    • > PHP Warning
      include_once(GOOGLEMARKER_PLUGIN_DIR/includes/pannel.header.php): failed to open stream: No such file or directory in wp-content/plugins/google-map-professional/includes/pannel.manage_markers.php on line 1
    • > PHP Warning
      Use of undefined constant GOOGLEMARKER_PLUGIN_DIR - assumed 'GOOGLEMARKER_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'google_marker' not found in wp-content/plugins/google-map-professional/includes/pannel.create_new_marker.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png), #4 (screenshot-4.png), #5 (screenshot-5.png)
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
The official readme.txt might help

google-map-professional/googlemarker.php 92% from 13 tests

Analyzing the main PHP file in "Wordpress Google Map Professional (Map In Your Language)" version 1.0
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("google-map-professional.php" instead of "googlemarker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin5,817 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
CSS4908724,744
PHP812336744
JavaScript38128329

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity5.20
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
43 PNG files occupy 0.73MB with 0.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pattern1.png2.76KB0.12KB▼ 95.68%
images/markers/makrer- (16).png3.80KB0.34KB▼ 91.12%
images/markers/makrer- (15).png3.79KB0.34KB▼ 91.12%
images/icon.png2.94KB0.43KB▼ 85.50%
images/markers/makrer- (3).png4.85KB1.66KB▼ 65.75%