73% wp-comment-stats

Code Review | WP Comment Stats

WordPress plugin WP Comment Stats scored 73% from 54 tests.

About plugin

  • Plugin page: wp-comment-stats
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.25-4.9.7
  • WordPress version: 6.3.1
  • First release: Jul 17, 2015
  • Latest release: Jul 13, 2018
  • Number of updates: 23
  • Update frequency: every 47.5 days
  • Top authors: jammy to go (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,158 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

Analyzing server-side resources used by WP Comment Stats
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.97 ▼1.68
Dashboard /wp-admin3.34 ▲0.0345.33 ▼2.89
Posts /wp-admin/edit.php3.48 ▲0.1263.50 ▲6.78
Add New Post /wp-admin/post-new.php5.95 ▲0.06101.38 ▲2.73
Media Library /wp-admin/upload.php3.29 ▲0.0635.80 ▲1.33
WP Comment Stats /wp-admin/edit-comments.php?page=commentstatslist3.2529.59
All Comments /wp-admin/edit-comments.php3.3039.54

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Comment Stats
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,217 ▲44613.19 ▼1.401.96 ▼0.0341.21 ▼0.48
Dashboard /wp-admin2,598 ▲4135.04 ▲0.15103.53 ▼8.6541.21 ▼1.68
Posts /wp-admin/edit.php2,114 ▲252.04 ▲0.0144.30 ▲2.1954.24 ▲17.47
Add New Post /wp-admin/post-new.php1,552 ▲3323.11 ▲0.02609.94 ▼43.4956.54 ▼7.71
Media Library /wp-admin/upload.php1,401 ▲134.29 ▲0.13101.77 ▼10.7243.44 ▼3.15
WP Comment Stats /wp-admin/edit-comments.php?page=commentstatslist1,1982.0324.6052.32
All Comments /wp-admin/edit-comments.php1,8112.2834.7934.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/edit-comments.php?page=commentstatslist
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-comments.php?page=commentstatslist
    • > Notice in wp-admin/includes/class-wp-list-table.php+1615
    Trying to access array offset on value of type null

SRP 0% 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
Please take a closer look at the following
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-comment-stats/views/widget/widget-stats-weekly.php
    • > /wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-weekly.php
    • > /wp-content/plugins/wp-comment-stats/views/widget/widget-stats-yearly.php
    • > /wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-yearly.php
    • > /wp-content/plugins/wp-comment-stats/views/widget/widget-stats-monthly.php
    • > /wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-monthly.php
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-comment-stats/views/widget/widget-stats-yearly.php on line 3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-yearly.php on line 13
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-weekly.php on line 3
    • > PHP Notice
      Undefined variable: comment_counts in wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-monthly.php on line 13
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-yearly.php on line 3
    • > PHP Notice
      Undefined variable: comment_counts in wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-monthly.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-comment-stats/wp-comment-stats.php on line 23
    • > PHP Notice
      Undefined variable: total_height in wp-content/plugins/wp-comment-stats/views/widget/widget-stats-yearly.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-comment-stats/trunk/views/widget/widget-stats-monthly.php on line 3
    • > PHP Notice
      Undefined variable: comment_counts in wp-content/plugins/wp-comment-stats/views/widget/widget-stats-weekly.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 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
3 plugin tags: stats, dashboard comment stats, comments

wp-comment-stats/wp-comment-stats.php Passed 13 tests

The entry point to "WP Comment Stats" version 1.0.3 is a PHP file that has certain tags in its header comment area
63 characters long description:
Shows the comments statistics breakdown plus a dashboard output

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
Success! There were no dangerous files found in this plugin412 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP69170368
CSS20244

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity10.00
▷ Minimum class complexity5.00
▷ Maximum class complexity15.00
Average method complexity1.82
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods2195.45%
▷ Protected methods00.00%
▷ Private methods14.55%
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin