82% baw-invitation-codes

Code Review | Easy Invitation Codes

WordPress plugin Easy Invitation Codes scored 82% from 54 tests.

About plugin

  • Plugin page: baw-invitation-codes
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.3
  • WordPress version: 5.8.1
  • First release: Jun 11, 2012
  • Latest release: Sep 5, 2015
  • Number of updates: 14
  • Update frequency: every 84.4 days
  • Top authors: juliobox (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

500+ active / 22,029 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.11MB] [CPU: ▼168.34ms] Passed 4 tests

An overview of server-side resources used by Easy Invitation Codes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1334.83 ▲10.34
Dashboard /wp-admin3.17 ▲0.1251.82 ▲1.05
Posts /wp-admin/edit.php3.23 ▲0.1247.04 ▲0.84
Add New Post /wp-admin/post-new.php5.54 ▲0.1199.70 ▼666.64
Media Library /wp-admin/upload.php3.12 ▲0.1138.16 ▼8.59
Some Options /wp-admin/admin.php?page=baweic_settings3.0933.21
Generate codes /wp-admin/admin.php?page=baweic_rand_code3.0933.31
Invitation Codes /wp-admin/admin.php?page=baweic_list_codes3.0630.30
Add new code /wp-admin/admin.php?page=baweic_add_code3.0932.80
Codes list (raw) /wp-admin/admin.php?page=baweic_raw_codes3.0826.47

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 2 new options
New WordPress options
baweic_options
baweic_fields

Browser metrics Passed 4 tests

A check of browser resources used by Easy Invitation Codes
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲12716.00 ▲0.359.60 ▼2.0752.11 ▲1.15
Dashboard /wp-admin3,014 ▲805.90 ▼0.06150.95 ▲10.89117.90 ▼0.71
Posts /wp-admin/edit.php2,783 ▲442.73 ▲0.0178.67 ▲9.5994.06 ▼6.87
Add New Post /wp-admin/post-new.php1,632 ▼5118.60 ▲0.58382.37 ▼2.74120.45 ▼3.41
Media Library /wp-admin/upload.php1,851 ▲445.01 ▼0.01155.30 ▼11.76126.09 ▼17.45
Some Options /wp-admin/admin.php?page=baweic_settings1,1272.0955.8096.40
Generate codes /wp-admin/admin.php?page=baweic_rand_code1,1562.0554.7197.05
Invitation Codes /wp-admin/admin.php?page=baweic_list_codes1,2602.0556.3374.65
Add new code /wp-admin/admin.php?page=baweic_add_code1,1172.0654.9397.23
Codes list (raw) /wp-admin/admin.php?page=baweic_raw_codes1,0752.0559.2676.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=baweic_list_codes
    • > Notice in wp-content/plugins/baw-invitation-codes/inc/back-end.php+260
    Undefined variable: input_id

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/baw-invitation-codes/inc/back-end.php
    • > /wp-content/plugins/baw-invitation-codes/inc/front-end.php
    • > /wp-content/plugins/baw-invitation-codes/inc/fields.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/baw-invitation-codes/baw-eic.php:14

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention: You can take inspiration from this readme.txt

baw-invitation-codes/baw-eic.php 92% from 13 tests

The entry point to "Easy Invitation Codes" version 1.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("baw-invitation-codes.php" instead of "baw-eic.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
No dangerous file extensions were detected578 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP43812420
PO File16485158

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants1
▷ 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
There are no PNG files in this plugin