83% newebpay-payment

Code Review | Newebpay Payment

WordPress plugin Newebpay Payment scored83%from 54 tests.

About plugin

  • Plugin page: newebpay-payment
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-5.9.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2022
  • Latest release: Apr 12, 2023
  • Number of updates: 13
  • Update frequency: every 25.2 days
  • Top authors: newebpay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,351 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.68ms] Passed 4 tests

An overview of server-side resources used by Newebpay Payment
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.85 ▼2.83
Dashboard /wp-admin3.31 ▲0.0147.16 ▼1.12
Posts /wp-admin/edit.php3.37 ▲0.0149.33 ▼1.59
Add New Post /wp-admin/post-new.php5.90 ▲0.01103.50 ▲6.63
Media Library /wp-admin/upload.php3.24 ▲0.0135.59 ▼1.17

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Newebpay Payment: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.23 ▼1.131.52 ▼0.4740.41 ▼5.12
Dashboard /wp-admin2,203 ▲214.86 ▼0.05103.03 ▼4.7238.67 ▼5.57
Posts /wp-admin/edit.php2,089 ▼01.96 ▼0.0640.57 ▲0.9534.36 ▼4.11
Add New Post /wp-admin/post-new.php1,517 ▼1617.81 ▼5.81595.11 ▼111.0248.14 ▼4.19
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0596.57 ▼12.3640.79 ▼5.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant NEWEB_MAIN_PATH - assumed 'NEWEB_MAIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/newebpay-payment/includes/nwp/nwpMPG.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'NEWEB_MAIN_PATH/includes/nwp/baseNwpMPG.php' (include_path='.:/usr/share/php') in wp-content/plugins/newebpay-payment/includes/nwp/nwpMPG.php on line 2
    • > PHP Warning
      require_once(NEWEB_MAIN_PATH/includes/nwp/baseNwpMPG.php): failed to open stream: No such file or directory in wp-content/plugins/newebpay-payment/includes/nwp/nwpMPG.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WC_newebpay' not found in wp-content/plugins/newebpay-payment/includes/api/nwpOthersAPI.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/newebpay-payment/includes/nwp/baseNwpMPG.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Requires php: Version not formatted correctly
The official readme.txt is a good inspiration

newebpay-payment/Central.php 92% from 13 tests

The main file in "Newebpay Payment" v. 1.0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("newebpay-payment.php" instead of "Central.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,657 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP72062251,342
JavaScript3311315

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity25.00
▷ Minimum class complexity1.00
▷ Maximum class complexity79.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods51
▷ Static methods35.88%
▷ Public methods3466.67%
▷ Protected methods23.92%
▷ Private methods1529.41%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon/newebpay.png3.79KB2.76KB▼ 27.27%