74% paypal-gift-certificate

Code Review | Easy PayPal Gift Certificate

WordPress plugin Easy PayPal Gift Certificate scored74%from 54 tests.

About plugin

  • Plugin page: paypal-gift-certi...
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 6.3.1
  • First release: Jan 19, 2015
  • Latest release: Dec 12, 2016
  • Number of updates: 32
  • Update frequency: every 21.7 days
  • Top authors: scottpaterson (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /5,602 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

Server-side resources used by Easy PayPal Gift Certificate
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0839.67 ▼7.13
Dashboard /wp-admin3.39 ▲0.0950.17 ▼4.20
Posts /wp-admin/edit.php3.44 ▲0.0857.68 ▲6.65
Add New Post /wp-admin/post-new.php5.97 ▲0.09112.42 ▲2.47
Media Library /wp-admin/upload.php3.31 ▲0.0842.40 ▼0.31
Easy PayPal GC /wp-admin/options-general.php?page=paypal-gift-certificate-settings3.2832.81

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
wpppgc_my_plugin_notice_shown
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
wpppgc_settingsoptions
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Easy PayPal Gift Certificate
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.28 ▲0.002.46 ▲0.7867.14 ▲23.93
Dashboard /wp-admin2,202 ▲255.60 ▼0.0690.18 ▼6.1042.00 ▲0.66
Posts /wp-admin/edit.php2,104 ▲12.02 ▲0.0740.10 ▼2.6637.56 ▲1.43
Add New Post /wp-admin/post-new.php1,584 ▲5623.51 ▲0.51669.17 ▲58.9350.43 ▼5.16
Media Library /wp-admin/upload.php1,401 ▲44.24 ▲0.06104.52 ▲3.4347.79 ▲1.06
Easy PayPal GC /wp-admin/options-general.php?page=paypal-gift-certificate-settings1,4452.0127.8646.33

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method wpppgc_wpppgc::wpppgc_deactivate() should not be called statically
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • wpppgc_settingsoptions
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • 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
Good news, no errors were detected

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_deactivation_hook() in wp-content/plugins/paypal-gift-certificate/paypal-gift-certificate.php:105

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: gateway, gift certificate, paypal, gift card

paypal-gift-certificate/paypal-gift-certificate.php Passed 13 tests

Analyzing the main PHP file in "Easy PayPal Gift Certificate" version 1.2.3
81 characters long description:
A simple and easy way to integrate Gift Certificates into your WordPress website.

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
No dangerous file extensions were detected523 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP128540523

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods133.33%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin