74% ref-code-generator-access-gate

Code Review | Zedna Ref Code Generator & Access Gate

WordPress plugin Zedna Ref Code Generator & Access Gate scored74%from 54 tests.

About plugin

  • Plugin page: ref-code-generato...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 6.3.1
  • First release: Oct 31, 2016
  • Latest release: Mar 12, 2020
  • Number of updates: 6
  • Update frequency: every 204.7 days
  • Top authors: zedna (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /869 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.17ms] Passed 4 tests

An overview of server-side resources used by Zedna Ref Code Generator & Access Gate
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.39 ▼7.28
Dashboard /wp-admin3.40 ▲0.1046.72 ▼5.03
Posts /wp-admin/edit.php3.45 ▲0.0956.68 ▲3.78
Add New Post /wp-admin/post-new.php5.98 ▲0.0980.32 ▼18.30
Media Library /wp-admin/upload.php3.33 ▲0.0936.31 ▲1.93
Add New /wp-admin/post-new.php?post_type=refcodegatepost3.4551.35
Used codes /wp-admin/admin.php?page=drcg_zedna_list_used3.2932.13
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=refcodegatepost3.3236.35
Free codes /wp-admin/admin.php?page=drcg_zedna_list_free3.2929.12
FAQ /wp-admin/admin.php?page=drcg_zedna_faq3.2931.67
Ref Code Generator /wp-admin/admin.php?page=drcg3.3136.75
Options /wp-admin/admin.php?page=drcg_zedna_options3.2930.85
Ref Code Gate post /wp-admin/edit.php?post_type=refcodegatepost3.3835.48
Code list /wp-admin/admin.php?page=drcg_zedna_list3.2932.90

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: 1 new table, 7 new options
New tables
wp_refcode
New WordPress options
category_children
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Zedna Ref Code Generator & Access Gate: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲16713.30 ▼1.111.80 ▲0.2045.24 ▲0.37
Dashboard /wp-admin2,280 ▲1064.86 ▼0.02109.07 ▼3.0240.14 ▲0.23
Posts /wp-admin/edit.php2,163 ▲712.00 ▲0.0335.94 ▼4.2432.50 ▼3.01
Add New Post /wp-admin/post-new.php1,574 ▲4117.47 ▼5.56675.70 ▲33.6860.60 ▲7.39
Media Library /wp-admin/upload.php1,462 ▲744.18 ▲0.0393.46 ▼5.0841.06 ▼3.46
Add New /wp-admin/post-new.php?post_type=refcodegatepost2,3427.59184.1272.37
Used codes /wp-admin/admin.php?page=drcg_zedna_list_used8302.0333.8650.25
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=refcodegatepost1,5142.1427.1033.70
Free codes /wp-admin/admin.php?page=drcg_zedna_list_free8302.0324.2721.13
FAQ /wp-admin/admin.php?page=drcg_zedna_faq9112.1824.9027.53
Ref Code Generator /wp-admin/admin.php?page=drcg8472.0323.1625.83
Options /wp-admin/admin.php?page=drcg_zedna_options9352.0622.7623.39
Ref Code Gate post /wp-admin/edit.php?post_type=refcodegatepost1,1741.9331.4029.44
Code list /wp-admin/admin.php?page=drcg_zedna_list8492.0324.8023.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_refcode
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • category_children

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ref-code-generator-access-gate/template/gate.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ref-code-generator-access-gate/drcg.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: discount, access gate, generator, refference code

ref-code-generator-access-gate/drcg.php 92% from 13 tests

The entry point to "Zedna Ref Code Generator & Access Gate" version 1.5 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ref-code-generator-access-gate.php" instead of "drcg.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected525 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP26951525

PHP code Passed 2 tests

An short overview of 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.23
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected