58% vote-smiley-reaction

Code Review | Vote & Smiley Reaction

WordPress plugin Vote & Smiley Reaction scored58%from 54 tests.

About plugin

  • Plugin page: vote-smiley-reaction
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9
  • WordPress version: 6.3.1
  • First release: May 26, 2021
  • Latest release: Jan 27, 2022
  • Number of updates: 3
  • Update frequency: every 82.0 days
  • Top authors: nerdaryan (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /940 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.83MB] [CPU: ▼50.82ms] Passed 4 tests

An overview of server-side resources used by Vote & Smiley Reaction
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.61 ▲4.08
Dashboard /wp-admin2.11 ▼1.199.25 ▼46.63
Posts /wp-admin/edit.php2.12 ▼1.248.31 ▼43.50
Add New Post /wp-admin/post-new.php2.11 ▼3.778.48 ▼89.88
Media Library /wp-admin/upload.php2.12 ▼1.1110.76 ▼23.25
Vote & Smiley Reaction /wp-admin/options-general.php?page=vote-smiley-reaction2.129.03

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 33 new files
Database: 1 new table, 7 new options
New tables
wp_rahularyan_reactions
New WordPress options
widget_recent-posts
theysaidso_admin_options
rahularyan_vsr_opts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Vote & Smiley Reaction
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,031 ▲28515.17 ▲0.826.00 ▲4.3342.67 ▼1.62
Dashboard /wp-admin2,351 ▲1636.41 ▲0.51126.67 ▲21.5937.40 ▼3.05
Posts /wp-admin/edit.php2,260 ▲1713.36 ▲1.3554.46 ▲17.2332.14 ▼4.07
Add New Post /wp-admin/post-new.php1,521 ▼2123.03 ▲4.80635.59 ▼14.1536.50 ▼27.03
Media Library /wp-admin/upload.php1,390 ▲24.22 ▼0.0792.86 ▼11.9947.63 ▼1.35
Vote & Smiley Reaction /wp-admin/options-general.php?page=vote-smiley-reaction2,4933.0446.5093.89

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-includes/link-template.php+49
    Trying to get property 'use_trailing_slashes' of non-object
  • Zombie tables detected upon uninstall: 1 table
    • wp_rahularyan_reactions
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • rahularyan_vsr_opts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=vote-smiley-reaction
    • > Notice in wp-includes/link-template.php+49
    Trying to get property 'use_trailing_slashes' of non-object
  • 84 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=vote-smiley-reaction
    • > Warning in wp-content/plugins/vote-smiley-reaction/views/admin/reaction_type.php+67
    in_array() expects parameter 2 to be array, bool given
  • 30 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=vote-smiley-reaction
    • > Notice in wp-content/plugins/vote-smiley-reaction/views/admin/reaction_type.php+43
    Undefined index: required

SRP 50% 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
Almost there! Just fix the following items
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/vote-smiley-reaction/includes/db.php
    • > /wp-content/plugins/vote-smiley-reaction/includes/admin.php
    • > /wp-content/plugins/vote-smiley-reaction/includes/hooks.php
    • > /wp-content/plugins/vote-smiley-reaction/includes/ajax.php

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: smiley, vote, reaction

vote-smiley-reaction/vote-smiley-reaction.php Passed 13 tests

The main file in "Vote & Smiley Reaction" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
44 characters long description:
Add voting and smiley reaction in WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,241 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP12273548912
CSS220151
JavaScript2247136
XML14930
SVG120012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity21.20
▷ Minimum class complexity2.00
▷ Maximum class complexity32.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes480.00%
Methods51
▷ Static methods3058.82%
▷ Public methods4078.43%
▷ Protected methods00.00%
▷ Private methods1121.57%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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