58% afterinc-app

Code Review | After Product Protection Plan

WordPress plugin After Product Protection Plan scored 58% from 54 tests.

About plugin

  • Plugin page: afterinc-app
  • Plugin version: 3.7.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0.2
  • WordPress version: 6.3.1
  • First release: Apr 11, 2022
  • Latest release: Jun 16, 2023
  • Number of updates: 172
  • Update frequency: every 2.5 days
  • Top authors: aftercommerce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,475 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.86MB] [CPU: ▼35.39ms] Passed 4 tests

An overview of server-side resources used by After Product Protection Plan
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1136.97 ▼7.12
Dashboard /wp-admin3.09 ▼0.2224.53 ▼27.12
Posts /wp-admin/edit.php3.09 ▼0.2723.39 ▼27.17
Add New Post /wp-admin/post-new.php3.09 ▼2.8024.67 ▼75.46
Media Library /wp-admin/upload.php3.09 ▼0.1424.39 ▼11.82
Bulk Product Update /wp-admin/admin.php?page=Bulk-Product-Update3.0927.50

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for After Product Protection Plan
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲17614.38 ▼0.016.38 ▲3.8941.07 ▼11.92
Dashboard /wp-admin2,247 ▲595.37 ▼0.51116.02 ▼0.3637.35 ▼8.25
Posts /wp-admin/edit.php2,141 ▲492.44 ▲0.4137.96 ▼7.1028.92 ▼7.23
Add New Post /wp-admin/post-new.php1,704 ▲19023.01 ▲5.52643.22 ▼39.3033.34 ▼13.85
Media Library /wp-admin/upload.php1,498 ▲1104.51 ▲0.31101.37 ▲5.2438.36 ▼3.65
Settings /wp-admin/admin.php?page=After Plans1,2222.1028.8130.54
Bulk Product Update /wp-admin/admin.php?page=Bulk-Product-Update9531.9931.0927.17

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 validation failed for this plugin
    • > 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.)
  • The plugin did not uninstall successfully, leaving 7 tables in the database
    • warranty_calc
    • quickcover_contract
    • quickcover_cron_status
    • batchsync_status
    • product_warranty
    • product_backup
    • app_configurations
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • jal_db_version
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 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=Bulk-Product-Update
    • > Notice in wp-content/plugins/afterinc-app/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/afterinc-app/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/afterinc-app/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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/afterinc-app/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/afterinc-app/bulkUpdate.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/afterinc-app/form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #5 (Cart edit.)
Please take inspiration from this readme.txt

afterinc-app/Custom_app.php 92% from 13 tests

The main PHP script in "After Product Protection Plan" version 3.7.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("afterinc-app.php" instead of "Custom_app.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected3,905 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP47641513,043
JavaScript59951558
CSS44012304

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity366.00
▷ Minimum class complexity366.00
▷ Maximum class complexity366.00
Average method complexity6.89
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods62
▷ Static methods00.00%
▷ Public methods62100.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%