77% reaction-buttons

Code Review | Reaction Buttons

WordPress plugin Reaction Buttons scored 77% from 54 tests.

About plugin

  • Plugin page: reaction-buttons
  • Plugin version: 2.1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.8.2
  • WordPress version: 6.3.1
  • First release: Jan 29, 2010
  • Latest release: Nov 7, 2017
  • Number of updates: 92
  • Update frequency: every 30.9 days
  • Top authors: jakob42 (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active / 40,711 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
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▲5.19ms] Passed 4 tests

This is a short check of server-side resources used by Reaction Buttons
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2650.44 ▲9.24
Dashboard /wp-admin3.54 ▲0.2369.79 ▲17.76
Posts /wp-admin/edit.php3.65 ▲0.2953.68 ▲0.05
Add New Post /wp-admin/post-new.php6.12 ▲0.23101.78 ▲9.83
Media Library /wp-admin/upload.php3.46 ▲0.2340.26 ▲1.65
Reaction Buttons /wp-admin/options-general.php?page=reaction_buttons3.4033.97

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 19 new options
New WordPress options
db_upgraded
reaction_buttons_usecss
theysaidso_admin_options
reaction_buttons_version
reaction_buttons_percentages_precision
reaction_buttons_already_voted_text
reaction_buttons_tagline
reaction_buttons_conditionals
widget_recent-comments
reaction_buttons_clear_supported_caches
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Reaction Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲18713.63 ▼0.027.92 ▲3.4542.73 ▼1.21
Dashboard /wp-admin2,210 ▲45.79 ▲0.8799.35 ▼2.4536.79 ▼5.87
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0034.68 ▼4.9235.42 ▼0.21
Add New Post /wp-admin/post-new.php6,463 ▲4,93020.39 ▼2.84941.10 ▲216.1756.90 ▼1.69
Media Library /wp-admin/upload.php1,392 ▲134.22 ▼0.0696.97 ▼12.0844.36 ▼0.64
Reaction Buttons /wp-admin/options-general.php?page=reaction_buttons1,1172.0625.9629.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 19 options in the database
    • reaction_buttons_already_voted_text
    • reaction_buttons_tagline
    • db_upgraded
    • widget_recent-comments
    • reaction_buttons_version
    • reaction_buttons_sort_buttons
    • reaction_buttons_usecss
    • widget_recent-posts
    • can_compress_scripts
    • reaction_buttons_percentages_precision
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=reaction_buttons
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=reaction_buttons
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/reaction-buttons/reaction_buttons.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/reaction-buttons/reaction_buttons.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% 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
These attributes need to be fixed:
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

reaction-buttons/reaction_buttons.php 69% from 13 tests

The main PHP file in "Reaction Buttons" ver. 2.1.6 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Name the main plugin file the same as the plugin slug ("reaction-buttons.php" instead of "reaction_buttons.php")
  • Domain Path: Please prefix the domain path with a forward slash character ("/i18n/")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("i18n/")

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
Good job! No executable or dangerous file extensions detected1,381 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12042111,088
PO File17980203
CSS1101590

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
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%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected