82% shopperapproved-reviews

Code Review | Shopper Approved Reviews

WordPress plugin Shopper Approved Reviews scored82%from 54 tests.

About plugin

  • Plugin page: shopperapproved-r...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Apr 24, 2023
  • Latest release: May 3, 2023
  • Number of updates: 14
  • Update frequency: every 0.8 days
  • Top authors: shopperapprovedapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /159 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▲300.16ms] 50% from 4 tests

This is a short check of server-side resources used by Shopper Approved Reviews
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 592.08ms on /wp-admin/admin.php?page=shopperapproved_widgets_menu)
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 300.16ms on /wp-admin/admin.php?page=shopperapproved_productfeed_menu)
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.43723.02 ▲684.80
Dashboard /wp-admin3.73 ▲0.43383.52 ▲334.90
Posts /wp-admin/edit.php3.79 ▲0.43348.19 ▲298.82
Add New Post /wp-admin/post-new.php6.33 ▲0.45368.90 ▲275.36
Media Library /wp-admin/upload.php3.65 ▲0.43327.01 ▲291.55
Thank You Page Survey /wp-admin/admin.php?page=shopperapproved_thankyou_menu3.60302.18
Shopper Approved /wp-admin/admin.php?page=shopperapproved_main_menu3.60313.99
Seals & Widgets /wp-admin/admin.php?page=shopperapproved_widgets_menu3.62592.08
Product Feed /wp-admin/admin.php?page=shopperapproved_productfeed_menu3.60311.94

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 162 new files
Database: no new tables, 23 new options
New WordPress options
sa_rp_status
sa_product_stars_code
widget_recent-posts
sa_seal_code
db_upgraded
sa_review_page_code
sa_seal_presets
sa_site_id
sa_domain
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by Shopper Approved Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲23815.38 ▲0.805.50 ▲3.7738.23 ▼3.44
Dashboard /wp-admin2,266 ▲786.56 ▲1.68115.79 ▲3.9877.18 ▲32.04
Posts /wp-admin/edit.php2,167 ▲783.27 ▲1.2746.05 ▲5.1074.99 ▲36.47
Add New Post /wp-admin/post-new.php6,421 ▲4,88427.31 ▲9.07961.59 ▲321.5658.18 ▼0.22
Media Library /wp-admin/upload.php1,527 ▲1425.51 ▲1.34108.38 ▲8.6685.64 ▲41.30
Thank You Page Survey /wp-admin/admin.php?page=shopperapproved_thankyou_menu7501.458.7819.99
Shopper Approved /wp-admin/admin.php?page=shopperapproved_main_menu7381.638.9719.48
Seals & Widgets /wp-admin/admin.php?page=shopperapproved_widgets_menu8392.9635.1426.14
Product Feed /wp-admin/admin.php?page=shopperapproved_productfeed_menu7501.638.6720.32

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 13 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • sa_category_code
    • sa_seal_code
    • sa_review_page_code
    • sa_api_token
    • sa_product_stars_code
    • db_upgraded
    • sa_product_widget_code
    • widget_recent-comments
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/shopperapproved-reviews/admin/class-sa-woo-integrations.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shopperapproved-reviews/admin/class-woocommerce-integrations.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shopperapproved-reviews/trunk/admin/class-woocommerce-integrations.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Integration' not found in wp-content/plugins/shopperapproved-reviews/trunk/admin/class-sa-woo-integrations.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Contributors: The plugin contributors field is missing
You can look at the official readme.txt

shopperapproved-reviews/shopperapproved.php 77% from 13 tests

This is the main PHP file of "Shopper Approved Reviews" version 1.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("7.0" instead of "5.4")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("shopperapproved-reviews.php" instead of "shopperapproved.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "5.4")

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
Success! There were no dangerous files found in this plugin6,154 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP192108592,286
CSS5279271,969
JavaScript171211011,898
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.93
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods158
▷ Static methods148.86%
▷ Public methods11874.68%
▷ Protected methods00.00%
▷ Private methods4025.32%
Functions50
▷ Named functions4896.00%
▷ Anonymous functions24.00%
Constants24
▷ Global constants625.00%
▷ Class constants1875.00%
▷ Public constants18100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
40 PNG files occupy 0.89MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-6.png48.26KB22.23KB▼ 53.95%
assets/images/screenshot-4.png28.57KB13.69KB▼ 52.09%
assets/images/imagine-reviews.png8.68KB5.17KB▼ 40.45%
assets/images/banner-772x250-rtl.png34.72KB15.86KB▼ 54.32%
trunk/assets/images/img-step-4.png14.19KB5.12KB▼ 63.92%