10% irecharge

Code Review | iRecharge Plugin

WordPress plugin iRecharge Plugin scored10%from 54 tests.

About plugin

  • Plugin page: irecharge
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 6.3.1
  • First release: Apr 20, 2015
  • Latest release: Sep 4, 2015
  • Number of updates: 27
  • Update frequency: every 5.2 days
  • Top authors: istrategytech (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /3,017 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/irecharge/iRecharge_plugin.php+17
    Undefined index: ist_irecharge_hidden

Server metrics [RAM: ▼1.93MB] [CPU: ▼54.56ms] Passed 4 tests

An overview of server-side resources used by iRecharge Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.98 ▼36.20
Dashboard /wp-admin2.09 ▼1.266.22 ▼56.04
Posts /wp-admin/edit.php2.09 ▼1.275.56 ▼38.34
Add New Post /wp-admin/post-new.php2.09 ▼3.805.14 ▼87.67
Media Library /wp-admin/upload.php2.09 ▼1.146.55 ▼28.08
iRecharge Vendor Set /wp-admin/options-general.php?page=iRecharge-Vendor-Set2.095.61

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

iRecharge Plugin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲14213.39 ▼0.969.17 ▲7.4642.09 ▼1.00
Dashboard /wp-admin2,199 ▲255.63 ▲0.0191.82 ▼8.7944.95 ▲2.92
Posts /wp-admin/edit.php2,113 ▲102.03 ▲0.0340.42 ▲4.1333.26 ▼4.62
Add New Post /wp-admin/post-new.php1,532 ▲623.20 ▲2.21618.19 ▼73.7849.69 ▼17.07
Media Library /wp-admin/upload.php1,404 ▲74.19 ▲0.04108.99 ▲9.8946.38 ▲0.75
iRecharge Vendor Set /wp-admin/options-general.php?page=iRecharge-Vendor-Set7011.126.5217.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/irecharge/iRecharge_plugin.php+17
    Undefined index: ist_irecharge_hidden
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=iRecharge-Vendor-Set
    • > Notice in wp-content/plugins/irecharge/iRecharge_plugin.php+17
    Undefined index: ist_irecharge_hidden
    • > GET request to /wp-admin/options-general.php?page=iRecharge-Vendor-Set
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=iRecharge-Vendor-Set
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=iRecharge-Vendor-Set
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/irecharge/iRecharge_plugin.php on line 69 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/irecharge/iRecharge_plugin.php(69): do_settings_fields()
    #1 wp-includes/class-wp-hook.php(310): ist_irecharge_admin()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

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 items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/irecharge/iRecharge_plugin.php:31
    • > PHP Notice
      Undefined index: ist_irecharge_hidden in wp-content/plugins/irecharge/iRecharge_plugin.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (/assets/screenshot-1.jpg), #2 (/assets/screenshot-2.jpg)
You can take inspiration from this readme.txt

irecharge/iRecharge_plugin.php 85% from 13 tests

The main PHP file in "iRecharge Plugin" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 427 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("irecharge.php" instead of "iRecharge_plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin230 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1212888
JavaScript2232273
CSS14069

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/airtel.png5.38KB3.25KB▼ 39.62%
img/mtn.png2.05KB1.85KB▼ 9.84%
img/logo.png5.52KB2.74KB▼ 50.35%
icon.png5.52KB2.74KB▼ 50.35%
img/visafone.png2.85KB1.81KB▼ 36.48%