83% alpha-insights-intelligent-profit-reports-for-woocommerce

Code Review | Alpha Insights - Intelligent Profit Reports For WooCommerce

WordPress plugin Alpha Insights - Intelligent Profit Reports For WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: alpha-insights-in...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Jun 27, 2021
  • Latest release: Jun 27, 2021
  • Number of updates: 2
  • Update frequency: every 3.0 days
  • Top authors: wpdavies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /419 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Server-side resources used by Alpha Insights - Intelligent Profit Reports For WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.23 ▼4.08
Dashboard /wp-admin3.31 ▲0.0151.85 ▲0.86
Posts /wp-admin/edit.php3.36 ▲0.0049.83 ▲0.34
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.85 ▲1.88
Media Library /wp-admin/upload.php3.23 ▲0.0037.89 ▼0.12

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 586 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Alpha Insights - Intelligent Profit Reports For WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.58 ▼0.041.59 ▼0.2342.47 ▼4.27
Dashboard /wp-admin2,206 ▲295.62 ▼0.0687.34 ▼3.8939.30 ▲0.34
Posts /wp-admin/edit.php2,111 ▲112.02 ▲0.0039.80 ▲4.5233.14 ▼0.24
Add New Post /wp-admin/post-new.php1,534 ▼122.96 ▼0.13639.55 ▲20.2761.23 ▼5.89
Media Library /wp-admin/upload.php1,411 ▲114.23 ▲0.0499.01 ▼4.0046.98 ▲2.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 207× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/setasign/fpdi/src/PdfParser/Type/PdfNumeric.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Tag/P.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Tag/TocEntry.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Tag/Dl.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Barcode/Msi.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Tag/Main.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'TCPDF' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/setasign/fpdi/src/Tcpdf/Fpdi.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Tag/Bdi.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/alpha-insights-intelligent-profit-reports-for-woocommerce/includes/helpers/mpdf/vendor/mpdf/mpdf/src/Tag/Table.php:8

User-side errors Passed 1 test

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


Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
You can take inspiration from this readme.txt

alpha-insights-intelligent-profit-reports-for-woocommerce/wpd-alpha-insights-free.php 77% from 13 tests

The main file in "Alpha Insights - Intelligent Profit Reports For WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("alpha-insights-intelligent-profit-reports-for-woocommerce.php" instead of "wpd-alpha-insights-free.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 158 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin89,810 lines of code in 426 files:
LanguageFilesBlank linesComment linesLines of code
Bourne Shell1203

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 7,009)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity60.67
▷ Minimum class complexity1.00
▷ Maximum class complexity7,009.00
Average method complexity13.28
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
▷ Abstract classes93.15%
▷ Concrete classes27796.85%
▷ Final classes134.69%
▷ Static methods1248.43%
▷ Public methods1,29187.76%
▷ Protected methods543.67%
▷ Private methods1268.57%
▷ Named functions11183.46%
▷ Anonymous functions2216.54%
▷ Global constants224.95%
▷ Class constants42295.05%
▷ Public constants422100.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
8 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-icons_777620_256x240.png4.57KB4.18KB▼ 8.43%
assets/css/images/ui-icons_cc0000_256x240.png4.52KB4.18KB▼ 7.56%
assets/css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
assets/img/Alpha-Insights-Icon-Large.png55.53KB21.80KB▼ 60.74%