10% content-user-relations

Code Review | Content User Relations

WordPress plugin Content User Relations scored10%from 54 tests.

About plugin

  • Plugin page: content-user-rela...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Jan 21, 2019
  • Latest release: Jun 17, 2019
  • Number of updates: 6
  • Update frequency: every 24.7 days
  • Top authors: EdwardBock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /630 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/content-user-relations/inc/database/query-conditions.php+66
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Server metrics [RAM: ▼1.90MB] [CPU: ▼52.36ms] Passed 4 tests

A check of server-side resources used by Content User Relations
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.365.43 ▼30.96
Dashboard /wp-admin2.12 ▼1.227.00 ▼54.76
Posts /wp-admin/edit.php2.12 ▼1.236.40 ▼37.42
Add New Post /wp-admin/post-new.php2.12 ▼3.777.48 ▼86.31
Media Library /wp-admin/upload.php2.12 ▼1.117.10 ▼29.02
Content relations /wp-admin/users.php?page=content-user-relation-settings2.207.19

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 27 new files
Database: 4 new tables, 6 new options
New tables
wp_cur_relations
wp_cur_states
wp_cur_types
wp_cur_typestates
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Content User Relations
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.48 ▲0.091.83 ▼0.0141.98 ▲2.01
Dashboard /wp-admin2,219 ▲284.94 ▲0.03102.99 ▲1.3840.74 ▲0.16
Posts /wp-admin/edit.php2,087 ▼22.04 ▼0.0238.91 ▲2.9533.77 ▲0.16
Add New Post /wp-admin/post-new.php1,533 ▼022.95 ▼0.14625.66 ▼55.4737.14 ▼14.52
Media Library /wp-admin/upload.php1,415 ▲304.17 ▼0.06101.13 ▲1.9546.14 ▲2.95
Content relations /wp-admin/users.php?page=content-user-relation-settings9761.9029.5227.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/content-user-relations/inc/database/query-conditions.php+66
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • Zombie tables were found after uninstall: 4 tables
    • wp_cur_typestates
    • wp_cur_relations
    • wp_cur_states
    • wp_cur_types
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/users.php?page=content-user-relation-settings
    • > Warning in wp-content/plugins/content-user-relations/inc/database/query-conditions.php+77
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SRP 50% 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
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'ContentUserRelations\\Database\\Query' not found in wp-content/plugins/content-user-relations/public-functions.php:13
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/content-user-relations/inc/database/query-conditions.php on line 66
    • > PHP Fatal error
      Uncaught Error: Class 'ph_destination' not found in wp-content/plugins/content-user-relations/inc/migrate/migrate-destination.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ContentUserRelations\\plugin_dir_url() in wp-content/plugins/content-user-relations/plugin.php:71
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/content-user-relations/inc/database/query-conditions.php on line 74
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/content-user-relations/inc/database/query-conditions.php on line 77

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/users.php?page=content-user-relation-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot set properties of undefined (setting '_renderItem')" "TypeError: Cannot set properties of undefined (setting '_renderItem')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/content-user-relations//js/user-profile.js?ver=6.3.1:38:54)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/users.php?page=content-user-relation-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: Cannot set properties of undefined (setting '_renderItem')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: relation, metabox, user

content-user-relations/plugin.php 92% from 13 tests

The main file in "Content User Relations" v. 1.1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("content-user-relations.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected2,303 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP152715171,388
JavaScript3103114623
Markdown1570150
PO File1375191
CSS218151

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.14
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods57
▷ Static methods11.75%
▷ Public methods5291.23%
▷ Protected methods00.00%
▷ Private methods58.77%
Functions34
▷ Named functions3088.24%
▷ Anonymous functions411.76%
Constants42
▷ Global constants00.00%
▷ Class constants42100.00%
▷ Public constants42100.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
There were not PNG files found in your plugin