83% theme-roulette

Code Review | Theme Roulette

WordPress plugin Theme Roulette scored83%from 54 tests.

About plugin

  • Plugin page: theme-roulette
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.5
  • WordPress version: 6.3.1
  • First release: Apr 3, 2015
  • Latest release: Sep 23, 2020
  • Number of updates: 16
  • Update frequency: every 125.0 days
  • Top authors: adamsilverstein (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,117 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.00ms] Passed 4 tests

Analyzing server-side resources used by Theme Roulette
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0338.15 ▲2.33
Dashboard /wp-admin3.33 ▼0.0146.61 ▼14.88
Posts /wp-admin/edit.php3.38 ▲0.0346.19 ▲2.44
Add New Post /wp-admin/post-new.php5.91 ▲0.0381.08 ▼9.90
Media Library /wp-admin/upload.php4.00 ▲0.7742.85 ▲10.34

Server storage [IO: ▲1.90MB] [DB: ▲0.04MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 9 new options
New WordPress options
theme_switched
theme_mods_twentytwentythree
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
current_theme
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Theme Roulette
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲16213.37 ▼0.868.15 ▲6.4842.62 ▼1.01
Dashboard /wp-admin2,200 ▲195.54 ▼0.1290.07 ▼9.7236.49 ▼2.00
Posts /wp-admin/edit.php2,108 ▲262.03 ▼0.0144.14 ▲9.2543.29 ▲3.94
Add New Post /wp-admin/post-new.php1,532 ▲623.69 ▲0.54690.71 ▲17.1559.77 ▼5.67
Media Library /wp-admin/upload.php1,392 ▼84.19 ▼0.00101.57 ▲7.2043.65 ▲3.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.04MB] 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
  • The uninstall procedure has failed, leaving 9 options in the database
    • theme_mods_twentytwentythree
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theme_switched
    • widget_recent-posts
    • current_theme

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/theme-roulette/theme-roulette.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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:
  • Tags: No tags were detected
Please take inspiration from this readme.txt

theme-roulette/theme-roulette.php 92% from 13 tests

"Theme Roulette" version 1.0.9'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:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected5,189 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JSON2005,041
PHP13561109
JavaScript392137
Markdown1102
CSS1070

PHP code Passed 2 tests

Analyzing 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.20
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 1.71MB with 1.24MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png352.02KB94.98KB▼ 73.02%
assets/banner-1544x500.png1,400.09KB392.60KB▼ 71.96%