84% google-places-reviews

Code Review | Reviews Block for Google

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

About plugin

  • Plugin page: google-places-rev...
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Aug 3, 2014
  • Latest release: Jul 2, 2022
  • Number of updates: 48
  • Update frequency: every 60.3 days
  • Top authors: dlocc (79.17%)webdevmattcrom (18.75%)jason_the_adams (6.25%)

Code review

54 tests

User reviews

44 reviews

Install metrics

3,000+ active /106,431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.40ms] Passed 4 tests

Server-side resources used by Reviews Block for Google
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.19 ▲4.47
Dashboard /wp-admin3.36 ▲0.0660.36 ▲14.06
Posts /wp-admin/edit.php3.41 ▲0.0645.14 ▼4.88
Add New Post /wp-admin/post-new.php5.95 ▲0.0781.30 ▼17.18
Media Library /wp-admin/upload.php3.28 ▲0.0635.80 ▲4.01

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 88 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Reviews Block for Google
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.39 ▼0.091.67 ▲0.1547.46 ▲10.30
Dashboard /wp-admin2,195 ▲205.58 ▼0.1481.45 ▼31.7239.66 ▼6.95
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0133.71 ▼8.7635.94 ▼2.01
Add New Post /wp-admin/post-new.php6,380 ▲4,85422.99 ▼0.05907.73 ▲250.7138.07 ▼22.47
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.0895.51 ▼0.0443.13 ▲1.20

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means 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 take a closer look at the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-places-reviews/includes/admin-settings.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-places-reviews/includes/plugin-listing-page.php:177
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/google-places-reviews/includes/legacy/widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/google-places-reviews/includes/legacy/widget-form.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/google-places-reviews/google-places-reviews.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/google-places-reviews/includes/legacy/widget-frontend.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/google-places-reviews/includes/options.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: google business, google places, google reviews, reviews, google

google-places-reviews/google-places-reviews.php Passed 13 tests

"Reviews Block for Google" version 2.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
95 characters long description:
Easily display Google business reviews and ratings with a simple and intuitive WordPress block.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected3,627 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP143744571,576
Sass11301201,450
JavaScript75780334
XML1256136
JSON300100
SVG30027
CSS4004

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity45.50
▷ Minimum class complexity14.00
▷ Maximum class complexity77.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
30 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) includes/legacy/assets/images/google-stars.png0.00KB0.00KB0.00%
includes/legacy/assets/images/new-window-icon.png0.27KB0.12KB▼ 56.20%
includes/legacy/assets/images/review_stars.png0.47KB0.54KB0.00%
build/images/blank-avatar.f6e71205.png0.93KB0.61KB▼ 33.76%
includes/legacy/assets/images/powered-by-google-on-white.png2.08KB2.14KB0.00%