83% itech-hide-add-cart-if-already-purchased

Code Review | iTech Hide Add Cart If Already Purchased

WordPress plugin iTech Hide Add Cart If Already Purchased scored83%from 54 tests.

About plugin

  • Plugin page: itech-hide-add-ca...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Sep 2, 2021
  • Latest release: Sep 2, 2021
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: itechtheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /253 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by iTech Hide Add Cart If Already Purchased
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0546.82 ▲5.32
Dashboard /wp-admin3.35 ▲0.0548.90 ▼0.36
Posts /wp-admin/edit.php3.47 ▲0.1152.34 ▼2.99
Add New Post /wp-admin/post-new.php5.95 ▲0.0691.53 ▼5.51
Media Library /wp-admin/upload.php3.28 ▲0.0445.64 ▲8.38

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for iTech Hide Add Cart If Already Purchased
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,901 ▲14013.71 ▼0.898.94 ▲7.3845.67 ▲4.51
Dashboard /wp-admin2,196 ▲195.62 ▼0.0086.09 ▼10.2039.72 ▼4.28
Posts /wp-admin/edit.php2,107 ▲71.99 ▲0.0240.25 ▼4.0534.95 ▼2.16
Add New Post /wp-admin/post-new.php1,530 ▲423.04 ▼0.09685.26 ▲66.2054.87 ▼5.60
Media Library /wp-admin/upload.php1,404 ▲44.24 ▲0.0499.49 ▼9.8144.43 ▼4.68

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

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
Everything seems fine, however 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
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/itech-hide-add-cart-if-already-purchased/public/partials/ithacap-public-display.php
    • > /wp-content/plugins/itech-hide-add-cart-if-already-purchased/admin/partials/ithacap-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Setting Page), #2 (Product Archive Page), #3 (Single Product Page)
You can look at the official readme.txt

itech-hide-add-cart-if-already-purchased/ithacap.php 85% from 13 tests

The main file in "iTech Hide Add Cart If Already Purchased" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("itech-hide-add-cart-if-already-purchased.php" instead of "ithacap.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin179 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12120527173
JavaScript24546
CSS2080

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin