62% 3d-viewer

Code Review | 3D viewer - Embed 3D Models on WordPress

WordPress plugin 3D viewer - Embed 3D Models on WordPress scored62%from 54 tests.

About plugin

  • Plugin page: 3d-viewer
  • Plugin version: 1.3.21
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4
  • WordPress version: 6.3.1
  • First release: Apr 7, 2021
  • Latest release: Nov 23, 2023
  • Number of updates: 129
  • Update frequency: every 7.4 days
  • Top authors: srabonr (35.66%)shehabulislam (33.33%)abuhayat (21.71%)btechnologies (11.63%)

Code review

54 tests

User reviews

13 reviews

Install metrics

5,000+ active /51,638 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲5.56MB] [CPU: ▲45.31ms] 75% from 4 tests

Analyzing server-side resources used by 3D viewer - Embed 3D Models on WordPress
Please fix the following
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 5.56MB on /wp-admin/admin.php?page=3d-viewer-pricing-manual)
PageMemory (MB)CPU Time (ms)
Home /8.94 ▲5.4880.15 ▲42.65
Dashboard /wp-admin8.96 ▲5.66107.78 ▲55.43
Posts /wp-admin/edit.php8.97 ▲5.6095.97 ▲45.07
Add New Post /wp-admin/post-new.php11.39 ▲5.50138.33 ▲43.36
Media Library /wp-admin/upload.php8.97 ▲5.7386.25 ▲50.16
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius8.9780.75
Upgrade /wp-admin/admin.php?page=3d-viewer-pricing-manual8.9785.05

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 444 new files
Database: no new tables, 12 new options
New WordPress options
model_viewer_import_ver
can_compress_scripts
bp3d_imported
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
fs_debug_mode
_bp3d_settings_
fs_active_plugins
...

Browser metrics Passed 4 tests

A check of browser resources used by 3D viewer - Embed 3D Models on WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15513.37 ▼0.955.14 ▲3.4636.82 ▼3.17
Dashboard /wp-admin2,313 ▲1385.10 ▼0.53110.15 ▼6.7065.55 ▲22.55
Posts /wp-admin/edit.php2,219 ▲1192.33 ▲0.3737.28 ▼5.5556.16 ▲17.46
Add New Post /wp-admin/post-new.php6,273 ▲4,74728.80 ▲5.711,081.11 ▲469.7854.38 ▼9.12
Media Library /wp-admin/upload.php1,518 ▲1184.63 ▲0.48112.84 ▲14.9965.14 ▲23.20
Freemius Debug [v.2.6.0] /wp-admin/admin.php?page=freemius1,1232.1028.1936.18
Upgrade /wp-admin/admin.php?page=3d-viewer-pricing-manual2,1103.3179.54159.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/3d-viewer/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 12 options in the database
    • fs_accounts
    • bp3d_imported
    • widget_theysaidso_widget
    • fs_active_plugins
    • can_compress_scripts
    • widget_recent-comments
    • model_viewer_import_ver
    • db_upgraded
    • _bp3d_settings_
    • fs_debug_mode
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/3d-viewer/inc/Shortcode/fullscreen_buttons.php
    • > /wp-content/plugins/3d-viewer/inc/Template/fullscreen_buttons.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/3d-viewer/inc/Template/woocommerce_carousel.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/3d-viewer/inc/Shortcode/style.php:2
    • > PHP Warning
      Use of undefined constant BP3D_VERSION - assumed 'BP3D_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/3d-viewer/3d-viewer-block/dist/editor.asset.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/3d-viewer/admin/ads/submenu.php:17
    • > PHP Warning
      Use of undefined constant BP3D_VERSION - assumed 'BP3D_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/3d-viewer/dist/3d-viewer-frontend.asset.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/3d-viewer/inc/Shortcode/3d_viewer.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BP3D\\Base\\add_action() in wp-content/plugins/3d-viewer/inc/Base/ExtendMimeType.php:71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/3d-viewer/3d-viewer-block/inc/block.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BP3D\\Base\\bp3dv_fs() in wp-content/plugins/3d-viewer/inc/Base/BlackFriday.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_ID() in wp-content/plugins/3d-viewer/inc/Woocommerce/config.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=3d-viewer-pricing-manual
    • > Security (severe) in unknown
    https://js.freemius.com/vendors/nojquery.ba-postmessage.min.js?v=180 11 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://missbasin.s2-tastewp.com') does not match the recipient window's origin ('').

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: threejs, 3d, widget, display, 3d model viewer

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

Analyzing the main PHP file in "3D viewer - Embed 3D Models on WordPress" version 1.3.21
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin77,858 lines of code in 343 files:
LanguageFilesBlank linesComment linesLines of code
PHP24512,05919,18052,002
JavaScript221,3911,2857,245
PO File213,4524,2747,030
Sass1696935,667
CSS294585735,630
JSON600224
Markdown110045
SVG31015

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity44.98
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.83
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces10
Interfaces1
Traits0
Classes141
▷ Abstract classes42.84%
▷ Concrete classes13797.16%
▷ Final classes21.46%
Methods1,656
▷ Static methods26115.76%
▷ Public methods1,25075.48%
▷ Protected methods201.21%
▷ Private methods38623.31%
Functions142
▷ Named functions13091.55%
▷ Anonymous functions128.45%
Constants158
▷ Global constants10566.46%
▷ Class constants5333.54%
▷ Public constants53100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
admin/csf/assets/images/checkerboard.png2.29KB2.54KB0.00%
public/transparent.png0.14KB0.13KB▼ 3.60%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%