72% registration-wall

Code Review | Registration Wall

WordPress plugin Registration Wall scored72%from 54 tests.

About plugin

  • Plugin page: registration-wall
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.8
  • WordPress version: 6.3.1
  • First release: Jan 22, 2021
  • Latest release: Jul 13, 2021
  • Number of updates: 10
  • Update frequency: every 17.2 days
  • Top authors: emoxie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /600 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.07MB] [CPU: ▼5.29ms] Passed 4 tests

A check of server-side resources used by Registration Wall
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0742.30 ▼1.33
Dashboard /wp-admin3.37 ▲0.0744.39 ▼7.97
Posts /wp-admin/edit.php3.49 ▲0.1347.36 ▼2.99
Add New Post /wp-admin/post-new.php5.97 ▲0.0985.18 ▼7.36
Media Library /wp-admin/upload.php3.30 ▲0.0735.17 ▼2.83
Registration Wall /wp-admin/options-general.php?page=registration-wall-settings3.3234.56

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Registration Wall
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,910 ▲17513.58 ▼0.725.78 ▲3.8944.00 ▲0.31
Dashboard /wp-admin2,213 ▲255.86 ▲0.97109.01 ▼9.4136.94 ▼11.18
Posts /wp-admin/edit.php2,093 ▲72.03 ▲0.0137.54 ▲1.1833.79 ▼2.22
Add New Post /wp-admin/post-new.php1,517 ▼1217.64 ▼5.81680.93 ▼11.0354.62 ▼3.31
Media Library /wp-admin/upload.php1,392 ▲44.15 ▼0.0495.95 ▼15.0841.73 ▼9.66
Registration Wall /wp-admin/options-general.php?page=registration-wall-settings1,9207.47153.30157.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

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
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=registration-wall-settings
    • > Warning in wp-content/plugins/registration-wall/admin/partials/settings.php+72
    in_array() expects parameter 2 to be array, bool given

SRP 0% 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
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/registration-wall/public/partials/registration-wall-public-display.php
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Console\\ConsoleCommand' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/plugins/error/cli/LogCommand.php:13
    • > PHP Warning
      Use of undefined constant REGISTRATION_WALL_URL - assumed 'REGISTRATION_WALL_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/registration-wall/admin/partials/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/plugins/error/error.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/plugins/anchors/anchors.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/registration-wall/admin/partials/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/plugins/highlight/highlight.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/registration-wall/admin/partials/settings-sidebar.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Theme' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/themes/learn2/learn2.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/plugins/problems/problems.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Grav\\Common\\Plugin' not found in wp-content/plugins/registration-wall/vendor/select2/select2/docs/plugins/breadcrumbs/breadcrumbs.php:6

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 97% from 29 tests

readme.txt 94% 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
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === registration-wall === )
You can look at the official readme.txt

registration-wall/registration-wall.php Passed 13 tests

The principal PHP file in "Registration Wall" v. 1.0.4 is loaded by WordPress automatically on each request
63 characters long description:
Easily restrict content to those that are registered/logged in.

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
Success! There were no dangerous files found in this plugin68,490 lines of code in 615 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript23312,1006,55745,147
CSS871,3646218,048
Sass1321,0115344,639
Markdown611,54204,271
SVG4012,697
PHP314586401,784
YAML28550807
Twig24560557
HTML7650344
JSON700194
Bourne Shell1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.15
▷ Minimum class complexity1.00
▷ Maximum class complexity64.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods107
▷ Static methods2624.30%
▷ Public methods8579.44%
▷ Protected methods87.48%
▷ Private methods1413.08%
Functions6
▷ Named functions466.67%
▷ Anonymous functions233.33%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
74 PNG files occupy 1.01MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/select2/select2/docs/themes/site/images/android-chrome-48x48.png1.08KB0.99KB▼ 9.02%
vendor/select2/select2/docs/pages/images/flags/id.png7.15KB3.27KB▼ 54.24%
vendor/select2/select2/docs/themes/site/images/apple-touch-icon-60x60.png1.91KB1.80KB▼ 5.48%
vendor/select2/select2/docs/pages/images/flags/tn.png3.91KB2.17KB▼ 44.39%
vendor/select2/select2/docs/pages/images/flags/in.png6.82KB3.17KB▼ 53.59%