78% grab-ar

Code Review | GRAB AR

WordPress plugin GRAB AR scored78%from 54 tests.

About plugin

  • Plugin page: grab-ar
  • Plugin version: 2.4
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.6
  • WordPress version: 6.3.1
  • First release: Oct 5, 2020
  • Latest release: Jul 22, 2021
  • Number of updates: 47
  • Update frequency: every 8.4 days
  • Top authors: grabar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /984 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.76ms] Passed 4 tests

An overview of server-side resources used by GRAB AR
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0948.87 ▲9.45
Dashboard /wp-admin3.41 ▲0.0750.94 ▼14.95
Posts /wp-admin/edit.php3.52 ▲0.1749.08 ▼0.44
Add New Post /wp-admin/post-new.php5.99 ▲0.1194.87 ▼11.40
Media Library /wp-admin/upload.php3.33 ▲0.1039.96 ▲3.76
GRAB AR Settings /wp-admin/options-general.php?page=grabar3.3736.67

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_grabar_widget
grabar_inc_button
grabar_fixed
widget_recent-posts
widget_recent-comments
grabar_custom_style
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for GRAB AR
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲3514.30 ▼0.373.31 ▲1.4038.11 ▼5.45
Dashboard /wp-admin2,218 ▲385.65 ▲0.0098.64 ▲8.5843.58 ▲3.60
Posts /wp-admin/edit.php2,126 ▲232.05 ▲0.0141.46 ▲2.4137.91 ▼4.54
Add New Post /wp-admin/post-new.php1,564 ▲1423.36 ▲0.24622.05 ▼26.0152.32 ▼1.96
Media Library /wp-admin/upload.php1,423 ▲264.20 ▲0.0194.91 ▼7.1341.98 ▼5.13
GRAB AR Settings /wp-admin/options-general.php?page=grabar1,1682.1424.5858.74

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • grabar_inc_button
    • db_upgraded
    • grabar_fixed
    • grabar_custom_style
    • widget_grabar_widget
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/grab-ar/views/dashboard-notices.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/grab-ar/include/widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/grab-ar/include/functions.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/grab-ar/views/sidebar.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/grab-ar/include/functions.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/grab-ar/views/settings.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 browser errors
    • > GET request to /wp-admin/options-general.php?page=grabar
    • > Network (severe)
    wp-content/plugins/grab-ar/include/css/GrabAR_settings.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=grabar
    • > Javascript (severe) in unknown
    /wp-content/plugins/grab-ar/include/js/settings.js?ver=6.3.1 40:53 Uncaught TypeError: Cannot set properties of null (setting 'checked')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: woocommerce, augmented reality, online shopping woo commerce, shop, ar...

grab-ar/grabar.php 85% from 13 tests

The main PHP script in "GRAB AR" version 2.4 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("grab-ar.php" instead of "grabar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,221 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
CSS1110571,203
PHP67281528
JavaScript26853490

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.50
▷ Minimum class complexity4.00
▷ Maximum class complexity17.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/images/cog.png0.84KB0.71KB▼ 16.13%
include/images/GrabARBttn.png4.46KB2.59KB▼ 41.77%
include/images/GrabARBttn_White.png5.04KB2.57KB▼ 48.92%
include/images/GrabAR_50.png3.99KB3.03KB▼ 23.94%
include/images/app_logo.png6.98KB4.83KB▼ 30.75%