89% ar-for-wordpress

Code Review | AR For WordPress

WordPress plugin AR For WordPress scored89%from 54 tests.

About plugin

  • Plugin page: ar-for-wordpress
  • Plugin version: 5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 5, 2017
  • Latest release: Nov 23, 2023
  • Number of updates: 215
  • Update frequency: every 10.4 days
  • Top authors: webandprint (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

700+ active /20,537 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.84MB] [CPU: ▲2.90ms] 75% from 4 tests

This is a short check of server-side resources used by AR For WordPress
Please fix the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 636.67ms on /wp-admin/post-new.php?post_type=armodels)
PageMemory (MB)CPU Time (ms)
Home /4.27 ▲0.8046.77 ▲4.30
Dashboard /wp-admin4.18 ▲0.8753.28 ▲0.45
Posts /wp-admin/edit.php4.23 ▲0.8751.70 ▲2.69
Add New Post /wp-admin/post-new.php6.80 ▲0.91102.91 ▲4.14
Media Library /wp-admin/upload.php4.06 ▲0.8339.31 ▲6.69
All AR Models /wp-admin/edit.php?post_type=armodels4.1141.29
Settings /wp-admin/edit.php?post_type=armodels&page=4.1540.62
Add New /wp-admin/post-new.php?post_type=armodels6.83636.67
AR Categories /wp-admin/edit-tags.php?taxonomy=model_category&post_type=armodels4.0646.24
Whats New /wp-admin/edit.php?post_type=armodels&page=ar-whats-new4.0337.23

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 64 new files
Database: no new tables, 35 new options
New WordPress options
ar_animation
ar_disable_zoom
ar_dimensions_units
ar_rotate_limit
ar_licence_renewal
ar_css_positions
ar_qr_destination
ar_hide_arview
ar_pause_file
ar_hide_fullscreen
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for AR For WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲11414.68 ▼0.081.70 ▼0.0732.34 ▼11.11
Dashboard /wp-admin2,262 ▲815.57 ▼0.1583.41 ▼25.4676.12 ▲28.54
Posts /wp-admin/edit.php2,180 ▲772.09 ▲0.1038.07 ▲0.1640.88 ▲4.34
Add New Post /wp-admin/post-new.php6,265 ▲4,73918.87 ▼4.26966.98 ▲296.5137.00 ▼17.90
Media Library /wp-admin/upload.php1,473 ▲794.11 ▼0.07100.30 ▲1.1071.78 ▲30.44
All AR Models /wp-admin/edit.php?post_type=armodels1,1731.9136.2143.89
Settings /wp-admin/edit.php?post_type=armodels&page=1,8853.0343.6779.13
Add New /wp-admin/post-new.php?post_type=armodels4,05618.93937.76106.39
AR Categories /wp-admin/edit-tags.php?taxonomy=model_category&post_type=armodels1,3562.1332.9741.26
Whats New /wp-admin/edit.php?post_type=armodels&page=ar-whats-new9952.0026.7633.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 35 options in the database
    • ar_licence_key
    • ar_animation_selection
    • ar_hide_qrcode
    • ar_licence_renewal
    • ar_scene_viewer
    • ar_hide_arview
    • ar_hide_dimensions
    • widget_theysaidso_widget
    • ar_dimensions_inches
    • ar_rotate_limit
    • ...

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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 require attention: Please take inspiration from this readme.txt

ar-for-wordpress/ar-wordpress.php 92% from 13 tests

"AR For WordPress" version 5.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ar-for-wordpress.php" instead of "ar-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected15,690 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
JSON3009,387
PHP135865674,488
CSS41761161,540
JavaScript65860237
Sass33138

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity5.50
▷ Minimum class complexity3.00
▷ Maximum class complexity8.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1083.33%
▷ Protected methods216.67%
▷ Private methods00.00%
Functions80
▷ Named functions7087.50%
▷ Anonymous functions1012.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
20 PNG files occupy 0.27MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ar-play-btn.png1.67KB0.82KB▼ 51.17%
assets/images/menu_icon.png1.24KB0.55KB▼ 55.86%
assets/images/ios.png13.19KB5.98KB▼ 54.63%
assets/images/app_logo.png5.34KB2.54KB▼ 52.53%
assets/images/ar-view-btn.png3.79KB2.10KB▼ 44.48%