83% add-product-frontend-for-woocommerce

Code Review | Add Product Frontend for WooCommerce

WordPress plugin Add Product Frontend for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: add-product-front...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Jan 6, 2023
  • Latest release: Nov 9, 2023
  • Number of updates: 9
  • Update frequency: every 34.2 days
  • Top authors: bytestechnolab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /523 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by Add Product Frontend for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.75 ▼7.18
Dashboard /wp-admin3.31 ▲0.0044.48 ▼5.16
Posts /wp-admin/edit.php3.36 ▲0.0046.76 ▲3.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.31 ▼3.46
Media Library /wp-admin/upload.php3.23 ▲0.0033.65 ▲0.67

Server storage [IO: ▲1.97MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 150 new files
Database: no new tables, 8 new options
New WordPress options
deferred_admin_notices
widget_recent-comments
can_compress_scripts
woocommerce_install_and_activate_admin_notices
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Add Product Frontend for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.331.79 ▲0.1643.72 ▲0.91
Dashboard /wp-admin2,195 ▲145.60 ▼0.0893.97 ▼6.5040.73 ▼0.86
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0039.25 ▲4.0936.58 ▲2.22
Add New Post /wp-admin/post-new.php1,526 ▼023.61 ▲0.16588.58 ▼34.0054.28 ▲9.14
Media Library /wp-admin/upload.php1,403 ▲94.21 ▼0.0199.18 ▼1.4240.39 ▼1.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 48× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/add-product-frontend-for-woocommerce/trunk/admin/partials/plugin-setting-bytes-add-product-frontend.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-product-frontend-for-woocommerce/public/inc/bytes-save-product.php:3
    • > PHP Notice
      Undefined variable: comments in wp-content/plugins/add-product-frontend-for-woocommerce/trunk/lib/plugin-deactivation/email/admin-deactivate-plugin.php on line 50
    • > PHP Notice
      Undefined variable: product_message in wp-content/plugins/add-product-frontend-for-woocommerce/trunk/public/partials/emails/admin-new-product.php on line 34
    • > PHP Notice
      Undefined variable: plugin_header in wp-content/plugins/add-product-frontend-for-woocommerce/lib/plugin-deactivation/email/admin-deactivate-plugin.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/add-product-frontend-for-woocommerce/admin/partials/plugin-bytes-product-list.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/add-product-frontend-for-woocommerce/trunk/admin/partials/plugin-info-bytes-add-product-frontend.php:2
    • > PHP Notice
      Undefined variable: product_title in wp-content/plugins/add-product-frontend-for-woocommerce/public/partials/emails/admin-new-product.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/add-product-frontend-for-woocommerce/admin/partials/setting/plugin-setting-user-role.php:3
    • > PHP Notice
      Undefined variable: reason in wp-content/plugins/add-product-frontend-for-woocommerce/trunk/lib/plugin-deactivation/email/admin-deactivate-plugin.php on line 46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

add-product-frontend-for-woocommerce/bytes-add-product-frontend-for-woocommerce.php 77% from 13 tests

The principal PHP file in "Add Product Frontend for WooCommerce" v. 1.0.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("add-product-frontend-for-woocommerce.php" instead of "bytes-add-product-frontend-for-woocommerce.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Description: The description should be shorter than 140 characters (currently 262 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected7,049 lines of code in 70 files:
LanguageFilesBlank linesComment linesLines of code
PHP471923033,768
CSS7365832,154
JavaScript151241231,110
SVG10017

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity4.43
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity1.52
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods92
▷ Static methods44.35%
▷ Public methods8289.13%
▷ Protected methods00.00%
▷ Private methods1010.87%
Functions42
▷ Named functions3685.71%
▷ Anonymous functions614.29%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin