68% wp-reactions-box

Code Review | WP Reactions Box

WordPress plugin WP Reactions Box scored68%from 54 tests.

About plugin

  • Plugin page: wp-reactions-box
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.3
  • WordPress version: 6.3.1
  • First release: Oct 13, 2015
  • Latest release: Oct 15, 2015
  • Number of updates: 5
  • Update frequency: every 0.6 days
  • Top authors: hkp1990 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,662 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼7.25ms] Passed 4 tests

Analyzing server-side resources used by WP Reactions Box
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0827.16 ▼15.74
Dashboard /wp-admin3.42 ▲0.1250.05 ▼2.62
Posts /wp-admin/edit.php3.53 ▲0.1851.25 ▲1.12
Add New Post /wp-admin/post-new.php6.00 ▲0.1189.31 ▼7.24
Media Library /wp-admin/upload.php3.34 ▲0.1138.50 ▼3.39
WP Reactions Box /wp-admin/index.php?page=wpreactionsbox3.3139.45
WP Reactions Box /wp-admin/options-general.php?page=wpreactionsbox3.2932.70

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 21 new files
Database: 1 new table, 7 new options
New tables
wp_hkp_reactions_posts
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
hkp_reactions_db_version

Browser metrics Passed 4 tests

WP Reactions Box: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.39 ▼0.969.55 ▲7.7945.47 ▲2.07
Dashboard /wp-admin2,206 ▲295.58 ▼0.1089.91 ▼6.3736.66 ▼5.23
Posts /wp-admin/edit.php2,108 ▲81.97 ▼0.0439.21 ▲3.2435.42 ▼17.46
Add New Post /wp-admin/post-new.php1,534 ▲823.08 ▲0.07663.19 ▼38.4653.43 ▼6.30
Media Library /wp-admin/upload.php1,408 ▲84.19 ▲0.01102.27 ▼12.5441.82 ▼6.09
WP Reactions Box /wp-admin/index.php?page=wpreactionsbox1,1131.6524.3828.48
WP Reactions Box /wp-admin/options-general.php?page=wpreactionsbox1,0062.0523.6931.67

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_hkp_reactions_posts
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • hkp_reactions_db_version
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wpreactionsbox
    • > Notice in wp-content/plugins/wp-reactions-box/wp-reactions-admin.php+176
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-reactions-box/wp-reactions-admin.php:357
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/wp-reactions-box/wp-reactions.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

wp-reactions-box/wp-reactions.php 92% from 13 tests

The primary PHP file in "WP Reactions Box" version 1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-reactions-box.php" instead of "wp-reactions.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 detected942 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP213235636
CSS1191217
JavaScript129289

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods426.67%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions2291.67%
▷ Anonymous functions28.33%
Constants1
▷ Global constants1100.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
13 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg-heart.png2.61KB1.72KB▼ 34.15%
images/heart1.png0.67KB0.65KB▼ 2.77%
images/themes/dark/emoticon.png34.99KB11.84KB▼ 66.16%
images/logo-admin.png1.23KB1.11KB▼ 9.87%
images/smiley.png1.42KB1.57KB0.00%