94% admins-post-statistics

Code Review | Admins Post Statistics

WordPress plugin Admins Post Statistics scored 94% from 54 tests.

About plugin

  • Plugin page: admins-post-stati...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8.2
  • WordPress version: 5.9.2
  • First release: Nov 11, 2017
  • Latest release: Nov 11, 2017
  • Number of updates: 8
  • Update frequency: every 0.6 days
  • Top authors: hindshalfeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 553 total downloads

Benchmarks

Plugin footprint Passed 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: ▲0.03MB] [CPU: ▼295.70ms] Passed 4 tests

Analyzing server-side resources used by Admins Post Statistics
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0863.25 ▲5.07
Dashboard /wp-admin3.46 ▲0.0536.61 ▲4.59
Posts /wp-admin/edit.php3.70 ▲0.0646.97 ▲10.28
Add New Post /wp-admin/post-new.php6.92 ▼0.0596.72 ▼1,194.73
Media Library /wp-admin/upload.php3.33 ▲0.0427.23 ▲2.26
Admin Statistics /wp-admin/edit.php?page=admin_statistics3.3124.66

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Admins Post Statistics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,786 ▲3115.64 ▲0.036.25 ▲0.242.26 ▼0.44
Dashboard /wp-admin2,883 ▲256.12 ▼0.17123.06 ▼56.14199.58 ▲19.66
Posts /wp-admin/edit.php2,722 ▲343.26 ▲0.0372.79 ▲6.94140.29 ▼72.24
Add New Post /wp-admin/post-new.php1,722 ▲6722.68 ▲2.02415.37 ▼33.50187.85 ▼29.56
Media Library /wp-admin/upload.php1,703 ▲55.51 ▼0.03150.54 ▲0.10229.64 ▲29.08
Admin Statistics /wp-admin/edit.php?page=admin_statistics1,0582.7965.22109.88

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/admins-post-statistics/count-views-column.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/admins-post-statistics/admin-post-count.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: shalfeh, admin, post views, post count, posts between two dates

admins-post-statistics/AdminsPostStatistics.php 92% from 13 tests

"Admins Post Statistics" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("admins-post-statistics.php" instead of "AdminsPostStatistics.php")

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 plugin3,133 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS51071302,870
PHP313918256
JavaScript1007

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/smoothness/images/ui-icons_cd0a0a_256x240.png4.57KB4.18KB▼ 8.43%
css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%
css/smoothness/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.18KB▼ 44.00%