62% mage-reviews

Code Review | Mage Reviews

WordPress plugin Mage Reviews scored 62% 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: 5.9.2
  • 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

30+ active / 6,945 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼1.97MB] [CPU: ▼347.28ms] Passed 4 tests

This is a short check of server-side resources used by Mage Reviews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.147.40 ▼45.11
Dashboard /wp-admin2.42 ▼0.988.31 ▼25.28
Posts /wp-admin/edit.php2.43 ▼1.218.29 ▼29.47
Add New Post /wp-admin/post-new.php2.42 ▼4.559.04 ▼1,289.27
Media Library /wp-admin/upload.php2.43 ▼0.877.96 ▼21.58
Reviews /wp-admin/admin.php?page=mage_reviews2.428.53
Dashboard /wp-admin/admin.php?page=mage_cast2.429.88

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 62 new files
Database: no new tables, 2 new options
New WordPress options
mage_reviews_activation
mage_reviews

Browser metrics Passed 4 tests

An overview of browser requirements for Mage Reviews
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,804 ▲6215.98 ▲0.327.79 ▲0.092.25 ▼0.18
Dashboard /wp-admin2,920 ▲696.04 ▼0.19124.13 ▼12.90178.04 ▲13.89
Posts /wp-admin/edit.php2,718 ▲273.06 ▼0.1763.50 ▼0.53139.14 ▼2.62
Add New Post /wp-admin/post-new.php1,727 ▲6621.23 ▲4.85415.69 ▲5.17208.27 ▲52.21
Media Library /wp-admin/upload.php1,726 ▲285.67 ▲0.18125.28 ▼21.97208.18 ▲16.34
Reviews /wp-admin/admin.php?page=mage_reviews2,0743.3962.51225.32
Dashboard /wp-admin/admin.php?page=mage_cast1,1123.0559.07103.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > 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 were found after uninstall: 2 options
    • mage_reviews_activation
    • mage_reviews

Smoke tests 25% 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)
Almost there, just fix the following server-side errors
  • 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mage-reviews/core/mage-cast.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mage-reviews/cast/craft.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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 is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: There are too many tags (26 tag instead of maximum 10)
You can look at the official readme.txt

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

"Mage Reviews" version 1.2.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected11,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
Everything seems fine, there were 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

All PNG images should be compressed to minimize bandwidth usage for end users
29 PNG files occupy 0.20MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
source/img/star-0.png0.42KB0.24KB▼ 42.42%
source/img/dog-0.png0.53KB0.30KB▼ 43.70%
source/img/leaf-0.png0.36KB0.26KB▼ 27.52%
core/plugins/mage_google_maps.png18.84KB8.51KB▼ 54.83%
source/img/trophy-1.png0.44KB0.30KB▼ 31.92%