83% foloosi-subscription

Code Review | Foolosi Subscription for WooCommerce

WordPress plugin Foolosi Subscription for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: foloosi-subscription
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.6
  • WordPress version: 6.3.1
  • First release: Feb 4, 2021
  • Latest release: Feb 18, 2021
  • Number of updates: 7
  • Update frequency: every 2.1 days
  • Top authors: foloosi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /520 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.58ms] Passed 4 tests

An overview of server-side resources used by Foolosi Subscription for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.71 ▼6.83
Dashboard /wp-admin3.33 ▼0.0245.45 ▼15.72
Posts /wp-admin/edit.php3.38 ▲0.0249.44 ▲5.00
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.24 ▼5.52
Media Library /wp-admin/upload.php3.25 ▲0.0232.62 ▼2.23

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Foolosi Subscription for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲9314.81 ▲0.061.95 ▲0.1542.56 ▼0.15
Dashboard /wp-admin2,220 ▲324.91 ▼0.18101.76 ▼17.9242.11 ▼6.05
Posts /wp-admin/edit.php2,106 ▲172.04 ▲0.0440.91 ▲4.2436.40 ▲0.89
Add New Post /wp-admin/post-new.php1,547 ▲2823.38 ▲0.25655.13 ▼40.5855.99 ▲0.58
Media Library /wp-admin/upload.php1,396 ▲84.23 ▲0.0199.90 ▼4.5543.96 ▼0.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • foloosi_recently_activated
    • widget_recent-posts
    • can_compress_scripts
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require_once(wp-content/plugins/foloosi-subscription/plugin-fw/lib/../includes/class-foloosi-debug.php): failed to open stream: No such file or directory in wp-content/plugins/foloosi-subscription/plugin-fw/lib/foloosi-debug.php on line 11
    • > PHP Warning
      require_once(wp-content/plugins/foloosi-subscription/plugin-fw/lib/../includes/class-foloosi-plugin-common.php): failed to open stream: No such file or directory in wp-content/plugins/foloosi-subscription/plugin-fw/lib/foloosi-plugin-common.php on line 11
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/foloosi-subscription/plugin-fw/lib/../includes/class-foloosi-debug.php' (include_path='.:/usr/share/php') in wp-content/plugins/foloosi-subscription/plugin-fw/lib/foloosi-debug.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/foloosi-subscription/plugin-options/privacy-options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/foloosi-subscription/templates/admin/subscriptions-tab.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/foloosi-subscription/plugin-options/subscriptions-options.php:16
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/foloosi-subscription/plugin-fw/lib/../includes/class-foloosi-plugin-common.php' (include_path='.:/usr/share/php') in wp-content/plugins/foloosi-subscription/plugin-fw/lib/foloosi-plugin-common.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/foloosi-subscription/plugin-options/general-options.php:8
    • > PHP Warning
      Use of undefined constant FOLOOSI_FWSBS_INIT - assumed 'FOLOOSI_FWSBS_INIT' (this will throw an Error in a future version of PHP) in wp-content/plugins/foloosi-subscription/plugin-options/subscriptions-options.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/foloosi-subscription/includes/admin/foloosi-subscription-details.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: subscriptions, subscription management, subscription billing, uae, card...

foloosi-subscription/foloosi-subscription-for-woocommerce.php 77% from 13 tests

The principal PHP file in "Foolosi Subscription for WooCommerce" v. 1.0.4 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 248 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("foloosi-subscription.php" instead of "foloosi-subscription-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected13,297 lines of code in 120 files:
LanguageFilesBlank linesComment linesLines of code
PHP931,8653,0707,808
CSS57841293,927
JavaScript192631941,476
SVG20154
XML110832

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity59.00
▷ Minimum class complexity4.00
▷ Maximum class complexity224.00
Average method complexity5.14
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods211
▷ Static methods2310.90%
▷ Public methods19994.31%
▷ Protected methods73.32%
▷ Private methods52.37%
Functions93
▷ Named functions9197.85%
▷ Anonymous functions22.15%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/upgrade.png1.65KB1.17KB▼ 28.95%
plugin-fw/assets/images/spinner.png0.15KB0.14KB▼ 5.88%
plugin-fw/assets/images/x.png0.70KB0.71KB0.00%