84% edd-purchase-rewards

Code Review | EDD Purchase Rewards

WordPress plugin EDD Purchase Rewards scored84%from 54 tests.

About plugin

  • Plugin page: edd-purchase-rewards
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.1
  • WordPress version: 6.3.1
  • First release: May 21, 2014
  • Latest release: Apr 13, 2015
  • Number of updates: 14
  • Update frequency: every 23.8 days
  • Top authors: sumobi (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /6,443 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼11.28ms] Passed 4 tests

Server-side resources used by EDD Purchase Rewards
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.46 ▼2.41
Dashboard /wp-admin3.34 ▲0.0449.05 ▼2.04
Posts /wp-admin/edit.php3.46 ▲0.1047.85 ▼15.25
Add New Post /wp-admin/post-new.php5.92 ▲0.0483.22 ▼25.43
Media Library /wp-admin/upload.php3.26 ▲0.0440.24 ▲2.22

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

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

Browser metrics Passed 4 tests

A check of browser resources used by EDD Purchase Rewards
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲914.25 ▼0.101.76 ▼0.2647.32 ▲0.53
Dashboard /wp-admin2,198 ▲185.51 ▼0.1182.37 ▼4.5738.75 ▼5.81
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0135.16 ▼5.8036.20 ▼2.96
Add New Post /wp-admin/post-new.php1,532 ▲623.20 ▼0.09659.36 ▼42.4964.26 ▼1.57
Media Library /wp-admin/upload.php1,406 ▲64.18 ▼0.0398.79 ▼6.0945.45 ▲0.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/edd-purchase-rewards/includes/template-functions.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/edd-purchase-rewards/includes/scripts.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes: You can take inspiration from this readme.txt

edd-purchase-rewards/edd-purchase-rewards.php Passed 13 tests

Analyzing the main PHP file in "EDD Purchase Rewards" version 1.1
64 characters long description:
Increase sales and build customer loyalty by rewarding customers

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected1,195 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP10301443933
PO File16262262

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.50
▷ Minimum class complexity5.00
▷ Maximum class complexity26.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods38
▷ Static methods25.26%
▷ Public methods3489.47%
▷ Protected methods00.00%
▷ Private methods410.53%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin