62% geocache-stat-bar

Code Review | Geocache Stat Bar

WordPress plugin Geocache Stat Bar scored62%from 54 tests.

About plugin

  • Plugin page: geocache-stat-bar
  • Plugin version: 2.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.9.1
  • WordPress version: 6.3.1
  • First release: Mar 5, 2016
  • Latest release: Dec 26, 2017
  • Number of updates: 78
  • Update frequency: every 8.5 days
  • Top authors: verturin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,478 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.52ms] Passed 4 tests

A check of server-side resources used by Geocache Stat Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1944.97 ▼1.71
Dashboard /wp-admin3.37 ▲0.0653.66 ▼5.61
Posts /wp-admin/edit.php3.42 ▲0.0654.58 ▲4.59
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.21 ▼10.66
Media Library /wp-admin/upload.php3.30 ▲0.0640.43 ▲3.90
Settings /wp-admin/admin.php?page=gcstb-settings3.2938.57
GCSTB Plugin /wp-admin/admin.php?page=gcstb-plugin3.2837.03
About /wp-admin/admin.php?page=gcstb-about3.2736.23

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 57 new files
Database: 1 new table, 7 new options
New tables
wp_gcstb_db_statbar
New WordPress options
widget_gcstb_widget
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Geocache Stat Bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.16 ▼0.191.97 ▲0.1443.52 ▲1.52
Dashboard /wp-admin2,227 ▲535.56 ▼0.1187.24 ▼26.6069.17 ▲24.39
Posts /wp-admin/edit.php2,135 ▲351.98 ▼0.0135.87 ▼6.7133.84 ▼3.70
Add New Post /wp-admin/post-new.php1,558 ▲3023.04 ▲0.03718.26 ▲21.9071.56 ▲21.45
Media Library /wp-admin/upload.php1,429 ▲264.18 ▼0.03112.15 ▲0.9981.15 ▲30.83
Settings /wp-admin/admin.php?page=gcstb-settings1,0292.0425.1330.79
GCSTB Plugin /wp-admin/admin.php?page=gcstb-plugin1,0211.9922.7932.92
About /wp-admin/admin.php?page=gcstb-about8922.1422.9730.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_gcstb_db_statbar
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_gcstb_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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 errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=gcstb-settings
    • > Notice in wp-content/plugins/geocache-stat-bar/includes/gcstb-settings.html.php+145
    Undefined variable: user_ID

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/geocache-stat-bar/avatar/avatar.php
  • 27× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: lignehides in wp-content/plugins/geocache-stat-bar/avatar/avatar.php on line 202
    • > PHP Notice
      Undefined variable: avatar in wp-content/plugins/geocache-stat-bar/avatar/avatar.php on line 222
    • > PHP Notice
      Undefined variable: avatar in wp-content/plugins/geocache-stat-bar/avatar/avatar.php on line 251
    • > PHP Notice
      Undefined index: imageuid in wp-content/plugins/geocache-stat-bar/avatar/avatar.php on line 20
    • > PHP Notice
      Undefined index: extension in wp-content/plugins/geocache-stat-bar/avatar/avatar.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/geocache-stat-bar/includes/gcstb-widget-init.php:11
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/geocache-stat-bar/includes/gcstb-db.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Add_action() in wp-content/plugins/geocache-stat-bar/includes/gcstb-menu.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/geocache-stat-bar/options.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/geocache-stat-bar/includes/gcstb-sidebar.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

geocache-stat-bar/geocache-stat-bar.php Passed 13 tests

The principal PHP file in "Geocache Stat Bar" v. 2.1.2 is loaded by WordPress automatically on each request
39 characters long description:
Affichage de votre Stat Bar Géocaching

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
Good job! No executable or dangerous file extensions detected910 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP12175166825
CSS117185

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
36 PNG files occupy 0.95MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png128.32KB37.87KB▼ 70.49%
avatar/GCSTB-background-00.png2.83KB0.09KB▼ 96.86%
images/GCSTB.png92.82KB25.14KB▼ 72.91%
images/5-16.png0.55KB0.50KB▼ 8.23%
images/4-16.png0.51KB0.49KB▼ 3.26%