68% charjing

Code Review | Charjing For Subscription Billing

WordPress plugin Charjing For Subscription Billing scored68%from 54 tests.

About plugin

  • Plugin page: charjing
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 26, 2016
  • Latest release: Jan 27, 2016
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: charjing (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /648 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.21MB] [CPU: ▼47.57ms] Passed 4 tests

Server-side resources used by Charjing For Subscription Billing
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.77 ▼0.7017.34 ▼26.86
Dashboard /wp-admin2.81 ▼0.5017.01 ▼37.18
Posts /wp-admin/edit.php2.81 ▼0.5517.12 ▼34.41
Add New Post /wp-admin/post-new.php2.81 ▼3.0817.48 ▼91.81
Media Library /wp-admin/upload.php2.81 ▼0.4218.65 ▼17.68
Add New /wp-admin/post-new.php?post_type=chg-products2.8117.65
All Products /wp-admin/edit.php?post_type=chg-products2.8119.79
Charjing Options /wp-admin/options-general.php?page=Charjing2.8115.34

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Charjing For Subscription Billing: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8714.35 ▲0.002.12 ▲0.3046.69 ▲2.03
Dashboard /wp-admin2,229 ▲525.69 ▲0.0893.32 ▲0.7540.31 ▼2.34
Posts /wp-admin/edit.php2,128 ▲282.03 ▲0.0837.28 ▼2.7134.93 ▼1.89
Add New Post /wp-admin/post-new.php1,552 ▲2423.13 ▼0.01663.88 ▼31.5051.06 ▲2.82
Media Library /wp-admin/upload.php1,431 ▲314.23 ▲0.04103.97 ▲0.2442.44 ▼2.59
Add New /wp-admin/post-new.php?post_type=chg-products2,2877.69182.8266.96
All Products /wp-admin/edit.php?post_type=chg-products1,1041.9733.0434.54
Charjing Options /wp-admin/options-general.php?page=Charjing9392.0324.7426.59

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/charjing/charjing.php+46
    Undefined index: cmdConfirmOrder
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Charjing
    • > Notice in wp-content/plugins/charjing/charjing.php+46
    Undefined index: cmdConfirmOrder
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Notice in wp-content/plugins/charjing/charjing.php+60
    Undefined index: product_price_box_content_nonce
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Warning in wp-content/plugins/charjing/charjing.php+93
    Illegal string offset 'setup_price'
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Notice in wp-content/plugins/charjing/charjing.php+113
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Warning in wp-content/plugins/charjing/charjing.php+96
    Illegal string offset 'price'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Warning in wp-content/plugins/charjing/charjing.php+105
    Illegal string offset 'is_recurring'
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Warning in wp-content/plugins/charjing/charjing.php+107
    Illegal string offset 'period_length'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=chg-products
    • > Warning in wp-content/plugins/charjing/charjing.php+113
    Illegal string offset 'period_option'
    • > GET request to /wp-admin/options-general.php?page=Charjing
    • > Notice in wp-content/plugins/charjing/settings.php+4
    Undefined index: cmdSave
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Charjing
    • > Notice in wp-content/plugins/charjing/settings.php+70
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/charjing/products_front.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: subscription, payment, authorizenet, billing

charjing/charjing.php Passed 13 tests

"Charjing For Subscription Billing" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
55 characters long description:
Charjing ,Products Billing and Subscription Management.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin2,463 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP183111,0272,303
CSS1220106
JavaScript251454

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.93
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes13.70%
▷ Concrete classes2696.30%
▷ Final classes00.00%
Methods112
▷ Static methods54.46%
▷ Public methods9080.36%
▷ Protected methods1816.07%
▷ Private methods43.57%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants00.00%
▷ Class constants18100.00%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin