84% a8c-3d-model-viewer

Code Review | A8C 3D Model Viewer Block

WordPress plugin A8C 3D Model Viewer Block scored84%from 54 tests.

About plugin

  • Plugin page: a8c-3d-model-viewer
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0
  • WordPress version: 6.3.1
  • First release: May 17, 2022
  • Latest release: May 17, 2022
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: vcanales (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /807 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by A8C 3D Model Viewer Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.26 ▲0.49
Dashboard /wp-admin3.33 ▲0.0348.85 ▼3.47
Posts /wp-admin/edit.php3.38 ▲0.0246.94 ▼8.24
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.18 ▼16.59
Media Library /wp-admin/upload.php3.25 ▲0.0335.40 ▼1.45

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by A8C 3D Model Viewer Block
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9316.00 ▲1.5755.90 ▲54.1643.46 ▼1.55
Dashboard /wp-admin2,218 ▲175.83 ▲0.92103.11 ▼14.3140.12 ▼1.15
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0240.86 ▲5.2235.50 ▲3.15
Add New Post /wp-admin/post-new.php6,206 ▲4,66124.06 ▲0.36919.76 ▲219.1556.85 ▲2.38
Media Library /wp-admin/upload.php1,400 ▼04.22 ▼0.0396.66 ▼16.0943.70 ▼3.02

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\A8c\\Plugins\\Blocks\\ModelViewer\\add_action() in wp-content/plugins/a8c-3d-model-viewer/blocks/model-viewer.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a8c-3d-model-viewer/index.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: block, model, 3d, blocks

a8c-3d-model-viewer/index.php 92% from 13 tests

The main PHP script in "A8C 3D Model Viewer Block" version 1.0.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("a8c-3d-model-viewer.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected498 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript249835413
PHP3212670
JSON1009
CSS2166

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
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
Namespaces1
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%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin