84% edd-first-time-buyers-gift

Code Review | EDD First Time Buyer's Gift

WordPress plugin EDD First Time Buyer's Gift scored84%from 54 tests.

About plugin

  • Plugin page: edd-first-time-bu...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 3, 2015
  • Latest release: Dec 9, 2018
  • Number of updates: 8
  • Update frequency: every 168.3 days
  • Top authors: EngageWP (87.5%)renventura (25%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,308 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼9.74ms] Passed 4 tests

Server-side resources used by EDD First Time Buyer's Gift
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.48 ▼0.50
Dashboard /wp-admin3.35 ▲0.0051.06 ▼16.24
Posts /wp-admin/edit.php3.40 ▲0.0450.20 ▼2.82
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.44 ▼19.41
Media Library /wp-admin/upload.php3.27 ▲0.0439.48 ▲3.52

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by EDD First Time Buyer's Gift
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.58 ▼0.801.66 ▼0.2841.36 ▲0.07
Dashboard /wp-admin2,206 ▲155.85 ▲0.9897.62 ▼8.8236.16 ▼6.83
Posts /wp-admin/edit.php2,089 ▼32.00 ▲0.0238.10 ▼2.3833.78 ▼3.68
Add New Post /wp-admin/post-new.php1,514 ▼517.49 ▼5.75688.54 ▲77.2555.04 ▲8.21
Media Library /wp-admin/upload.php1,388 ▼34.16 ▼0.0398.58 ▼4.3944.83 ▼5.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/edd-first-time-buyers-gift/includes/admin/shortcodes.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/edd-first-time-buyers-gift/includes/admin/register-settings.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/edd-first-time-buyers-gift/includes/admin/register-settings.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: easy digital downloads, coupons, discounts

edd-first-time-buyers-gift/edd-first-time-buyers-gift.php Passed 13 tests

The main PHP script in "EDD First Time Buyer's Gift" version 1.1 is automatically included on every request by WordPress
127 characters long description:
Increase customer satisfaction and repeat business by generating and assigning discounts for buyers after their first purchase.

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
There were no executable files found in this plugin161 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP477110161

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin