77% advanced-reporting-for-woocommerce

Code Review | Advanced Reporting for Woocommerce

WordPress plugin Advanced Reporting for Woocommerce scored 77% from 54 tests.

About plugin

  • Plugin page: advanced-reportin...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.6
  • WordPress version: 5.9.2
  • First release: Sep 14, 2016
  • Latest release: Dec 28, 2020
  • Number of updates: 154
  • Update frequency: every 10.2 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active / 24,260 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼294.08ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Reporting for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4156.18 ▼1.42
Dashboard /wp-admin3.79 ▲0.3844.73 ▲11.75
Posts /wp-admin/edit.php4.01 ▲0.3742.24 ▲5.12
Add New Post /wp-admin/post-new.php7.32 ▲0.3597.74 ▼1,180.59
Media Library /wp-admin/upload.php3.73 ▲0.4326.07 ▲0.59
Settings /wp-admin/admin.php?page=phoen_report_setting3.7025.36
Reports /wp-admin/admin.php?page=advanced_reporting_for_woocommerce4.0039.98
Install Plugins /wp-admin/themes.php?page=tgm-support-ticket-system-install-plugins3.7325.36

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 78 new files
Database: no new tables, 2 new options
New WordPress options
phoen_reportings_enable
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Reporting for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,842 ▲8816.19 ▲0.536.79 ▼0.692.16 ▼0.50
Dashboard /wp-admin2,969 ▲1116.16 ▼0.08132.94 ▼3.98248.71 ▲87.04
Posts /wp-admin/edit.php2,775 ▲843.25 ▲0.0266.37 ▲1.80158.92 ▲10.86
Add New Post /wp-admin/post-new.php1,722 ▲6119.25 ▼3.54405.32 ▼68.12255.36 ▲98.31
Media Library /wp-admin/upload.php1,780 ▲825.59 ▲0.05127.69 ▼15.46305.55 ▲119.98
Settings /wp-admin/admin.php?page=phoen_report_setting1,9049.05247.72198.48
Reports /wp-admin/admin.php?page=advanced_reporting_for_woocommerce9621.9838.77134.65
Install Plugins /wp-admin/themes.php?page=tgm-support-ticket-system-install-plugins1,2822.4455.30133.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • phoen_reportings_enable
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=advanced_reporting_for_woocommerce
    • > Error in wp-content/plugins/advanced-reporting-for-woocommerce/includes/phoe_reporting.php+608
    Uncaught Error: Call to undefined function get_woocommerce_currency_symbol() in wp-content/plugins/advanced-reporting-for-woocommerce/includes/phoe_reporting.php:608
    Stack trace:
    #0 wp-content/plugins/advanced-reporting-for-woocommerce/phoen_advance_reporting.php(59): include_once()
    #1 wp-includes/class-wp-hook.php(307): phoe_advance_reporting()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/advanced-reporting-for-woocommerce/includes/phoe_reporting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-reporting-for-woocommerce/phoen_advance_reporting.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/advanced-reporting-for-woocommerce/includes/phoen_reporting_settings.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/advanced-reporting-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/advanced-reporting-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/advanced-reporting-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
Attributes that need to be fixed:
  • Tags: You are using too many tags: 31 tag instead of maximum 10
The official readme.txt might help

advanced-reporting-for-woocommerce/phoen_advance_reporting.php 77% from 13 tests

Analyzing the main PHP file in "Advanced Reporting for Woocommerce" version 3.0
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("advanced-reporting-for-woocommerce.php" instead of "phoen_advance_reporting.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 227 characters long)

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
Success! There were no dangerous files found in this plugin16,670 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
CSS364409,569
PHP71,2381,6633,114
Sass1434341,656
LESS1434441,646
SVG100685

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
17 PNG files occupy 0.47MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/button2.png3.58KB2.59KB▼ 27.61%
assets/screenshot-5.png62.55KB17.98KB▼ 71.25%
assets/screenshot-6.png23.02KB7.24KB▼ 68.53%
assets/screenshot-2.png49.74KB14.39KB▼ 71.07%
assets/images/premium-head.png6.61KB5.20KB▼ 21.37%