10% post-and-page-reactions

Code Review | Post And Page Reactions

WordPress plugin Post And Page Reactionsscored10%from 54 tests.

About plugin

  • Plugin page: post-and-page-rea...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 6.3.1
  • First release: Aug 2, 2016
  • Latest release: Jul 13, 2017
  • Number of updates: 17
  • Update frequency: every 21.1 days
  • Top authors: arete-it (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /6,771 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ai_wp_smileys_class::ai_wp_create_table() should not be called statically

Server metrics [RAM: ▲0.38MB] [CPU: ▼1.55ms] Passed 4 tests

Analyzing server-side resources used by Post And Page Reactions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3644.61 ▲6.31
Dashboard /wp-admin3.73 ▲0.4350.02 ▼12.15
Posts /wp-admin/edit.php3.79 ▲0.4448.56 ▲5.40
Add New Post /wp-admin/post-new.php6.25 ▲0.3799.78 ▲0.99
Media Library /wp-admin/upload.php3.58 ▲0.3534.16 ▼0.42
Settings /wp-admin/admin.php?page=post-and-page-reactions/post-and-page-reactions.php/smiley_settings3.5433.93
Reactions /wp-admin/admin.php?page=post-and-page-reactions/post-and-page-reactions.php/settings3.5432.95

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 29 new files
Database: 3 new tables, 7 new options
New tables
wp_arete_wp_smiley_settings
wp_arete_wp_smileys
wp_arete_wp_smileys_manage
New WordPress options
theysaidso_admin_options
ai_post_and_page_reactions_version
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post And Page Reactions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,084 ▲33815.67 ▲1.297.67 ▲5.9640.53 ▼2.75
Dashboard /wp-admin2,364 ▲1857.03 ▲1.22122.61 ▲16.4293.80 ▲51.85
Posts /wp-admin/edit.php2,285 ▲1964.00 ▲1.9948.92 ▲9.6080.08 ▲41.19
Add New Post /wp-admin/post-new.php6,250 ▲4,71719.53 ▼3.88871.95 ▲189.5837.47 ▼29.48
Media Library /wp-admin/upload.php1,427 ▲394.80 ▲0.6183.54 ▼24.5578.74 ▲30.34
Settings /wp-admin/admin.php?page=post-and-page-reactions/post-and-page-reactions.php/smiley_settings1,1743.9347.3682.06
Reactions /wp-admin/admin.php?page=post-and-page-reactions/post-and-page-reactions.php/settings1,2353.6942.3568.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_arete_wp_smileys_manage
  • Zombie WordPress options were found after uninstall: 7 options
    • ai_post_and_page_reactions_version
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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)
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post-and-page-reactions/post-and-page-reactions.php/settings
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post-and-page-reactions/post-and-page-reactions.php/settings
    • > 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/post-and-page-reactions/class/class.php:162
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/post-and-page-reactions/core.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-and-page-reactions/core.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/post-and-page-reactions/core.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === Post And Page Reactions=== )
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

post-and-page-reactions/post-and-page-reactions.php Passed 13 tests

The primary PHP file in "Post And Page Reactions" version 1.0.5 is used by WordPress to initiate all plugin functionality
86 characters long description:
A plugin that helps registered users and guests to react on wordpress posts and pages.

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
Everything looks great! No dangerous files found in this plugin13,204 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript61,6909968,367
PHP41433174,131
CSS552154706

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.33
▷ Minimum class complexity6.00
▷ Maximum class complexity19.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions44
▷ Named functions44100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
11 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/thankful.png1.49KB1.57KB0.00%
img/grin.png2.32KB1.77KB▼ 23.62%
img/love.png0.91KB1.01KB0.00%
img/haha.png1.53KB1.63KB0.00%
img/unlike.png0.72KB0.65KB▼ 10.53%