62% mage-reviews

Code Review | Mage Reviews

WordPress plugin Mage Reviews scored62%from 54 tests.

About plugin

  • Plugin page: mage-reviews
  • Plugin version: 1.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Nov 2, 2013
  • Latest release: Apr 16, 2017
  • Number of updates: 47
  • Update frequency: every 26.8 days
  • Top authors: Maximilian Ruthe (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

20+ active /7,236 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.34MB] [CPU: ▼46.51ms] Passed 4 tests

Server-side resources used by Mage Reviews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.62 ▼0.8410.65 ▼30.46
Dashboard /wp-admin2.67 ▼0.6315.02 ▼36.55
Posts /wp-admin/edit.php2.67 ▼0.6813.95 ▼34.98
Add New Post /wp-admin/post-new.php2.67 ▼3.2212.88 ▼84.04
Media Library /wp-admin/upload.php2.67 ▼0.5515.30 ▼21.91
Reviews /wp-admin/admin.php?page=mage_reviews2.6714.22
Dashboard /wp-admin/admin.php?page=mage_cast2.6714.71

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 9 new options
New WordPress options
mage_reviews_activation
widget_mage-recent-reviews
widget_recent-posts
can_compress_scripts
widget_recent-comments
mage_reviews
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Mage Reviews
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7414.45 ▲0.033.25 ▲1.1345.76 ▼1.54
Dashboard /wp-admin2,222 ▲345.86 ▼0.0598.72 ▼15.7489.61 ▲43.45
Posts /wp-admin/edit.php2,111 ▲221.98 ▼0.0138.64 ▼4.0237.86 ▲1.57
Add New Post /wp-admin/post-new.php1,549 ▲1618.35 ▼5.14742.58 ▲71.6969.02 ▲16.53
Media Library /wp-admin/upload.php1,413 ▲224.13 ▼0.0499.62 ▲2.6982.87 ▲36.61
Reviews /wp-admin/admin.php?page=mage_reviews1,6362.2438.61135.98
Dashboard /wp-admin/admin.php?page=mage_cast8892.3625.4058.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/mage-reviews/cast/craft.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; Mage_Recent_Reviews has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 9 options
    • mage_reviews_activation
    • db_upgraded
    • theysaidso_admin_options
    • mage_reviews
    • widget_theysaidso_widget
    • widget_mage-recent-reviews
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mage_cast
    • > Deprecated in wp-content/plugins/mage-reviews/cast/craft.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; Mage_Recent_Reviews has a deprecated constructor
  • 51 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mage_cast
    • > Warning in wp-content/plugins/mage-reviews/core/mage-cast.php+198
    preg_replace(): Compilation failed: invalid range in character class at offset 13

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mage-reviews/cast/craft.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mage-reviews/core/mage-cast.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=mage_reviews
    • > Network (severe)
    wp-content/plugins/mage-reviews/core/images/arrow-down.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 26 tag instead of maximum 10
You can look at the official readme.txt

mage-reviews/mage-reviews.php Passed 13 tests

The main PHP file in "Mage Reviews" ver. 1.2.4 adds more information about the plugin and also serves as the entry point for this plugin
125 characters long description:
A simple customizable rating option will be integrated within the comment form and display rating average and author ratings.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin11,504 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS71,071837,783
PHP7601491,685
SVG3011,409
PO File2156156497
JavaScript51528130

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity14.50
▷ Minimum class complexity4.00
▷ Maximum class complexity25.00
Average method complexity4.38
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions81
▷ Named functions81100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
29 PNG files occupy 0.20MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
source/img/music-0.png0.27KB0.23KB▼ 13.97%
core/plugins/mage_google_maps.png18.84KB8.51KB▼ 54.83%
source/img/trophy-1.png0.44KB0.30KB▼ 31.92%
source/img/bulb-0.png0.66KB0.45KB▼ 31.56%
source/img/snowflake-0.png0.65KB0.31KB▼ 52.77%