10% total-wp-reviews

Code Review | Total WP Reviews

WordPress plugin Total WP Reviews scored10%from 54 tests.

About plugin

  • Plugin page: total-wp-reviews
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Jan 6, 2018
  • Latest release: Sep 4, 2018
  • Number of updates: 16
  • Update frequency: every 15.2 days
  • Top authors: shounakgupte (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /867 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/total-wp-reviews/total-reviews.php+42
    Function create_function() is deprecated

Server metrics [RAM: ▼1.95MB] [CPU: ▼52.86ms] Passed 4 tests

Analyzing server-side resources used by Total WP Reviews
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.68 ▼32.93
Dashboard /wp-admin2.06 ▼1.245.85 ▼46.84
Posts /wp-admin/edit.php2.06 ▼1.295.65 ▼41.53
Add New Post /wp-admin/post-new.php2.06 ▼3.835.05 ▼90.14
Media Library /wp-admin/upload.php2.06 ▼1.174.79 ▼29.20
Total Reviews /wp-admin/options-general.php?page=total_reviews2.065.65

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: 3 new tables, 12 new options
New tables
wp_total_reviews_google_review
wp_total_reviews_google_place
wp_total_reviews_facebook_page
New WordPress options
widget_total_reviews_google_widget
total_reviews_active
widget_theysaidso_widget
total_reviews_google_api_key
widget_recent-posts
can_compress_scripts
db_upgraded
fbrev_active
total_reviews
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Total WP Reviews: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲4614.39 ▼0.202.05 ▼0.5940.53 ▼0.75
Dashboard /wp-admin2,206 ▲265.70 ▲0.0283.58 ▼6.1837.76 ▼2.22
Posts /wp-admin/edit.php2,108 ▲82.02 ▲0.0034.32 ▼5.5538.52 ▲1.76
Add New Post /wp-admin/post-new.php1,533 ▲523.09 ▲0.12691.27 ▲43.0366.59 ▲15.00
Media Library /wp-admin/upload.php1,405 ▲144.15 ▼0.03101.96 ▼2.2445.61 ▼4.61
Total Reviews /wp-admin/options-general.php?page=total_reviews1,2481.9730.86105.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/total-wp-reviews/total-reviews.php+42
    Function create_function() is deprecated
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_total_reviews_google_review
    • wp_total_reviews_google_place
    • wp_total_reviews_facebook_page
  • The uninstall procedure has failed, leaving 12 options in the database
    • db_upgraded
    • widget_total_reviews_facebook_widget
    • widget_theysaidso_widget
    • widget_total_reviews_google_widget
    • can_compress_scripts
    • total_reviews_active
    • fbrev_active
    • widget_recent-posts
    • total_reviews_google_api_key
    • total_reviews
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=total_reviews
    • > Deprecated in wp-content/plugins/total-wp-reviews/total-reviews.php+52
    Function create_function() is deprecated

SRP 50% 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
Almost there! Just fix the following items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/total-wp-reviews/fb-widget/widget.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/total-wp-reviews/google-widget/total-reviews.options.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/total-wp-reviews/total-reviews.setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/total-wp-reviews/google-widget/total-reviews.reviews.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function total_reviews_text() in wp-content/plugins/total-wp-reviews/fb-widget/total-reviews.options.php:1
    • > PHP Fatal error
      require(): Failed opening required 'ABSPATHwp-includes/version.php' (include_path='.:/usr/share/php') in wp-content/plugins/total-wp-reviews/total-reviews.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function total_reviews_text() in wp-content/plugins/total-wp-reviews/google-widget/total-reviews.finder.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/total-wp-reviews/google-widget/widget.php:4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/total-wp-reviews/total-reviews.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_script() in wp-content/plugins/total-wp-reviews/fb-widget/total-reviews.reviews.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=total_reviews
    • > Javascript (severe) in unknown
    /wp-content/plugins/total-wp-reviews/assets/js/bootstrap.min.js?ver=6.3.1 5:215 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

total-wp-reviews/total-reviews.php 92% from 13 tests

"Total WP Reviews" version 1.0.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("total-wp-reviews.php" instead of "total-reviews.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,487 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP13286752,103
JavaScript7268327
CSS510854
SVG1003

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity10.33
▷ Minimum class complexity7.00
▷ Maximum class complexity13.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png17.77KB9.42KB▼ 47.01%
screenshot-3.png11.64KB5.13KB▼ 55.93%
assets/img/powered_by_google_on_non_white.png1.37KB1.97KB0.00%
assets/img/google_rating_logo_36.png1.62KB1.64KB0.00%
screenshot-2.png26.01KB10.10KB▼ 61.18%