72% wp-access-codes

Code Review | WP Access Codes

WordPress plugin WP Access Codes scored72%from 54 tests.

About plugin

  • Plugin page: wp-access-codes
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.0
  • WordPress version: 6.3.1
  • First release: Sep 14, 2014
  • Latest release: Sep 14, 2014
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: slickorange (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,323 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.16ms] Passed 4 tests

An overview of server-side resources used by WP Access Codes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0342.02 ▲0.35
Dashboard /wp-admin3.38 ▲0.0341.76 ▼16.38
Posts /wp-admin/edit.php3.49 ▲0.0952.09 ▲5.76
Add New Post /wp-admin/post-new.php5.96 ▲0.0399.30 ▲0.21
Media Library /wp-admin/upload.php3.30 ▲0.0341.96 ▲3.20
WP Access Codes /wp-admin/options-general.php?page=wp-access-codes3.2433.33

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WP Access Codes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7214.34 ▲0.101.80 ▼0.0043.25 ▲4.63
Dashboard /wp-admin2,199 ▲225.59 ▲0.0386.96 ▼6.8238.79 ▼6.67
Posts /wp-admin/edit.php2,104 ▲41.95 ▼0.0540.58 ▲2.1035.39 ▼1.93
Add New Post /wp-admin/post-new.php1,529 ▲323.66 ▲0.76700.35 ▲24.2759.21 ▲1.86
Media Library /wp-admin/upload.php1,404 ▲74.17 ▼0.1396.70 ▼17.4746.29 ▼2.21
WP Access Codes /wp-admin/options-general.php?page=wp-access-codes9572.0223.7230.96

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-access-codes
    • > Notice in wp-content/plugins/wp-access-codes/wp-access-codes.php+132
    Undefined index: access_code

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-access-codes/front-end.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-access-codes/wp-access-codes.php:84
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-access-codes/wp-access-codes.php on line 33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpac_wp_role_dropdown() in wp-content/plugins/wp-access-codes/options-page.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpac_get_access_code_object() in wp-content/plugins/wp-access-codes/edit-page.php:2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-access-codes/wp-access-codes.php on line 27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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 to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === wp-access-codes === )
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
The official readme.txt might help

wp-access-codes/wp-access-codes.php Passed 13 tests

The main PHP script in "WP Access Codes" version 0.9 is automatically included on every request by WordPress
135 characters long description:
Allows registered users to be assigned a WordPress role or to be added to a Press Permit group based on which access code they entered.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin365 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP412244365

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin