58% canon-carepak-plus

Code Review | Canon CarePAK Plus

WordPress plugin Canon CarePAK Plus scored58%from 54 tests.

About plugin

  • Plugin page: canon-carepak-plus
  • Plugin version: 2.2.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0.2
  • WordPress version: 6.3.1
  • First release: Nov 10, 2022
  • Latest release: Jun 15, 2023
  • Number of updates: 51
  • Update frequency: every 4.3 days
  • Top authors: canoncarepakquickcover (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /433 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.41MB] [CPU: ▼33.55ms] Passed 4 tests

Analyzing server-side resources used by Canon CarePAK Plus
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5654.39 ▲15.59
Dashboard /wp-admin3.55 ▲0.2029.62 ▼34.71
Posts /wp-admin/edit.php3.55 ▲0.1931.11 ▼19.49
Add New Post /wp-admin/post-new.php3.55 ▼2.3430.13 ▼76.20
Media Library /wp-admin/upload.php3.55 ▲0.3131.26 ▼3.79
Settings /wp-admin/admin.php?page=CanonCarePak3.5524.96
Bulk Product Update /wp-admin/admin.php?page=Bulk-Product-Update3.5525.57

Server storage [IO: ▲0.69MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 23 new files
Database: 7 new tables, 7 new options
New tables
product_backup
batchsync_status
app_configurations
quickcover_contract
quickcover_cron_status
warranty_calc
product_warranty
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
jal_db_version
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Canon CarePAK Plus
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,972 ▲22613.76 ▼0.8311.48 ▲9.7343.59 ▲2.73
Dashboard /wp-admin2,239 ▲655.07 ▼0.6398.13 ▲0.9331.92 ▼9.10
Posts /wp-admin/edit.php2,152 ▲492.43 ▲0.3742.55 ▲0.9533.01 ▼5.51
Add New Post /wp-admin/post-new.php1,715 ▲18423.04 ▼0.17684.45 ▼4.9535.56 ▼27.80
Media Library /wp-admin/upload.php1,510 ▲1164.50 ▲0.29105.28 ▼0.9239.56 ▼8.35
Settings /wp-admin/admin.php?page=CanonCarePak1,2332.1131.7334.24
Bulk Product Update /wp-admin/admin.php?page=Bulk-Product-Update9762.0130.1126.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin does not fully uninstall, leaving 7 tables in the database
    • quickcover_cron_status
    • quickcover_contract
    • app_configurations
    • warranty_calc
    • batchsync_status
    • product_backup
    • product_warranty
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • jal_db_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Bulk-Product-Update
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CanonCarePak
    • > Notice in wp-content/plugins/canon-carepak-plus/form.php+239
    Undefined variable: getTotal_batch
    • > GET request to /wp-admin/admin.php?page=CanonCarePak
    • > Notice in wp-content/plugins/canon-carepak-plus/form.php+175
    Undefined variable: getSuccess_batch
    • > GET request to /wp-admin/admin.php?page=CanonCarePak
    • > Notice in wp-content/plugins/canon-carepak-plus/form.php+176
    Undefined variable: getFailed_batch
    • > GET request to /wp-admin/admin.php?page=CanonCarePak
    • > Notice in wp-content/plugins/canon-carepak-plus/form.php+177
    Undefined variable: get_Latestdate
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Bulk-Product-Update
    • > Notice in wp-content/plugins/canon-carepak-plus/bulkUpdate.php+20
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Bulk-Product-Update
    • > Notice in wp-content/plugins/canon-carepak-plus/bulkUpdate.php+20
    Trying to get property 'name' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Bulk-Product-Update
    • > Notice in wp-content/plugins/canon-carepak-plus/bulkUpdate.php+20
    Trying to get property 'count' of non-object

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
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/canon-carepak-plus/Custom_app.php:36
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/canon-carepak-plus/form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/canon-carepak-plus/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/canon-carepak-plus/bulkUpdate.php:3

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

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: checkout, e-commerce, sales, woo, shop...

canon-carepak-plus/Custom_app.php 92% from 13 tests

"Canon CarePAK Plus" version 2.2.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("canon-carepak-plus.php" instead of "Custom_app.php")

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
Everything looks great! No dangerous files found in this plugin3,988 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP47691703,113
JavaScript59317553
CSS44014322

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity369.00
▷ Minimum class complexity369.00
▷ Maximum class complexity369.00
Average method complexity6.84
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods63
▷ Static methods00.00%
▷ Public methods63100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/scr1.PNG43.33KB25.00KB▼ 42.30%
assets/images/logo.png8.32KB3.95KB▼ 52.50%
assets/scr2.PNG35.83KB15.72KB▼ 56.12%