68% accumulus-subscription-commerce

Code Review | Accumulus Subscription Commerce

WordPress plugin Accumulus Subscription Commerce scored68%from 54 tests.

About plugin

  • Plugin page: accumulus-subscri...
  • Plugin version: 2.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Mar 20, 2018
  • Latest release: Aug 16, 2019
  • Number of updates: 35
  • Update frequency: every 15.6 days
  • Top authors: accumulus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,162 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.55MB] [CPU: ▼29.11ms] Passed 4 tests

This is a short check of server-side resources used by Accumulus Subscription Commerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3447.28 ▲7.43
Dashboard /wp-admin3.39 ▲0.0931.39 ▼20.80
Posts /wp-admin/edit.php3.39 ▲0.0432.69 ▼20.23
Add New Post /wp-admin/post-new.php3.39 ▼2.4929.81 ▼56.29
Media Library /wp-admin/upload.php3.39 ▲0.1626.05 ▼19.12
Accumulus /wp-admin/options-general.php?page=accumulus3.4835.77

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 506 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Accumulus Subscription Commerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.44 ▲0.091.74 ▼0.0742.35 ▼0.99
Dashboard /wp-admin2,207 ▲195.82 ▲0.94100.19 ▼12.7837.14 ▼6.87
Posts /wp-admin/edit.php2,093 ▲72.02 ▲0.0235.54 ▼2.9635.21 ▼5.84
Add New Post /wp-admin/post-new.php1,527 ▲1323.31 ▲5.74659.05 ▼21.3454.40 ▲0.21
Media Library /wp-admin/upload.php1,395 ▲74.22 ▲0.12103.49 ▼13.2445.20 ▼3.00
Accumulus /wp-admin/options-general.php?page=accumulus9632.0327.4828.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/accumulus-subscription-commerce/settings.php+259
    Undefined index: page
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=accumulus
    • > Notice in wp-content/plugins/accumulus-subscription-commerce/settings.php+171
    Undefined index: showitest

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 64× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/accumulus-subscription-commerce/includes/scripts.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/promises/src/CancellationException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/psr7/src/LazyOpenStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/guzzle/src/Pool.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/accumulus-subscription-commerce/accumulus.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/psr7/src/LimitStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/accumulus-subscription-commerce/vendor/guzzlehttp/psr7/src/MultipartStream.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === accumulus-subscription-commerce === )
  • Screenshots: These screenshots require images: #1 (Accumulus Subscription Commerce Signup Widget for Wordpress), #2 (Accumulus WordPress Settings)
Please take inspiration from this readme.txt

accumulus-subscription-commerce/accumulus.php 92% from 13 tests

The entry point to "Accumulus Subscription Commerce" version 2.5.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("accumulus-subscription-commerce.php" instead of "accumulus.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin29,486 lines of code in 436 files:
LanguageFilesBlank linesComment linesLines of code
PHP1332,1546,65210,222
JavaScript2181,9162,9609,690
Markdown171,25103,762
CSS103503583,130
JSON126701,443
HTML2115312855
SVG1803210
YAML26056
PO File1201953
XML20053
make1409
Bourne Shell1203

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.95
▷ Minimum class complexity1.00
▷ Maximum class complexity80.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces15
Interfaces15
Traits8
Classes83
▷ Abstract classes22.41%
▷ Concrete classes8197.59%
▷ Final classes78.64%
Methods771
▷ Static methods658.43%
▷ Public methods59777.43%
▷ Protected methods648.30%
▷ Private methods11014.27%
Functions179
▷ Named functions9150.84%
▷ Anonymous functions8849.16%
Constants56
▷ Global constants58.93%
▷ Class constants5191.07%
▷ Public constants51100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
47 PNG files occupy 0.44MB with 0.16MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/themes/default/images/ui-icons_666666_256x240.png6.82KB4.17KB▼ 38.82%
public/images/check_tmb.png1.57KB1.32KB▼ 16.07%
public/css/themes/default/images/ui-bg_flat_65_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
public/css/themes/default/images/ui-bg_flat_0_eeeeee_40x100.png0.21KB0.08KB▼ 60.45%
public/css/themes/default/images/ui-icons_ff3333_256x240.png4.44KB4.17KB▼ 6.02%