68% mage-google-maps

Code Review | Mage Google Maps

WordPress plugin Mage Google Maps scored68%from 54 tests.

About plugin

  • Plugin page: mage-google-maps
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Jan 13, 2014
  • Latest release: Apr 15, 2017
  • Number of updates: 24
  • Update frequency: every 49.6 days
  • Top authors: Maximilian Ruthe (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /7,447 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.36MB] [CPU: ▼46.81ms] Passed 4 tests

Analyzing server-side resources used by Mage Google Maps
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.60 ▼0.8610.44 ▼31.34
Dashboard /wp-admin2.66 ▼0.6516.01 ▼38.76
Posts /wp-admin/edit.php2.66 ▼0.7013.01 ▼36.55
Add New Post /wp-admin/post-new.php2.65 ▼3.2314.45 ▼80.57
Media Library /wp-admin/upload.php2.66 ▼0.5713.28 ▼23.86
Dashboard /wp-admin/admin.php?page=mage_cast2.6611.77
Maps /wp-admin/admin.php?page=mage_maps2.6614.29

Server storage [IO: ▲1.08MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/mage-google-maps/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 221 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
mage_maps
db_upgraded
widget_mage-google-maps
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Mage Google Maps
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13514.21 ▼0.0922.65 ▲20.7839.55 ▼4.82
Dashboard /wp-admin2,240 ▲405.92 ▲0.06101.72 ▼0.3974.58 ▲32.18
Posts /wp-admin/edit.php2,119 ▲222.02 ▼0.0235.48 ▼2.5333.15 ▼2.46
Add New Post /wp-admin/post-new.php1,701 ▲17521.88 ▲4.21746.98 ▲37.0656.28 ▲0.09
Media Library /wp-admin/upload.php1,416 ▲134.20 ▼0.0297.88 ▼9.8871.30 ▲23.57
Dashboard /wp-admin/admin.php?page=mage_cast9032.3832.2479.79
Maps /wp-admin/admin.php?page=mage_maps1,5992.1433.2879.13

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/mage-google-maps/cast/craft.php+27
    Methods with the same name as their class will not be constructors in a future version of PHP; Mage_Google_Maps has a deprecated constructor
  • This plugin does not fully uninstall, leaving 8 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_mage-google-maps
    • widget_recent-posts
    • theysaidso_admin_options
    • mage_maps
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mage_maps
    • > Deprecated in wp-content/plugins/mage-google-maps/cast/craft.php+27
    Methods with the same name as their class will not be constructors in a future version of PHP; Mage_Google_Maps has a deprecated constructor
  • 37 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mage_maps
    • > Warning in wp-content/plugins/mage-google-maps/core/mage-cast.php+199
    preg_replace(): Compilation failed: invalid range in character class at offset 13

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mage-google-maps/core/mage-cast.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 25 tag instead of maximum 10
You can look at the official readme.txt

mage-google-maps/mage-google-maps.php 92% from 13 tests

The entry point to "Mage Google Maps" version 1.1.2 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path folder was not found ("/lang/")

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 plugin12,192 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,155707,800
PHP6381251,529
JavaScript4322671,454
SVG3011,409

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity18.50
▷ Minimum class complexity4.00
▷ Maximum class complexity33.00
Average method complexity5.38
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions66
▷ Named functions66100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
195 compressed PNG files occupy 0.30MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
source/img/leaf.png0.78KB1.07KB0.00%
source/img/home.png0.39KB0.48KB0.00%
source/img/pizza.png0.88KB1.25KB0.00%
source/img/road.png0.63KB0.87KB0.00%
source/img/hospital-h.png0.26KB0.25KB▼ 2.67%