83% targetpay-by-idealpluginsnl

Code Review | TargetPay for Woocommerce

WordPress plugin TargetPay for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: targetpay-by-idea...
  • Plugin version: 2.2.1 - bugfixes...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.1
  • WordPress version: 6.3.1
  • First release: Oct 3, 2016
  • Latest release: Mar 10, 2017
  • Number of updates: 11
  • Update frequency: every 14.7 days
  • Top authors: idealplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /31,170 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by TargetPay for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0635.56 ▼6.41
Dashboard /wp-admin3.38 ▲0.0245.97 ▼17.72
Posts /wp-admin/edit.php3.49 ▲0.1347.83 ▼1.89
Add New Post /wp-admin/post-new.php5.96 ▲0.0691.62 ▼20.24
Media Library /wp-admin/upload.php3.30 ▲0.0634.79 ▼1.35

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for TargetPay for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.67 ▲0.331.75 ▲0.1439.54 ▼2.69
Dashboard /wp-admin2,198 ▲215.64 ▼0.0093.87 ▼0.2340.08 ▼3.13
Posts /wp-admin/edit.php2,100 ▼31.99 ▼0.0239.64 ▲3.3538.87 ▲9.73
Add New Post /wp-admin/post-new.php1,526 ▼023.57 ▲0.56605.25 ▼69.6247.49 ▼12.15
Media Library /wp-admin/upload.php1,400 ▲64.18 ▲0.0593.73 ▼5.7141.24 ▼0.84

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • 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
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/targetpay-by-idealpluginsnl/targetpay.php:21

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)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === targetpay-by-idealpluginsnl === )
  • Screenshots: No descriptions were found for these screenshots #2, #3, #4 in targetpay-by-idealpluginsnl/assets to your readme.txt
You can take inspiration from this readme.txt

targetpay-by-idealpluginsnl/targetpay.php 85% from 13 tests

Analyzing the main PHP file in "TargetPay for Woocommerce" version 2.2.1 - bugfixes...
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("targetpay-by-idealpluginsnl.php" instead of "targetpay.php")
  • Version: Plugin version number should only contain digits separated by dots (ex. "1.0.3" instead of "2.2.1 - bugfixes...")

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
Good job! No executable or dangerous file extensions detected723 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2166168706
Markdown111017

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods4495.65%
▷ Protected methods12.17%
▷ Private methods12.17%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants18.33%
▷ Class constants1191.67%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/admin_header.png5.23KB2.52KB▼ 51.77%
images/MRC_24.png2.18KB1.15KB▼ 47.06%
images/MRC_60.png4.63KB1.95KB▼ 58.01%
images/IDE_60.png3.61KB2.18KB▼ 39.72%
images/AFT_24.png1.32KB1.43KB0.00%