83% campay-shortcode-payment-gateway

Code Review | CamPay Shortcode Payment Gateway

WordPress plugin CamPay Shortcode Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: campay-shortcode-...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2021
  • Latest release: Jun 23, 2023
  • Number of updates: 36
  • Update frequency: every 19.5 days
  • Top authors: campay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /558 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.15MB] [CPU: ▼3.51ms] Passed 4 tests

A check of server-side resources used by CamPay Shortcode Payment Gateway
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1438.93 ▼6.85
Dashboard /wp-admin3.45 ▲0.1547.23 ▼0.95
Posts /wp-admin/edit.php3.56 ▲0.2149.70 ▼2.07
Add New Post /wp-admin/post-new.php6.03 ▲0.1585.01 ▼4.18
Media Library /wp-admin/upload.php3.37 ▲0.1542.06 ▲4.78
Campay Settings /wp-admin/options-general.php?page=campay_shortcode_gateway3.3432.55

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for CamPay Shortcode Payment Gateway
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲13013.52 ▼0.888.13 ▲6.1742.48 ▲2.16
Dashboard /wp-admin2,214 ▲345.58 ▼0.1484.30 ▼9.7741.91 ▲1.00
Posts /wp-admin/edit.php2,116 ▲162.02 ▲0.0336.71 ▼0.8035.81 ▼2.12
Add New Post /wp-admin/post-new.php1,539 ▲1123.02 ▼0.10680.67 ▲65.9757.70 ▲12.89
Media Library /wp-admin/upload.php1,416 ▲224.24 ▲0.01100.71 ▼8.7445.86 ▼1.97
Campay Settings /wp-admin/options-general.php?page=campay_shortcode_gateway8122.0322.9630.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/campay-shortcode-payment-gateway/campay_shortcode_gateway.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Contributors: Plugin contributors not specified
  • Screenshots: Screenshot #1 (Admin dashboard screenshot-1.png) image not found
The official readme.txt is a good inspiration

campay-shortcode-payment-gateway/campay_shortcode_gateway.php 92% from 13 tests

"CamPay Shortcode Payment Gateway" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("campay-shortcode-payment-gateway.php" instead of "campay_shortcode_gateway.php")

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 plugin789 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP112546572
CSS153111
JavaScript12345106

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods14.55%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin