72% stl-viewer

Code Review | STL Viewer

WordPress plugin STL Viewer scored72%from 54 tests.

About plugin

  • Plugin page: stl-viewer
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1.1
  • WordPress version: 6.3.1
  • First release: Apr 17, 2013
  • Latest release: Mar 15, 2015
  • Number of updates: 109
  • Update frequency: every 6.4 days
  • Top authors: christian.loelkes (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /6,762 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.65ms] Passed 4 tests

Analyzing server-side resources used by STL Viewer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0334.14 ▼5.69
Dashboard /wp-admin3.39 ▲0.0944.47 ▼5.38
Posts /wp-admin/edit.php3.50 ▲0.1550.32 ▲0.31
Add New Post /wp-admin/post-new.php5.97 ▲0.0991.34 ▼7.85
Media Library /wp-admin/upload.php3.31 ▲0.0935.11 ▲2.54
STL Viewer /wp-admin/options-general.php?page=stlviewer3.2528.12

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 32 new options
New WordPress options
widget_theysaidso_widget
stlviewer_fog_near
stlviewer_height
stlviewer_informations
stlviewer_rotation_y
widget_recent-posts
theysaidso_admin_options
stlviewer_loading_text
stlviewer_directional_light_intensity
stlviewer_webgl_test_success
...

Browser metrics Passed 4 tests

STL Viewer: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.30 ▼1.091.68 ▼0.4042.81 ▼3.17
Dashboard /wp-admin2,207 ▲225.83 ▼0.02118.97 ▲1.9846.34 ▲0.72
Posts /wp-admin/edit.php2,093 ▲72.04 ▲0.0239.33 ▲2.3035.74 ▼0.57
Add New Post /wp-admin/post-new.php1,522 ▼1123.17 ▲0.08664.55 ▼0.6260.36 ▲2.14
Media Library /wp-admin/upload.php1,395 ▲74.21 ▼0.0297.60 ▼2.7643.08 ▼1.73
STL Viewer /wp-admin/options-general.php?page=stlviewer8792.1827.7646.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 32 options
    • widget_theysaidso_widget
    • stlviewer_floor_repeat
    • theysaidso_admin_options
    • widget_recent-comments
    • stlviewer_floor_scale
    • stlviewer_delete_settings
    • stlviewer_webgl_error
    • stlviewer_download_link
    • stlviewer_width
    • stlviewer_rotation_x
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=stlviewer
    • > Notice in wp-content/plugins/stl-viewer/settings.php+168
    Undefined variable: checked

SRP 0% 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/stl-viewer/help.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stl-viewer/settings.php:93

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please describe screenshot #1 in stl-viewer/assets to your readme.txt
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === stl-viewer === )
The official readme.txt might help

stl-viewer/stl.php 92% from 13 tests

The principal PHP file in "STL Viewer" v. 1.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("stl-viewer.php" instead of "stl.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
There were no executable files found in this plugin2,411 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript78351572,091
PHP38347320

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity13.00
▷ Minimum class complexity11.00
▷ Maximum class complexity15.00
Average method complexity1.77
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2787.10%
▷ Protected methods00.00%
▷ Private methods412.90%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin