84% wholesale

Code Review | Wholesale

WordPress plugin Wholesale scored84%from 54 tests.

About plugin

  • Plugin page: wholesale
  • Plugin version: 1.0.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8.3
  • WordPress version: 6.3.1
  • First release: Apr 8, 2021
  • Latest release: Jan 21, 2022
  • Number of updates: 6
  • Update frequency: every 48.0 days
  • Top authors: mjkhajeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /519 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.43ms] Passed 4 tests

An overview of server-side resources used by Wholesale
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0541.35 ▼2.15
Dashboard /wp-admin3.35 ▲0.0550.94 ▼2.85
Posts /wp-admin/edit.php3.40 ▲0.0546.20 ▼9.40
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.34 ▼15.31
Media Library /wp-admin/upload.php3.27 ▲0.0541.06 ▲0.75

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

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

Browser metrics Passed 4 tests

Wholesale: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2913.23 ▼1.094.35 ▲2.3540.79 ▼3.43
Dashboard /wp-admin2,215 ▲125.80 ▲0.89100.72 ▼16.7038.59 ▼9.40
Posts /wp-admin/edit.php2,079 ▼31.99 ▼0.0338.00 ▼3.9938.80 ▼1.85
Add New Post /wp-admin/post-new.php1,535 ▼523.07 ▼0.12676.12 ▲37.3464.84 ▲4.75
Media Library /wp-admin/upload.php1,400 ▼04.14 ▼0.22108.75 ▼5.5251.25 ▼0.12

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function MJWCWS\\Backend\\add_action() in wp-content/plugins/wholesale/Backend/WCMetabox.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 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
5 plugin tags: wholesale, wholesale woocommerce, shopping, wc, woocommerce

wholesale/wholesale.php 92% from 13 tests

The entry point to "Wholesale" version 1.0.0.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin197 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21911149
PO File1121648

PHP code Passed 2 tests

A short review 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.27
Average class complexity8.50
▷ Minimum class complexity7.00
▷ Maximum class complexity10.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods220.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin