67% wordpress-countdown-widget

Code Review | Wordpress Countdown Widget

WordPress plugin Wordpress Countdown Widget scored 67% from 54 tests.

About plugin

  • Plugin page: wordpress-countdo...
  • Plugin version: 3.1.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4.1
  • WordPress version: 5.9.2
  • First release: Oct 5, 2010
  • Latest release: May 10, 2020
  • Number of updates: 107
  • Update frequency: every 34.8 days
  • Top authors: mattsay (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

10,000+ active / 187,490 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.08MB] [CPU: ▼334.03ms] Passed 4 tests

Analyzing server-side resources used by Wordpress Countdown Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2057.50 ▲4.11
Dashboard /wp-admin3.25 ▼0.1622.71 ▼14.09
Posts /wp-admin/edit.php3.25 ▼0.3917.71 ▼20.62
Add New Post /wp-admin/post-new.php3.25 ▼3.7218.63 ▼1,294.08
Media Library /wp-admin/upload.php3.25 ▼0.0423.05 ▼7.31
Countdown Widget /wp-admin/options-general.php?page=wp-countdown-widget3.2621.24

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 1 new option
New WordPress options
wp_countdown_widget

Browser metrics Passed 4 tests

Checking browser requirements for Wordpress Countdown Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,920 ▲17616.36 ▲0.769.53 ▲3.032.37 ▲0.16
Dashboard /wp-admin2,902 ▲366.16 ▼0.04124.30 ▼8.36164.73 ▲0.59
Posts /wp-admin/edit.php2,714 ▲203.26 ▲0.0372.26 ▲5.43192.21 ▲44.41
Add New Post /wp-admin/post-new.php1,680 ▼7215.88 ▼5.54437.55 ▼6.23159.60 ▲0.89
Media Library /wp-admin/upload.php1,722 ▲245.68 ▲0.15144.67 ▲5.48190.95 ▼36.59
Countdown Widget /wp-admin/options-general.php?page=wp-countdown-widget1,4632.5858.60208.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wordpress-countdown-widget/countdown-widget.php+380
    Undefined index: page
  • Zombie WordPress options were found after uninstall: 1 option
    • wp_countdown_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-countdown-widget
    • > Notice in wp-content/plugins/wordpress-countdown-widget/countdown-widget.php+406
    Undefined index: action

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wordpress-countdown-widget/countdown-options-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wordpress-countdown-widget/countdown-shortcodes.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wordpress-countdown-widget/countdown-options.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wordpress-countdown-widget/countdown-shortcodes.php:44

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 86% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Use options page to edit time span labels)
You can look at the official readme.txt

wordpress-countdown-widget/countdown-widget.php 77% from 13 tests

The primary PHP file in "Wordpress Countdown Widget" version 3.1.7 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 218 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wordpress-countdown-widget.php" instead of "countdown-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin845 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP520239685
Markdown2360103
CSS213756
JavaScript1061

PHP code Passed 2 tests

This is a short overview 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.31
Average class complexity76.00
▷ Minimum class complexity76.00
▷ Maximum class complexity76.00
Average method complexity5.69
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png37.37KB20.04KB▼ 46.38%
css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
screenshot-2.png11.92KB6.67KB▼ 44.00%
screenshot-1.png37.82KB14.27KB▼ 62.27%