84% logo-switcher

Code Review | Logo Switcher

WordPress plugin Logo Switcher scored84%from 54 tests.

About plugin

  • Plugin page: logo-switcher
  • Plugin version: 2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Aug 1, 2016
  • Latest release: Jun 25, 2020
  • Number of updates: 132
  • Update frequency: every 10.8 days
  • Top authors: leanderiversen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /26,667 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.21ms] Passed 4 tests

A check of server-side resources used by Logo Switcher
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.58 ▲4.17
Dashboard /wp-admin3.32 ▲0.0244.05 ▼1.17
Posts /wp-admin/edit.php3.37 ▲0.0145.92 ▲1.53
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.35 ▼12.48
Media Library /wp-admin/upload.php3.24 ▲0.0133.45 ▼0.73
Logo Switcher /wp-admin/options-general.php?page=logo_switcher3.1828.60

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Logo Switcher
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7513.13 ▼1.242.07 ▲0.4445.03 ▲1.45
Dashboard /wp-admin2,207 ▲155.81 ▲0.9097.88 ▼6.5038.56 ▼4.21
Posts /wp-admin/edit.php2,093 ▲42.12 ▲0.0740.21 ▲4.1334.99 ▲0.62
Add New Post /wp-admin/post-new.php1,525 ▲323.33 ▲0.08635.64 ▼2.4157.19 ▲8.93
Media Library /wp-admin/upload.php1,392 ▲44.18 ▼0.0094.57 ▼4.5642.07 ▲0.02
Logo Switcher /wp-admin/options-general.php?page=logo_switcher7992.0224.7526.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=logo_switcher
    • > Notice in wp-content/plugins/logo-switcher/inc/plugin.php+89
    Trying to access array offset on value of type bool

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (This is where you upload the logo you want to use), #2 (This is where you change the settings of the plugin to suite your needs)
The official readme.txt might help

logo-switcher/logo-switcher.php 92% from 13 tests

"Logo Switcher" version 2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 286 characters long)

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
There were no executable files found in this plugin510 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PO File57279317
PHP564107193

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.50
▷ Minimum class complexity4.00
▷ Maximum class complexity13.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods13
▷ Static methods646.15%
▷ Public methods1292.31%
▷ Protected methods00.00%
▷ Private methods17.69%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.15MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png43.68KB9.12KB▼ 79.12%
screenshot-2.png107.81KB41.38KB▼ 61.62%