78% xmas-decoration

Code Review | Xmas Decoration

WordPress plugin Xmas Decoration scored 78% from 53 tests.

About plugin

  • Plugin page: xmas-decoration
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.3.2
  • WordPress version: 5.8.1
  • First release: Dec 15, 2015
  • Latest release: Nov 30, 2020
  • Number of updates: 17
  • Update frequency: every 106.9 days
  • Top authors: meohen1989 (100%)

Code review

53 tests

User reviews

8 reviews

Install metrics

100+ active / 21,658 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
Install script ran successfully

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

A check of server-side resources used by Xmas Decoration
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1940.76 ▲17.07
Dashboard /wp-admin3.06 ▲0.0136.62 ▼10.26
Posts /wp-admin/edit.php3.11 ▲0.0144.49 ▼2.04
Add New Post /wp-admin/post-new.php5.43 ▼0.0090.89 ▼1,039.26
Media Library /wp-admin/upload.php3.01 ▼0.0034.13 ▼4.75
Xmas Decoration /wp-admin/options-general.php?page=xmas_decoration3.0127.51

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 3 new options
New WordPress options
xmas_decoration_bar_type
xmas_decoration_body_date_range
xmas_decoration_body_padding_top

Browser metrics Passed 4 tests

A check of browser resources used by Xmas Decoration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,978 ▲1,37216.83 ▲1.3413.63 ▲4.3651.08 ▲1.68
Dashboard /wp-admin2,935 ▲856.00 ▲0.18132.02 ▲2.01106.29 ▲7.87
Posts /wp-admin/edit.php2,711 ▲52.69 ▼0.0066.35 ▼4.87101.07 ▲2.34
Add New Post /wp-admin/post-new.php1,580 ▼7118.41 ▲1.24341.91 ▼21.52114.01 ▲2.51
Media Library /wp-admin/upload.php1,777 ▲25.01 ▲0.01157.87 ▼3.59115.17 ▲0.84
Xmas Decoration /wp-admin/options-general.php?page=xmas_decoration1,4142.4761.2884.17

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 3 options in the database
    • xmas_decoration_body_date_range
    • xmas_decoration_bar_type
    • xmas_decoration_body_padding_top

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/xmas-decoration/xmas-decoration.php
    • > /wp-content/plugins/xmas-decoration/site/tmpl/default.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/xmas-decoration/admin/tmpl/default.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/xmas-decoration/site/tmpl/default.php:442

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Xmas Decoration)
You can take inspiration from this readme.txt

xmas-decoration/xmas-decoration.php Passed 13 tests

The primary PHP file in "Xmas Decoration" version 1.3 is used by WordPress to initiate all plugin functionality
32 characters long description:
This plugin adds Xmas Decoration

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected851 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP31711577
CSS1510263
JavaScript20711

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
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%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
site/assets/images/b-ball_i2.png4.04KB2.36KB▼ 41.47%
site/assets/images/b-ball_i3.png2.61KB1.83KB▼ 29.73%
site/assets/images/b-ball_i1.png4.89KB2.50KB▼ 48.98%
site/assets/images/b-ball_n7.png8.44KB3.01KB▼ 64.33%
site/assets/images/b-ball_n5.png4.41KB2.60KB▼ 41.09%