10% stats-widget

Code Review | Stats Widget

WordPress plugin Stats Widget scored10%from 54 tests.

About plugin

  • Plugin page: stats-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5-3.5
  • WordPress version: 6.3.1
  • First release: May 24, 2013
  • Latest release: May 24, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: ThesisPremium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,563 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/stats-widget/stats-widget.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; Widget_SiteStats has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼50.45ms] Passed 4 tests

Analyzing server-side resources used by Stats Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.188.52 ▼30.24
Dashboard /wp-admin2.29 ▼1.019.38 ▼37.09
Posts /wp-admin/edit.php2.29 ▼1.069.91 ▼41.06
Add New Post /wp-admin/post-new.php2.29 ▼3.5911.34 ▼93.39
Media Library /wp-admin/upload.php2.29 ▼0.9410.44 ▼21.64

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_sitestats
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Stats Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.20 ▼1.171.66 ▼0.2438.99 ▼11.03
Dashboard /wp-admin2,206 ▲154.84 ▼0.05112.37 ▲7.2742.26 ▼1.96
Posts /wp-admin/edit.php2,092 ▼01.99 ▼0.0534.65 ▼6.1129.58 ▼4.76
Add New Post /wp-admin/post-new.php1,533 ▼323.14 ▼0.06650.57 ▲18.3251.67 ▼4.58
Media Library /wp-admin/upload.php1,385 ▼34.30 ▲0.0795.31 ▼5.2240.04 ▼4.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Widget_SiteStats is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_sitestats
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/stats-widget/stats-widget.php:28

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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (widget sidebar view.)
  • Contributors: No tags were detected
  • Contributors: The plugin contributors field is not present
The official readme.txt is a good inspiration

stats-widget/stats-widget.php Passed 13 tests

"Stats Widget" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
135 characters long description:
Widget to display stats on your site to guests such as the # total of pages, posts ,comments , tags and categories created on the site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected78 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1252065
CSS14013

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ 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%
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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png.png38.18KB21.54KB▼ 43.57%