10% aistore-recharge

Code Review | AIStore Recharge

WordPress plugin AIStore Recharge scored 10% from 54 tests.

About plugin

  • Plugin page: aistore-recharge
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Feb 14, 2019
  • Latest release: Jul 18, 2020
  • Number of updates: 37
  • Update frequency: every 14.1 days
  • Top authors: susheelhbti (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,510 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Error in wp-content/plugins/aistore-recharge/activate.php+79
    Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/aistore-recharge/activate.php:79
    Stack trace:
    #0 wp-content/plugins/aistore-recharge/activate.php(32): Aistore_Install::cteate_product_if_not_exist()
    #1 wp-includes/class-wp-hook.php(303): Aistore_Install::install()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(698): do_action()

Server metrics [RAM: ▼0.00MB] [CPU: ▼139.39ms] Passed 4 tests

Analyzing server-side resources used by AIStore Recharge
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1231.60 ▲9.75
Dashboard /wp-admin3.06 ▲0.0042.68 ▲4.23
Posts /wp-admin/edit.php3.11 ▲0.0045.22 ▲2.78
Add New Post /wp-admin/post-new.php5.42 ▼0.0288.45 ▼563.79
Media Library /wp-admin/upload.php3.00 ▲0.0033.57 ▼0.79

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: 1 new table, no new options
New tables
wp_recharge

Browser metrics Passed 4 tests

This is an overview of browser requirements for AIStore Recharge
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,689 ▲9315.82 ▲0.169.86 ▼2.2043.05 ▼5.61
Dashboard /wp-admin2,967 ▲335.95 ▼0.05130.22 ▼16.08113.64 ▲0.42
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0163.83 ▲0.38100.15 ▲13.64
Add New Post /wp-admin/post-new.php1,682 ▼118.82 ▲0.14372.35 ▲3.79110.16 ▲3.47
Media Library /wp-admin/upload.php1,810 ▲35.04 ▲0.02137.66 ▼25.00121.07 ▲6.26

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
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_recharge

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/aistore-recharge/template/report.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/aistore-recharge/template/prepaid.php:62
    • > PHP Notice
      Undefined variable: url2 in wp-content/plugins/aistore-recharge/template/gas.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/aistore-recharge/template/dth.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/aistore-recharge/index.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/aistore-recharge/template/electricity.php:56
    • > PHP Notice
      Undefined variable: recharge_amount in wp-content/plugins/aistore-recharge/template/step2.php on line 29
    • > PHP Notice
      Undefined variable: url2 in wp-content/plugins/aistore-recharge/template/postpaid.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/aistore-recharge/template/postpaid.php:55
    • > PHP Notice
      Undefined variable: url2 in wp-content/plugins/aistore-recharge/template/electricity.php on line 8
    • > PHP Notice
      Undefined variable: url2 in wp-content/plugins/aistore-recharge/template/prepaid.php on line 7

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
There were no plugin tags found

aistore-recharge/index.php 92% from 13 tests

The main PHP file in "AIStore Recharge" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("aistore-recharge.php" instead of "index.php")

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
There were no executable files found in this plugin1,223 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP12757711,223

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods4100.00%
▷ Public methods250.00%
▷ Protected methods00.00%
▷ Private methods250.00%
Functions19
▷ Named functions1894.74%
▷ Anonymous functions15.26%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin