10% ar-model-viewer-for-woocommerce

Code Review | AR Model Viewer for WooCommerce

WordPress plugin AR Model Viewer for WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: ar-model-viewer-f...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 2, 2023
  • Latest release: Jan 2, 2023
  • Number of updates: 19
  • Update frequency: every 8.4 days
  • Top authors: racmanuel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 398 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/ar-model-viewer-for-woocommerce/includes/class-ar-model-viewer-for-woocommerce.php+220
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.95MB] [CPU: ▼50.67ms] Passed 4 tests

This is a short check of server-side resources used by AR Model Viewer for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.87 ▼39.93
Dashboard /wp-admin2.06 ▼1.256.76 ▼40.89
Posts /wp-admin/edit.php2.06 ▼1.306.28 ▼40.70
Add New Post /wp-admin/post-new.php2.06 ▼3.837.94 ▼81.16
Media Library /wp-admin/upload.php2.06 ▼1.177.95 ▼30.20
AR Model Viewer for WooCommerce /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings2.065.66

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 69 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by AR Model Viewer for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,961 ▲22616.58 ▲2.2176.07 ▲73.7143.55 ▲0.16
Dashboard /wp-admin2,234 ▲465.95 ▲1.01103.01 ▼1.2238.05 ▼11.35
Posts /wp-admin/edit.php2,119 ▲482.13 ▲0.1035.55 ▲0.0936.42 ▲0.34
Add New Post /wp-admin/post-new.php1,544 ▲2418.12 ▼5.05595.24 ▼104.8452.46 ▲0.28
Media Library /wp-admin/upload.php1,413 ▲224.35 ▲0.2094.18 ▼19.7040.18 ▼6.94
AR Model Viewer for WooCommerce /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings1,7872.8662.6944.99

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/ar-model-viewer-for-woocommerce/includes/class-ar-model-viewer-for-woocommerce.php+220
    Trying to access array offset on value of type bool
  • Incomplete uninstall procedure, leaving 69 files (0.98MB) in the plugin directory
    • (new file) admin/images/icons8-3d-object-96(-xxxhdpi).png
    • (new file) admin/css/ar-model-viewer-for-woocommerce-admin-product.css
    • (new file) LICENSE.txt
    • (new file) admin/class-ar-model-viewer-for-woocommerce-admin.php
    • (new file) admin/images/icons8-3d-object-72(-xxhdpi).png
    • (new file) admin/images/icons8-3d-object-36(-hdpi).png
    • (new file) README.txt
    • (new file) .gitignore
    • (new file) admin/images/icons8-3d-object-18(-ldpi).png
    • (new file) admin/css/ar-model-viewer-for-woocommerce-admin.css
    • ...
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings
    • > Notice in wp-content/plugins/ar-model-viewer-for-woocommerce/includes/class-ar-model-viewer-for-woocommerce.php+242
    Trying to access array offset on value of type bool

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/ar-model-viewer-for-woocommerce/public/partials/ar-model-viewer-for-woocommerce-public-display.php
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/CMB2_Options_Hookup.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/ar-model-viewer-for-woocommerce/vendor/cmb2/cmb2/includes/types/CMB2_Type_Counter_Base.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ar_model_viewer_for_woocommerce_settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clearAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

ar-model-viewer-for-woocommerce/ar-model-viewer-for-woocommerce.php 85% from 13 tests

The entry point to "AR Model Viewer for WooCommerce" version 1.0.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 261 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("6.0.0" instead of "5.9")

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
Good job! No executable or dangerous file extensions detected511,850 lines of code in 1,875 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1,333179,19736,412432,064
PO File12014,31518,50232,323
TypeScript2583,7877,96618,873
PHP832,6537,5048,949
JSON30008,461
CSS182771,2304,663
SVG2203,982
Sass17306291,411
Markdown1442101,124

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity19.00
▷ Minimum class complexity1.00
▷ Maximum class complexity188.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes79
▷ Abstract classes911.39%
▷ Concrete classes7088.61%
▷ Final classes00.00%
Methods631
▷ Static methods11618.38%
▷ Public methods52683.36%
▷ Protected methods8914.10%
▷ Private methods162.54%
Functions41
▷ Named functions4097.56%
▷ Anonymous functions12.44%
Constants11
▷ Global constants545.45%
▷ Class constants654.55%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
51 compressed PNG files occupy 0.05MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icons8-mac-client-material-filled/Android/icons8-mac-client-48(-xhdpi).png0.65KB0.88KB0.00%
vendor/cmb2/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
admin/images/icons8-web-accessibility-material-filled/Android/icons8-web-accessibility-36(-hdpi).png0.59KB0.66KB0.00%
vendor/cmb2/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
admin/images/icons8-android-os-material-filled/Android/icons8-android-os-18(-ldpi).png0.29KB0.33KB0.00%