78% holiday-logo-switcher

Code Review | Holiday Logo Switcher

WordPress plugin Holiday Logo Switcher scored78%from 54 tests.

About plugin

  • Plugin page: holiday-logo-swit...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.8.2
  • WordPress version: 6.3.1
  • First release: Jun 23, 2021
  • Latest release: Jan 3, 2022
  • Number of updates: 8
  • Update frequency: every 24.4 days
  • Top authors: multimedianj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /422 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▲0.83ms] Passed 4 tests

Analyzing server-side resources used by Holiday Logo Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0845.22 ▲0.89
Dashboard /wp-admin3.39 ▲0.0852.13 ▲3.88
Posts /wp-admin/edit.php3.50 ▲0.1451.63 ▼1.77
Add New Post /wp-admin/post-new.php5.97 ▲0.0893.10 ▲4.15
Media Library /wp-admin/upload.php3.31 ▲0.0837.00 ▲0.33
Holiday Logo Switcher /wp-admin/options-general.php?page=holiday-logo-switcher3.2835.93
All Items /wp-admin/edit.php?post_type=holiday_logos3.3538.45
Add New /wp-admin/post-new.php?post_type=holiday_logos3.3649.77

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Holiday Logo Switcher: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.27 ▼1.294.84 ▲2.7242.55 ▼0.51
Dashboard /wp-admin2,237 ▲495.88 ▲0.95100.07 ▼3.0542.83 ▲1.77
Posts /wp-admin/edit.php2,123 ▲371.99 ▼0.0241.44 ▲4.9535.44 ▼1.87
Add New Post /wp-admin/post-new.php1,572 ▲3618.48 ▼4.76655.38 ▲16.2452.54 ▼2.48
Media Library /wp-admin/upload.php1,419 ▲344.25 ▲0.07104.08 ▲0.9245.15 ▲1.53
Holiday Logo Switcher /wp-admin/options-general.php?page=holiday-logo-switcher8532.0524.3037.08
All Items /wp-admin/edit.php?post_type=holiday_logos1,0842.0133.1831.55
Add New /wp-admin/post-new.php?post_type=holiday_logos1,7073.6468.4932.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/holiday-logo-switcher/holiday-logo-switcher.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/holiday-logo-switcher/includes/views/options-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/holiday-logo-switcher/includes/views/mb-hls-options.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/holiday-logo-switcher/includes/views/cpt-holiday-logos.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/holiday-logo-switcher/includes/views/opt_fields/dark-logo.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/holiday-logo-switcher/includes/views/opt_fields/default-logo.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
These attributes need to be fixed: You can take inspiration from this readme.txt

holiday-logo-switcher/holiday-logo-switcher.php Passed 13 tests

"Holiday Logo Switcher" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
50 characters long description:
Display a different logo depending on the holiday.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin275 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP85083274
CSS1151

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods320.00%
▷ Public methods1493.33%
▷ Protected methods16.67%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/logo.png8.17KB3.39KB▼ 58.56%