84% business-reviews-wp

Code Review | Widget for Google Reviews

WordPress plugin Widget for Google Reviews scored84%from 54 tests.

About plugin

  • Plugin page: business-reviews-wp
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4
  • WordPress version: 6.3.1
  • First release: Mar 1, 2021
  • Latest release: Nov 22, 2023
  • Number of updates: 20
  • Update frequency: every 50.1 days
  • Top authors: techlabpro1 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

900+ active /10,256 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.67MB] [CPU: ▲3.77ms] 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 /4.15 ▲0.6952.90 ▲17.66
Dashboard /wp-admin3.98 ▲0.6352.78 ▼2.82
Posts /wp-admin/edit.php4.03 ▲0.6752.49 ▲7.76
Add New Post /wp-admin/post-new.php6.68 ▲0.79102.73 ▲2.81
Media Library /wp-admin/upload.php3.90 ▲0.6742.77 ▲7.33
New Shortcode /wp-admin/post-new.php?post_type=rtbr4.3950.84
All Shortcodes /wp-admin/edit.php?post_type=rtbr3.9441.51
Settings /wp-admin/edit.php?post_type=rtbr&page=rtbr-settings3.9039.74

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 79 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_rtbr-widget-review
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

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 /2,965 ▲21813.84 ▼0.509.13 ▲7.5346.52 ▲10.74
Dashboard /wp-admin2,244 ▲635.59 ▼0.0695.70 ▼5.2285.84 ▲44.33
Posts /wp-admin/edit.php2,171 ▲712.13 ▲0.1141.22 ▲3.1734.44 ▼0.65
Add New Post /wp-admin/post-new.php1,655 ▲11123.19 ▼1.84619.65 ▼21.20148.12 ▲87.99
Media Library /wp-admin/upload.php1,458 ▲614.14 ▼0.08104.01 ▲4.3279.35 ▲35.23
New Shortcode /wp-admin/post-new.php?post_type=rtbr3,6094.62136.04107.89
All Shortcodes /wp-admin/edit.php?post_type=rtbr1,1712.4741.7133.23
Settings /wp-admin/edit.php?post_type=rtbr&page=rtbr-settings1,1923.7051.0371.91

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: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_rtbr-widget-review
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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
  • 15× 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/style.php:3
    • > 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/layout.php:3
    • > PHP Warning
      Use of undefined constant RTBR_PATH - assumed 'RTBR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/business-reviews-wp/app/Rtbr.php on line 3
    • > PHP Warning
      require_once(RTBR_PATHvendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/business-reviews-wp/app/Rtbr.php on line 3
    • > 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
    • > PHP Fatal error
      Uncaught Error: Class 'Rtbr\\Helpers\\Functions' not found in wp-content/plugins/business-reviews-wp/views/metas/settings.php:3
    • > PHP Notice
      Undefined variable: review_data in wp-content/plugins/business-reviews-wp/templates/grid-one.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/business-reviews-wp/views/widgets/business-review.php:2

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.14'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 detected7,817 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP549761,0645,291
CSS5165592,084
JavaScript57374437
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.44
Average class complexity26.10
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity163.00
Code structure
Namespaces13
Interfaces0
Traits1
Classes29
▷ Abstract classes13.45%
▷ Concrete classes2896.55%
▷ Final classes13.57%
Methods249
▷ Static methods4919.68%
▷ Public methods22590.36%
▷ Protected methods20.80%
▷ Private methods228.84%
Functions14
▷ Named functions17.14%
▷ Anonymous functions1392.86%
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
10 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/imgs/icon-20x20.png1.50KB0.73KB▼ 51.17%
assets/imgs/facebook-mini.png1.40KB0.80KB▼ 42.56%
assets/imgs/icon-128x128.png6.40KB3.35KB▼ 47.62%
assets/imgs/google-medium.png2.92KB1.61KB▼ 44.85%
assets/imgs/facebook-medium.png1.16KB1.15KB▼ 1.18%