83% hal

Code Review | HAL

WordPress plugin HAL scored 83% from 54 tests.

About plugin

  • Plugin page: hal
  • Plugin version: 2.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 17, 2014
  • Latest release: Mar 13, 2023
  • Number of updates: 231
  • Update frequency: every 13.8 days
  • Top authors: ccsd (54.55%)Friz (45.89%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active / 9,095 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 gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.83ms] Passed 4 tests

A check of server-side resources used by HAL
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.90 ▼5.80
Dashboard /wp-admin3.41 ▲0.1152.19 ▼3.23
Posts /wp-admin/edit.php3.53 ▲0.1758.53 ▲6.71
Add New Post /wp-admin/post-new.php5.99 ▲0.11119.14 ▲26.35
Media Library /wp-admin/upload.php3.34 ▲0.1138.84 ▼8.98

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
widget_hal-publications
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

HAL: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲10913.60 ▲0.158.59 ▲6.3844.28 ▲0.89
Dashboard /wp-admin2,218 ▲125.87 ▲0.02108.25 ▼3.2745.21 ▲0.87
Posts /wp-admin/edit.php2,101 ▲122.05 ▲0.0338.79 ▲4.1635.36 ▲0.67
Add New Post /wp-admin/post-new.php1,538 ▲523.32 ▲0.02710.46 ▼56.2053.20 ▼4.00
Media Library /wp-admin/upload.php1,403 ▲154.22 ▲0.0393.80 ▼17.4341.50 ▼4.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_hal-publications
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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
Good news, no errors were detected

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 take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_locale() in wp-content/plugins/hal/constantes.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/hal/wp-hal.php:15

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: open archive, open science, hal

hal/wp-hal.php 77% from 13 tests

This is the main PHP file of "HAL" version 2.4.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hal.php" instead of "wp-hal.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 168 characters long)

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
No dangerous file extensions were detected11,694 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,2032,9718,909
PHP21081411,316
SVG1213515
PO File3182183428
CSS27735330
JSON100196

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants13
▷ Global constants13100.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
img/logo-hal.png15.52KB7.25KB▼ 53.30%