83% wp-tripadvisor-review-slider

Code Review | WP TripAdvisor Review Slider

WordPress plugin WP TripAdvisor Review Slider scored83%from 54 tests.

About plugin

  • Plugin page: wp-tripadvisor-re...
  • Plugin version: 11.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4
  • WordPress version: 6.3.1
  • First release: Dec 15, 2017
  • Latest release: Nov 28, 2023
  • Number of updates: 168
  • Update frequency: every 13.0 days
  • Top authors: jgwhite33 (100%)

Code review

54 tests

User reviews

116 reviews

Install metrics

10,000+ active /281,620 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲5.49MB] [CPU: ▲22.59ms] 75% from 4 tests

This is a short check of server-side resources used by WP TripAdvisor Review Slider
Please take the time to fix the following items
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.49MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.21 ▲5.7565.13 ▲21.98
Dashboard /wp-admin9.23 ▲5.8879.22 ▲14.45
Posts /wp-admin/edit.php9.23 ▲5.8784.28 ▲38.73
Add New Post /wp-admin/post-new.php10.33 ▲4.44122.43 ▲22.57
Media Library /wp-admin/upload.php9.23 ▲6.0068.92 ▲31.37
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2367.51

Server storage [IO: ▲3.96MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 256 new files
Database: 2 new tables, 12 new options
New tables
wp_wptripadvisor_reviews
wp_wptripadvisor_post_templates
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
fs_active_plugins
theysaidso_admin_options
can_compress_scripts
wp-tripadvisor-review-slider_current_db_version
widget_theysaidso_widget
wprev_activated_time_trip
fs_accounts
...

Browser metrics Passed 4 tests

WP TripAdvisor Review Slider: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲23413.44 ▼0.918.29 ▲6.6127.80 ▼17.24
Dashboard /wp-admin2,273 ▲1025.57 ▲0.0596.37 ▼7.2046.04 ▼0.14
Posts /wp-admin/edit.php2,140 ▲402.00 ▲0.0640.03 ▼1.1539.41 ▲1.73
Add New Post /wp-admin/post-new.php1,547 ▲2122.88 ▼0.29615.41 ▼58.8251.61 ▲0.77
Media Library /wp-admin/upload.php1,436 ▲364.20 ▼0.0297.58 ▼17.0543.60 ▼3.28
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0911.6927.7430.70

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
Please fix the following items
  • The uninstall procedure has failed, leaving 10 options in the database
    • fs_debug_mode
    • db_upgraded
    • fs_active_plugins
    • widget_recent-comments
    • wp-tripadvisor-review-slider_current_db_version
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • fs_accounts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/wp-tripadvisor-review-slider-public-display-widget.php on line 20
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/wp-tripadvisor-review-slider-public-display.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-tripadvisor-review-slider/admin/partials/get_tripadvisor.php:16
    • > PHP Notice
      Undefined variable: a in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/wp-tripadvisor-review-slider-public-display-widget.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/template_style_1.php:16
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/wp-tripadvisor-review-slider-public-display.php on line 17
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/wp-tripadvisor-review-slider-public-display-widget.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-tripadvisor-review-slider/admin/partials/templates_posts.php:16
    • > PHP Notice
      Undefined variable: a in wp-content/plugins/wp-tripadvisor-review-slider/public/partials/wp-tripadvisor-review-slider-public-display.php on line 21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-tripadvisor-review-slider/public/class-wp-tripadvisor-review-slider-widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
7 plugin tags: reviews, tripadvisor review slider, tripadvisor slider, tripadvisor, testimonials...

wp-tripadvisor-review-slider/wp-tripadvisor-review-slider.php Passed 13 tests

Analyzing the main PHP file in "WP TripAdvisor Review Slider" version 11.9
107 characters long description:
Allows you to easily display your TripAdvisor Business Page reviews in your Posts, Pages, and Widget areas.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected40,953 lines of code in 177 files:
LanguageFilesBlank linesComment linesLines of code
PHP1419,10319,09237,955
JavaScript143727811,670
CSS2148401,114
Markdown1680214

PHP code 0% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 175)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity86.38
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.70
▷ Minimum method complexity1.00
▷ Maximum method complexity175.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,413
▷ Static methods20214.30%
▷ Public methods1,00070.77%
▷ Protected methods322.26%
▷ Private methods38126.96%
Functions107
▷ Named functions107100.00%
▷ Anonymous functions00.00%
Constants169
▷ Global constants12272.19%
▷ Class constants4727.81%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
26 PNG files occupy 0.31MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/partials/imgs/tripadvisor_stars_5.png5.87KB1.63KB▼ 72.23%
admin/partials/logo2.png6.61KB2.25KB▼ 65.94%
public/partials/imgs/tripadvisor_stars_1.5.png1.07KB1.08KB0.00%
admin/partials/template3_thumb.png65.48KB18.84KB▼ 71.23%
admin/partials/logo.png13.58KB5.51KB▼ 59.43%