84% woocommerce-advanced-newsletter-integration-ani

Code Review | WooCommerce Advanced Newsletter(WAN)

WordPress plugin WooCommerce Advanced Newsletter(WAN) scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-advan...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 11, 2014
  • Latest release: Dec 11, 2014
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: wptreasure (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,514 total downloads

Benchmarks

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.01MB] [CPU: ▼2.96ms] Passed 4 tests

A check of server-side resources used by WooCommerce Advanced Newsletter(WAN)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.94 ▼3.70
Dashboard /wp-admin3.31 ▲0.0152.76 ▼1.30
Posts /wp-admin/edit.php3.36 ▲0.0150.63 ▼0.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.53 ▼6.66
Media Library /wp-admin/upload.php3.24 ▲0.0136.93 ▲1.68

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Advanced Newsletter(WAN)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▼0.361.67 ▼0.1443.91 ▲0.56
Dashboard /wp-admin2,192 ▲155.55 ▼0.1689.18 ▼2.9037.21 ▼4.78
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0135.52 ▼4.8035.10 ▼6.01
Add New Post /wp-admin/post-new.php1,531 ▲523.11 ▼0.12687.65 ▲0.9462.68 ▲9.75
Media Library /wp-admin/upload.php1,400 ▼04.21 ▼0.0095.98 ▼11.9442.19 ▼13.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
Everything seems fine, however this is by no means an exhaustive test

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-advanced-newsletter-integration-ani/woocommerce-newsletter.php:11
    • > PHP Warning
      require_once(wp-content/plugins/woocommerce-advanced-newsletter-integration-ani/classes/api/ML_Rest_Base.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-advanced-newsletter-integration-ani/classes/api/ML_Rest.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/woocommerce-advanced-newsletter-integration-ani/classes/api/ML_Rest_Base.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-advanced-newsletter-integration-ani/classes/api/ML_Rest.php on line 3

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 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
The official readme.txt is a good inspiration

woocommerce-advanced-newsletter-integration-ani/woocommerce-newsletter.php 92% from 13 tests

Analyzing the main PHP file in "WooCommerce Advanced Newsletter(WAN)" version 1.0.0
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("woocommerce-advanced-newsletter-integration-ani.php" instead of "woocommerce-newsletter.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin902 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8151100889
JavaScript12213

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.29
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods66
▷ Static methods11.52%
▷ Public methods5989.39%
▷ Protected methods710.61%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected