94% 3d-viewer-block

Code Review | 3D Viewer Block- Simple Yet Powerful 3D Viewer.

WordPress plugin 3D Viewer Block- Simple Yet Powerful 3D Viewer. scored 94% from 54 tests.

About plugin

  • Plugin page: 3d-viewer-block
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Dec 13, 2021
  • Latest release: Mar 9, 2022
  • Number of updates: 16
  • Update frequency: every 5.4 days
  • Top authors: charlescormier (62.5%)abuhayat (43.75%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 572 total downloads

Benchmarks

Plugin footprint Passed 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: ▼287.39ms] Passed 4 tests

An overview of server-side resources used by 3D Viewer Block- Simple Yet Powerful 3D Viewer.
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.4758.61 ▲36.52
Dashboard /wp-admin3.46 ▲0.0638.69 ▲0.62
Posts /wp-admin/edit.php3.69 ▲0.0566.06 ▲25.13
Add New Post /wp-admin/post-new.php6.93 ▼0.04118.94 ▼1,177.14
Media Library /wp-admin/upload.php3.34 ▲0.0527.32 ▲1.82

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for 3D Viewer Block- Simple Yet Powerful 3D Viewer.
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,791 ▲3318.71 ▲3.0261.86 ▲56.202.34 ▲0.14
Dashboard /wp-admin2,888 ▲306.12 ▼0.05115.99 ▼14.06160.24 ▲0.98
Posts /wp-admin/edit.php2,691 ▼03.24 ▲0.0083.47 ▲22.01180.20 ▲38.74
Add New Post /wp-admin/post-new.php1,772 ▲10418.58 ▲0.35474.07 ▲48.94181.65 ▲4.11
Media Library /wp-admin/upload.php1,698 ▲35.50 ▼0.03137.85 ▼12.17177.37 ▼9.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant TDVB_PLUGIN_VERSION - assumed 'TDVB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/3d-viewer-block/dist/editor.asset.php on line 4
    • > PHP Warning
      Use of undefined constant TDVB_PLUGIN_VERSION - assumed 'TDVB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/3d-viewer-block/dist/script.asset.php on line 4

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Requires at least: Invalid version format
The official readme.txt might help

3d-viewer-block/plugin.php 92% from 13 tests

Analyzing the main PHP file in "3D Viewer Block- Simple Yet Powerful 3D Viewer." version 1.0.2
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("3d-viewer-block.php" instead of "plugin.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
Success! There were no dangerous files found in this plugin574 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript345837384
PHP31817110
JSON10078
CSS2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.00
▷ Minimum class complexity5.00
▷ Maximum class complexity13.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods225.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin