84% business-reviews-wp

Code Review | Widget for Google Reviews

WordPress plugin Widget for Google Reviews scored 84% from 54 tests.

About plugin

  • Plugin page: business-reviews-wp
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8
  • WordPress version: 5.8.1
  • First release: Mar 1, 2021
  • Latest release: Oct 8, 2021
  • Number of updates: 11
  • Update frequency: every 20.5 days
  • Top authors: techlabpro1 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 1,004 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.59MB] [CPU: ▼138.22ms] Passed 4 tests

Analyzing server-side resources used by Widget for Google Reviews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▲0.5841.21 ▲13.73
Dashboard /wp-admin3.65 ▲0.5951.22 ▲4.87
Posts /wp-admin/edit.php3.71 ▲0.5949.99 ▲4.41
Add New Post /wp-admin/post-new.php6.12 ▲0.6997.22 ▼560.49
Media Library /wp-admin/upload.php3.59 ▲0.5836.78 ▼1.68
New Shortcode /wp-admin/post-new.php?post_type=rtbr4.0045.98
All Shortcodes /wp-admin/edit.php?post_type=rtbr3.6433.32
Settings /wp-admin/edit.php?post_type=rtbr&page=rtbr-settings3.6038.60

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 72 new files
Database: no new tables, 1 new option
New WordPress options
widget_rtbr-widget-review

Browser metrics Passed 4 tests

Checking browser requirements for Widget for Google Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,833 ▲23716.40 ▲0.8213.93 ▲5.2150.34 ▲1.21
Dashboard /wp-admin2,999 ▲656.10 ▲0.01136.34 ▼9.76139.50 ▲27.92
Posts /wp-admin/edit.php2,779 ▲402.60 ▼0.1263.28 ▼1.9989.59 ▼2.31
Add New Post /wp-admin/post-new.php1,524 ▼14818.79 ▲0.03363.02 ▲9.55106.84 ▼4.07
Media Library /wp-admin/upload.php1,790 ▼175.03 ▼0.03127.91 ▼24.72139.69 ▲17.58
New Shortcode /wp-admin/post-new.php?post_type=rtbr4,5835.50155.07154.95
All Shortcodes /wp-admin/edit.php?post_type=rtbr1,5093.0666.4992.42
Settings /wp-admin/edit.php?post_type=rtbr&page=rtbr-settings1,5184.0472.8391.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_rtbr-widget-review

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
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Rtbr\\Helpers\\Functions' not found in wp-content/plugins/business-reviews-wp/views/metas/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Rtbr\\Helpers\\Functions' not found in wp-content/plugins/business-reviews-wp/views/metas/field-selection.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/business-reviews-wp/views/widgets/business-review.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/business-reviews-wp/templates/partials/pagination.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/business-reviews-wp/app/Widgets/BusinessReview.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Rtbr\\Helpers\\Functions' not found in wp-content/plugins/business-reviews-wp/views/metas/style.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Rtbr\\Models\\SettingsAPI' not found in wp-content/plugins/business-reviews-wp/app/Controllers/Admin/AdminSettings.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Rtbr\\Helpers\\Functions' not found in wp-content/plugins/business-reviews-wp/views/metas/layout.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/business-reviews-wp/app/Rtbr.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/business-reviews-wp/views/settings/admin-settings-display.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Donate link: Invalid URI found ("")
The official readme.txt might help

business-reviews-wp/business-reviews-wp.php Passed 13 tests

"Widget for Google Reviews" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
63 characters long description:
This is a business reviews plugin for Google, Facebook and Yelp

Code Analysis 97% from 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 detected6,730 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP488359054,299
CSS5219592,041
JavaScript56876385
JSON1005

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 163)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity28.27
▷ Minimum class complexity1.00
▷ Maximum class complexity189.00
Average method complexity4.02
▷ Minimum method complexity1.00
▷ Maximum method complexity163.00
Code structure
Namespaces11
Interfaces0
Traits1
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes14.17%
Methods230
▷ Static methods3615.65%
▷ Public methods20890.43%
▷ Protected methods10.43%
▷ Private methods219.13%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/imgs/icon-16x16.png1.39KB0.58KB▼ 58.46%
assets/imgs/icon-32x32.png1.79KB1.00KB▼ 44.22%
assets/imgs/facebook-medium.png1.16KB1.15KB▼ 1.18%
assets/imgs/yelp-mini.png3.61KB1.59KB▼ 56.01%
assets/imgs/icon-20x20.png1.50KB0.73KB▼ 51.17%