72% better-user-shortcodes

Code Review | Better User Shortcodes

WordPress plugin Better User Shortcodes scored72%from 54 tests.

About plugin

  • Plugin page: better-user-short...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-3.4.2
  • WordPress version: 6.3.1
  • First release: Nov 9, 2012
  • Latest release: Nov 9, 2012
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: hccoder (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

100+ active /5,687 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.92ms] Passed 4 tests

An overview of server-side resources used by Better User Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.44 ▼2.76
Dashboard /wp-admin3.35 ▲0.0545.49 ▼4.53
Posts /wp-admin/edit.php3.47 ▲0.1148.93 ▲2.54
Add New Post /wp-admin/post-new.php5.93 ▲0.0589.17 ▼2.91
Media Library /wp-admin/upload.php3.28 ▲0.0537.16 ▲2.76
Logout /wp-admin/admin.php?page=better-user-shortcodes-logout3.2229.93
Login /wp-admin/admin.php?page=better-user-shortcodes-login3.2227.53
Help /wp-admin/admin.php?page=better-user-shortcodes-help3.2227.89
Better User Shortcodes /wp-admin/admin.php?page=better-user-shortcodes3.2228.77
Registration /wp-admin/admin.php?page=better-user-shortcodes-registration3.2228.12
Password reminder /wp-admin/admin.php?page=better-user-shortcodes-password-reminder3.2227.75

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 26 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-posts
bus_registration_email
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
bus_password_reminder_email
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Better User Shortcodes
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲10713.22 ▼1.371.63 ▼0.2537.93 ▼8.19
Dashboard /wp-admin2,251 ▲635.83 ▼0.07102.78 ▼11.9486.33 ▲39.33
Posts /wp-admin/edit.php2,131 ▲391.98 ▼0.0336.01 ▼2.9934.68 ▲0.16
Add New Post /wp-admin/post-new.php1,701 ▲15722.43 ▲3.99754.20 ▲103.6248.87 ▼10.46
Media Library /wp-admin/upload.php1,430 ▲424.23 ▼0.0899.93 ▲1.9646.24 ▲2.11
Logout /wp-admin/admin.php?page=better-user-shortcodes-logout8772.0128.7527.75
Login /wp-admin/admin.php?page=better-user-shortcodes-login9142.0226.1925.48
Help /wp-admin/admin.php?page=better-user-shortcodes-help8032.0327.5128.88
Better User Shortcodes /wp-admin/admin.php?page=better-user-shortcodes8302.2125.0027.01
Registration /wp-admin/admin.php?page=better-user-shortcodes-registration1,0052.0223.6328.26
Password reminder /wp-admin/admin.php?page=better-user-shortcodes-password-reminder9742.0623.3925.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • bus_password_reminder_email
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • bus_registration_email

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
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-logout
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HCCoder_BSUAdmin::adminLogout() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-logout
    • > Deprecated in wp-includes/shortcodes.php+395
    Non-static method HCCoder_BSUShortcode::frontendLogout() should not be called statically
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-login
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HCCoder_BSUAdmin::adminLogin() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-login
    • > Deprecated in wp-includes/shortcodes.php+395
    Non-static method HCCoder_BSUShortcode::frontendLogin() should not be called statically
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-help
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HCCoder_BSUAdmin::adminHelp() should not be called statically
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HCCoder_BSUAdmin::adminIndex() should not be called statically
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-registration
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HCCoder_BSUAdmin::adminRegistration() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-registration
    • > Deprecated in wp-includes/shortcodes.php+395
    Non-static method HCCoder_BSUShortcode::frontendRegistration() should not be called statically
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-password-reminder
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HCCoder_BSUAdmin::adminPasswordReminder() should not be called statically
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=better-user-shortcodes-password-reminder
    • > Deprecated in wp-includes/shortcodes.php+395
    Non-static method HCCoder_BSUShortcode::frontendPasswordReminder() should not be called statically

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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/better-user-shortcodes/views/adminhelp.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/better-user-shortcodes/views/passwordremindershortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function getItem() on null in wp-content/plugins/better-user-shortcodes/views/adminindex.php:9
    • > PHP Fatal error
      Uncaught Error: Call to a member function getItem() on null in wp-content/plugins/better-user-shortcodes/views/logoutshortcode.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/better-user-shortcodes/views/adminlogin.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/better-user-shortcodes/views/loginshortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/better-user-shortcodes/views/registrationshortcode.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/better-user-shortcodes/views/adminpasswordreminder.php:12
    • > PHP Notice
      Undefined variable: config in wp-content/plugins/better-user-shortcodes/views/logoutshortcode.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/better-user-shortcodes/views/adminlogout.php:12
    • > PHP Warning
      require(ABSPATHwp-content/plugins/better-user-shortcodes/classes/config.php): failed to open stream: No such file or directory in wp-content/plugins/better-user-shortcodes/better-user-shortcodes.php on line 11

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: ""
  • Screenshots: Please add images for these screenshots: #1 (Login options), #2 (Logout options), #3 (Registration options), #4 (Password reminder options)
You can look at the official readme.txt

better-user-shortcodes/better-user-shortcodes.php Passed 13 tests

The main PHP file in "Better User Shortcodes" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
Set up your custom registration form, add shortcodes into your posts, pages or sidebars and forget wp-login.php.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected628 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP16164135628

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity2.67
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods15
▷ Static methods213.33%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions2
▷ Named functions2100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
static/images/icon.png0.80KB0.86KB0.00%