78% before-you-are-dead-countdown

Code Review | Before You Are Dead Countdown

WordPress plugin Before You Are Dead Countdown scored78%from 54 tests.

About plugin

  • Plugin page: before-you-are-de...
  • Plugin version: 1.5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0
  • WordPress version: 6.3.1
  • First release: Apr 8, 2014
  • Latest release: Nov 5, 2014
  • Number of updates: 57
  • Update frequency: every 3.7 days
  • Top authors: anou (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,192 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.57ms] Passed 4 tests

A check of server-side resources used by Before You Are Dead Countdown
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0839.05 ▼3.16
Dashboard /wp-admin3.40 ▲0.0546.91 ▼12.39
Posts /wp-admin/edit.php3.51 ▲0.1546.22 ▲2.81
Add New Post /wp-admin/post-new.php6.00 ▲0.1194.67 ▲4.50
Media Library /wp-admin/upload.php3.32 ▲0.0936.75 ▲2.47
BYAD Countdown /wp-admin/options-general.php?page=byad-countdown3.2832.26

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Before You Are Dead Countdown
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲7814.18 ▼0.501.76 ▼0.0738.99 ▼3.35
Dashboard /wp-admin2,228 ▲366.01 ▲1.06102.99 ▼11.9739.38 ▲1.19
Posts /wp-admin/edit.php2,111 ▲252.88 ▲0.8443.48 ▲9.2337.20 ▼0.90
Add New Post /wp-admin/post-new.php1,549 ▲3518.38 ▲0.73603.14 ▼74.5969.96 ▲14.62
Media Library /wp-admin/upload.php1,404 ▲195.25 ▲1.03110.07 ▲2.0542.23 ▼10.42
BYAD Countdown /wp-admin/options-general.php?page=byad-countdown7061.9613.8321.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_byadcd_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=byad-countdown
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/before-you-are-dead-countdown/templates/byad-settings-tpl.php on line 5 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/before-you-are-dead-countdown/templates/byad-settings-tpl.php(5): do_settings_fields()
    #1 wp-content/plugins/before-you-are-dead-countdown/byad-settings.php(234): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): Byad_Countdown_Settings->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/before-you-are-dead-countdown/byad-countdown.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/before-you-are-dead-countdown/byad-countdown_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/before-you-are-dead-countdown/templates/byad-settings-tpl.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: timer, action, javascript, counter, shortcode...

before-you-are-dead-countdown/byad-countdown.php 85% from 13 tests

"Before You Are Dead Countdown" version 1.5.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("before-you-are-dead-countdown.php" instead of "byad-countdown.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,347 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31668724
PHP475119299
PO File38997275
CSS18249

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity5.33
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods210.00%
▷ Public methods20100.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
6 PNG files occupy 0.12MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png112.92KB36.46KB▼ 67.71%
images/calendar.png0.88KB0.91KB0.00%
assets/banner-772x250.png4.61KB3.69KB▼ 19.88%
assets/screenshot-1.png4.61KB3.77KB▼ 18.22%
assets/screenshot-3.png4.54KB3.70KB▼ 18.57%