83% author-stats

Code Review | Author Stats

WordPress plugin Author Stats scored 83% from 54 tests.

About plugin

  • Plugin page: author-stats
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 5.8.1
  • First release: Jan 22, 2012
  • Latest release: Sep 10, 2014
  • Number of updates: 19
  • Update frequency: every 50.7 days
  • Top authors: dkukral (73.68%)Droyal (26.32%)jboydston (10.53%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,501 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼153.58ms] Passed 4 tests

Analyzing server-side resources used by Author Stats
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0331.64 ▼0.17
Dashboard /wp-admin3.09 ▲0.0443.24 ▼0.90
Posts /wp-admin/edit.php3.14 ▲0.0443.06 ▼8.47
Add New Post /wp-admin/post-new.php5.45 ▲0.0290.37 ▼604.79
Media Library /wp-admin/upload.php3.03 ▲0.0333.95 ▲0.50
Author Stats /wp-admin/index.php?page=author-stats2.9828.71

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Author Stats: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.92 ▲0.4011.59 ▼0.0649.18 ▲0.87
Dashboard /wp-admin2,978 ▲475.92 ▼0.29142.77 ▼16.55106.91 ▼1.51
Posts /wp-admin/edit.php2,741 ▲22.72 ▲0.0162.68 ▼3.6594.94 ▲1.02
Add New Post /wp-admin/post-new.php1,675 ▼818.87 ▲0.67390.82 ▼39.06107.28 ▼1.71
Media Library /wp-admin/upload.php1,812 ▲55.03 ▲0.04155.49 ▲5.53120.80 ▲2.89
Author Stats /wp-admin/index.php?page=author-stats1,0912.5063.4769.09

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
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/index.php?page=author-stats
    • > Notice in wp-content/plugins/author-stats/php/stats.php+129
    Undefined index: author

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/author-stats/author-stats.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/author-stats/php/display_stats.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/index.php?page=author-stats
    • > Network (severe)
    wp-content/plugins/author-stats/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in author-stats/assets to your readme.txt
Please take inspiration from this readme.txt

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

The main PHP file in "Author Stats" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
46 characters long description:
Displays various metrics for a selected author

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin329 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34112327
CSS1151
JavaScript1141

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity3.29
▷ Minimum method complexity2.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected