83% funny-fruits

Code Review | Funny fruits

WordPress plugin Funny fruits scored83%from 54 tests.

About plugin

  • Plugin page: funny-fruits
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7
  • WordPress version: 6.3.1
  • First release: Mar 20, 2017
  • Latest release: Mar 20, 2017
  • Number of updates: 3
  • Update frequency: every 2.0 days
  • Top authors: oleksandr87 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,303 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Funny fruits
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.55 ▼0.24
Dashboard /wp-admin3.31 ▲0.0052.82 ▼1.32
Posts /wp-admin/edit.php3.36 ▲0.0048.81 ▼3.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.05 ▲3.11
Media Library /wp-admin/upload.php3.24 ▲0.0038.16 ▼0.46

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Funny fruits
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13613.36 ▼1.299.35 ▲7.6242.03 ▼2.37
Dashboard /wp-admin2,192 ▲185.54 ▼0.0787.35 ▼3.1939.46 ▼3.41
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.1440.60 ▲3.5836.20 ▲4.29
Add New Post /wp-admin/post-new.php1,529 ▲323.12 ▼0.02644.46 ▼7.2858.80 ▼1.42
Media Library /wp-admin/upload.php1,397 ▲34.22 ▲0.04100.78 ▼0.8443.82 ▼3.02

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/funny-fruits/funnyfruits.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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 your attention:
  • Screenshots: Screenshot #1 (Screenshot 1) image not found
The official readme.txt is a good inspiration

funny-fruits/index.php 85% from 13 tests

"Funny fruits" version 1.0'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:
  • Description: The description should be shorter than 140 characters (currently 144 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("funny-fruits.php" instead of "index.php")

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
Good job! No executable or dangerous file extensions detected389 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP24626389

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.07
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
9 PNG files occupy 0.22MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/a5.png21.64KB7.90KB▼ 63.48%
images/fan.png1.71KB0.78KB▼ 54.46%
images/b1.png1.77KB1.87KB0.00%
images/a1.png23.10KB7.44KB▼ 67.77%
images/b2.png2.18KB1.89KB▼ 13.40%