84% set-no-sleep-for-ios

Code Review | Set No sleep For IOS

WordPress plugin Set No sleep For IOS scored84%from 54 tests.

About plugin

  • Plugin page: set-no-sleep-for-ios
  • Plugin version: 1.10.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 6.3.1
  • First release: Jul 10, 2020
  • Latest release: Jul 10, 2020
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mhrnmhrn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /386 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Set No sleep For IOS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.87 ▲0.64
Dashboard /wp-admin3.32 ▲0.0247.39 ▼2.79
Posts /wp-admin/edit.php3.37 ▲0.0250.38 ▼2.27
Add New Post /wp-admin/post-new.php5.90 ▲0.0299.36 ▼2.15
Media Library /wp-admin/upload.php3.24 ▲0.0238.79 ▼3.41

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
widget_nosleep_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Set No sleep For IOS
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.19 ▼1.125.14 ▲3.2544.13 ▼4.04
Dashboard /wp-admin2,206 ▲204.88 ▼0.07111.27 ▼6.8643.59 ▲0.69
Posts /wp-admin/edit.php2,092 ▼01.99 ▼0.0138.37 ▼3.7234.93 ▼1.64
Add New Post /wp-admin/post-new.php1,535 ▼823.28 ▲5.07616.65 ▼49.2052.59 ▼2.75
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0798.14 ▼13.6445.40 ▼7.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_nosleep_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/set-no-sleep-for-ios/includes/no-sleep-scripts.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/set-no-sleep-for-ios/includes/no-sleep-class.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

set-no-sleep-for-ios/no-sleep.php 92% from 13 tests

"Set No sleep For IOS" version 1.10.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("set-no-sleep-for-ios.php" instead of "no-sleep.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
Everything looks great! No dangerous files found in this plugin237 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript12448168
PHP4224169

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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