94% ocd-plugin-stats

Code Review | OCD Plugin Stats

WordPress plugin OCD Plugin Stats scored 94% from 54 tests.

About plugin

  • Plugin page: ocd-plugin-stats
  • Plugin version: 0.31
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 5.8.1
  • First release: Feb 29, 2012
  • Latest release: Jan 25, 2014
  • Number of updates: 7
  • Update frequency: every 99.4 days
  • Top authors: MakerBlock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,509 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

A check of server-side resources used by OCD Plugin Stats
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0346.30 ▲9.47
Dashboard /wp-admin3.09 ▲0.0452.26 ▲2.77
Posts /wp-admin/edit.php3.14 ▲0.0348.57 ▼0.39
Add New Post /wp-admin/post-new.php5.44 ▲0.0196.75 ▼569.51
Media Library /wp-admin/upload.php3.03 ▲0.0336.16 ▲3.00

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 3 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for OCD Plugin Stats
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,819 ▲22315.97 ▼0.1112.91 ▲0.1052.26 ▲0.58
Dashboard /wp-admin3,086 ▲1526.19 ▲0.11152.99 ▼25.97123.12 ▲4.19
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0168.35 ▼7.2192.83 ▼1.08
Add New Post /wp-admin/post-new.php1,581 ▼10218.28 ▼0.46413.93 ▼7.98118.17 ▲3.76
Media Library /wp-admin/upload.php1,748 ▼624.98 ▼0.06165.43 ▲5.99118.05 ▼0.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
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 register_activation_hook() in wp-content/plugins/ocd-plugin-stats/ocd_plugin_stats.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (What the widget will look like in your dashboard.)
Please take inspiration from this readme.txt

ocd-plugin-stats/ocd_plugin_stats.php 92% from 13 tests

The main file in "OCD Plugin Stats" v. 0.31 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("ocd-plugin-stats.php" instead of "ocd_plugin_stats.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected120 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11443120

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods6100.00%
▷ Public methods6100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png18.44KB7.91KB▼ 57.12%