84% random-happiness

Code Review | Random Happiness

WordPress plugin Random Happiness scored84%from 54 tests.

About plugin

  • Plugin page: random-happiness
  • Plugin version: 1.0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3
  • WordPress version: 6.3.1
  • First release: Sep 23, 2014
  • Latest release: Aug 8, 2015
  • Number of updates: 12
  • Update frequency: every 26.6 days
  • Top authors: greghl (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /968 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.01MB] [CPU: ▼4.87ms] Passed 4 tests

A check of server-side resources used by Random Happiness
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.57 ▼9.58
Dashboard /wp-admin3.32 ▲0.0145.17 ▼2.52
Posts /wp-admin/edit.php3.37 ▲0.0149.19 ▲4.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0196.27 ▼9.94
Media Library /wp-admin/upload.php3.24 ▲0.0136.94 ▲2.56

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

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

Browser metrics Passed 4 tests

Random Happiness: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.23 ▼1.051.67 ▼0.1540.73 ▲0.25
Dashboard /wp-admin2,214 ▲264.85 ▼0.02108.42 ▼0.9040.41 ▲1.43
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0539.58 ▲5.6236.21 ▼2.11
Add New Post /wp-admin/post-new.php1,592 ▲5922.49 ▼0.54654.84 ▼24.1358.36 ▲1.68
Media Library /wp-admin/upload.php1,396 ▲114.14 ▼0.1096.87 ▼8.5543.80 ▼0.36

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/random-happiness/random_happiness.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (random happiness) image required
You can take inspiration from this readme.txt

random-happiness/random_happiness.php 92% from 13 tests

Analyzing the main PHP file in "Random Happiness" version 1.0.3.2
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("random-happiness.php" instead of "random_happiness.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin203 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP71880203

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
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%
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
PNG images were not found in this plugin