10% instajet

Code Review | Instajet

WordPress plugin Instajet scored 10% from 54 tests.

About plugin

  • Plugin page: instajet
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.5.2
  • WordPress version: 5.8.1
  • First release: Jun 19, 2016
  • Latest release: Jun 19, 2016
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: brightonmike (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 930 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/instajet/lib/rdplugin.php+190
    Accessing static property InstaJet::$plugin_file as non static

Server metrics [RAM: ▼1.71MB] [CPU: ▼189.13ms] Passed 4 tests

Server-side resources used by Instajet
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.92 ▼0.926.02 ▼27.63
Dashboard /wp-admin1.94 ▼1.126.63 ▼34.38
Posts /wp-admin/edit.php1.94 ▼1.175.90 ▼41.64
Add New Post /wp-admin/post-new.php1.94 ▼3.506.36 ▼652.85
Media Library /wp-admin/upload.php1.94 ▼1.067.36 ▼22.78
Add New /wp-admin/post-new.php?post_type=aircraft1.947.04
Instajet /wp-admin/options-general.php?page=instajet_options1.945.64
Aircraft Types /wp-admin/edit-tags.php?taxonomy=aircrafttypes&post_type=aircraft1.945.55
Flight Requests /wp-admin/edit.php?post_type=flight-requests1.945.75
Add New /wp-admin/post-new.php?post_type=flight-requests1.946.85
Aircraft /wp-admin/edit.php?post_type=aircraft1.946.22
Statistics /wp-admin/edit.php?post_type=flight-requests&page=statistics1.946.50

Server storage [IO: ▲7.30MB] [DB: ▲0.02MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 105 new files
Database: 2 new tables, 5 new options
New tables
wp_airports
wp_legs
New WordPress options
instajet_searchpagepage_id
widget_editflightwidget
instajet_db_version
aircrafttypes_children
instajet_flightstatuspage_id

Browser metrics Passed 4 tests

An overview of browser requirements for Instajet
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,000 ▲40417.42 ▲1.8523.18 ▲14.9751.64 ▲2.17
Dashboard /wp-admin3,067 ▲1345.98 ▲0.04132.25 ▼21.49124.12 ▲8.75
Posts /wp-admin/edit.php2,833 ▲942.71 ▲0.0263.13 ▼2.5590.12 ▼2.33
Add New Post /wp-admin/post-new.php1,565 ▲6516.94 ▼1.87341.05 ▼33.50103.55 ▼4.32
Media Library /wp-admin/upload.php2,091 ▲2845.59 ▲0.58160.45 ▲13.04117.74 ▼7.04
Add New /wp-admin/post-new.php?post_type=aircraft3,3889.12219.56140.74
Instajet /wp-admin/options-general.php?page=instajet_options1,3022.3461.1693.60
Aircraft Types /wp-admin/edit-tags.php?taxonomy=aircrafttypes&post_type=aircraft2,3662.5362.4992.60
Flight Requests /wp-admin/edit.php?post_type=flight-requests1,5702.6560.8680.42
Add New /wp-admin/post-new.php?post_type=flight-requests3,2598.99219.63142.04
Aircraft /wp-admin/edit.php?post_type=aircraft3,5042.7573.3695.44
Statistics /wp-admin/edit.php?post_type=flight-requests&page=statistics1,1462.28177.7891.18

Uninstaller [IO: ▲0.42MB] [DB: ▲0.02MB] 25% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/instajet/lib/rdplugin.php+190
    Accessing static property InstaJet::$plugin_file as non static
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_legs
    • wp_airports
  • This plugin does not fully uninstall, leaving 5 options in the database
    • instajet_flightstatuspage_id
    • instajet_db_version
    • aircrafttypes_children
    • instajet_searchpagepage_id
    • widget_editflightwidget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=flight-requests&page=statistics
    • > Notice in wp-content/plugins/instajet/lib/rdplugin.php+190
    Accessing static property InstaJet::$plugin_file as non static
  • 37 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=flight-requests&page=statistics
    • > Notice in wp-content/plugins/instajet/lib/admin/ij-admin.php+482
    Accessing static property InstaJet::$plugin_url as non static
  • 135 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=flight-requests&page=statistics
    • > Notice in wp-content/plugins/instajet/lib/rdplugin.php+287
    Accessing static property InstaJet::$plugin_path as non static
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=flight-requests&page=statistics
    • > Deprecated in wp-content/plugins/instajet/lib/ij-widgets.php+11
    Function create_function() is deprecated
  • 18 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=flight-requests&page=statistics
    • > Notice in wp-content/plugins/instajet/lib/rdplugin/rdplugin-admin.php+111
    Undefined index: instajet_license_key
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=flight-requests
    • > Notice in wp-content/plugins/instajet/lib/admin/ij-admin.php+131
    Undefined index: post_type
    • > GET request to /wp-admin/options-general.php?page=instajet_options
    • > Notice in wp-content/plugins/instajet/lib/rdplugin/rdplugin-admin.php+267
    Undefined index: message
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=aircraft
    • > Notice in wp-content/plugins/instajet/lib/admin/ij-admin.php+496
    Undefined index: page
    • > GET request to /wp-admin/post-new.php?post_type=flight-requests
    • > Notice in wp-content/plugins/instajet/lib/admin/ij-admin.php+179
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=flight-requests
    • > Warning in wp-content/plugins/instajet/lib/admin/ij-admin.php+179
    Invalid argument supplied for foreach()
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=flight-requests&page=statistics
    • > Notice in wp-content/plugins/instajet/instajet.php+510
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/instajet/lib/rdplugin/fields/multiselect.php
    • > /wp-content/plugins/instajet/lib/rdplugin/fields/readonly.php
    • > /wp-content/plugins/instajet/lib/rdplugin/fields/textarea.php
    • > /wp-content/plugins/instajet/lib/rdplugin/fields/hidden.php
    • > /wp-content/plugins/instajet/lib/rdplugin/fields/text.php
    • > /wp-content/plugins/instajet/lib/rdplugin/fields/select.php
    • > /wp-content/plugins/instajet/lib/admin/.views/admin-settings.php
    • > /wp-content/plugins/instajet/lib/admin/.views/admin-price-adjust.php
  • 33× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/instajet/lib/rdplugin/fields/multiselect.php on line 1
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/instajet/lib/rdplugin/fields/text.php on line 1
    • > PHP Notice
      Undefined variable: value in wp-content/plugins/instajet/lib/rdplugin/fields/readonly.php on line 1
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/instajet/lib/rdplugin/fields/radio.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/instajet/lib/admin/.views/admin-general.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_head() in wp-content/plugins/instajet/templates/view.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ij_admin_tabs() in wp-content/plugins/instajet/lib/admin/.views/admin-price-adjust.php:632
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/instajet/lib/rdplugin/fields/radio.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/instajet/lib/rdplugin/fields/multiselect.php on line 2
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/instajet/lib/rdplugin/fields/hidden.php on line 1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: flight search, marketing tool, lead generation, private jet, private jet search...

instajet/instajet.php Passed 13 tests

The primary PHP file in "Instajet" version 1.1.8 is used by WordPress to initiate all plugin functionality
67 characters long description:
A private jet charter booking and lead generation tool for brokers.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin8,150 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP381,6322,0105,595
CSS10339972,318
JavaScript55447155
SVG10161
PO File10021

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity19.64
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods198
▷ Static methods168.08%
▷ Public methods17387.37%
▷ Protected methods189.09%
▷ Private methods73.54%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
37 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/ui-bg_inset-soft_50_c9c9c9_1x100.png0.27KB0.16KB▼ 40.93%
assets/img/ui-bg_glass_100_f8f8f8_1x400.png0.26KB0.11KB▼ 55.34%
assets/img/calendar.png0.37KB0.45KB0.00%
assets/img/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
assets/img/ui-bg_flat_55_eeeeee_40x100.png0.21KB0.08KB▼ 60.45%