68% xtrad-viewer

Code Review | Xtrad Viewer

WordPress plugin Xtrad Viewer scored 68% from 54 tests.

About plugin

  • Plugin page: xtrad-viewer
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.4
  • WordPress version: 6.3.1
  • First release: Apr 17, 2019
  • Latest release: Apr 1, 2020
  • Number of updates: 31
  • Update frequency: every 11.6 days
  • Top authors: lenford18 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 909 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

A check of server-side resources used by Xtrad Viewer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0735.54 ▼4.80
Dashboard /wp-admin3.34 ▲0.0449.35 ▲2.62
Posts /wp-admin/edit.php3.39 ▲0.0345.09 ▼4.36
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.96 ▼13.09
Media Library /wp-admin/upload.php3.26 ▲0.0334.39 ▼0.76
Viewer /wp-admin/admin.php?page=xtrad-viewer-menu3.2432.87
3D Viewer /wp-admin/admin.php?page=xtrad-top-menu3.2331.98

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 202 new files
Database: 1 new table, 8 new options
New tables
wp_xdscenes
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
xtrad_viewer_lib_version
xtrad_viewer_db_version
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Xtrad Viewer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲14515.53 ▲1.1554.58 ▲52.7637.32 ▼11.82
Dashboard /wp-admin2,239 ▲514.90 ▼0.9696.79 ▼6.4939.97 ▼2.29
Posts /wp-admin/edit.php2,116 ▲302.05 ▼0.0035.45 ▼3.7232.77 ▼2.12
Add New Post /wp-admin/post-new.php1,556 ▲2323.14 ▼0.35633.97 ▼42.8156.50 ▼0.88
Media Library /wp-admin/upload.php1,415 ▲304.30 ▲0.1094.12 ▼14.9942.09 ▼3.84
Viewer /wp-admin/admin.php?page=xtrad-viewer-menu2,5866.56236.0164.09
3D Viewer /wp-admin/admin.php?page=xtrad-top-menu1,7151.8025.8674.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_xdscenes
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • xtrad_viewer_lib_version
    • widget_recent-posts
    • widget_recent-comments
    • xtrad_viewer_db_version
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xtrad-viewer-menu
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/xtrad-viewer/admin/partials/xtrad-viewer-admin-display.php+474
    scandir(wp-content/uploads/xtrad-library/360/): failed to open dir: No such file or directory
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xtrad-viewer-menu
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/xtrad-viewer/admin/partials/xtrad-viewer-admin-display.php+523
    scandir(): (errno 2): No such file or directory
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xtrad-viewer-menu
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/xtrad-viewer/admin/partials/xtrad-viewer-admin-display.php+523
    array_diff(): Expected parameter 1 to be an array, bool given
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xtrad-viewer-menu
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/xtrad-viewer/admin/partials/xtrad-viewer-admin-display.php+525
    Invalid argument supplied for foreach()
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xtrad-viewer-menu
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/xtrad-viewer/admin/partials/xtrad-viewer-admin-display.php+492
    scandir(wp-content/uploads/xtrad-library/videos/): failed to open dir: No such file or directory
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=xtrad-viewer-menu
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/xtrad-viewer/admin/partials/xtrad-viewer-admin-display.php+523
    scandir(wp-content/uploads/xtrad-library/svg/): failed to open dir: No such file or directory

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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/xtrad-viewer/public/partials/huffman.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: mtl, obj, webgl, 3d scene, slider...

xtrad-viewer/xtrad-viewer.php Passed 13 tests

The main PHP script in "Xtrad Viewer" version 1.3.1 is automatically included on every request by WordPress
28 characters long description:
Edits and Displays 3D Scenes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected3,432 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP175019171,967
CSS711336881
JavaScript15468112566
JSON180018

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity10.94
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods74
▷ Static methods00.00%
▷ Public methods6385.14%
▷ Protected methods22.70%
▷ Private methods912.16%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
40 PNG files occupy 1.34MB with 0.46MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Quick_Start_Guide/Save_Hello_World.png8.24KB3.77KB▼ 54.31%
images/ball.png3.89KB3.10KB▼ 20.21%
images/Quick_Start_Guide/XTRAD_-_Popup.png25.63KB11.29KB▼ 55.95%
textures/sprites/snowflakes/snowflake5.png0.87KB0.89KB0.00%
images/Quick_Start_Guide/Menu_Templates.png3.88KB2.28KB▼ 41.35%