84% gift-on-registration

Code Review | Gift on User Registration

WordPress plugin Gift on User Registration scored84%from 54 tests.

About plugin

  • Plugin page: gift-on-registration
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Jan 25, 2014
  • Latest release: Jan 30, 2014
  • Number of updates: 7
  • Update frequency: every 0.7 days
  • Top authors: igmoweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /954 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

An overview of server-side resources used by Gift on User Registration
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.05 ▼2.77
Dashboard /wp-admin3.35 ▲0.0545.43 ▼4.62
Posts /wp-admin/edit.php3.47 ▲0.1146.72 ▼0.37
Add New Post /wp-admin/post-new.php5.93 ▲0.0579.08 ▼19.26
Media Library /wp-admin/upload.php3.28 ▲0.0534.90 ▼0.14
Gift on Registration /wp-admin/options-general.php?page=gour_page3.2430.93

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gift on User Registration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3313.29 ▼1.376.50 ▲4.4641.97 ▲3.34
Dashboard /wp-admin2,210 ▲225.90 ▼0.0399.79 ▼2.9939.16 ▼2.44
Posts /wp-admin/edit.php2,096 ▲71.99 ▼0.0039.33 ▲2.5934.17 ▲2.17
Add New Post /wp-admin/post-new.php1,536 ▲1723.35 ▲0.25655.76 ▼0.9055.55 ▲1.66
Media Library /wp-admin/upload.php1,386 ▲14.22 ▲0.0096.53 ▼19.3440.59 ▼8.46
Gift on Registration /wp-admin/options-general.php?page=gour_page7892.0623.4227.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gift-on-registration/gift-on-registration.php:64

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === gift-on-registration === )
  • Donate link: Please fix this invalid URI: ""
You can look at the official readme.txt

gift-on-registration/gift-on-registration.php Passed 13 tests

The main file in "Gift on User Registration" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
50 characters long description:
Sends a gift (file) to every newly registered user

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
No dangerous file extensions were detected273 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP27552181
PO File222248092

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.26
Average class complexity10.50
▷ Minimum class complexity6.00
▷ Maximum class complexity15.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/gift.png25.01KB8.44KB▼ 66.26%