84% christmas-decorations

Code Review | Christmas Decorations

WordPress plugin Christmas Decorationsscored84%from 54 tests.

About plugin

  • Plugin page: christmas-decorat...
  • Plugin version: 01.04.01
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.0-5.8.2
  • WordPress version: 6.3.1
  • First release: Sep 19, 2015
  • Latest release: Nov 28, 2021
  • Number of updates: 32
  • Update frequency: every 70.7 days
  • Top authors: siddharthsingh91 (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active /7,426 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼13.27ms] Passed 4 tests

Analyzing server-side resources used by Christmas Decorations
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0437.34 ▼15.05
Dashboard /wp-admin3.34 ▲0.0347.46 ▼11.73
Posts /wp-admin/edit.php3.39 ▲0.0349.81 ▼2.84
Add New Post /wp-admin/post-new.php5.92 ▲0.0385.22 ▼20.84
Media Library /wp-admin/upload.php3.26 ▲0.0332.58 ▼5.46

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Christmas Decorations
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,365 ▲60413.44 ▼0.7512.84 ▲10.6853.28 ▲12.16
Dashboard /wp-admin2,195 ▲185.67 ▲0.1294.42 ▼1.2737.86 ▼9.35
Posts /wp-admin/edit.php2,097 ▼02.03 ▲0.0539.56 ▲1.1034.16 ▲1.77
Add New Post /wp-admin/post-new.php1,537 ▲918.17 ▼4.95655.07 ▼49.7386.24 ▲19.33
Media Library /wp-admin/upload.php1,400 ▲64.20 ▼0.03103.84 ▼3.5340.23 ▼4.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/christmas-decorations/html_container.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/christmas-decorations/html_container.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/christmas-decorations/including_js_css.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === Christmas Decorations=== )
You can take inspiration from this readme.txt

christmas-decorations/index.php 92% from 13 tests

The main file in "Christmas Decorations" v. 01.04.01 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("christmas-decorations.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin215 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3232394
PHP381282
CSS113039

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.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
1 PNG file occupies 0.17MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/christmas.png176.34KB116.38KB▼ 34.00%