84% was-this-article-helpful

Code Review | Was This Helpful?

WordPress plugin Was This Helpful? scored84%from 54 tests.

About plugin

  • Plugin page: was-this-article-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 26, 2019
  • Latest release: May 18, 2022
  • Number of updates: 29
  • Update frequency: every 39.6 days
  • Top authors: WaspThemes (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /7,943 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.49ms] Passed 4 tests

This is a short check of server-side resources used by Was This Helpful?
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0542.56 ▼1.15
Dashboard /wp-admin3.36 ▲0.0550.42 ▼4.19
Posts /wp-admin/edit.php3.41 ▲0.0552.01 ▲3.84
Add New Post /wp-admin/post-new.php5.94 ▲0.05100.13 ▲7.76
Media Library /wp-admin/upload.php3.28 ▲0.0537.34 ▼0.45
Helpful /wp-admin/options-general.php?page=wthf3.2533.51

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 11 new options
New WordPress options
wthf_no_text
widget_recent-posts
wthf_thank_text
theysaidso_admin_options
widget_recent-comments
wthf_question_text
widget_theysaidso_widget
db_upgraded
can_compress_scripts
wthf_types
...

Browser metrics Passed 4 tests

Was This Helpful?: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.75 ▲0.401.74 ▼0.2541.14 ▼5.61
Dashboard /wp-admin2,199 ▲195.62 ▼0.0891.72 ▲1.9141.37 ▲1.60
Posts /wp-admin/edit.php2,114 ▲142.00 ▲0.0140.37 ▲3.1537.53 ▲0.52
Add New Post /wp-admin/post-new.php1,529 ▲123.00 ▼0.14687.20 ▲0.3458.90 ▲2.19
Media Library /wp-admin/upload.php1,404 ▲74.15 ▼0.0794.60 ▼21.3446.24 ▼2.30
Helpful /wp-admin/options-general.php?page=wthf9031.9922.4929.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • 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 shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/was-this-article-helpful/index.php:24

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 96% 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: helpful, feedback, ux

was-this-article-helpful/index.php 92% from 13 tests

The main file in "Was This Helpful?" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("was-this-article-helpful.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected279 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP112554176
CSS111070
JavaScript113733

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions11
▷ Named functions11100.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 images were found in this plugin