90% subscriber-discounts-for-woocommerce

Code Review | Subscriber Discounts for WooCommerce

WordPress plugin Subscriber Discounts for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: subscriber-discou...
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 7, 2017
  • Latest release: Apr 4, 2023
  • Number of updates: 36
  • Update frequency: every 62.4 days
  • Top authors: scott.deluzio (97.22%)ampmode (5.56%)

Code review

54 tests

User reviews

9 reviews

Install metrics

600+ active /12,367 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼1.35ms] Passed 4 tests

Analyzing server-side resources used by Subscriber Discounts for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0939.08 ▼0.65
Dashboard /wp-admin3.41 ▲0.1144.84 ▲0.32
Posts /wp-admin/edit.php3.53 ▲0.1745.65 ▼2.35
Add New Post /wp-admin/post-new.php6.01 ▲0.12103.88 ▲14.76
Media Library /wp-admin/upload.php3.33 ▲0.1035.35 ▼2.72
Subscriber Discounts /wp-admin/admin.php?page=subscriber-discounts-woo3.3130.71

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Subscriber Discounts for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲9713.24 ▼1.141.73 ▲0.1342.88 ▲4.06
Dashboard /wp-admin2,213 ▲245.89 ▲0.98107.78 ▼16.7741.33 ▼2.30
Posts /wp-admin/edit.php2,095 ▲62.01 ▲0.0340.24 ▼0.5135.46 ▼4.32
Add New Post /wp-admin/post-new.php1,521 ▼2317.73 ▼0.74641.08 ▼17.1751.14 ▼17.14
Media Library /wp-admin/upload.php1,398 ▲104.24 ▲0.0299.86 ▼10.1043.20 ▼4.15
Subscriber Discounts /wp-admin/admin.php?page=subscriber-discounts-woo1,2251.9537.4634.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: activecampaign, woocommerce, discounts, mailchimp

subscriber-discounts-for-woocommerce/subscriber-discounts-for-woocommerce.php 92% from 13 tests

The main PHP script in "Subscriber Discounts for WooCommerce" version 1.5.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected6,940 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
HTML36503,200
JavaScript7198342,408
CSS46336663
PHP859155575
JSON20094

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.50
▷ Minimum class complexity3.00
▷ Maximum class complexity17.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
4 compressed PNG files occupy 0.01MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/js/chosen_v1.6.2/chosen-sprite.png0.53KB0.88KB0.00%
includes/js/chosen_v1.6.2/docsupport/oss-credit.png4.30KB3.26KB▼ 24.02%
includes/js/chosen_v1.6.2/docsupport/chosen.png1.47KB2.08KB0.00%
includes/js/chosen_v1.6.2/chosen-sprite@2x.png0.72KB0.83KB0.00%