10% simple-google-map-generator

Code Review | Simple Google Map Generator

WordPress plugin Simple Google Map Generator scored10%from 54 tests.

About plugin

  • Plugin page: simple-google-map...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 29, 2014
  • Latest release: Jun 9, 2015
  • Number of updates: 23
  • Update frequency: every 13.7 days
  • Top authors: piman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,738 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/simple-google-map-generator/lib/functions.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; AllGoogleMaps has a deprecated constructor

Server metrics [RAM: ▼1.94MB] [CPU: ▼55.87ms] Passed 4 tests

An overview of server-side resources used by Simple Google Map Generator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.429.17 ▼32.36
Dashboard /wp-admin2.07 ▼1.246.11 ▼47.21
Posts /wp-admin/edit.php2.07 ▼1.296.58 ▼44.33
Add New Post /wp-admin/post-new.php2.07 ▼3.828.16 ▼99.56
Media Library /wp-admin/upload.php2.07 ▼1.165.99 ▼30.44
Google Maps /wp-admin/options-general.php?page=rtltheme-gmap2.077.05

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Google Map Generator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲16314.35 ▲0.0035.04 ▲33.4948.67 ▲7.09
Dashboard /wp-admin2,202 ▲315.56 ▲0.0385.09 ▼3.3738.97 ▼4.82
Posts /wp-admin/edit.php2,104 ▲12.00 ▲0.0335.14 ▼1.2338.65 ▲3.54
Add New Post /wp-admin/post-new.php1,529 ▲123.35 ▲0.24673.89 ▲30.8254.84 ▲7.08
Media Library /wp-admin/upload.php1,398 ▼54.26 ▲0.0499.94 ▲4.0643.09 ▼1.28
Google Maps /wp-admin/options-general.php?page=rtltheme-gmap1,6656.36134.20136.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/simple-google-map-generator/lib/functions.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; AllGoogleMaps has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=rtltheme-gmap
    • > Deprecated in wp-content/plugins/simple-google-map-generator/lib/functions.php+4
    Methods with the same name as their class will not be constructors in a future version of PHP; AllGoogleMaps has a deprecated constructor

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
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/simple-google-map-generator/rtltheme-gmap.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-google-map-generator/lib/functions.php:101
    • > PHP Fatal error
      require_once(): Failed opening required 'RT_PLUGIN_DIR/lib/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-google-map-generator/settings.php on line 2
    • > PHP Warning
      require_once(RT_PLUGIN_DIR/lib/functions.php): failed to open stream: No such file or directory in wp-content/plugins/simple-google-map-generator/settings.php on line 2
    • > PHP Warning
      Use of undefined constant RT_PLUGIN_DIR - assumed 'RT_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-google-map-generator/settings.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=rtltheme-gmap
    • > Console-api (warning) in unknown
    http://maps.google.com/maps/api/js?sensor=true 210:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: simple, persian, google map, google, drag and drop...

simple-google-map-generator/rtltheme-gmap.php 85% from 13 tests

The entry point to "Simple Google Map Generator" version 1.1.1 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-google-map-generator.php" instead of "rtltheme-gmap.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected514 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP48630278
PO File24242125
CSS230110
JavaScript1031

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.17MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon-shadow.png1.44KB2.04KB0.00%
screenshot.png163.98KB65.46KB▼ 60.08%
img/rtltheme.png3.75KB1.79KB▼ 52.34%
img/default.png2.90KB1.77KB▼ 39.00%