78% cut-the-lights

Code Review | Cut The Lights

WordPress plugin Cut The Lights scored78%from 54 tests.

About plugin

  • Plugin page: cut-the-lights
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.0
  • WordPress version: 6.3.1
  • First release: May 4, 2022
  • Latest release: Jun 13, 2022
  • Number of updates: 16
  • Update frequency: every 2.6 days
  • Top authors: giuliogulizia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,909 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.27ms] Passed 4 tests

A check of server-side resources used by Cut The Lights
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.91 ▲2.68
Dashboard /wp-admin3.32 ▼0.0244.75 ▼15.48
Posts /wp-admin/edit.php3.37 ▲0.0246.11 ▼1.84
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.15 ▼6.45
Media Library /wp-admin/upload.php3.24 ▲0.0236.76 ▲3.95

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Cut The Lights
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.99 ▼0.287.59 ▲5.6937.83 ▼6.75
Dashboard /wp-admin2,240 ▲494.87 ▼0.98102.66 ▲5.6339.16 ▼4.99
Posts /wp-admin/edit.php2,123 ▲342.02 ▲0.0340.81 ▼1.2636.79 ▼0.96
Add New Post /wp-admin/post-new.php1,561 ▲3318.07 ▼0.19589.51 ▼37.5653.01 ▼10.01
Media Library /wp-admin/upload.php1,425 ▲374.25 ▲0.0699.51 ▲2.1041.34 ▼0.95

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cut-the-lights/public/partials/lights-off-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cut-the-lights/admin/partials/lights-off-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 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt might help

cut-the-lights/lights-off.php 85% from 13 tests

"Cut The Lights" version 1.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cut-the-lights.php" instead of "lights-off.php")

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
Good job! No executable or dangerous file extensions detected4,726 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
CSS105462343,483
Sass1022313815
PHP12159588420
JavaScript24546
SVG2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.29
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.30
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/cutowl-dark.png2.54KB1.47KB▼ 42.19%
assets/cutowl-light.png2.87KB1.50KB▼ 47.84%