72% swiftxr-3darvr-viewer

Code Review | SwiftXR (3D/AR/VR) Viewer

WordPress plugin SwiftXR (3D/AR/VR) Viewer scored72%from 54 tests.

About plugin

  • Plugin page: swiftxr-3darvr-vi...
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Mar 15, 2023
  • Latest release: Jun 9, 2023
  • Number of updates: 17
  • Update frequency: every 5.1 days
  • Top authors: swiftxr (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /599 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.01MB] [CPU: ▼7.85ms] Passed 4 tests

Analyzing server-side resources used by SwiftXR (3D/AR/VR) Viewer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0245.49 ▲2.05
Dashboard /wp-admin3.32 ▼0.0252.42 ▼11.27
Posts /wp-admin/edit.php3.37 ▲0.0250.67 ▼1.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0487.13 ▼18.17
Media Library /wp-admin/upload.php3.25 ▲0.0235.61 ▼0.25
My Published Links /wp-admin/admin.php?page=swiftxr-app-dashboard3.2838.32
Add New /wp-admin/admin.php?page=swiftxr-app-form3.3133.99
Settings /wp-admin/admin.php?page=swiftxr-settings3.2635.71
Guide /wp-admin/admin.php?page=swiftxr-tutorial3.2830.60

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 26 new files
Database: 1 new table, 7 new options
New tables
wp_swiftxr_shortcodes
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
swiftxr-product-append
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for SwiftXR (3D/AR/VR) Viewer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9213.29 ▼1.001.80 ▲0.0944.80 ▲5.36
Dashboard /wp-admin2,244 ▲564.88 ▼1.00111.48 ▲12.8645.03 ▲1.09
Posts /wp-admin/edit.php2,109 ▲202.06 ▲0.0636.62 ▼1.0237.92 ▲1.59
Add New Post /wp-admin/post-new.php1,546 ▲1023.22 ▲0.01668.03 ▲18.5055.86 ▲9.59
Media Library /wp-admin/upload.php1,426 ▲414.18 ▼0.0894.99 ▼7.1543.84 ▼0.16
My Published Links /wp-admin/admin.php?page=swiftxr-app-dashboard8511.8028.1938.20
Add New /wp-admin/admin.php?page=swiftxr-app-form1,0541.8527.1529.73
Settings /wp-admin/admin.php?page=swiftxr-settings8861.6924.9735.63
Guide /wp-admin/admin.php?page=swiftxr-tutorial9482.0624.0341.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • swiftxr-product-append
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/swiftxr-3darvr-viewer/admin/index.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/swiftxr-3darvr-viewer/admin/views/tutorial.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/swiftxr-3darvr-viewer/admin/views/settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/swiftxr-3darvr-viewer/admin/views/dashboard.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/swiftxr-3darvr-viewer/admin/views/form.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=swiftxr-app-form
    • > Other (warning) in unknown
    /wp-admin/admin.php?page=swiftxr-app-form 319 Unrecognized feature: 'vr'.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Tags: There are too many tags (12 tag instead of maximum 10)
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

swiftxr-3darvr-viewer/swiftxr-viewer.php 92% from 13 tests

The principal PHP file in "SwiftXR (3D/AR/VR) Viewer" v. 1.0.5 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("swiftxr-3darvr-viewer.php" instead of "swiftxr-viewer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,143 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP10406110690
CSS16613349
JavaScript15536104

PHP code Passed 2 tests

A short 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.28
Average class complexity14.00
▷ Minimum class complexity8.00
▷ Maximum class complexity25.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/emptystate-files.png6.66KB4.21KB▼ 36.83%
admin/assets/home-trophy.png20.16KB7.24KB▼ 64.07%