10% random-look

Code Review | Random Look

WordPress plugin Random Look scored10%from 54 tests.

About plugin

  • Plugin page: random-look
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-6.3
  • WordPress version: 6.3.1
  • First release: May 8, 2020
  • Latest release: Jul 22, 2023
  • Number of updates: 5
  • Update frequency: every 234.0 days
  • Top authors: shenyanzhi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /620 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/random-look/random-look.php+39
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.00MB] [CPU: ▼9.80ms] Passed 4 tests

An overview of server-side resources used by Random Look
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.29 ▼10.31
Dashboard /wp-admin3.31 ▼0.0348.06 ▼12.14
Posts /wp-admin/edit.php3.36 ▲0.0145.45 ▼3.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.10 ▼13.12
Media Library /wp-admin/upload.php3.23 ▲0.0134.54 ▼0.84
随便看看设置 /wp-admin/options-general.php?page=random-look/random-look.php3.2032.63

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
random_look_options

Browser metrics Passed 4 tests

An overview of browser requirements for Random Look
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.40 ▼0.182.14 ▲0.2145.01 ▲2.96
Dashboard /wp-admin2,210 ▲194.84 ▼0.06105.14 ▼12.6148.24 ▲2.93
Posts /wp-admin/edit.php2,093 ▲42.18 ▲0.1935.71 ▼3.2840.18 ▲1.58
Add New Post /wp-admin/post-new.php1,536 ▲2223.02 ▲5.63632.28 ▼47.0274.38 ▲9.12
Media Library /wp-admin/upload.php1,386 ▼24.17 ▼0.0097.96 ▲0.8746.67 ▼0.24
随便看看设置 /wp-admin/options-general.php?page=random-look/random-look.php8282.0224.9567.74

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/random-look/random-look.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% 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 to be fixed:
  • Screenshots: Please add an image for screenshot #1 (screenshot-1.png)
You can take inspiration from this readme.txt

random-look/random-look.php Passed 13 tests

This is the main PHP file of "Random Look" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
90 characters long description:
添加随便看看,顾名思义就是随机给出文章来看看,很小但很实用。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin133 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2129113
Markdown116020

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.04MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
(invalid) screenshot-1.png36.97KB0.00KB▼ 100.00%