84% airplane-mode

Code Review | Airplane Mode

WordPress plugin Airplane Mode scored84%from 54 tests.

About plugin

  • Plugin page: airplane-mode
  • Plugin version: 0.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.3
  • WordPress version: 6.3.1
  • First release: Aug 9, 2019
  • Latest release: Nov 15, 2019
  • Number of updates: 4
  • Update frequency: every 24.5 days
  • Top authors: norcross (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /33,667 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼1.05ms] Passed 4 tests

An overview of server-side resources used by Airplane Mode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2539.31 ▼3.94
Dashboard /wp-admin3.55 ▲0.2552.55 ▲3.14
Posts /wp-admin/edit.php3.67 ▲0.3153.95 ▲2.62
Add New Post /wp-admin/post-new.php6.13 ▲0.2598.53 ▼6.03
Media Library /wp-admin/upload.php3.48 ▲0.2545.03 ▲8.51

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Airplane Mode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,744 ▼4214.24 ▼0.111.79 ▼0.1438.90 ▼3.01
Dashboard /wp-admin2,158 ▼165.55 ▼0.0688.67 ▼2.9436.98 ▼6.99
Posts /wp-admin/edit.php2,070 ▼302.03 ▼0.0539.64 ▲4.8134.74 ▼8.28
Add New Post /wp-admin/post-new.php1,496 ▼4723.24 ▲0.10678.46 ▼22.6056.23 ▼1.80
Media Library /wp-admin/upload.php1,366 ▼344.25 ▲0.05109.29 ▲3.8954.48 ▲11.32

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
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/airplane-mode/airplane-mode.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/airplane-mode/inc/wp-cli.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 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
2 plugin tags: http, external calls

airplane-mode/airplane-mode.php 85% from 13 tests

The primary PHP file in "Airplane Mode" version 0.2.5 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: Please prefix the domain path with a forward slash character ("/languages")
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")

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
No dangerous file extensions were detected810 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP2215515624
Markdown231098
CSS29744
PO File17733
SVG11011

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity32.00
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods45
▷ Static methods24.44%
▷ Public methods4191.11%
▷ Protected methods12.22%
▷ Private methods36.67%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
There are no PNG files in this plugin