58% da-reactions

Code Review | Da Reactions

WordPress plugin Da Reactions scored58%from 54 tests.

About plugin

  • Plugin page: da-reactions
  • Plugin version: 5.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 15, 2019
  • Latest release: Nov 14, 2023
  • Number of updates: 55
  • Update frequency: every 29.4 days
  • Top authors: DanieleAlessandra (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

200+ active /14,669 total downloads

Benchmarks

Plugin footprint 47% 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: ▲5.36MB] [CPU: ▲37.43ms] 75% from 4 tests

Analyzing server-side resources used by Da Reactions
Please have a look at the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.36MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.95 ▲5.4872.51 ▲31.93
Dashboard /wp-admin8.97 ▲5.6296.70 ▲34.46
Posts /wp-admin/edit.php8.97 ▲5.6096.10 ▲45.77
Add New Post /wp-admin/post-new.php10.65 ▲4.75150.20 ▲59.39
Media Library /wp-admin/upload.php8.97 ▲5.7375.59 ▲37.54
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9771.16

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 750 new files
Database: 3 new tables, 13 new options
New tables
wp_da_r_groups
wp_da_r_votes
wp_da_r_reactions
New WordPress options
widget_theysaidso_widget
fs_active_plugins
widget_recent-posts
fs_debug_mode
fs_accounts
widget_da-reactions-most-voted-widget
da-reactions_general
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Da Reactions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲29816.89 ▲2.547.56 ▲5.6028.46 ▼16.98
Dashboard /wp-admin2,361 ▲1807.15 ▲1.45161.70 ▲45.7446.97 ▲2.13
Posts /wp-admin/edit.php2,277 ▲1773.98 ▲1.8362.83 ▲23.7767.25 ▲31.67
Add New Post /wp-admin/post-new.php1,653 ▲12623.70 ▲0.46753.13 ▲55.9441.04 ▼2.93
Media Library /wp-admin/upload.php1,464 ▲644.11 ▼0.10115.73 ▲9.0143.69 ▼0.41
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1733.5351.5529.18

Uninstaller [IO: ▲0.01MB] [DB: ▲0.01MB] 25% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/da-reactions/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie tables were found after uninstall: 3 tables
    • wp_da_r_groups
    • wp_da_r_reactions
    • wp_da_r_votes
  • The uninstall procedure has failed, leaving 13 options in the database
    • widget_recent-posts
    • fs_debug_mode
    • db_upgraded
    • widget_theysaidso_widget
    • da-reactions_general
    • da-reactions_notices
    • fs_accounts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/da-reactions/templates/template-static.php
    • > /wp-content/plugins/da-reactions/templates/template-exposed.php
    • > /wp-content/plugins/da-reactions/templates/single-reaction-image.php
    • > /wp-content/plugins/da-reactions/templates/template-reveal.php
    • > /wp-content/plugins/da-reactions/templates/buttons-placeholder.php
    • > /wp-content/plugins/da-reactions/templates/count-badge.php
    • > /wp-content/plugins/da-reactions/templates/toggle-button.php
  • 46× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: nonce in wp-content/plugins/da-reactions/templates/buttons-placeholder.php on line 10
    • > PHP Notice
      Undefined variable: single_reaction_image in wp-content/plugins/da-reactions/templates/buttons-placeholder.php on line 13
    • > PHP Notice
      Undefined variable: reactions in wp-content/plugins/da-reactions/templates/image-buttons.php on line 1
    • > PHP Notice
      Undefined variable: image in wp-content/plugins/da-reactions/templates/template-reveal.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'DaReactions\\Pages\\SettingsPage' not found in wp-content/plugins/da-reactions/classes/DaReactions/Pages/GraphicSettings.php:22
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/da-reactions/templates/template-reveal.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _ex() in wp-content/plugins/da-reactions/templates/admin/buttons-settings-add-new.php:1
    • > PHP Notice
      Undefined variable: button_html in wp-content/plugins/da-reactions/templates/template-static.php on line 6
    • > PHP Notice
      Undefined variable: item_type in wp-content/plugins/da-reactions/templates/buttons-placeholder.php on line 8
    • > PHP Notice
      Undefined variable: number_value in wp-content/plugins/da-reactions/templates/count-badge.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Requires php: Version not formatted correctly
You can look at the official readme.txt

da-reactions/da-reactions.php Passed 13 tests

The principal PHP file in "Da Reactions" v. 5.0.3 is loaded by WordPress automatically on each request
79 characters long description:
This plugin generates reactions to let your visitors rate content and comments.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin44,025 lines of code in 700 files:
LanguageFilesBlank linesComment linesLines of code
PHP1788,26120,04140,684
SVG49530351,392
PO File1330383896
CSS153416616
JavaScript1078238412
JSON10025

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity56.63
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes92
▷ Abstract classes44.35%
▷ Concrete classes8895.65%
▷ Final classes00.00%
Methods1,568
▷ Static methods30219.26%
▷ Public methods1,15373.53%
▷ Protected methods181.15%
▷ Private methods39725.32%
Functions112
▷ Named functions10391.96%
▷ Anonymous functions98.04%
Constants155
▷ Global constants10467.10%
▷ Class constants5132.90%
▷ Public constants51100.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
4 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dist/icon-256x256.png13.44KB5.44KB▼ 59.51%
freemius/assets/img/da-reactions.png13.44KB5.44KB▼ 59.51%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%