83% toys-for-playground

Code Review | Toys for Playground

WordPress plugin Toys for Playground scored83%from 54 tests.

About plugin

  • Plugin page: toys-for-playground
  • Plugin version: 1.1.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Sep 3, 2023
  • Latest release: Oct 10, 2023
  • Number of updates: 18
  • Update frequency: every 2.1 days
  • Top authors: Marc4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼6.08ms] Passed 4 tests

This is a short check of server-side resources used by Toys for Playground
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0241.00 ▲4.31
Dashboard /wp-admin3.33 ▲0.0345.65 ▼2.47
Posts /wp-admin/edit.php3.39 ▲0.0348.15 ▲0.09
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.10 ▼21.00
Media Library /wp-admin/upload.php3.26 ▲0.0335.67 ▼0.95
/wp-admin/admin.php?page=toys-cloner3.2834.27
/wp-admin/admin.php?page=toys-generator3.2632.69

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Toys for Playground
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.24 ▲1.061.69 ▼2.5439.79 ▲0.45
Dashboard /wp-admin2,211 ▲345.51 ▼0.1682.38 ▼7.4438.42 ▲0.07
Posts /wp-admin/edit.php2,116 ▲162.03 ▲0.0540.17 ▲3.7435.70 ▼2.82
Add New Post /wp-admin/post-new.php1,541 ▲723.40 ▲5.18675.49 ▲21.6652.94 ▼13.35
Media Library /wp-admin/upload.php1,416 ▲164.20 ▲0.01100.27 ▲2.1043.63 ▼1.07
/wp-admin/admin.php?page=toys-cloner1,0182.1623.1128.82
/wp-admin/admin.php?page=toys-generator9841.9922.3329.29

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/toys-for-playground/sharer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/toys-for-playground/generator.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/toys-for-playground/cloner.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

toys-for-playground/toys-for-playground.php 85% from 13 tests

"Toys for Playground" version 1.1.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.9" instead of "5.6")
  • Description: Please keep the plugin description shorter than 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin542 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP510154500
JavaScript25842

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin