79% offcanvas-menu

Code Review | Offcanvas Mobile Menu

WordPress plugin Offcanvas Mobile Menu scored79%from 54 tests.

About plugin

  • Plugin page: offcanvas-menu
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: May 26, 2022
  • Latest release: Oct 18, 2023
  • Number of updates: 17
  • Update frequency: every 30.0 days
  • Top authors: enweby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /955 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▲4.15ms] Passed 4 tests

This is a short check of server-side resources used by Offcanvas Mobile Menu
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1949.71 ▲4.59
Dashboard /wp-admin3.90 ▲0.5557.94 ▼4.99
Posts /wp-admin/edit.php3.95 ▲0.5958.16 ▲8.02
Add New Post /wp-admin/post-new.php6.49 ▲0.60120.34 ▲22.73
Media Library /wp-admin/upload.php3.77 ▲0.5347.68 ▲8.97
Offcanvas Menu /wp-admin/admin.php?page=offcanvas-menu&page=offcanvas-menu3.7645.04

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

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

Browser metrics Passed 4 tests

Offcanvas Mobile Menu: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲21313.60 ▼0.7511.54 ▲9.8742.14 ▲3.29
Dashboard /wp-admin2,221 ▲445.63 ▼0.0284.71 ▼10.1443.75 ▲2.34
Posts /wp-admin/edit.php2,123 ▲202.03 ▲0.0534.66 ▼7.8634.03 ▼0.54
Add New Post /wp-admin/post-new.php1,556 ▲3023.18 ▼0.01604.12 ▼8.6849.14 ▲4.57
Media Library /wp-admin/upload.php1,420 ▲234.25 ▲0.0798.37 ▼5.2741.66 ▼2.07
Offcanvas Menu /wp-admin/admin.php?page=offcanvas-menu&page=offcanvas-menu2,0264.4278.9783.24

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/offcanvas-menu/admin/index.php
    • > /wp-content/plugins/offcanvas-menu/includes/index.php
    • > /wp-content/plugins/offcanvas-menu/admin/partials/oc-main-menu.php
    • > /wp-content/plugins/offcanvas-menu/public/partials/offcanvas-menu-public-display.php
    • > /wp-content/plugins/offcanvas-menu/index.php
    • > /wp-content/plugins/offcanvas-menu/public/index.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/offcanvas-menu/admin/partials/offcanvas-menu-admin-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: off-canvas menu, responsive mobile menu, offcanvas menu, wordpress mobile menu, offcanvas mobile menu...

offcanvas-menu/offcanvas-menu.php Passed 13 tests

The principal PHP file in "Offcanvas Mobile Menu" v. 1.0.3 is loaded by WordPress automatically on each request
74 characters long description:
Lightweight plugin to display offcanvas mobile menu on WordPress websites.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,600 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP165741,1151,844
CSS33511476
Markdown1140191
JavaScript42310469
SVG10120

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity109.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods134
▷ Static methods107.46%
▷ Public methods12190.30%
▷ Protected methods32.24%
▷ Private methods107.46%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants5
▷ Global constants5100.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
10 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/plugin-icon.png9.43KB4.92KB▼ 47.80%
admin/images/enweby-logo-black.png3.26KB2.57KB▼ 21.23%
admin/images/epqv-128x128.png4.87KB2.96KB▼ 39.10%
admin/images/enweby-logo-grey.png3.26KB2.58KB▼ 20.73%
admin/images/hfch-128x128.png3.93KB2.60KB▼ 34.00%