78% auto-assign-product-to-sale-category

Code Review | Auto Assign product to sale category

WordPress plugin Auto Assign product to sale category scored78%from 54 tests.

About plugin

  • Plugin page: auto-assign-produ...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Dec 23, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mrakisp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /880 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
Installer ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼19.27ms] Passed 4 tests

Analyzing server-side resources used by Auto Assign product to sale category
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.83 ▼4.37
Dashboard /wp-admin3.37 ▲0.0648.51 ▲0.12
Posts /wp-admin/edit.php3.48 ▲0.1250.19 ▼4.47
Add New Post /wp-admin/post-new.php3.21 ▼2.6736.88 ▼68.34
Media Library /wp-admin/upload.php3.29 ▲0.0638.52 ▲1.64

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Auto Assign product to sale category
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17813.66 ▼0.725.29 ▲3.4439.73 ▼1.17
Dashboard /wp-admin2,222 ▲344.86 ▼1.17108.33 ▼3.3542.09 ▼3.27
Posts /wp-admin/edit.php2,105 ▲162.00 ▼0.0139.96 ▼2.9535.29 ▼0.64
Add New Post /wp-admin/post-new.php1,548 ▲1223.31 ▼0.10664.66 ▲55.0567.63 ▲15.32
Media Library /wp-admin/upload.php1,407 ▲194.20 ▼0.08102.52 ▲6.5643.13 ▼0.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/auto-assign-product-to-sale-category/public/partials/aatsc-public-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/auto-assign-product-to-sale-category/admin/partials/select-cat-view.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/auto-assign-product-to-sale-category/admin/partials/aatsc-admin-display.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

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
5 plugin tags: sale, product category sale, adding sale product category to products, automatically populate sales product category, aatsc

auto-assign-product-to-sale-category/aatsc.php 85% from 13 tests

"Auto Assign product to sale category" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: The principal plugin file should be the same as the plugin slug ("auto-assign-product-to-sale-category.php" instead of "aatsc.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
No dangerous file extensions were detected271 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP13142575265
JavaScript24546
CSS2080

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity3.00
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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