78% lb-gmaps

Code Review | LB GMaps

WordPress plugin LB GMaps scored78%from 54 tests.

About plugin

  • Plugin page: lb-gmaps
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9
  • WordPress version: 6.3.1
  • First release: Nov 19, 2017
  • Latest release: Nov 30, 2017
  • Number of updates: 23
  • Update frequency: every 0.5 days
  • Top authors: lborisov (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,057 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼8.49ms] Passed 4 tests

A check of server-side resources used by LB GMaps
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1836.17 ▼2.87
Dashboard /wp-admin3.55 ▲0.2445.57 ▲2.69
Posts /wp-admin/edit.php3.60 ▲0.2446.83 ▼3.57
Add New Post /wp-admin/post-new.php6.07 ▲0.1880.55 ▼28.96
Media Library /wp-admin/upload.php3.41 ▲0.1836.71 ▲1.43
LB GMaps /wp-admin/edit.php?post_type=lb-gmaps3.4537.08
Add LB GMap /wp-admin/post-new.php?post_type=lb-gmaps3.6249.24
Settings /wp-admin/edit.php?post_type=lb-gmaps&page=lb-gmaps-settings3.3729.11

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 26 new files
Database: 2 new tables, 6 new options
New tables
wp_lb_gmaps
wp_lb_gmaps_markers
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

LB GMaps: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲20415.06 ▲0.6815.78 ▲13.6338.62 ▼11.30
Dashboard /wp-admin2,236 ▲515.83 ▲0.95113.02 ▼3.2269.21 ▲23.81
Posts /wp-admin/edit.php2,125 ▲361.97 ▼0.0238.39 ▼2.2534.24 ▼0.61
Add New Post /wp-admin/post-new.php1,546 ▲3223.37 ▲5.89764.83 ▲65.2958.41 ▲6.95
Media Library /wp-admin/upload.php1,415 ▲334.16 ▼0.0294.90 ▼11.2971.31 ▲24.31
LB GMaps /wp-admin/edit.php?post_type=lb-gmaps1,0991.9335.2432.83
Add LB GMap /wp-admin/post-new.php?post_type=lb-gmaps2,5197.71175.74136.93
Settings /wp-admin/edit.php?post_type=lb-gmaps&page=lb-gmaps-settings8262.0222.9023.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/lb-gmaps/views/lb_gmaps_marker_info.php
    • > /wp-content/plugins/lb-gmaps/views/lb_gmaps_map_searching_field.php
    • > /wp-content/plugins/lb-gmaps/views/lb_gmaps_marker_form.php
    • > /wp-content/plugins/lb-gmaps/views/lb_gmaps_map_directions_type.php
    • > /wp-content/plugins/lb-gmaps/views/lb_gmaps_map_contextmenu.php
    • > /wp-content/plugins/lb-gmaps/views/lb_gmaps_marker_transfer.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/lb-gmaps/includes/lb_gmaps_constants.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/lb-gmaps/includes/lb_gmaps_constants.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lb-gmaps/includes/metabox/lb_gmaps_metabox.php:4

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 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === lb-gmaps === )
  • Screenshots: These screenshots need descriptions #1, #2 in lb-gmaps/assets to your readme.txt
The official readme.txt might help

lb-gmaps/lb_gmaps.php 92% from 13 tests

This is the main PHP file of "LB GMaps" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 ("lb-gmaps.php" instead of "lb_gmaps.php")

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
Success! There were no dangerous files found in this plugin2,551 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31961231,324
PHP17161110832
CSS3670395

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.25
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods86
▷ Static methods00.00%
▷ Public methods6980.23%
▷ Protected methods00.00%
▷ Private methods1719.77%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/google-maps-icon.png1.32KB1.17KB▼ 11.75%