68% generalstats

Code Review | GeneralStats

WordPress plugin GeneralStats scored68%from 54 tests.

About plugin

  • Plugin page: generalstats
  • Plugin version: 3.34
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 6.3.1
  • First release: Mar 24, 2007
  • Latest release: Nov 9, 2017
  • Number of updates: 109
  • Update frequency: every 35.6 days
  • Top authors: neoxx (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /86,831 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.09MB] [CPU: ▼53.51ms] Passed 4 tests

Server-side resources used by GeneralStats
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▼0.567.71 ▼36.01
Dashboard /wp-admin2.92 ▼0.389.76 ▼41.65
Posts /wp-admin/edit.php2.92 ▼0.448.04 ▼44.99
Add New Post /wp-admin/post-new.php2.92 ▼2.977.94 ▼91.40
Media Library /wp-admin/upload.php2.92 ▼0.318.20 ▼30.74
GeneralStats /wp-admin/options-general.php?page=generalstats2.927.96

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_generalstats
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
generalstats

Browser metrics Passed 4 tests

Checking browser requirements for GeneralStats
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲11113.48 ▼0.959.01 ▲6.4942.60 ▲0.20
Dashboard /wp-admin2,211 ▲345.58 ▲0.0698.23 ▲7.4143.37 ▲1.77
Posts /wp-admin/edit.php2,113 ▲131.99 ▲0.0338.76 ▲1.4834.00 ▼1.23
Add New Post /wp-admin/post-new.php1,532 ▲623.03 ▲0.02644.17 ▼46.5256.51 ▲4.61
Media Library /wp-admin/upload.php1,407 ▲44.21 ▲0.11100.27 ▼6.0343.70 ▼4.50
GeneralStats /wp-admin/options-general.php?page=generalstats2,7762.2751.2345.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/generalstats/generalstats.php+434
    Use of undefined constant EMPTY_TRASH_DAYS - assumed 'EMPTY_TRASH_DAYS' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=generalstats
    • > Warning in wp-content/plugins/generalstats/generalstats.php+434
    Use of undefined constant EMPTY_TRASH_DAYS - assumed 'EMPTY_TRASH_DAYS' (this will throw an Error in a future version of PHP)

SRP 50% 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
Almost there! Just fix the following items
  • 54× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to get property 'term_taxonomy' of non-object in wp-content/plugins/generalstats/generalstats.php on line 540
    • > PHP Notice
      Trying to get property 'posts' of non-object in wp-content/plugins/generalstats/generalstats.php on line 571
    • > PHP Notice
      Trying to get property 'comments' of non-object in wp-content/plugins/generalstats/generalstats.php on line 549
    • > PHP Notice
      Trying to get property 'posts' of non-object in wp-content/plugins/generalstats/generalstats.php on line 572
    • > PHP Notice
      Trying to get property 'posts' of non-object in wp-content/plugins/generalstats/generalstats.php on line 544
    • > PHP Notice
      Trying to get property 'terms' of non-object in wp-content/plugins/generalstats/generalstats.php on line 563
    • > PHP Notice
      Trying to get property 'terms' of non-object in wp-content/plugins/generalstats/generalstats.php on line 563
    • > PHP Notice
      Trying to get property 'terms' of non-object in wp-content/plugins/generalstats/generalstats.php on line 540
    • > PHP Notice
      Trying to get property 'links' of non-object in wp-content/plugins/generalstats/generalstats.php on line 559
    • > PHP Notice
      Trying to get property 'terms' of non-object in wp-content/plugins/generalstats/generalstats.php on line 540

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
These attributes need your attention:
  • Tags: There are too many tags (22 tag instead of maximum 10)
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screenshot shows the Settings/GeneralStats Tab with the Selection GUI Section in the Admin Menu.), #2 (This picture presents the Preview Section of the GeneralStats Tab in the Admin Menu.)
You can look at the official readme.txt

generalstats/generalstats.php 92% from 13 tests

"GeneralStats" version 3.34's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin2,189 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP21,1821,3831,793
JavaScript5168206297
CSS124099

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity130.00
▷ Minimum class complexity4.00
▷ Maximum class complexity256.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods141
▷ Static methods00.00%
▷ Public methods8660.99%
▷ Protected methods00.00%
▷ Private methods5539.01%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png20.18KB10.26KB▼ 49.15%
screenshot-2.png14.31KB6.49KB▼ 54.65%