10% plugin-jetradar-cheap-flights

Code Review | Plugin Jetradar Cheap Flights

WordPress plugin Plugin Jetradar Cheap Flights scored10%from 54 tests.

About plugin

  • Plugin page: plugin-jetradar-c...
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.5.1
  • WordPress version: 6.3.1
  • First release: Mar 11, 2013
  • Latest release: Oct 7, 2015
  • Number of updates: 36
  • Update frequency: every 42.8 days
  • Top authors: travelpayouts (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /6,606 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/plugin-jetradar-cheap-flights/aviasales.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; Aviasales has a deprecated constructor

Server metrics [RAM: ▼1.89MB] [CPU: ▼52.42ms] Passed 4 tests

Analyzing server-side resources used by Plugin Jetradar Cheap Flights
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.11 ▼1.365.21 ▼33.70
Dashboard /wp-admin2.13 ▼1.225.65 ▼54.98
Posts /wp-admin/edit.php2.13 ▼1.236.05 ▼40.01
Add New Post /wp-admin/post-new.php2.13 ▼3.766.22 ▼80.28
Media Library /wp-admin/upload.php2.13 ▼1.105.98 ▼34.39

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_aviasales
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Plugin Jetradar Cheap Flights
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.77 ▲0.221.77 ▲0.1543.93 ▲1.29
Dashboard /wp-admin2,206 ▲184.84 ▼0.08111.10 ▲3.7538.51 ▼2.61
Posts /wp-admin/edit.php2,086 ▼32.02 ▲0.0136.77 ▼1.3532.19 ▼0.82
Add New Post /wp-admin/post-new.php1,533 ▲523.22 ▲4.62610.63 ▼36.5254.44 ▼2.56
Media Library /wp-admin/upload.php1,388 ▲34.15 ▼0.0193.24 ▼7.6142.94 ▼0.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/plugin-jetradar-cheap-flights/aviasales.php+21
    Methods with the same name as their class will not be constructors in a future version of PHP; Aviasales has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_aviasales
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% 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 0% 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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/plugin-jetradar-cheap-flights/aviasales.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/plugin-jetradar-cheap-flights/params.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/plugin-jetradar-cheap-flights/widget.php:3
    • > PHP Notice
      Undefined variable: validate in wp-content/plugins/plugin-jetradar-cheap-flights/params.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/plugin-jetradar-cheap-flights/params.php on line 1

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

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
You can look at the official readme.txt

plugin-jetradar-cheap-flights/aviasales.php 85% from 13 tests

The main PHP script in "Plugin Jetradar Cheap Flights" version 2.0.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 259 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("plugin-jetradar-cheap-flights.php" instead of "aviasales.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected1,820 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS415546695
JavaScript5153132675
PHP519521450

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity50.00
▷ Minimum class complexity50.00
▷ Maximum class complexity50.00
Average method complexity4.77
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods215.38%
▷ Public methods646.15%
▷ Protected methods538.46%
▷ Private methods215.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/aviasales_logo.png3.46KB1.42KB▼ 58.94%
assets/jetradar_logo.png7.82KB2.73KB▼ 65.10%
screenshot-2.png32.35KB8.42KB▼ 73.98%
assets/minicolors/jquery.minicolors.png75.64KB34.31KB▼ 54.64%
assets/input_bg.png14.26KB6.68KB▼ 53.13%