78% 3d-scene-viewer

Code Review | 3D Scene Viewer

WordPress plugin 3D Scene Viewer scored78%from 54 tests.

About plugin

  • Plugin page: 3d-scene-viewer
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 2, 2023
  • Latest release: Aug 2, 2023
  • Number of updates: 7
  • Update frequency: every 21.9 days
  • Top authors: wprj (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /293 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.19ms] Passed 4 tests

A check of server-side resources used by 3D Scene Viewer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1638.49 ▼2.45
Dashboard /wp-admin3.47 ▲0.1649.91 ▲2.94
Posts /wp-admin/edit.php3.58 ▲0.2248.07 ▼3.83
Add New Post /wp-admin/post-new.php6.05 ▲0.1785.82 ▼9.27
Media Library /wp-admin/upload.php3.39 ▲0.1634.99 ▲2.79
3D Scenes /wp-admin/edit.php?post_type=scene3d3.4336.95
New 3D Scene /wp-admin/post-new.php?post_type=scene3d3.5145.79

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 433 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for 3D Scene Viewer
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲15314.99 ▲0.5611.39 ▲9.7143.67 ▲2.94
Dashboard /wp-admin2,262 ▲744.86 ▼0.07112.89 ▲11.0043.15 ▼2.38
Posts /wp-admin/edit.php2,145 ▲562.06 ▲0.0142.99 ▲3.7341.23 ▲4.36
Add New Post /wp-admin/post-new.php6,279 ▲4,73719.42 ▲1.03825.37 ▲212.7262.42 ▼3.22
Media Library /wp-admin/upload.php1,444 ▲594.23 ▲0.0199.56 ▲0.1442.45 ▼1.14
3D Scenes /wp-admin/edit.php?post_type=scene3d1,1251.9531.3829.13
New 3D Scene /wp-admin/post-new.php?post_type=scene3d3,0885.97268.4281.76

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

Smoke tests 50% 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 | 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
  • 22× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/3d-scene-viewer/admin/views/metaboxes/preview.php:8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/3d-scene-viewer/admin/views/metaboxes/fog.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/3d-scene-viewer/admin/views/metaboxes/usage.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Scene3d_Plugin' not found in wp-content/plugins/3d-scene-viewer/includes/woocommerce/meta-box.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/3d-scene-viewer/admin/views/parts/floor.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/3d-scene-viewer/includes/gutenberg/gutenberg.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/3d-scene-viewer/admin/views/metaboxes/settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/3d-scene-viewer/admin/views/parts/spotlight.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'SCENE3D_BASE_PATHadmin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/3d-scene-viewer/autoload.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/3d-scene-viewer/admin/views/parts/pointlight.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=scene3d
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=scene3d - [.WebGL-0x1be001d17100]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
    • > GET request to /wp-admin/post-new.php?post_type=scene3d
    • > Rendering (warning) in unknown
    /wp-admin/post-new.php?post_type=scene3d - [.WebGL-0x1be001d17100]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: woocommerce, threejs, 3d model, 3d, 3d scene...

3d-scene-viewer/scene3d.php 85% from 13 tests

The principal PHP file in "3D Scene Viewer" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("3d-scene-viewer.php" instead of "scene3d.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin48,100 lines of code in 424 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript39327,0944,30541,847
CSS7768102,451
SVG1032,087
PHP231514311,715

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity13.20
▷ Minimum class complexity4.00
▷ Maximum class complexity27.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods41
▷ Static methods717.07%
▷ Public methods3892.68%
▷ Protected methods00.00%
▷ Private methods37.32%
Functions10
▷ Named functions110.00%
▷ Anonymous functions990.00%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/images/spin.png9.07KB4.67KB▼ 48.47%