79% three-viewer

Code Review | Three Viewer

WordPress plugin Three Viewer scored79%from 54 tests.

About plugin

  • Plugin page: three-viewer
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Apr 7, 2022
  • Latest release: Jun 22, 2022
  • Number of updates: 4
  • Update frequency: every 19.0 days
  • Top authors: ofeknakar01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /949 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.23MB] [CPU: ▼38.22ms] Passed 4 tests

An overview of server-side resources used by Three Viewer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7213.20 ▼24.37
Dashboard /wp-admin2.78 ▼0.5215.65 ▼26.87
Posts /wp-admin/edit.php2.78 ▼0.5816.38 ▼30.41
Add New Post /wp-admin/post-new.php2.78 ▼3.1115.48 ▼71.21
Media Library /wp-admin/upload.php2.78 ▼0.4513.23 ▼20.27

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Three Viewer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,108 ▲36217.44 ▲3.1510.65 ▲8.5141.28 ▼0.97
Dashboard /wp-admin2,424 ▲2397.22 ▲2.33140.77 ▲34.3742.58 ▲2.09
Posts /wp-admin/edit.php2,327 ▲2384.59 ▲2.5765.48 ▲29.1297.29 ▲62.60
Add New Post /wp-admin/post-new.php1,431 ▼10321.52 ▼1.71568.03 ▼100.9149.79 ▼1.43
Media Library /wp-admin/upload.php1,460 ▲695.77 ▲1.4891.21 ▼12.3390.93 ▲45.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: gltf, fbx, model, 3d-viewer, 3d...

three-viewer/threeviewer.php 85% from 13 tests

"Three Viewer" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
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 ("three-viewer.php" instead of "threeviewer.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin35,098 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript910,8872,13333,931
CSS3381777
PHP315515384
SVG1006

PHP code Passed 2 tests

A short 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.11
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.88
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.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
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner-2.png18.03KB7.91KB▼ 56.10%
banner-1.png21.09KB9.08KB▼ 56.97%
banner-3.png20.16KB8.70KB▼ 56.82%