78% review-widgets-for-foursquare

Code Review | Widgets for Foursquare Reviews

WordPress plugin Widgets for Foursquare Reviews scored78%from 54 tests.

About plugin

  • Plugin page: review-widgets-fo...
  • Plugin version: 11.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jul 18, 2020
  • Latest release: Nov 24, 2023
  • Number of updates: 132
  • Update frequency: every 9.3 days
  • Top authors: trustindex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,448 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.13MB] [CPU: ▲4.23ms] Passed 4 tests

Analyzing server-side resources used by Widgets for Foursquare Reviews
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.59 ▲1.1244.66 ▲8.54
Dashboard /wp-admin4.46 ▲1.1550.75 ▲5.58
Posts /wp-admin/edit.php4.50 ▲1.1357.59 ▲4.54
Add New Post /wp-admin/post-new.php7.10 ▲1.2187.10 ▼0.32
Media Library /wp-admin/upload.php4.34 ▲1.1042.51 ▲7.10

Server storage [IO: ▲3.23MB] [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: 131 new files
Database: 1 new table, 8 new options
New tables
wp_trustindex_foursquare_reviews
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
trustindex-foursquare-version
trustindex-foursquare-active
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Widgets for Foursquare Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4714.18 ▼0.551.58 ▼0.2038.26 ▼1.48
Dashboard /wp-admin2,208 ▲315.80 ▲0.1795.66 ▼1.2185.14 ▲39.96
Posts /wp-admin/edit.php2,122 ▲191.97 ▲0.0338.68 ▼1.9635.49 ▲1.80
Add New Post /wp-admin/post-new.php6,426 ▲4,90029.19 ▲6.15878.75 ▲239.1939.36 ▼16.46
Media Library /wp-admin/upload.php1,422 ▲254.24 ▲0.0899.97 ▲2.3476.35 ▲34.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 11× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/feature_request.php
    • > /wp-content/plugins/review-widgets-for-foursquare/review-widgets-for-foursquare.php
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/advanced.php
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/setup_trustindex_join.php
    • > /wp-content/plugins/review-widgets-for-foursquare/trustindex-foursquare-widget.class.php
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/my_reviews.php
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/setup_no_reg_header.php
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/get_reviews.php
    • > /wp-content/plugins/review-widgets-for-foursquare/settings.php
    • > /wp-content/plugins/review-widgets-for-foursquare/tabs/rate.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_foursquare' not found in wp-content/plugins/review-widgets-for-foursquare/tabs/_get_more_customers.php:1
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/review-widgets-for-foursquare/include/activate.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/review-widgets-for-foursquare/include/activate.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-foursquare/uninstall.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-foursquare/tabs/setup_no_reg.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/review-widgets-for-foursquare/include/troubleshooting.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_foursquare' not found in wp-content/plugins/review-widgets-for-foursquare/tabs/demo_widgets.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_foursquare' not found in wp-content/plugins/review-widgets-for-foursquare/tabs/setup_no_reg_platform.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_foursquare' not found in wp-content/plugins/review-widgets-for-foursquare/tabs/_rate_us_feedback.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/review-widgets-for-foursquare/include/activate.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

review-widgets-for-foursquare/review-widgets-for-foursquare.php Passed 13 tests

Analyzing the main PHP file in "Widgets for Foursquare Reviews" version 11.1
122 characters long description:
Embed Foursquare reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Foursquare reviews.

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin10,475 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP2343389,281
JavaScript63011751,018
CSS413063
SVG42061
JSON10052

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity127.00
▷ Minimum class complexity10.00
▷ Maximum class complexity348.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods98
▷ Static methods66.12%
▷ Public methods9697.96%
▷ Protected methods00.00%
▷ Private methods22.04%
Functions17
▷ Named functions847.06%
▷ Anonymous functions952.94%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/img/platforms.png10.24KB4.08KB▼ 60.12%
static/img/yes.png1.91KB0.25KB▼ 87.08%
static/img/no.png1.92KB0.28KB▼ 85.53%
static/img/trustindex-sign-logo.png3.34KB0.59KB▼ 82.47%