77% advanced-reporting-for-woocommerce

Code Review | Advanced Reporting for Woocommerce

WordPress plugin Advanced Reporting for Woocommerce scored77%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: 6.3.1
  • 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

900+ active /26,576 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▲0.57ms] Passed 4 tests

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.53 ▲0.0740.18 ▼0.69
Dashboard /wp-admin3.42 ▲0.1250.69 ▼0.38
Posts /wp-admin/edit.php3.48 ▲0.1252.60 ▲1.57
Add New Post /wp-admin/post-new.php5.94 ▲0.0697.37 ▲6.81
Media Library /wp-admin/upload.php3.29 ▲0.0638.19 ▲1.78
Install Plugins /wp-admin/themes.php?page=tgm-support-ticket-system-install-plugins3.3633.96
Settings /wp-admin/admin.php?page=phoen_report_setting3.2932.38
Reports /wp-admin/admin.php?page=advanced_reporting_for_woocommerce3.7054.74

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 78 new files
Database: no new tables, 8 new options
New WordPress options
phoen_reportings_enable
theysaidso_admin_options
recovery_mode_email_last_sent
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Reporting for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.15 ▼0.151.68 ▲0.1144.03 ▼0.95
Dashboard /wp-admin2,241 ▲615.79 ▲0.1289.82 ▲2.9175.92 ▲32.20
Posts /wp-admin/edit.php2,171 ▲712.05 ▲0.0840.86 ▲3.4639.75 ▲1.46
Add New Post /wp-admin/post-new.php1,576 ▲4823.17 ▲0.11711.89 ▲17.5359.73 ▼8.02
Media Library /wp-admin/upload.php1,460 ▲604.14 ▼0.0699.93 ▼9.7786.63 ▲40.17
Install Plugins /wp-admin/themes.php?page=tgm-support-ticket-system-install-plugins1,0172.1926.5331.77
Settings /wp-admin/admin.php?page=phoen_report_setting1,4719.41284.0677.14
Reports /wp-admin/admin.php?page=advanced_reporting_for_woocommerce7731.126.9129.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • db_upgraded
    • widget_recent-comments
    • phoen_reportings_enable
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > 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(310): phoe_advance_reporting()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
Please fix the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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 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 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 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 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 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (31 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

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

The main PHP file in "Advanced Reporting for Woocommerce" ver. 3.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 227 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-reporting-for-woocommerce.php" instead of "phoen_advance_reporting.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "2.6.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
No dangerous file extensions were detected16,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
No cyclomatic complexity issues were detected for this plugin
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 0.47MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/premium-head.png6.61KB5.20KB▼ 21.37%
assets/images/image-frame-odd.png0.90KB0.81KB▼ 10.31%
assets/screenshot-5.png62.55KB17.98KB▼ 71.25%
assets/images/image-frame-even.png0.67KB0.62KB▼ 8.42%
assets/images/csv_sheet.png98.85KB24.79KB▼ 74.92%