88% gspots

Code Review | Gspots

WordPress plugin Gspots scored 88% from 54 tests.

About plugin

  • Plugin page: gspots
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.9.1
  • WordPress version: 5.8.1
  • First release: Jul 14, 2014
  • Latest release: Jul 18, 2014
  • Number of updates: 17
  • Update frequency: every 0.3 days
  • Top authors: scottygfunk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 743 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.13MB] [CPU: ▼142.02ms] Passed 4 tests

A check of server-side resources used by Gspots
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1338.51 ▲5.42
Dashboard /wp-admin3.19 ▲0.1348.33 ▲4.22
Posts /wp-admin/edit.php3.27 ▲0.1737.76 ▼8.42
Add New Post /wp-admin/post-new.php5.55 ▲0.1292.35 ▼564.69
Media Library /wp-admin/upload.php3.13 ▲0.1333.27 ▲0.80
Add New /wp-admin/post-new.php?post_type=spot3.2444.88
Gspots /wp-admin/options-general.php?page=gspots-setting-admin3.0829.04
All Spots /wp-admin/edit.php?post_type=spot3.1736.44
Types /wp-admin/edit-tags.php?taxonomy=type&post_type=spot3.1324.53

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gspots
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,790 ▲18516.62 ▲1.0218.79 ▲8.6648.77 ▼0.31
Dashboard /wp-admin3,017 ▲865.88 ▼0.05133.78 ▼10.78112.51 ▲7.45
Posts /wp-admin/edit.php2,786 ▲472.69 ▼0.0165.06 ▲1.3495.28 ▲11.06
Add New Post /wp-admin/post-new.php1,703 ▲20519.08 ▲0.27375.17 ▲4.50106.88 ▼7.24
Media Library /wp-admin/upload.php1,854 ▲475.03 ▲0.01141.90 ▼13.76115.12 ▼10.58
Add New /wp-admin/post-new.php?post_type=spot3,1368.95212.91146.64
Gspots /wp-admin/options-general.php?page=gspots-setting-admin1,0852.0957.0784.19
All Spots /wp-admin/edit.php?post_type=spot1,4552.6263.2973.26
Types /wp-admin/edit-tags.php?taxonomy=type&post_type=spot1,7582.5064.6779.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=gspots-setting-admin
    • > User deprecated in wp-includes/functions.php+5221
    screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=gspots-setting-admin
    • > User deprecated in wp-includes/functions.php+5221
    get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
The following issues need your attention
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gspots/core/meta-box.php:9
    • > PHP Warning
      Use of undefined constant GSPOTS_CACHE_LOCATION - assumed 'GSPOTS_CACHE_LOCATION' (this will throw an Error in a future version of PHP) in wp-content/plugins/gspots/core/geocache.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/gspots/core/settings.php:121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/gspots/core/shortcode.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gspots/core/post-type.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gspots/core/taxonomy.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gspots/core/geocache.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gspots/gspots.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: map, google, spots, store, search...

gspots/gspots.php 92% from 13 tests

The principal PHP file in "Gspots" v. 1.0.5 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
There were no executable files found in this plugin3,116 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript27147812,490
PHP812385511
CSS22412114
JSON1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity3.33
▷ Minimum class complexity3.00
▷ Maximum class complexity4.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods646.15%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
6 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/markers/marker_red.png1.91KB1.01KB▼ 46.91%
core/markers/marker_orange.png1.91KB1.01KB▼ 47.26%
core/markers/marker_purple.png1.92KB1.00KB▼ 47.97%
core/markers/marker_blue.png1.93KB1.02KB▼ 47.27%
core/markers/marker.png1.87KB0.97KB▼ 47.86%