84% protected-registration

Code Review | Protected Registration

WordPress plugin Protected Registration scored84%from 54 tests.

About plugin

  • Plugin page: protected-registr...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3
  • WordPress version: 6.3.1
  • First release: Nov 3, 2015
  • Latest release: Nov 4, 2015
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: zanzofily (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,134 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.92ms] Passed 4 tests

A check of server-side resources used by Protected Registration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0138.73 ▲1.86
Dashboard /wp-admin3.33 ▲0.0243.70 ▼3.37
Posts /wp-admin/edit.php3.38 ▲0.0247.70 ▲2.65
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.06 ▼8.25
Media Library /wp-admin/upload.php3.25 ▲0.0232.89 ▼1.93
Protected Registreation /wp-admin/options-general.php?page=pr-registration3.2229.48

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Protected Registration: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.22 ▼0.142.23 ▲0.5843.05 ▲0.98
Dashboard /wp-admin2,196 ▲275.51 ▼0.1182.21 ▼20.6838.16 ▼5.07
Posts /wp-admin/edit.php2,104 ▲42.15 ▲0.1640.57 ▲3.4036.20 ▲1.12
Add New Post /wp-admin/post-new.php1,538 ▲218.12 ▼4.74618.58 ▼27.4761.08 ▲1.16
Media Library /wp-admin/upload.php1,404 ▲74.24 ▲0.0094.62 ▼14.0742.35 ▼5.18
Protected Registreation /wp-admin/options-general.php?page=pr-registration8252.0524.8624.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/protected-registration/includes/PR_Frontend.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/protected-registration/includes/panel.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/protected-registration/includes/PR_Admin.class.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/protected-registration/PR.php:13

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: protection, invitations, keys, registration

protected-registration/PR.php 92% from 13 tests

Analyzing the main PHP file in "Protected Registration" version 0.1
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("protected-registration.php" instead of "PR.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
There were no executable files found in this plugin245 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP49923214
CSS20019
JavaScript16312

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants125.00%
▷ Class constants375.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png14.14KB7.79KB▼ 44.93%