74% content-relations

Code Review | Content Relations

WordPress plugin Content Relations scored74%from 54 tests.

About plugin

  • Plugin page: content-relations
  • Plugin version: 1.0.14
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Jun 5, 2015
  • Latest release: Jul 27, 2022
  • Number of updates: 24
  • Update frequency: every 108.7 days
  • Top authors: EdwardBock (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,480 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼4.26ms] Passed 4 tests

An overview of server-side resources used by Content Relations
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1845.92 ▲8.25
Dashboard /wp-admin3.48 ▲0.1844.12 ▼6.43
Posts /wp-admin/edit.php3.59 ▲0.2444.86 ▼1.22
Add New Post /wp-admin/post-new.php6.07 ▲0.1886.43 ▼12.80
Media Library /wp-admin/upload.php3.40 ▲0.1737.36 ▲3.42
Content Relations /wp-admin/tools.php?page=settings-content-realations3.3632.03

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 19 new files
Database: 2 new tables, 6 new options
New tables
wp_content_relations_types
wp_content_relations
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Content Relations
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.18 ▼1.421.58 ▼0.4139.72 ▼4.52
Dashboard /wp-admin2,210 ▲185.84 ▲0.89102.87 ▼13.7037.62 ▼8.83
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0137.48 ▼0.0532.49 ▼5.12
Add New Post /wp-admin/post-new.php6,292 ▲4,75319.00 ▼4.18892.36 ▲231.7157.80 ▼5.88
Media Library /wp-admin/upload.php1,389 ▼24.26 ▲0.07107.45 ▲13.7745.69 ▼2.54
Content Relations /wp-admin/tools.php?page=settings-content-realations7582.0633.8424.56

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_content_relations
    • wp_content_relations_types
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/content-relations/migrate.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/content-relations/parts/content-relations-meta-box.tpl.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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: metabox, post, relation

content-relations/ph-content-relations.php 92% from 13 tests

This is the main PHP file of "Content Relations" version 1.0.14, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("content-relations.php" instead of "ph-content-relations.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
Good job! No executable or dangerous file extensions detected1,409 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP14187478792
JavaScript14179433
CSS1516184

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.38
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods42
▷ Static methods12.38%
▷ Public methods3992.86%
▷ Protected methods00.00%
▷ Private methods37.14%
Functions24
▷ Named functions2291.67%
▷ Anonymous functions28.33%
Constants11
▷ Global constants00.00%
▷ Class constants11100.00%
▷ Public constants11100.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