10% random-christmas-fact-widget

Code Review | Random Christmas Fact Widget

WordPress plugin Random Christmas Fact Widget scored10%from 54 tests.

About plugin

  • Plugin page: random-christmas-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 27, 2015
  • Latest release: Sep 23, 2023
  • Number of updates: 12
  • Update frequency: every 260.8 days
  • Top authors: monkeymays (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /2,940 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/random-christmas-fact-widget/randomtext.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; cw_randomtext has a deprecated constructor

Server metrics [RAM: ▼1.93MB] [CPU: ▼52.88ms] Passed 4 tests

Server-side resources used by Random Christmas Fact Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.404.64 ▼37.64
Dashboard /wp-admin2.09 ▼1.226.57 ▼47.34
Posts /wp-admin/edit.php2.09 ▼1.275.61 ▼41.76
Add New Post /wp-admin/post-new.php2.09 ▼3.807.73 ▼84.79
Media Library /wp-admin/upload.php2.09 ▼1.156.79 ▼28.70

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_cw_randomtext
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Random Christmas Fact Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.28 ▼0.301.65 ▲0.0143.10 ▼1.36
Dashboard /wp-admin2,189 ▲215.48 ▼0.0682.29 ▼21.0740.29 ▼5.18
Posts /wp-admin/edit.php2,103 ▲31.94 ▼0.0642.58 ▲8.6936.57 ▼1.25
Add New Post /wp-admin/post-new.php1,526 ▼023.44 ▲0.50666.24 ▲6.1950.83 ▼19.47
Media Library /wp-admin/upload.php1,400 ▲34.19 ▼0.0094.65 ▼16.0041.64 ▼7.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/random-christmas-fact-widget/randomtext.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; cw_randomtext has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_cw_randomtext
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/random-christmas-fact-widget/randomtext.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: christmas, santa claus, holiday, widget-only, widget...

random-christmas-fact-widget/randomtext.php 92% from 13 tests

The main PHP file in "Random Christmas Fact Widget" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("random-christmas-fact-widget.php" instead of "randomtext.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin83 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11044
PHP1212139

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin