84% cwidget-countdown

Code Review | CWidget Countdown

WordPress plugin CWidget Countdown scored84%from 54 tests.

About plugin

  • Plugin page: cwidget-countdown
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.0.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2013
  • Latest release: Feb 5, 2019
  • Number of updates: 19
  • Update frequency: every 100.3 days
  • Top authors: kaisercrazy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,857 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.75ms] Passed 4 tests

This is a short check of server-side resources used by CWidget Countdown
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.29 ▼4.39
Dashboard /wp-admin3.35 ▲0.0546.31 ▼2.29
Posts /wp-admin/edit.php3.40 ▲0.0543.83 ▼7.61
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.15 ▼16.69
Media Library /wp-admin/upload.php3.28 ▲0.0536.25 ▲2.63

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 65 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_cwidget_countdown
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for CWidget Countdown
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲17313.77 ▼0.416.93 ▲4.8442.28 ▼6.90
Dashboard /wp-admin2,209 ▲214.85 ▼0.07112.56 ▲7.1841.98 ▼2.75
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0333.87 ▼7.4534.56 ▼0.59
Add New Post /wp-admin/post-new.php1,533 ▲1923.58 ▲6.05675.97 ▲2.2961.54 ▲9.40
Media Library /wp-admin/upload.php1,391 ▲34.20 ▲0.0198.15 ▼8.5643.24 ▲0.04

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_cwidget_countdown

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cwidget-countdown/cwidget.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (The Widget), #2 (The Countdown!)
Please take inspiration from this readme.txt

cwidget-countdown/cwidget.php 92% from 13 tests

Analyzing the main PHP file in "CWidget Countdown" version 2.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cwidget-countdown.php" instead of "cwidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin857 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript500152517
PHP11823166
PO File44444149
CSS14125

PHP code Passed 2 tests

A short 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.17
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png12.38KB5.87KB▼ 52.56%
screenshot-2.png2.26KB1.20KB▼ 47.15%