89% wp-promptpay

Code Review | PromptPay

WordPress plugin PromptPay scored89%from 54 tests.

About plugin

  • Plugin page: wp-promptpay
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.2
  • WordPress version: 6.3.1
  • First release: Sep 11, 2017
  • Latest release: Aug 4, 2020
  • Number of updates: 8
  • Update frequency: every 132.4 days
  • Top authors: jojoee (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /2,366 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.07MB] [CPU: ▲0.25ms] Passed 4 tests

This is a short check of server-side resources used by PromptPay
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0648.25 ▲10.25
Dashboard /wp-admin3.37 ▲0.0746.58 ▼1.44
Posts /wp-admin/edit.php3.48 ▲0.1352.45 ▲8.03
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.19 ▼5.06
Media Library /wp-admin/upload.php3.29 ▲0.0636.01 ▼0.52
PromptPay /wp-admin/options-general.php?page=promptpay3.2631.94

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for PromptPay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲14713.85 ▼0.749.21 ▲7.3243.45 ▼3.86
Dashboard /wp-admin2,215 ▲275.02 ▲0.16111.67 ▼0.9537.96 ▼8.02
Posts /wp-admin/edit.php2,101 ▲92.28 ▲0.2739.73 ▲3.5335.80 ▼1.56
Add New Post /wp-admin/post-new.php1,521 ▲11417.54 ▼2.65667.20 ▲25.4659.24 ▲5.32
Media Library /wp-admin/upload.php1,397 ▲94.43 ▲0.2497.14 ▼5.6043.12 ▼5.74
PromptPay /wp-admin/options-general.php?page=promptpay7451.437.7920.94

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Shortcode (screenshot-1.jpg)), #2 (WooCommerce (screenshot-2.jpg))
  • Donate link: Please fix this invalid url: ""
The official readme.txt might help

wp-promptpay/promptpay.php 85% from 13 tests

The main file in "PromptPay" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-promptpay.php" instead of "promptpay.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 | 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 plugin377 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP16290278
CSS1231686
JavaScript10513

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1780.95%
▷ Protected methods00.00%
▷ Private methods419.05%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin