84% offline-shell

Code Review | Offline Shell

WordPress plugin Offline Shell scored84%from 54 tests.

About plugin

  • Plugin page: offline-shell
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2016
  • Latest release: Mar 14, 2016
  • Number of updates: 14
  • Update frequency: every 0.4 days
  • Top authors: mozillawebapps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,021 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.20ms] Passed 4 tests

Server-side resources used by Offline Shell
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0244.87 ▼2.92
Dashboard /wp-admin3.33 ▲0.0252.35 ▼3.24
Posts /wp-admin/edit.php3.38 ▲0.0250.87 ▼0.36
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.13 ▼6.27
Media Library /wp-admin/upload.php3.25 ▲0.0238.53 ▲0.15
Offline Shell /wp-admin/options-general.php?page=offline-shell-options3.2233.12

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 11 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
offline_shell_race_enabled
offline_shell_files
offline_shell_version
offline_shell_enabled
offline_shell_debug
widget_theysaidso_widget
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Offline Shell
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.25 ▼0.422.08 ▲0.2743.14 ▼1.84
Dashboard /wp-admin2,193 ▲225.54 ▼0.0491.16 ▼10.7639.87 ▼8.24
Posts /wp-admin/edit.php2,104 ▲42.16 ▲0.1339.26 ▲0.7635.52 ▼1.61
Add New Post /wp-admin/post-new.php1,529 ▲123.63 ▲0.56700.78 ▲85.7256.38 ▼19.27
Media Library /wp-admin/upload.php1,398 ▼24.24 ▲0.1097.57 ▼5.9243.98 ▼2.28
Offline Shell /wp-admin/options-general.php?page=offline-shell-options4,0821.7036.6175.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/offline-shell/wp-offline-shell-main.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/offline-shell/wp-offline-shell.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/offline-shell/wp-offline-shell-admin.php:3

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === offline-shell === )
The official readme.txt is a good inspiration

offline-shell/wp-offline-shell.php 92% from 13 tests

Analyzing the main PHP file in "Offline Shell" version 0.4.0
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("offline-shell.php" instead of "wp-offline-shell.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,189 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP14198284880
JavaScript32235146
Markdown141097
JSON30061
Bourne Shell1005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity13.33
▷ Minimum class complexity2.00
▷ Maximum class complexity46.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods71
▷ Static methods1521.13%
▷ Public methods6185.92%
▷ Protected methods00.00%
▷ Private methods1014.08%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected