78% random-theme

Code Review | Random Theme

WordPress plugin Random Theme scored78%from 54 tests.

About plugin

  • Plugin page: random-theme
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9.5
  • WordPress version: 6.3.1
  • First release: May 12, 2018
  • Latest release: May 14, 2018
  • Number of updates: 8
  • Update frequency: every 0.3 days
  • Top authors: wpamanuke (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,340 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▲2.99ms] Passed 4 tests

A check of server-side resources used by Random Theme
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5475.54 ▲31.76
Dashboard /wp-admin3.99 ▲0.6459.38 ▼7.41
Posts /wp-admin/edit.php3.42 ▲0.0651.22 ▼0.72
Add New Post /wp-admin/post-new.php5.90 ▲0.01106.35 ▲10.81
Media Library /wp-admin/upload.php3.29 ▲0.0645.91 ▲9.28
Editor /wp-admin/site-editor.php5.9492.10

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Random Theme
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.26 ▲0.912.80 ▼1.4014.61 ▼30.60
Dashboard /wp-admin2,182 ▲55.63 ▲0.0390.31 ▼0.6638.18 ▼1.25
Posts /wp-admin/edit.php2,100 ▲32.00 ▼0.0439.59 ▲1.0136.60 ▼0.44
Add New Post /wp-admin/post-new.php1,514 ▼1220.59 ▼3.00648.63 ▼66.0548.07 ▼8.39
Media Library /wp-admin/upload.php1,403 ▼04.16 ▼0.0299.01 ▼9.7847.26 ▲0.51
Editor /wp-admin/site-editor.php7,95217.82903.4136.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • 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
Even though everything seems fine, this is not 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_themes() in wp-content/plugins/random-theme/random-theme.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/site-editor.php
    • > Network (severe)
    index.php/wp-json/wp/v2/global-styles/themes/twentytwentythree/variations?_locale=user - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: theme switcher, showcase, random theme, preview, theme preview...

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

"Random Theme" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 235 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected41 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1171041

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected