10% gex-ratings-facepunch-style

Code Review | Gex Ratings (Facepunch Style)

WordPress plugin Gex Ratings (Facepunch Style) scored 10% from 54 tests.

About plugin

  • Plugin page: gex-ratings-facep...
  • Plugin version: 1.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.1
  • WordPress version: 5.8.1
  • First release: Oct 8, 2016
  • Latest release: Nov 20, 2017
  • Number of updates: 26
  • Update frequency: every 15.7 days
  • Top authors: gexeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 586 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/gex-ratings-facepunch-style/gex-ratings-facepunch-style.php+53
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.03MB] [CPU: ▼150.62ms] Passed 4 tests

An overview of server-side resources used by Gex Ratings (Facepunch Style)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.95 ▲0.1131.88 ▼1.20
Dashboard /wp-admin3.25 ▲0.1950.27 ▼0.13
Posts /wp-admin/edit.php3.36 ▲0.2540.26 ▼2.00
Add New Post /wp-admin/post-new.php4.84 ▼0.6053.63 ▼599.15
Media Library /wp-admin/upload.php3.19 ▲0.1838.17 ▲4.55
Gex Ratings /wp-admin/options-general.php?page=gex_ratings3.1631.22

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: 1 new table, 2 new options
New tables
wp_gex_ratings
New WordPress options
widget_gex_ratings_statistics_widget
gex_ratings_settings_all

Browser metrics Passed 4 tests

Gex Ratings (Facepunch Style): an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,884 ▲28916.31 ▲0.7613.70 ▲2.1649.57 ▲0.37
Dashboard /wp-admin3,045 ▲1115.97 ▲0.01139.32 ▼12.61111.72 ▼7.25
Posts /wp-admin/edit.php2,762 ▲232.73 ▲0.0262.81 ▼3.7285.81 ▼4.61
Add New Post /wp-admin/post-new.php1,890 ▲39015.46 ▼3.09375.20 ▼11.72110.40 ▼4.07
Media Library /wp-admin/upload.php1,816 ▲95.05 ▲0.04149.96 ▼0.85123.43 ▲6.33
Gex Ratings /wp-admin/options-general.php?page=gex_ratings1,4182.1251.80101.18

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

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)
Good news, no errors were detected

SRP 0% 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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gex-ratings-facepunch-style/gex-ratings-facepunch-style.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/gex-ratings-facepunch-style/admin.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Ratings being displayed for a post.), #2 (Ratings being displayed for a comment.), #3 (Rating names are hidden when more than 3 different ratings are displayed to save horizontal space.), #4 (Ratings are styled using your current site theme.), #5 (Admin Page with Settings, Ratings and Statistics.)
You can look at the official readme.txt

gex-ratings-facepunch-style/gex-ratings-facepunch-style.php Passed 13 tests

"Gex Ratings (Facepunch Style)" version 1.0.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
67 characters long description:
Add facepunch style ratings to your site posts, comments and pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin729 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3141147542
CSS1252896
JavaScript1222391

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity34.50
▷ Minimum class complexity4.00
▷ Maximum class complexity65.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions00.00%
▷ Anonymous functions8100.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
18 PNG files occupy 0.17MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ratings/Programming King.png3.21KB0.37KB▼ 88.50%
ratings/Disagree.png0.64KB0.72KB0.00%
screenshot-2.png35.28KB14.09KB▼ 60.06%
ratings/Informative.png0.76KB0.83KB0.00%
ratings/Friendly.png0.73KB0.83KB0.00%