90% discount-patreon-connect

Code Review | Patreon Connect: Patron Discount

WordPress plugin Patreon Connect: Patron Discount scored90%from 54 tests.

About plugin

  • Plugin page: discount-patreon-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Jun 21, 2017
  • Latest release: Jun 26, 2017
  • Number of updates: 4
  • Update frequency: every 1.3 days
  • Top authors: uiux (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /812 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.08MB] [CPU: ▼0.14ms] Passed 4 tests

This is a short check of server-side resources used by Patreon Connect: Patron Discount
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0941.66 ▲0.65
Dashboard /wp-admin3.39 ▲0.0845.74 ▼5.43
Posts /wp-admin/edit.php3.44 ▲0.0845.70 ▲2.28
Add New Post /wp-admin/post-new.php5.97 ▲0.0898.95 ▲9.04
Media Library /wp-admin/upload.php3.31 ▲0.0835.26 ▲1.94

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Patreon Connect: Patron Discount
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲5213.70 ▼0.681.85 ▼0.1842.03 ▼5.92
Dashboard /wp-admin2,212 ▲245.82 ▲0.8898.67 ▼16.4841.27 ▼5.73
Posts /wp-admin/edit.php2,100 ▲112.12 ▲0.1136.66 ▲2.3233.70 ▼0.75
Add New Post /wp-admin/post-new.php1,543 ▲1023.08 ▼0.08606.82 ▼89.9549.04 ▼2.84
Media Library /wp-admin/upload.php1,397 ▲94.20 ▲0.0194.85 ▼9.4842.03 ▼2.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The SRP test was a success

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

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: shipping discount, patreon wordpress, cart discount, product discount, patreon...

discount-patreon-connect/patreon-wordpress-discount.php 92% from 13 tests

The main PHP file in "Patreon Connect: Patron Discount" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("discount-patreon-connect.php" instead of "patreon-wordpress-discount.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin500 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP325727500

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity33.50
▷ Minimum class complexity10.00
▷ Maximum class complexity57.00
Average method complexity6.42
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin