90% post-length-indicator

Code Review | Post Length Indicator

WordPress plugin Post Length Indicator scored90%from 54 tests.

About plugin

  • Plugin page: post-length-indic...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.0
  • WordPress version: 6.3.1
  • First release: Feb 24, 2014
  • Latest release: Dec 4, 2018
  • Number of updates: 7
  • Update frequency: every 249.1 days
  • Top authors: hlashbrooke (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,889 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.70ms] Passed 4 tests

An overview of server-side resources used by Post Length Indicator
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0540.69 ▲1.90
Dashboard /wp-admin3.38 ▲0.0744.65 ▼2.86
Posts /wp-admin/edit.php3.49 ▲0.1344.78 ▼1.55
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.74 ▼8.29
Media Library /wp-admin/upload.php3.30 ▲0.0736.69 ▲5.82
Post Length Indicator /wp-admin/options-general.php?page=pli_settings3.2732.26

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Length Indicator
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.17 ▼0.371.71 ▼0.0745.74 ▲4.74
Dashboard /wp-admin2,199 ▲225.64 ▲0.0390.93 ▲8.0241.97 ▲0.31
Posts /wp-admin/edit.php2,107 ▲251.94 ▼0.0940.60 ▲3.9633.97 ▼0.00
Add New Post /wp-admin/post-new.php1,540 ▲1418.51 ▼4.90586.31 ▼52.1389.89 ▲31.49
Media Library /wp-admin/upload.php1,407 ▲44.18 ▲0.0295.29 ▲0.2542.79 ▼0.69
Post Length Indicator /wp-admin/options-general.php?page=pli_settings8642.2535.1430.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: readbility, post, length, comments

post-length-indicator/post-length-indicator.php Passed 13 tests

The main file in "Post Length Indicator" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
139 characters long description:
Displays a dual-coloured bar alongside the scrollbar to indicate how much of the page contains the post and how much contains the comments.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin340 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP47472218
PO File1142647
JavaScript210045
CSS10030

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity11.50
▷ Minimum class complexity8.00
▷ Maximum class complexity15.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin