73% smart-maintenance-countdown

Code Review | Smart Maintenance & Countdown

WordPress plugin Smart Maintenance & Countdown scored73%from 54 tests.

About plugin

  • Plugin page: smart-maintenance...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.5.3
  • WordPress version: 6.3.1
  • First release: Jan 27, 2014
  • Latest release: Nov 20, 2020
  • Number of updates: 16
  • Update frequency: every 155.6 days
  • Top authors: gmnazmul (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

800+ active /31,361 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.93MB] [CPU: ▼57.53ms] Passed 4 tests

Server-side resources used by Smart Maintenance & Countdown
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.405.81 ▼35.28
Dashboard /wp-admin2.09 ▼1.267.92 ▼59.75
Posts /wp-admin/edit.php2.09 ▼1.277.81 ▼43.07
Add New Post /wp-admin/post-new.php2.09 ▼3.809.55 ▼92.01
Media Library /wp-admin/upload.php2.09 ▼1.147.02 ▼25.76

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 76 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smart Maintenance & Countdown
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲14713.50 ▼0.778.71 ▲7.0342.12 ▲4.66
Dashboard /wp-admin2,210 ▲335.56 ▼0.1199.66 ▲15.1285.01 ▲40.68
Posts /wp-admin/edit.php2,118 ▲151.98 ▼0.0337.57 ▼4.2735.81 ▼1.47
Add New Post /wp-admin/post-new.php1,554 ▲2823.06 ▼0.02786.96 ▲92.8656.91 ▼1.58
Media Library /wp-admin/upload.php1,418 ▲184.18 ▼0.04102.77 ▼7.6667.07 ▲15.42

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_custom_page_data() in wp-content/plugins/smart-maintenance-countdown/templates/NoCountDown/index.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-maintenance-countdown/includes/admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_custom_page_data() in wp-content/plugins/smart-maintenance-countdown/templates/CountDown_1/index.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/smart-maintenance-countdown/index.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-maintenance-countdown/includes/view.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_custom_page_data() in wp-content/plugins/smart-maintenance-countdown/templates/CountDown_2/index.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.png. Note that this screenshot shows the admin section of this plugin.), #2 (This screen shot description corresponds to screenshot-2.png. Note that this screenshot shows the NoCountDown Template.), #3 (This screen shot description corresponds to screenshot-3.png. Note that this screenshot shows the CountDown_1 Template.), #4 (This screen shot description corresponds to screenshot-4.png. Note that this screenshot shows the CountDown_2 Template.)
You can take inspiration from this readme.txt

smart-maintenance-countdown/index.php 92% from 13 tests

The main PHP script in "Smart Maintenance & Countdown" version 1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("smart-maintenance-countdown.php" instead of "index.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
There were no executable files found in this plugin3,133 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
SVG10001,506
PHP68634578
JavaScript252142528
CSS35415521

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
23 PNG files occupy 0.63MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/NoCountDown/images/google.png6.65KB2.39KB▼ 64.08%
templates/CountDown_1/images/timer-piece.png2.80KB2.06KB▼ 26.27%
templates/NoCountDown/images/dust.png116.24KB74.78KB▼ 35.67%
screenshot-4.png34.76KB14.37KB▼ 58.65%
templates/NoCountDown/images/noise.png2.07KB1.02KB▼ 50.85%