84% yith-maintenance-mode

Code Review | YITH Maintenance Mode

WordPress plugin YITH Maintenance Mode scored84%from 54 tests.

About plugin

  • Plugin page: yith-maintenance-...
  • Plugin version: 1.9.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: May 30, 2013
  • Latest release: Nov 13, 2023
  • Number of updates: 62
  • Update frequency: every 61.6 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

7,000+ active /268,078 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 gracefully, with no errors

Server metrics [RAM: ▲0.24MB] [CPU: ▼7.93ms] Passed 4 tests

A check of server-side resources used by YITH Maintenance Mode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2036.39 ▼5.97
Dashboard /wp-admin3.56 ▲0.2246.87 ▼14.47
Posts /wp-admin/edit.php3.68 ▲0.3251.15 ▲1.66
Add New Post /wp-admin/post-new.php6.15 ▲0.2582.91 ▼12.93
Media Library /wp-admin/upload.php3.51 ▲0.2736.57 ▲2.48
Maintenance Mode /wp-admin/themes.php?page=yith-maintenance-mode3.5238.28

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 94 new files
Database: no new tables, 50 new options
New WordPress options
yith_maintenance_socials_skype
yith_maintenance_newsletter_submit_background
yith_maintenance_newsletter_submit_background_hover
yith_maintenance_newsletter_email_label
yith_maintenance_socials_facebook
yith_maintenance_mascotte
can_compress_scripts
yith_maintenance_newsletter_submit_label
yith_maintenance_newsletter_email_name
yith_maintenance_background_color
...

Browser metrics Passed 4 tests

An overview of browser requirements for YITH Maintenance Mode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7214.34 ▲0.092.04 ▲0.3338.63 ▼5.18
Dashboard /wp-admin2,202 ▲225.64 ▼0.0493.53 ▼1.0539.05 ▼1.08
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0440.47 ▲0.6736.15 ▼1.44
Add New Post /wp-admin/post-new.php1,529 ▲323.20 ▲0.32634.49 ▲42.4751.36 ▲4.54
Media Library /wp-admin/upload.php1,407 ▲104.17 ▼0.08100.58 ▲3.9240.95 ▲0.91
Maintenance Mode /wp-admin/themes.php?page=yith-maintenance-mode1,8433.8875.3837.31

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 does not fully uninstall, leaving 50 options in the database
    • yith_maintenance_background_attachment
    • yith_maintenance_socials_dribble
    • yith_maintenance_socials_youtube
    • yith_maintenance_newsletter_submit_font
    • yith_maintenance_logo_tagline
    • yith_maintenance_socials_tumblr
    • yith_maintenance_enable_newsletter_form
    • can_compress_scripts
    • yith_maintenance_background_image
    • yith_maintenance_roles
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, 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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/yith-maintenance-mode/templates/maintenance-skin2.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/yith-maintenance-mode/templates/maintenance-skin3.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yith-maintenance-mode/yit-common/yit-functions.php:156
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/yith-maintenance-mode/templates/maintenance.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/yith-maintenance-mode/templates/maintenance-skin4.php:39

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)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: maintenance page, construction, maintenance, wordpress maintenance mode, yith

yith-maintenance-mode/init.php 92% from 13 tests

The main PHP script in "YITH Maintenance Mode" version 1.9.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("yith-maintenance-mode.php" instead of "init.php")

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 detected4,132 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP172655832,054
CSS522923980
JSON200438
PO File1146149356
JavaScript15126275
XML10029

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity17.00
▷ Minimum class complexity2.00
▷ Maximum class complexity43.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods2488.89%
▷ Protected methods311.11%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
60 compressed PNG files occupy 2.69MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/skin4/socials/facebook.png2.10KB2.09KB0.46%
assets/images/skin1/socials/skype.png2.32KB2.32KB0.21%
assets/images/skin4/separator2.png1.33KB0.68KB▼ 49.23%
assets/images/socials/skype.png2.32KB2.32KB0.21%
assets/images/skin1/socials/twitter.png2.14KB2.14KB0.14%