84% wc-add-to-cart-as-admin

Code Review | WC Add To Cart As Admin

WordPress plugin WC Add To Cart As Admin scored84%from 54 tests.

About plugin

  • Plugin page: wc-add-to-cart-as...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.0
  • WordPress version: 6.3.1
  • First release: Dec 7, 2018
  • Latest release: Dec 10, 2018
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: tahireu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /745 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.90ms] Passed 4 tests

This is a short check of server-side resources used by WC Add To Cart As Admin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.04 ▼7.30
Dashboard /wp-admin3.31 ▲0.0045.64 ▼1.79
Posts /wp-admin/edit.php3.36 ▲0.0046.79 ▼0.36
Add New Post /wp-admin/post-new.php5.89 ▲0.00108.00 ▲12.21
Media Library /wp-admin/upload.php3.23 ▲0.0034.34 ▲1.85

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

WC Add To Cart As Admin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.151.68 ▼0.2840.70 ▼2.14
Dashboard /wp-admin2,206 ▲185.85 ▲0.96107.95 ▲0.4139.97 ▼2.16
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0239.63 ▼2.2134.32 ▼3.15
Add New Post /wp-admin/post-new.php1,542 ▲2818.16 ▲0.62616.04 ▼30.0954.30 ▼8.36
Media Library /wp-admin/upload.php1,385 ▼34.25 ▲0.0794.53 ▼5.1643.19 ▲0.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wc-add-to-cart-as-admin/wc-add-to-cart-as-admin.php
    • > /wp-content/plugins/wc-add-to-cart-as-admin/admin/class-atcaa-admin.php
    • > /wp-content/plugins/wc-add-to-cart-as-admin/includes/class-atcaa-activator.php
    • > /wp-content/plugins/wc-add-to-cart-as-admin/public/class-atcaa-public.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: store, woocommerce, shop, online-store, e-shop...

wc-add-to-cart-as-admin/wc-add-to-cart-as-admin.php Passed 13 tests

Analyzing the main PHP file in "WC Add To Cart As Admin" version 1.0.1
56 characters long description:
Add products to your customer's cart from WP admin side.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected849 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP5200143433
JavaScript25335247
CSS2476169

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity11.00
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods21100.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin