82% in-stock-mailer-for-woocommerce

Code Review | In Stock Mailer for WooCommerce

WordPress plugin In Stock Mailer for WooCommerce scored82%from 54 tests.

About plugin

  • Plugin page: in-stock-mailer-f...
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.6.1
  • WordPress version: 6.3.1
  • First release: Mar 14, 2020
  • Latest release: Feb 9, 2021
  • Number of updates: 61
  • Update frequency: every 5.5 days
  • Top authors: frankspress (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /3,070 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
Install script ran successfully

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

Server-side resources used by In Stock Mailer for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.62 ▼8.15
Dashboard /wp-admin3.31 ▲0.0048.30 ▼7.88
Posts /wp-admin/edit.php3.36 ▲0.0050.87 ▲0.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.64 ▼3.02
Media Library /wp-admin/upload.php3.23 ▲0.0037.19 ▲0.94

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 538 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

In Stock Mailer for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.28 ▼1.241.63 ▼0.5439.81 ▼5.70
Dashboard /wp-admin2,224 ▲215.85 ▲0.03101.23 ▼3.4540.45 ▼6.52
Posts /wp-admin/edit.php2,103 ▲32.05 ▲0.0538.58 ▲0.6835.23 ▼1.60
Add New Post /wp-admin/post-new.php1,536 ▲1023.21 ▲5.56615.66 ▼67.6952.14 ▼10.40
Media Library /wp-admin/upload.php1,394 ▼34.18 ▼0.08100.53 ▼13.7542.08 ▼4.81

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, 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
Please take a closer look at the following
  • 205× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Test\\TestCase' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/ramsey/uuid/tests/Provider/Time/SystemTimeProviderTest.php:9
    • > PHP Fatal error
      Cannot declare class AssertionError, because the name is already in use in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/symfony/polyfill-php70/Resources/stubs/AssertionError.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Tests\\Psr7\\BaseTest' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/guzzlehttp/psr7/tests/MimeTypeTest.php:7
    • > PHP Fatal error
      Cannot declare class Error, because the name is already in use in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/symfony/polyfill-php70/Resources/stubs/Error.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/guzzlehttp/promises/src/AggregateException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Converter\\TimeConverterInterface' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/ramsey/uuid/src/Converter/Time/DegradedTimeConverter.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Tests\\Psr7\\BaseTest' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\Tests\\Thennable' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'MailchimpMarketing\\Configuration' not found in wp-content/plugins/in-stock-mailer-for-woocommerce/vendor/mailchimp/marketing/lib/ApiClient.php:7

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)
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: Please take inspiration from this readme.txt

in-stock-mailer-for-woocommerce/in-stock-mailer-for-wc.php 69% from 13 tests

The primary PHP file in "In Stock Mailer for WooCommerce" version 2.1.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.9" instead of "3.5")
  • Git Repository: Please remove the Git repository from this plugin
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("in-stock-mailer-for-woocommerce.php" instead of "in-stock-mailer-for-wc.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin101,117 lines of code in 480 files:
LanguageFilesBlank linesComment linesLines of code
PHP35012,08813,46282,782
Markdown321,59104,760
CSS51681213,177
SVG1002,671
Sass1434341,768
LESS1434441,758
JSON15001,385
reStructuredText98651,0881,138
JavaScript513487815
YAML10520295
make55611226
XML710129
Bourne Shell94331115
Python25711466
Dockerfile211032

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 1,890)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity31.74
▷ Minimum class complexity1.00
▷ Maximum class complexity1,890.00
Average method complexity4.31
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces46
Interfaces27
Traits4
Classes272
▷ Abstract classes10.37%
▷ Concrete classes27199.63%
▷ Final classes2810.33%
Methods3,133
▷ Static methods2247.15%
▷ Public methods2,64584.42%
▷ Protected methods32710.44%
▷ Private methods1615.14%
Functions607
▷ Named functions12821.09%
▷ Anonymous functions47978.91%
Constants197
▷ Global constants5326.90%
▷ Class constants14473.10%
▷ Public constants144100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.79MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/isa-inline-logo.png247.47KB69.30KB▼ 72.00%
assets/img/mchimp-no-consent.png16.42KB8.10KB▼ 50.67%
assets/img/mchimp-chimped.png12.18KB5.02KB▼ 58.79%
includes/options/img/isa-inline-logo.png190.93KB60.24KB▼ 68.45%
includes/options/img/banner-772x250.png44.52KB14.24KB▼ 68.02%