68% widget-google-reviews

Code Review | Plugin for Google Reviews

WordPress plugin Plugin for Google Reviews scored68%from 54 tests.

About plugin

  • Plugin page: widget-google-rev...
  • Plugin version: 3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.4
  • WordPress version: 6.3.1
  • First release: Oct 8, 2016
  • Latest release: Nov 27, 2023
  • Number of updates: 216
  • Update frequency: every 12.1 days
  • Top authors: widgetpack (58.8%)richplugins (41.67%)

Code review

54 tests

User reviews

1221 reviews

Install metrics

100,000+ active /3,123,407 total downloads

Benchmarks

Plugin footprint 65% 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.83MB] [CPU: ▲5.16ms] Passed 4 tests

Server-side resources used by Plugin for Google Reviews
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6947.94 ▲2.37
Dashboard /wp-admin4.20 ▲0.8957.63 ▲4.92
Posts /wp-admin/edit.php4.25 ▲0.8959.85 ▲12.21
Add New Post /wp-admin/post-new.php6.75 ▲0.8699.78 ▲5.24
Media Library /wp-admin/upload.php4.12 ▲0.8944.29 ▲8.09
Overview /wp-admin/admin.php?page=grw4.0942.39
Support /wp-admin/admin.php?page=grw-support4.1044.87
Settings /wp-admin/admin.php?page=grw-settings4.11323.88
Builder /wp-admin/admin.php?page=grw-builder4.1144.41
Widgets /wp-admin/edit.php?post_type=grw_feed4.1648.54

Server storage [IO: ▲2.02MB] [DB: ▲0.32MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 131 new files
Database: 3 new tables, 17 new options
New tables
wp_grp_google_review
wp_grp_google_place
wp_grp_google_stats
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
grw_revupd_cron_timeout
widget_grw_widget
theysaidso_admin_options
grw_activation_time
grw_is_multisite
...

Browser metrics Passed 4 tests

Plugin for Google Reviews: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲11113.35 ▼0.843.86 ▲2.2338.55 ▼4.71
Dashboard /wp-admin2,233 ▲555.89 ▲0.1796.24 ▼11.9888.50 ▲45.99
Posts /wp-admin/edit.php2,163 ▲632.41 ▲0.4537.78 ▼3.1237.20 ▼2.09
Add New Post /wp-admin/post-new.php6,247 ▲4,72119.33 ▼4.10809.64 ▲131.7134.80 ▼23.10
Media Library /wp-admin/upload.php1,520 ▲1174.53 ▲0.32101.27 ▲4.1782.94 ▲41.22
Overview /wp-admin/admin.php?page=grw2,9319.59227.83114.86
Support /wp-admin/admin.php?page=grw-support2,09113.86600.73151.58
Settings /wp-admin/admin.php?page=grw-settings1,1612.1129.5841.59
Builder /wp-admin/admin.php?page=grw-builder2,4609.14171.89141.76
Widgets /wp-admin/edit.php?post_type=grw_feed1,2632.4533.9946.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_grp_google_place
    • wp_grp_google_stats
    • wp_grp_google_review
  • This plugin did not uninstall successfully, leaving 17 options in the database
    • grw_revupd_cron_log
    • widget_recent-comments
    • can_compress_scripts
    • grw_revupd_cron
    • widget_grw_widget
    • grw_version
    • widget_recent-posts
    • grw_google_api_key
    • theysaidso_admin_options
    • grw_is_multisite
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 85
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 67
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 20
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 122
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 29
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 66
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 113
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 57
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 76
    • > PHP Warning
      Use of undefined constant GRW_ASSETS_URL - assumed 'GRW_ASSETS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/widget-google-reviews/includes/page-setting-fig.php on line 104

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: reviews plugin, reviews, google reviews, rating, widget...

widget-google-reviews/grw.php 92% from 13 tests

This is the main PHP file of "Plugin for Google Reviews" version 3.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("widget-google-reviews.php" instead of "grw.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin10,302 lines of code in 85 files:
LanguageFilesBlank linesComment linesLines of code
PHP38728803,514
CSS10576663,482
JavaScript10281952,689
PO File231570591
JSON10021
SVG3005

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes32
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes13.12%
Methods176
▷ Static methods10.57%
▷ Public methods15386.93%
▷ Protected methods21.14%
▷ Private methods2111.93%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants11
▷ Global constants763.64%
▷ Class constants436.36%
▷ Public constants4100.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
20 PNG files occupy 0.51MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/google_key_2_1.png21.21KB12.49KB▼ 41.12%
assets/img/google_placeid_2.png34.97KB16.15KB▼ 53.83%
assets/img/google_key_8.png15.08KB9.56KB▼ 36.59%
assets/img/google_placeid_3.png51.17KB28.09KB▼ 45.12%
assets/img/google_key_2.png37.40KB17.38KB▼ 53.53%