67% better-hints

Code Review | Better Hints for WordPress

WordPress plugin Better Hints for WordPress scored 67% from 54 tests.

About plugin

  • Plugin page: better-hints
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 4, 2018
  • Latest release: Jan 13, 2018
  • Number of updates: 22
  • Update frequency: every 0.4 days
  • Top authors: dpoakaspine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 631 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▼0.76MB] [CPU: ▼29.88ms] Passed 4 tests

This is a short check of server-side resources used by Better Hints for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2342.47 ▼2.62
Dashboard /wp-admin3.18 ▼0.1226.68 ▼20.88
Posts /wp-admin/edit.php3.18 ▼0.1728.80 ▼19.91
Add New Post /wp-admin/post-new.php3.18 ▼2.7127.39 ▼65.42
Media Library /wp-admin/upload.php3.18 ▼0.0522.85 ▼13.32
Activate Pro /wp-admin/edit.php?post_type=hint&page=options3.1823.81
Add New /wp-admin/post-new.php?post_type=hint3.1825.96
Hints /wp-admin/edit.php?post_type=hint3.1825.30

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_betterhints_widget_area_id
recovery_mode_email_last_sent
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Better Hints for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲11713.25 ▼1.312.18 ▲0.0757.01 ▲8.09
Dashboard /wp-admin2,234 ▲465.80 ▲0.93100.28 ▼13.0039.77 ▼7.63
Posts /wp-admin/edit.php2,117 ▲281.99 ▼0.0539.10 ▲2.1634.28 ▲0.11
Add New Post /wp-admin/post-new.php1,559 ▲2623.49 ▼0.00592.51 ▼34.3861.69 ▲6.53
Media Library /wp-admin/upload.php1,413 ▲254.27 ▲0.0996.53 ▼2.1541.93 ▼2.61
Activate Pro /wp-admin/edit.php?post_type=hint&page=options8052.1524.6425.54
Add New /wp-admin/post-new.php?post_type=hint1,3001.7110.3530.87
Hints /wp-admin/edit.php?post_type=hint1,1071.9430.4827.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/better-hints/index.php+31
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 8 options in the database
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_betterhints_widget_area_id
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% 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
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=hint
    • > Notice in wp-content/plugins/better-hints/index.php+31
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=hint
    • > Notice in wp-content/plugins/better-hints/index.php+1133
    Trying to get property 'post_type' of non-object
    • > GET request to /wp-admin/post-new.php?post_type=hint
    • > Notice in wp-content/plugins/better-hints/index.php+460
    Undefined variable: html
    • > GET request to /wp-admin/post-new.php?post_type=hint
    • > Error in wp-content/plugins/better-hints/index.php+467
    Uncaught Error: Call to undefined function pll__() in wp-content/plugins/better-hints/index.php:467
    Stack trace:
    #0 wp-admin/includes/template.php(1443): betterhints_display_meta_box()
    #1 wp-admin/edit-form-advanced.php(688): do_meta_boxes()
    #2 wp-admin/post-new.php(75): require('/var/www/wordpr...')
    #3 {main}
    thrown

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-hints/index.php:48

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 86% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Requires php: Invalid plugin version format
  • Screenshots: These screenshots need descriptions #4, #5, #6, #7 in better-hints/assets to your readme.txt
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

better-hints/index.php 92% from 13 tests

"Better Hints for WordPress" version 1.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("better-hints.php" instead of "index.php")

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
There were no executable files found in this plugin1,100 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1220100882
PO File1394093
CSS119080
JavaScript126945

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.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%
Functions42
▷ Named functions42100.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