84% hercules-post-stats

Code Review | Hercules Post Stats

WordPress plugin Hercules Post Stats scored84%from 54 tests.

About plugin

  • Plugin page: hercules-post-stats
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Jan 18, 2015
  • Latest release: Jan 18, 2015
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: toddnestor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /764 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.77ms] Passed 4 tests

This is a short check of server-side resources used by Hercules Post Stats
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.81 ▼0.63
Dashboard /wp-admin3.31 ▲0.0146.67 ▼3.58
Posts /wp-admin/edit.php3.36 ▲0.0147.09 ▲1.02
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.53 ▲1.69
Media Library /wp-admin/upload.php3.23 ▲0.0134.77 ▲0.11

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Hercules Post Stats
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.161.84 ▼0.0545.07 ▼2.62
Dashboard /wp-admin2,206 ▲154.83 ▼1.21108.77 ▲8.6242.48 ▼2.61
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0139.82 ▲4.3834.68 ▼1.54
Add New Post /wp-admin/post-new.php6,305 ▲4,78621.81 ▼1.30858.94 ▲252.3356.10 ▲0.17
Media Library /wp-admin/upload.php1,388 ▲34.21 ▲0.0394.90 ▼1.2041.22 ▼1.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hercules-post-stats/hercules_post_stats.php:22

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 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
4 plugin tags: posts, wp-admin, hercules, metabox

hercules-post-stats/hercules_post_stats.php 92% from 13 tests

Analyzing the main PHP file in "Hercules Post Stats" version 1.0
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("hercules-post-stats.php" instead of "hercules_post_stats.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin259 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1443182
PHP1121977

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.86
▷ Minimum method complexity1.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%
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
No PNG images were found in this plugin