79% us-debt-clock-widget

Code Review | U.S. Debt Clock Widget

WordPress plugin U.S. Debt Clock Widget scored79%from 54 tests.

About plugin

  • Plugin page: us-debt-clock-widget
  • Plugin version: 1.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-6.0
  • WordPress version: 6.3.1
  • First release: Nov 2, 2014
  • Latest release: Jun 26, 2022
  • Number of updates: 43
  • Update frequency: every 65.0 days
  • Top authors: ChrisHardie (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,467 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.32ms] Passed 4 tests

An overview of server-side resources used by U.S. Debt Clock Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.09 ▼1.31
Dashboard /wp-admin3.32 ▼0.0349.65 ▼10.31
Posts /wp-admin/edit.php3.37 ▲0.0146.87 ▼0.78
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.87 ▼20.86
Media Library /wp-admin/upload.php3.24 ▲0.0137.69 ▲0.03

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_us_debtclock_widget

Browser metrics Passed 4 tests

U.S. Debt Clock Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.35 ▼0.021.72 ▼0.1845.94 ▼0.06
Dashboard /wp-admin2,192 ▲125.48 ▼0.1786.27 ▼7.8035.54 ▼3.97
Posts /wp-admin/edit.php2,097 ▼02.00 ▼0.0335.93 ▼2.1434.82 ▼2.52
Add New Post /wp-admin/post-new.php1,528 ▲223.27 ▲0.36654.95 ▼32.8754.59 ▼12.32
Media Library /wp-admin/upload.php1,394 ▼64.23 ▲0.0897.85 ▼13.8443.92 ▼3.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_us_debtclock_widget
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/us-debt-clock-widget/us-debt-clock-widget.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/us-debt-clock-widget/tests/bootstrap.php on line 6
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/us-debt-clock-widget/tests/bootstrap.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/us-debt-clock-widget/tests/test-us-debtclock-widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
6 plugin tags: finance, widgets, money, economy, government...

us-debt-clock-widget/us-debt-clock-widget.php Passed 13 tests

"U.S. Debt Clock Widget" version 1.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
42 characters long description:
Display the U.S. national debt in a widget

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin303 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP38080206
Bourne Shell115459
XML10014
CSS12012
YAML14012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity10.67
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png29.08KB9.50KB▼ 67.32%
screenshot-1.png11.23KB4.10KB▼ 63.50%