10% pegleg-ratings

Code Review | Pegleg Ratings

WordPress plugin Pegleg Ratings scored10%from 54 tests.

About plugin

  • Plugin page: pegleg-ratings
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.7
  • WordPress version: 6.3.1
  • First release: Nov 29, 2013
  • Latest release: Dec 23, 2016
  • Number of updates: 4
  • Update frequency: every 280.0 days
  • Top authors: esserq (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /962 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/pegleg-ratings/pl-ratings.php+64
    Undefined variable: rhr_db_version

Server metrics [RAM: ▼11.72MB] [CPU: ▼2,354,722.08ms] Passed 4 tests

This is a short check of server-side resources used by Pegleg Ratings
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▼45.6436.49 ▼9,418,826.99
Dashboard /wp-admin3.38 ▼0.0150.85 ▼15.98
Posts /wp-admin/edit.php3.49 ▲0.0950.64 ▲1.42
Add New Post /wp-admin/post-new.php4.67 ▼1.2657.49 ▼46.77
Media Library /wp-admin/upload.php3.30 ▲0.0336.53 ▲1.68

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 6 new files
Database: 1 new table, 7 new options
New tables
wp_rh_ratings
New WordPress options
can_compress_scripts
widget_recent-posts
rhr_db_version
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pegleg Ratings
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲15013.82 ▼0.539.95 ▲8.2843.09 ▲1.06
Dashboard /wp-admin2,195 ▲185.63 ▲0.1289.58 ▲0.0440.44 ▼2.94
Posts /wp-admin/edit.php2,097 ▼61.98 ▼0.0236.43 ▼4.1033.09 ▼3.62
Add New Post /wp-admin/post-new.php1,528 ▲223.43 ▼0.05635.20 ▼30.3762.15 ▲8.43
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0696.02 ▼17.2543.99 ▼3.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_rh_ratings
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/pegleg-ratings/pl-ratings.php on line 31
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/pegleg-ratings/pl-ratings.php on line 31
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pegleg-ratings/pl-ratings.php on line 31

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The rating widget with default styling.) image not found
You can take inspiration from this readme.txt

pegleg-ratings/pl-ratings.php 92% from 13 tests

The main PHP script in "Pegleg Ratings" version 1.2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pegleg-ratings.php" instead of "pl-ratings.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin223 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP17752152
JavaScript110442
CSS18229

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
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%
Functions10
▷ Named functions10100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
sprites.png4.28KB0.72KB▼ 83.15%
screenshot-1.png1.52KB1.11KB▼ 27.04%