10% lh-relationships

Code Review | LH Relationships

WordPress plugin LH Relationships scored10%from 54 tests.

About plugin

  • Plugin page: lh-relationships
  • Plugin version: 0.21
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2
  • WordPress version: 6.3.1
  • First release: Dec 20, 2011
  • Latest release: Apr 24, 2015
  • Number of updates: 30
  • Update frequency: every 43.4 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,481 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/lh-relationships/functions.php+112
    Undefined offset: 0

Server metrics [RAM: ▼1.67MB] [CPU: ▼52.01ms] Passed 4 tests

Analyzing server-side resources used by LH Relationships
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.157.17 ▼35.03
Dashboard /wp-admin2.34 ▼0.977.03 ▼43.12
Posts /wp-admin/edit.php2.34 ▼1.028.34 ▼39.56
Add New Post /wp-admin/post-new.php2.34 ▼3.558.02 ▼90.34
Media Library /wp-admin/upload.php2.34 ▼0.907.76 ▼27.92
Predicates /wp-admin/edit.php?post_type=lh-uri&page=lh_relationships_predicate-identifier2.348.27
Add New /wp-admin/post-new.php?post_type=lh-uri2.347.38
Uris /wp-admin/edit.php?post_type=lh-uri2.348.82
Namespaces /wp-admin/edit.php?post_type=lh-uri&page=lh_relationships_namespace-identifier2.347.38

Server storage [IO: ▲0.05MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: 3 new tables, 6 new options
New tables
wp_predicate
wp_namespace
wp_statement
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

LH Relationships: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲8113.26 ▼1.121.61 ▼0.7239.65 ▼11.60
Dashboard /wp-admin2,238 ▲474.80 ▼0.24109.39 ▲2.2143.10 ▼3.11
Posts /wp-admin/edit.php2,124 ▲322.06 ▲0.0439.41 ▲3.9037.22 ▲2.90
Add New Post /wp-admin/post-new.php6,634 ▲5,10623.46 ▲4.97858.59 ▲236.2680.69 ▲19.23
Media Library /wp-admin/upload.php1,426 ▲444.24 ▲0.0495.81 ▼7.3043.01 ▼0.75
Predicates /wp-admin/edit.php?post_type=lh-uri&page=lh_relationships_predicate-identifier1,1392.0223.4330.88
Add New /wp-admin/post-new.php?post_type=lh-uri2,7607.79173.6972.71
Uris /wp-admin/edit.php?post_type=lh-uri4,0352.0235.5237.93
Namespaces /wp-admin/edit.php?post_type=lh-uri&page=lh_relationships_namespace-identifier1,1882.0223.1230.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 25% 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
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5453
    Function register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead.
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_statement
    • wp_namespace
    • wp_predicate
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=lh-uri&page=lh_relationships_namespace-identifier
    • > User deprecated in wp-includes/functions.php+5453
    Function register_sidebar_widget is deprecated since version 2.8.0! Use wp_register_sidebar_widget() instead.
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+29
    Undefined index: lh_relationships_rdf_type
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+354
    Undefined index: wgs84:lat
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+422
    Undefined index: statement_details
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+420
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+426
    Undefined offset: 1
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+431
    Undefined index: OjectId
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/uri_setup.php+75
    Undefined index: new_GUID
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+273
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lh-uri
    • > Notice in wp-content/plugins/lh-relationships/system.php+273
    Trying to get property 'object' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_next_scheduled() in wp-content/plugins/lh-relationships/library/machine-tags.php:227
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/the_widgets.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/uri_setup.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/enhance_feed.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/system.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/user_relationships.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/menu_items.php:238
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-relationships/system.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: feed, rdf, schemaorg, localhero, skos...

lh-relationships/lh-relationships.php Passed 13 tests

The main PHP file in "LH Relationships" ver. 0.21 adds more information about the plugin and also serves as the entry point for this plugin
41 characters long description:
Add RDF relationship support to Wordpress

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 plugin971 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,03284971

PHP code Passed 2 tests

Analyzing 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.22
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions49
▷ Named functions49100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin