78% advent-calender

Code Review | Advent Calendar

WordPress plugin Advent Calendar scored 78% from 54 tests.

About plugin

  • Plugin page: advent-calender
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-6.1
  • WordPress version: 6.3.1
  • First release: Nov 29, 2013
  • Latest release: Nov 29, 2022
  • Number of updates: 34
  • Update frequency: every 96.7 days
  • Top authors: bassgang (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 9,770 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼3.39ms] Passed 4 tests

Analyzing server-side resources used by Advent Calendar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.40 ▼2.85
Dashboard /wp-admin3.37 ▲0.0752.90 ▼6.24
Posts /wp-admin/edit.php3.48 ▲0.1346.98 ▼1.54
Add New Post /wp-admin/post-new.php5.95 ▲0.0688.11 ▼2.91
Media Library /wp-admin/upload.php3.29 ▲0.0636.27 ▼0.11
Bulk creation /wp-admin/edit.php?post_type=acal_entry&page=acal-creation-tool3.2631.71
Advent calendar entries /wp-admin/edit.php?post_type=acal_entry3.3337.53

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

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

Browser metrics Passed 4 tests

Advent Calendar: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.32 ▼0.823.94 ▲2.1339.46 ▼5.10
Dashboard /wp-admin2,230 ▲485.83 ▲0.9399.35 ▼11.7239.17 ▼5.95
Posts /wp-admin/edit.php2,116 ▲272.06 ▲0.0533.55 ▼1.7035.23 ▼0.58
Add New Post /wp-admin/post-new.php1,556 ▲1423.48 ▲5.08684.26 ▲88.4261.66 ▲2.28
Media Library /wp-admin/upload.php1,415 ▲274.28 ▲0.0897.16 ▲2.3644.31 ▲1.04
Bulk creation /wp-admin/edit.php?post_type=acal_entry&page=acal-creation-tool7942.0624.9726.33
Advent calendar entries /wp-admin/edit.php?post_type=acal_entry1,0801.9831.8528.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/advent-calender/admin/views/bulk-creation-footer.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/advent-calender/public/views/shortcode-entry-published.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advent-calender/admin/views/bulk-creation-message.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advent-calender/public/views/single-advent-calendar-entry-custom.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_date() in wp-content/plugins/advent-calender/public/views/shortcode-entry-future.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/advent-calender/admin/views/admin.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advent-calender/admin/views/bulk-creation-form.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/advent-calender/public/views/single-advent-calendar-entry.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advent-calender/admin/views/bulk-creation-header.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: calendar, advent, christmas, flexible

advent-calender/advent-calendar.php 85% from 13 tests

The main PHP script in "Advent Calendar" version 1.0.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advent-calender.php" instead of "advent-calendar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin401 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP14145392381
CSS12020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity11.50
▷ Minimum class complexity6.00
▷ Maximum class complexity17.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods736.84%
▷ Public methods1473.68%
▷ Protected methods00.00%
▷ Private methods526.32%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
There are no PNG files in this plugin