10% smcountdown

Code Review | SM CountDown Widget

WordPress plugin SM CountDown Widget scored 10% from 53 tests.

About plugin

  • Plugin page: smcountdown
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 5.8.1
  • First release: May 19, 2014
  • Latest release: Jun 9, 2015
  • Number of updates: 10
  • Update frequency: every 39.0 days
  • Top authors: sierramike (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

40+ active / 2,134 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/smcountdown/smcountdown-widget.php+37
    Methods with the same name as their class will not be constructors in a future version of PHP; smcountdown_widget_Widget has a deprecated constructor

Server metrics [RAM: ▼1.64MB] [CPU: ▼295.74ms] Passed 4 tests

Server-side resources used by SM CountDown Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.98 ▼0.7413.54 ▼11.08
Dashboard /wp-admin2.01 ▼1.0515.03 ▼32.99
Posts /wp-admin/edit.php2.01 ▼1.109.60 ▼33.31
Add New Post /wp-admin/post-new.php2.01 ▼3.429.95 ▼1,088.42
Media Library /wp-admin/upload.php2.01 ▼1.008.99 ▼28.22

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 1 new option
New WordPress options
widget_smcountdown_widget

Browser metrics Passed 4 tests

Checking browser requirements for SM CountDown Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,819 ▲21316.35 ▲0.7111.99 ▲2.8844.67 ▼2.43
Dashboard /wp-admin2,963 ▲1106.13 ▲0.26132.33 ▲1.47105.94 ▲2.89
Posts /wp-admin/edit.php2,710 ▲42.70 ▲0.0166.14 ▼1.8292.21 ▼0.44
Add New Post /wp-admin/post-new.php1,857 ▲20418.82 ▲0.17353.38 ▲5.30107.16 ▼4.69
Media Library /wp-admin/upload.php1,779 ▲45.01 ▼0.01142.34 ▼5.00114.37 ▲0.50

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in smcountdown_widget_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_smcountdown_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smcountdown/smcountdown-widget.php:37

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: timer, countdown, launch, widget

smcountdown/smcountdown-widget.php 85% from 13 tests

The main file in "SM CountDown Widget" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("smcountdown.php" instead of "smcountdown-widget.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin409 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2042180
CSS18178
PO File2141478
PHP1253973

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.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 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
timer-bg.png0.26KB0.61KB0.00%