10% a2reviews

Code Review | A2Reviews

WordPress plugin A2Reviews scored10%from 54 tests.

About plugin

  • Plugin page: a2reviews
  • Plugin version: 1.2.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3
  • WordPress version: 6.3.1
  • First release: May 7, 2020
  • Latest release: Aug 17, 2023
  • Number of updates: 37
  • Update frequency: every 34.4 days
  • Top authors: eosvn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,360 total downloads

Benchmarks

Plugin footprint 57% 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/a2reviews/public/class-a2reviews-public.php+333
    Trying to get property 'widget_position' of non-object

Server metrics [RAM: ▲0.33MB] [CPU: ▲631.54ms] 50% from 4 tests

A check of server-side resources used by A2Reviews
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 975.47ms on /wp-admin/options-general.php?page=a2reviews-setting-admin)
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 631.54ms on /wp-admin/options-general.php?page=a2reviews-setting-admin)
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.36563.70 ▲519.00
Dashboard /wp-admin3.64 ▲0.30615.07 ▲547.58
Posts /wp-admin/edit.php3.69 ▲0.34614.93 ▲561.89
Add New Post /wp-admin/post-new.php6.24 ▲0.361,005.36 ▲897.68
Media Library /wp-admin/upload.php3.57 ▲0.34946.41 ▲903.84
A2reviews /wp-admin/options-general.php?page=a2reviews-setting-admin3.49975.47

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
a2reviews_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by A2Reviews
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲20215.64 ▲1.292.00 ▲0.3936.13 ▼3.30
Dashboard /wp-admin2,344 ▲1647.38 ▲1.69130.80 ▲42.8351.67 ▲6.77
Posts /wp-admin/edit.php2,407 ▲3104.34 ▲2.3563.57 ▲26.7137.18 ▲4.56
Add New Post /wp-admin/post-new.php1,546 ▲1823.39 ▲0.22663.53 ▼27.0039.98 ▼22.34
Media Library /wp-admin/upload.php1,583 ▲1805.94 ▲1.76118.59 ▲14.2349.62 ▼0.29
A2reviews /wp-admin/options-general.php?page=a2reviews-setting-admin1,4895.0978.9044.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • a2reviews_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/a2reviews/public/partials/a2reviews-public-display.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/a2reviews/admin/partials/a2reviews-admin-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a2reviews/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/a2reviews/public/class-a2reviews-shortcode.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a2reviews/public/class-a2reviews-order.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/a2reviews/public/partials/feature-reviews.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

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
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #1, #2, #3, #4, #5, #6, #7, #8 in a2reviews/assets to your readme.txt
You can look at the official readme.txt

a2reviews/a2reviews.php Passed 13 tests

The main PHP script in "A2Reviews" version 1.2.3 is automatically included on every request by WordPress
85 characters long description:
A2Reviews is the best review app for WooCommerce. Smart assessment management system.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,691 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP204281,0371,414
JavaScript53013186
CSS323891

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity16.18
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods68
▷ Static methods45.88%
▷ Public methods5276.47%
▷ Protected methods00.00%
▷ Private methods1623.53%
Functions24
▷ Named functions416.67%
▷ Anonymous functions2083.33%
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
PNG images were not found in this plugin