73% embedder-for-google-reviews

Code Review | Embedder for Google Reviews

WordPress plugin Embedder for Google Reviews scored 73% from 54 tests.

About plugin

  • Plugin page: embedder-for-goog...
  • Plugin version: 1.5.14
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Aug 22, 2022
  • Latest release: Jul 28, 2023
  • Number of updates: 69
  • Update frequency: every 5.3 days
  • Top authors: paretodigital (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active / 5,504 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
Install script ran successfully

Server metrics [RAM: ▲5.06MB] [CPU: ▲28.26ms] 75% from 4 tests

Analyzing server-side resources used by Embedder for Google Reviews
Please fix the following
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.06MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.90 ▲5.4469.48 ▲27.53
Dashboard /wp-admin8.92 ▲5.6271.42 ▲20.76
Posts /wp-admin/edit.php8.92 ▲5.5783.74 ▲35.42
Add New Post /wp-admin/post-new.php9.50 ▲3.62133.28 ▲37.82
Media Library /wp-admin/upload.php8.92 ▲5.6968.88 ▲29.34
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9257.97

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 241 new files
Database: no new tables, 13 new options
New WordPress options
fs_debug_mode
widget_recent-comments
grwp_place_info
db_upgraded
can_compress_scripts
fs_accounts
theysaidso_admin_options
fs_active_plugins
gr_latest_results_free
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for Embedder for Google Reviews
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,038 ▲30313.88 ▼0.505.75 ▲3.9228.28 ▼13.46
Dashboard /wp-admin2,330 ▲1425.05 ▼0.83110.36 ▲0.2646.45 ▲5.47
Posts /wp-admin/edit.php2,210 ▲1212.29 ▲0.2441.03 ▲1.5638.20 ▼0.38
Add New Post /wp-admin/post-new.php1,543 ▲1523.26 ▲4.92680.01 ▲74.4163.96 ▲11.56
Media Library /wp-admin/upload.php1,513 ▲1254.45 ▲0.27100.55 ▲5.6745.95 ▲4.38
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1811.8427.3828.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/embedder-for-google-reviews/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 13 options
    • widget_recent-comments
    • db_upgraded
    • google_reviews_option_name
    • gr_latest_results_free
    • fs_accounts
    • can_compress_scripts
    • theysaidso_admin_options
    • gr_latest_results
    • fs_active_plugins
    • fs_debug_mode
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GRWP_Google_Reviews_Output' not found in wp-content/plugins/embedder-for-google-reviews/public/includes/class-grwp-reviews-widget-slider.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'GRWP_Google_Reviews_Output' not found in wp-content/plugins/embedder-for-google-reviews/public/includes/class-grwp-reviews-widget-badge.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/embedder-for-google-reviews/admin/includes/how-to.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GRWP_Google_Reviews_Output' not found in wp-content/plugins/embedder-for-google-reviews/public/includes/class-grwp-reviews-widget-grid.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'GRWP_Free_API_Service_Advanced' not found in wp-content/plugins/embedder-for-google-reviews/admin/includes/class-grwp-pro-api-service.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed: You can take inspiration from this readme.txt

embedder-for-google-reviews/google-reviews.php 85% from 13 tests

This is the main PHP file of "Embedder for Google Reviews" version 1.5.14, 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:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("embedder-for-google-reviews.php" instead of "google-reviews.php")

Code Analysis 97% from 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
There were no executable files found in this plugin36,777 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PHP1488,52617,94135,176
PO File64706021,140
JavaScript8108163429
CSS150028
SVG4004

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity65.89
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes71
▷ Abstract classes22.82%
▷ Concrete classes6997.18%
▷ Final classes00.00%
Methods1,356
▷ Static methods20915.41%
▷ Public methods94369.54%
▷ Protected methods261.92%
▷ Private methods38728.54%
Functions104
▷ Named functions10399.04%
▷ Anonymous functions10.96%
Constants151
▷ Global constants10468.87%
▷ Class constants4731.13%
▷ Public constants47100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
dist/images/sample-photo.png11.63KB11.62KB0.12%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%