84% hairspaces-around-dashes

Code Review | Hairspaces Around Dashes

WordPress plugin Hairspaces Around Dashes scored 84% from 54 tests.

About plugin

  • Plugin page: hairspaces-around...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 12, 2022
  • Latest release: May 25, 2022
  • Number of updates: 7
  • Update frequency: every 1.9 days
  • Top authors: golang (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 270 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.52ms] Passed 4 tests

An overview of server-side resources used by Hairspaces Around Dashes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.10 ▼1.38
Dashboard /wp-admin3.31 ▲0.0142.41 ▼6.81
Posts /wp-admin/edit.php3.36 ▲0.0045.78 ▼3.45
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.14 ▼10.43
Media Library /wp-admin/upload.php3.23 ▲0.0037.16 ▲4.68

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hairspaces Around Dashes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.32 ▼0.982.71 ▲0.9440.72 ▼0.36
Dashboard /wp-admin2,209 ▲184.84 ▼0.03111.22 ▼6.7545.70 ▲0.77
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0137.55 ▼2.8034.25 ▼3.74
Add New Post /wp-admin/post-new.php1,537 ▲423.39 ▲0.26666.58 ▲7.8551.55 ▼0.24
Media Library /wp-admin/upload.php1,391 ▲94.26 ▲0.03100.14 ▲0.4042.47 ▼0.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hairspaces-around-dashes/hairspaces-around-dashes.php:33

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === hairspaces-around-dashes === )
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt might help

hairspaces-around-dashes/hairspaces-around-dashes.php Passed 13 tests

The principal PHP file in "Hairspaces Around Dashes" v. 1.0.5 is loaded by WordPress automatically on each request
103 characters long description:
This simple but effective plugin converts spaces around dashes (both em and en dashes) into hairspaces.

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
There were no executable files found in this plugin118 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1240105
PHP113913

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions1
▷ Named functions1100.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
No PNG files were detected