84% user-blocks

Code Review | User Blocks

WordPress plugin User Blocks scored84%from 54 tests.

About plugin

  • Plugin page: user-blocks
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Sep 25, 2019
  • Latest release: Sep 25, 2019
  • Number of updates: 2
  • Update frequency: every 3.0 days
  • Top authors: kbjohnson90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,102 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.09ms] Passed 4 tests

This is a short check of server-side resources used by User Blocks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.69 ▼1.35
Dashboard /wp-admin3.32 ▼0.0350.88 ▼13.06
Posts /wp-admin/edit.php3.37 ▲0.0148.40 ▼4.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0286.77 ▼13.92
Media Library /wp-admin/upload.php3.24 ▲0.0136.44 ▼0.87

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

User Blocks: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲6414.47 ▲0.121.72 ▼0.2146.56 ▲1.45
Dashboard /wp-admin2,198 ▲215.58 ▲0.0196.51 ▼5.7444.43 ▲0.56
Posts /wp-admin/edit.php2,103 ▲31.96 ▼0.0337.26 ▼0.2733.18 ▼5.27
Add New Post /wp-admin/post-new.php6,200 ▲4,67418.87 ▼4.29874.54 ▲175.7660.60 ▼3.50
Media Library /wp-admin/upload.php1,400 ▼04.16 ▼0.02100.69 ▼8.5641.71 ▼5.98

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

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
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-blocks/php_version_notice.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/user-blocks/tests/src/ExampleTest.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/user-blocks/user-blocks.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: usermeta, user, data, block, blocks...

user-blocks/user-blocks.php Passed 13 tests

The main PHP script in "User Blocks" version 1.0.0 is automatically included on every request by WordPress
51 characters long description:
User blocks for building profile and account pages.

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
Good job! No executable or dangerous file extensions detected7,499 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JSON4007,191
JavaScript31660108
PHP7171384
YAML25163
Markdown315031
Sass33322
CSS20230

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
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
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods2
▷ Static methods150.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
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 images were found in this plugin