66% travelpayouts

Code Review | Travelpayouts: All Travel Brands in One Place

WordPress plugin Travelpayouts: All Travel Brands in One Place scored66%from 54 tests.

About plugin

  • Plugin page: travelpayouts
  • Plugin version: 1.1.12
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Aug 19, 2015
  • Latest release: Oct 31, 2023
  • Number of updates: 170
  • Update frequency: every 17.6 days
  • Top authors: travelpayouts (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

7,000+ active /221,493 total downloads

Benchmarks

Plugin footprint 81% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲14.49MB] [CPU: ▲264.28ms] 25% from 4 tests

This is a short check of server-side resources used by Travelpayouts: All Travel Brands in One Place
Please have a look at the following items
  • RAM: Total memory usage must be kept under 10MB (currently 17.78MB on /wp-admin/options-general.php?page=travelpayouts_landing_page)
  • Extra RAM: Extra memory usage should kept under 5MB (currently 14.49MB on /wp-admin/options-general.php?page=travelpayouts_landing_page)
  • Extra CPU: Extra CPU usage must be kept under 200.00ms (currently 264.28ms on /wp-admin/options-general.php?page=travelpayouts_landing_page)
PageMemory (MB)CPU Time (ms)
Home /18.71 ▲15.24378.98 ▲337.88
Dashboard /wp-admin17.83 ▲14.48308.77 ▲245.00
Posts /wp-admin/edit.php17.88 ▲14.52286.29 ▲236.13
Add New Post /wp-admin/post-new.php20.30 ▲14.41369.17 ▲271.68
Media Library /wp-admin/upload.php17.77 ▲14.54339.41 ▲304.29
Travelpayouts /wp-admin/options-general.php?page=travelpayouts_landing_page17.78265.50

Server storage [IO: ▲16.00MB] [DB: ▲0.23MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2,483 new files
Database: no new tables, 10 new options
New WordPress options
travelpayouts_admin_settings-transients
travelpayouts_version
travelpayouts_notices
travelpayouts_admin_settings
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Travelpayouts: All Travel Brands in One Place
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,441 ▲69517.26 ▲2.6710.32 ▲8.7651.55 ▲9.09
Dashboard /wp-admin2,650 ▲4728.24 ▲2.52218.25 ▲108.7987.60 ▲41.53
Posts /wp-admin/edit.php2,388 ▲2852.31 ▲0.3544.44 ▲3.1446.60 ▲9.91
Add New Post /wp-admin/post-new.php1,734 ▲20827.51 ▲3.78961.87 ▲292.6843.02 ▼12.04
Media Library /wp-admin/upload.php1,678 ▲2784.36 ▲0.14106.94 ▲9.6380.24 ▲36.63
Travelpayouts /wp-admin/options-general.php?page=travelpayouts_landing_page2,1362.3148.47100.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_recent-posts
    • widget_recent-comments
    • travelpayouts_admin_settings
    • can_compress_scripts
    • travelpayouts_notices
    • travelpayouts_version
    • theysaidso_admin_options
    • travelpayouts_admin_settings-transients
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/travelpayouts/vendor/travelpayouts-snowplow/snowplow-tracker/Worker.php
    • > /wp-content/plugins/travelpayouts/src/admin/templates/script.php
  • 877× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Travelpayouts\\Vendor\\Monolog\\Handler\\HandlerInterface' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-monolog/monolog/src/Monolog/Handler/HandlerWrapper.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'Travelpayouts\\Vendor\\Doctrine\\Common\\Annotations\\Reader' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Travelpayouts\\Vendor\\Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-monolog/monolog/src/Monolog/Handler/InsightOpsHandler.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Travelpayouts\\modules\\tables\\components\\hotels\\HotelTableShortcodeModel' not found in wp-content/plugins/travelpayouts/src/modules/tables/components/hotels/selectionsDiscount/Table.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Travelpayouts\\modules\\tables\\components\\api\\BaseTokenApiModel' not found in wp-content/plugins/travelpayouts/src/modules/tables/components/flights/directFlightsRoute/Api.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Travelpayouts\\Vendor\\Ramsey\\Uuid\\Uuid' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-ramsey/uuid/src/Rfc4122/UuidV3.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Travelpayouts\\Vendor\\Brick\\Math\\Internal\\Calculator' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-brick/math/src/Internal/Calculator/NativeCalculator.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Travelpayouts\\Vendor\\Psr\\Log\\AbstractLogger' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-rollbar/rollbar/src/RollbarLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Travelpayouts\\Vendor\\Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-symfony/translation/Translator.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'Travelpayouts\\Vendor\\Ramsey\\Uuid\\UuidInterface' not found in wp-content/plugins/travelpayouts/vendor/travelpayouts-ramsey/uuid/src/Rfc4122/UuidInterface.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5, #6, #7 in travelpayouts/assets to your readme.txt
You can look at the official readme.txt

travelpayouts/travelpayouts.php Passed 13 tests

The main file in "Travelpayouts: All Travel Brands in One Place" v. 1.1.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
125 characters long description:
Earn money and make your visitors happy! Offer them useful tools for their travel needs. Earn on commission for each booking.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/travelpayouts/vendor/travelpayouts-nesbot/carbon/bin/carbon.bat
149,312 lines of code in 2,160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,92924,36666,582115,092
CSS451,63715116,807
YAML31004,774
JavaScript968423263,740
JSON35003,704
XSD392482,803
PO File16348241,343
SVG1200948
Markdown219043
Sass34035
XML14215
Bourne Shell1104
DOS Batch1004

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 210)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.42
▷ Minimum class complexity1.00
▷ Maximum class complexity351.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity210.00
Code structure
Namespaces250
Interfaces112
Traits51
Classes1,073
▷ Abstract classes948.76%
▷ Concrete classes97991.24%
▷ Final classes606.13%
Methods7,701
▷ Static methods1,07613.97%
▷ Public methods6,02678.25%
▷ Protected methods1,05313.67%
▷ Private methods6228.08%
Functions600
▷ Named functions15826.33%
▷ Anonymous functions44273.67%
Constants841
▷ Global constants212.50%
▷ Class constants82097.50%
▷ Public constants77794.76%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
44 PNG files occupy 1.58MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/admin/widgets/flights/tp_subscriptions_widget/pallet_2.png0.23KB0.24KB0.00%
(invalid) assets/0e6e208e4d4826c0889d.png0.08KB0.00KB▼ 100.00%
images/rest/search_form.png27.55KB17.50KB▼ 36.47%
assets/c3aae356d03bcb13da7cbf2763770658.png15.19KB12.42KB▼ 18.22%
assets/a7433f869d49ae59f30d6a575fd7f627.png41.78KB47.07KB0.00%