64% perfit-woocommerce

Code Review | Perfit WooCommerce

WordPress plugin Perfit WooCommerce scored64%from 54 tests.

About plugin

  • Plugin page: perfit-woocommerce
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.4
  • WordPress version: 6.3.1
  • First release: May 7, 2020
  • Latest release: May 7, 2020
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: PerfitDev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,046 total downloads

Benchmarks

Plugin footprint 48% 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.51MB] [CPU: ▼17.93ms] Passed 4 tests

Analyzing server-side resources used by Perfit WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1643.84 ▲4.23
Dashboard /wp-admin3.53 ▲0.2245.13 ▼4.84
Posts /wp-admin/edit.php3.58 ▲0.2247.12 ▼0.93
Add New Post /wp-admin/post-new.php3.34 ▼2.5536.70 ▼68.57
Media Library /wp-admin/upload.php3.39 ▲0.1536.72 ▲2.64

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Perfit WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.28 ▼0.451.55 ▼0.0237.18 ▼3.66
Dashboard /wp-admin2,198 ▲185.61 ▼0.0884.11 ▼5.1441.80 ▼4.31
Posts /wp-admin/edit.php2,100 ▼01.96 ▲0.0238.97 ▲4.8338.11 ▲3.12
Add New Post /wp-admin/post-new.php1,529 ▲323.47 ▲0.36692.11 ▲6.1253.59 ▲0.49
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.04103.07 ▼7.1547.54 ▲0.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Error in wp-content/plugins/perfit-woocommerce/includes/class-wcp.php+64
    Uncaught Error: Call to undefined function wc_get_logger() in wp-content/plugins/perfit-woocommerce/includes/class-wcp.php:64
    Stack trace:
    #0 wp-content/plugins/perfit-woocommerce/includes/class-wcp.php(383): WooCommercePerfit::log()
    #1 wp-content/plugins/perfit-woocommerce/includes/class-wcp-install.php(62): WooCommercePerfit->inactivated_key()
    #2 wp-includes/class-wp-hook.php(310): WCP_Install::uninstall()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/includes/plugin.php(1269): do_action()
    #6 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • Incomplete uninstall procedure, leaving 15 files (0.05MB) in the plugin directory
    • (new file) includes/class-wcp-settings-tab.php
    • (new file) i18n/languages/woocommerce-perfit-es_AR.mo
    • (new file) includes/admin/views/html-settings.php
    • (new file) i18n/languages/woocommerce-perfit-es_AR.po
    • (new file) i18n/languages/woocommerce-perfit-en_US.po
    • (new file) includes/class-wcp.php
    • (new file) includes/class-wcp-rest-account-controller.php
    • (new file) i18n/languages/woocommerce-perfit-en_US.mo
    • (new file) includes/class-wcp-install.php
    • (new file) i18n/languages/woocommerce-perfit.pot
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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 fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/perfit-woocommerce/includes/admin/views/html-settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: perfit, woocommerce, email marketing

perfit-woocommerce/index.php 85% from 13 tests

The primary PHP file in "Perfit WooCommerce" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("perfit-woocommerce.php" instead of "index.php")
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "3.1.0")

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
There were no executable files found in this plugin816 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP9171450732
PO File2183384

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity12.29
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods65
▷ Static methods69.23%
▷ Public methods4772.31%
▷ Protected methods00.00%
▷ Private methods1827.69%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants9
▷ Global constants888.89%
▷ Class constants111.11%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin