77% flight-search-widget-blocks

Code Review | Flight Search Widget and Blocks

WordPress plugin Flight Search Widget and Blocks scored 77% from 54 tests.

About plugin

  • Plugin page: flight-search-wid...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.1
  • WordPress version: 5.8.1
  • First release: Jan 8, 2019
  • Latest release: Mar 10, 2019
  • Number of updates: 7
  • Update frequency: every 8.7 days
  • Top authors: milukove (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,952 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
Installer ran successfully

Server metrics [RAM: ▲5.00MB] [CPU: ▼114.49ms] 75% from 4 tests

A check of server-side resources used by Flight Search Widget and Blocks
Please fix the following
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.00MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /7.87 ▲5.1557.48 ▲33.69
Dashboard /wp-admin8.18 ▲5.1280.54 ▲30.33
Posts /wp-admin/edit.php8.23 ▲5.1270.74 ▲37.05
Add New Post /wp-admin/post-new.php10.08 ▲4.6596.56 ▼551.63
Media Library /wp-admin/upload.php8.12 ▲5.1166.76 ▲29.67
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius8.2955.31

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 395 new files
Database: no new tables, 6 new options
New WordPress options
fs_gdpr
fs_accounts
fs_debug_mode
fs_api_cache
widget_fswb_simple
fs_active_plugins

Browser metrics Passed 4 tests

Checking browser requirements for Flight Search Widget and Blocks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲19916.07 ▲0.4311.60 ▼0.1045.91 ▼12.50
Dashboard /wp-admin3,031 ▲1006.19 ▲0.21139.54 ▲2.51120.92 ▲4.53
Posts /wp-admin/edit.php2,802 ▲662.75 ▲0.0365.56 ▲4.4199.51 ▲0.56
Add New Post /wp-admin/post-new.php3,516 ▲2,01614.66 ▼3.86438.32 ▲83.20125.91 ▲9.35
Media Library /wp-admin/upload.php1,794 ▼105.43 ▲0.40148.54 ▲5.94134.95 ▲8.58
Freemius Debug [v.2.2.4] /wp-admin/admin.php?page=freemius1,5162.4757.5583.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • fs_debug_mode
    • widget_fswb_simple
    • fs_accounts
    • fs_gdpr
    • fs_api_cache
    • fs_active_plugins

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/flight-search-widget-blocks/freemius/templates/ajax-loader.php
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flight-search-widget-blocks/include/fswb-blocks.php:139
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/flight-search-widget-blocks/include/fswb-categories.php:21
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/flight-search-widget-blocks/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/flight-search-widget-blocks/freemius/templates/partials/network-activation.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 on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: skyscanner, flight search, gutenberg, widget, flight

flight-search-widget-blocks/flight-search-widget-blocks.php 92% from 13 tests

The main file in "Flight Search Widget and Blocks" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin58,524 lines of code in 330 files:
LanguageFilesBlank linesComment linesLines of code
PHP1648,07017,63137,526
PO File215,9467,40013,048
JavaScript953847183,601
Sass28399772,515
CSS1797901,085
Markdown21380556
SVG201165
JSON10028

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,360)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity42.20
▷ Minimum class complexity1.00
▷ Maximum class complexity2,360.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes121
▷ Abstract classes21.65%
▷ Concrete classes11998.35%
▷ Final classes00.00%
Methods1,564
▷ Static methods18311.70%
▷ Public methods1,05467.39%
▷ Protected methods20312.98%
▷ Private methods30719.63%
Functions129
▷ Named functions12798.45%
▷ Anonymous functions21.55%
Constants133
▷ Global constants10679.70%
▷ Class constants2720.30%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/images/fswp-logo-rectangle.png20.78KB7.07KB▼ 65.97%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%