78% cube-3d

Code Review | Cube 3D

WordPress plugin Cube 3D scored78%from 54 tests.

About plugin

  • Plugin page: cube-3d
  • Plugin version: 1.11
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Mar 2, 2016
  • Latest release: Jul 31, 2023
  • Number of updates: 27
  • Update frequency: every 100.3 days
  • Top authors: manu225 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,965 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.28ms] Passed 4 tests

A check of server-side resources used by Cube 3D
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0146.62 ▲5.23
Dashboard /wp-admin3.33 ▲0.0352.47 ▲7.53
Posts /wp-admin/edit.php3.45 ▲0.0950.37 ▼6.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.40 ▼8.00
Media Library /wp-admin/upload.php3.24 ▲0.0138.44 ▲0.02

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: 1 new table, 6 new options
New tables
wp_cube_3d
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cube 3D
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,939 ▲17814.43 ▼0.101.63 ▼0.0044.96 ▲4.48
Dashboard /wp-admin2,330 ▲1536.14 ▲0.50110.68 ▲21.9680.92 ▲37.10
Posts /wp-admin/edit.php2,273 ▲1703.48 ▲1.4946.33 ▲6.6869.91 ▲30.75
Add New Post /wp-admin/post-new.php1,539 ▲1322.99 ▼0.81586.47 ▼89.1097.38 ▲47.58
Media Library /wp-admin/upload.php1,410 ▲104.09 ▼0.1279.07 ▼33.5978.44 ▲30.38

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/cube-3d/views/cube-3d.tpl.php
  • 28× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cube-3d/cube-3d.php:25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 12
    • > PHP Notice
      Undefined variable: cube in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 24
    • > PHP Notice
      Trying to get property 'width' of non-object in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 17
    • > PHP Notice
      Trying to get property 'width' of non-object in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/cube-3d/views/cubes_3d_list.php:9
    • > PHP Notice
      Trying to get property 'faces_image' of non-object in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 25
    • > PHP Notice
      Undefined variable: cube in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 23
    • > PHP Notice
      Trying to get property 'faces_color' of non-object in wp-content/plugins/cube-3d/views/cube-3d.tpl.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === cube-3d === )
The official readme.txt is a good inspiration

cube-3d/cube-3d.php 85% from 13 tests

The entry point to "Cube 3D" version 1.11 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path must begin with a forward slash character ("/")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("")

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
Good job! No executable or dangerous file extensions detected333 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP39227182
CSS2171151

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png0.70KB0.75KB0.00%
images/pro.png46.13KB9.57KB▼ 79.25%
images/save.png0.54KB0.39KB▼ 28.11%
images/remove.png1.27KB1.20KB▼ 5.76%
images/fb.png1.59KB1.00KB▼ 37.42%