72% clear-statpress

Code Review | Clear StatPress

WordPress plugin Clear StatPress scored72%from 54 tests.

About plugin

  • Plugin page: clear-statpress
  • Plugin version: 1.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6
  • WordPress version: 6.3.1
  • First release: Dec 13, 2012
  • Latest release: Aug 17, 2016
  • Number of updates: 42
  • Update frequency: every 32.0 days
  • Top authors: leniy (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /7,170 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.04ms] Passed 4 tests

A check of server-side resources used by Clear StatPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.93 ▼3.73
Dashboard /wp-admin3.33 ▲0.0344.05 ▼1.57
Posts /wp-admin/edit.php3.38 ▲0.0244.18 ▼3.59
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.46 ▼15.25
Media Library /wp-admin/upload.php3.26 ▲0.0236.18 ▼0.11
About /wp-admin/admin.php?page=leniy-plugins3.2230.03
Clear StatPress /wp-admin/admin.php?page=leniy-plugins/Clear-StatPress.php3.2032.69

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Clear StatPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲9114.74 ▲0.361.84 ▼0.7944.10 ▼3.82
Dashboard /wp-admin2,232 ▲445.86 ▲0.96101.49 ▼4.8071.55 ▲31.97
Posts /wp-admin/edit.php2,112 ▲202.00 ▼0.1336.45 ▼4.5335.25 ▼1.19
Add New Post /wp-admin/post-new.php1,689 ▲17520.09 ▲2.47744.87 ▲77.4663.12 ▲6.21
Media Library /wp-admin/upload.php1,414 ▲234.20 ▼0.0297.52 ▼6.4558.76 ▲8.45
About /wp-admin/admin.php?page=leniy-plugins8951.8622.7062.67
Clear StatPress /wp-admin/admin.php?page=leniy-plugins/Clear-StatPress.php8952.0225.6736.01

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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
    • > GET request to /wp-admin/admin.php?page=leniy-plugins/Clear-StatPress.php
    • > Notice in wp-content/plugins/clear-statpress/Clear-StatPress.php+177
    Undefined index: confirmdel

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/clear-statpress/inc/leniy_admin_menu.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/clear-statpress/Clear-StatPress.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=leniy-plugins
    • > Network (severe)
    https://blog.leniy.org/project/wordpress - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 86% 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
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
You can take inspiration from this readme.txt

clear-statpress/Clear-StatPress.php 77% from 13 tests

Analyzing the main PHP file in "Clear StatPress" version 1.4.5
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("clear-statpress.php" instead of "Clear-StatPress.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 298 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin261 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP31831184
CSS10751
PO File16826

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions6
▷ Named functions6100.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
3 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png63.31KB23.71KB▼ 62.55%
inc/leniy-ico.png0.45KB0.61KB0.00%
inc/leniy.png1.36KB1.79KB0.00%