84% contrast-woocommerce-giftcards

Code Review | Contrast Digital - WooCommerce Gift Cards

WordPress plugin Contrast Digital - WooCommerce Gift Cards scored 84% from 54 tests.

About plugin

  • Plugin page: contrast-woocomme...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0+
  • WordPress version: 6.3.1
  • First release: Sep 2, 2016
  • Latest release: Sep 2, 2016
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: contrastdigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 913 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼0.20ms] Passed 4 tests

An overview of server-side resources used by Contrast Digital - WooCommerce Gift Cards
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.01 ▼2.11
Dashboard /wp-admin3.35 ▲0.0551.26 ▲4.36
Posts /wp-admin/edit.php3.40 ▲0.0548.98 ▲0.15
Add New Post /wp-admin/post-new.php5.93 ▲0.0590.48 ▼1.92
Media Library /wp-admin/upload.php3.28 ▲0.0537.43 ▲3.07

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Contrast Digital - WooCommerce Gift Cards
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.64 ▼0.714.40 ▲2.8139.68 ▼2.56
Dashboard /wp-admin2,203 ▲155.83 ▼0.07100.10 ▼2.5636.01 ▼1.31
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0239.86 ▲5.1132.12 ▼0.03
Add New Post /wp-admin/post-new.php1,534 ▲123.19 ▲0.01602.40 ▼10.3871.72 ▲9.91
Media Library /wp-admin/upload.php1,385 ▼34.18 ▲0.06100.53 ▼4.6341.14 ▼0.79

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

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

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/contrast-woocommerce-giftcards/cntrst-woocommerce-giftcards.php:31

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tested up to: Version format is invalid
You can look at the official readme.txt

contrast-woocommerce-giftcards/cntrst-woocommerce-giftcards.php 92% from 13 tests

The main PHP file in "Contrast Digital - WooCommerce Gift Cards" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("contrast-woocommerce-giftcards.php" instead of "cntrst-woocommerce-giftcards.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected284 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15169245
PO File1103039

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin