83% lightning-advanced-unit

Code Review | Lightning Advanced Unit

WordPress plugin Lightning Advanced Unit scored83%from 54 tests.

About plugin

  • Plugin page: lightning-advance...
  • Plugin version: 3.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-4.9.5
  • WordPress version: 6.3.1
  • First release: Jun 12, 2016
  • Latest release: Jan 4, 2022
  • Number of updates: 83
  • Update frequency: every 24.5 days
  • Top authors: kurudrive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

5,000+ active /207,919 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.00MB] [CPU: ▼4.29ms] Passed 4 tests

This is a short check of server-side resources used by Lightning Advanced Unit
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.66 ▼0.02
Dashboard /wp-admin3.31 ▲0.0046.36 ▼0.93
Posts /wp-admin/edit.php3.36 ▲0.0043.60 ▼3.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.76 ▼13.06
Media Library /wp-admin/upload.php3.23 ▲0.0033.62 ▲0.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Lightning Advanced Unit: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.39 ▲0.161.79 ▲0.1245.79 ▲2.57
Dashboard /wp-admin2,192 ▲215.64 ▲0.0897.38 ▲6.8942.88 ▲3.07
Posts /wp-admin/edit.php2,097 ▼32.01 ▼0.0133.76 ▼3.6333.45 ▼1.43
Add New Post /wp-admin/post-new.php1,526 ▼222.95 ▼0.21652.24 ▼68.1055.64 ▼3.14
Media Library /wp-admin/upload.php1,400 ▲64.14 ▼0.0994.69 ▼6.3646.55 ▲0.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

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 everything seems fine, this is not an exhaustive test

SRP 50% 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 fix the following
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightning-advanced-unit/inc/sidebar-child-list-hidden.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightning-advanced-unit/inc/vk-mobile-nav/class-vk-mobile-nav.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightning-advanced-unit/inc/sidebar-fix/sidebar-fix.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/lightning-advanced-unit/inc/navigation/navigation.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lightning-advanced-unit/inc/navi-common.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightning-advanced-unit/inc/vk-mobile-nav/class-vk-mobile-nav.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/lightning-advanced-unit/lightning_advanced_unit.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightning-advanced-unit/inc/sidebar-position.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/lightning-advanced-unit/inc/widgets/widget-new-posts.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightning-advanced-unit/inc/widgets/widget-full-wide-title.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === lightning-advanced-unit === )
  • Donate link: Invalid url: ""
You can look at the official readme.txt

lightning-advanced-unit/lightning_advanced_unit.php 85% from 13 tests

This is the main PHP file of "Lightning Advanced Unit" version 3.4.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("lightning-advanced-unit.php" instead of "lightning_advanced_unit.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected6,901 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
JSON2005,051
PHP11133204824
JavaScript9132234439
Sass114510352
PO File14301,046154
SVG60658
Ruby20415
CSS6105
Markdown1203

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity24.67
▷ Minimum class complexity8.00
▷ Maximum class complexity33.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods22
▷ Static methods940.91%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions2191.30%
▷ Anonymous functions28.70%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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