83% credit-card-number-generator

Code Review | Credit Card Number Generator

WordPress plugin Credit Card Number Generator scored 83% from 54 tests.

About plugin

  • Plugin page: credit-card-numbe...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 20, 2020
  • Latest release: Feb 3, 2023
  • Number of updates: 31
  • Update frequency: every 31.9 days
  • Top authors: WeblineIndia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,414 total downloads


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.13MB] [CPU: ▼2.48ms] Passed 4 tests

Analyzing server-side resources used by Credit Card Number Generator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1438.53 ▼3.21
Dashboard /wp-admin3.43 ▲0.1349.86 ▲2.50
Posts /wp-admin/edit.php3.54 ▲0.1945.30 ▼1.92
Add New Post /wp-admin/post-new.php6.01 ▲0.1385.18 ▼7.30
Media Library /wp-admin/upload.php3.35 ▲0.1339.97 ▲6.38
Credit Card Number Generator /wp-admin/options-general.php?page=wli-credit-card-generator3.3234.86

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 9 new options
New WordPress options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Credit Card Number Generator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲19814.23 ▼0.157.21 ▲5.3039.05 ▼10.56
Dashboard /wp-admin2,229 ▲415.07 ▼0.83113.63 ▲9.0941.88 ▲0.26
Posts /wp-admin/edit.php2,117 ▲282.27 ▲0.2635.77 ▼1.4329.58 ▼2.00
Add New Post /wp-admin/post-new.php1,536 ▼623.55 ▲5.48657.87 ▲46.4437.06 ▼16.28
Media Library /wp-admin/upload.php1,408 ▲174.43 ▲0.2496.65 ▲1.4542.18 ▼5.97
Credit Card Number Generator /wp-admin/options-general.php?page=wli-credit-card-generator1,7893.0062.6835.66

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_credit_card_number_validator_widget
    • CCNG_DUMMY_CARD_status
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_credit_card_number_generator_widget

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/credit-card-number-generator/public/credit-card-number-generator-public.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/credit-card-number-generator/admin/class-credit-card-number-generator-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/credit-card-number-generator/admin/class-credit-card-number-generator-admin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/credit-card-number-generator/admin/class-credit-card-number-validator-widget.php:3

User-side errors Passed 1 test

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


Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
  • Requires at least: Invalid version format
The official readme.txt is a good inspiration

credit-card-number-generator/credit-card-number-generator.php 92% from 13 tests

This is the main PHP file of "Credit Card Number Generator" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
There were no executable files found in this plugin839 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity8.67
▷ Minimum class complexity8.00
▷ Maximum class complexity10.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions5100.00%
▷ Anonymous functions00.00%
▷ Global constants1100.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
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/card_sprites.png17.64KB6.70KB▼ 62.02%
assets/images/card-unknown.png0.73KB0.52KB▼ 28.63%