10% lh-tools

Code Review | LH Tools

WordPress plugin LH Tools scored 10% from 54 tests.

About plugin

  • Plugin page: lh-tools
  • Plugin version: 0.15
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2
  • WordPress version: 6.3.1
  • First release: Feb 4, 2012
  • Latest release: Apr 24, 2015
  • Number of updates: 36
  • Update frequency: every 34.9 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,841 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/lh-tools/lh-tools.php+394
    rmdir(arc): No such file or directory

Server metrics [RAM: ▼1.75MB] [CPU: ▼56.35ms] Passed 4 tests

Server-side resources used by LH Tools
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.23 ▼1.235.39 ▼45.45
Dashboard /wp-admin2.25 ▼1.056.29 ▼42.60
Posts /wp-admin/edit.php2.25 ▼1.107.53 ▼43.24
Add New Post /wp-admin/post-new.php2.25 ▼3.636.56 ▼94.11
Media Library /wp-admin/upload.php2.25 ▼0.976.28 ▼25.91

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 332 new files
Database: no new tables, 12 new options
New WordPress options
rdf_tools_endpoint_read_key
rdf_tools_endpoint_max_limit
rdf_tools_endpoint_active
widget_recent-comments
rdf_tools_endpoint_write_key
rdf_tools_endpoint_src_file
widget_recent-posts
can_compress_scripts
rdf_tools_endpoint_features
db_upgraded
...

Browser metrics Passed 4 tests

An overview of browser requirements for LH Tools
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲7213.23 ▼1.075.07 ▲2.8341.72 ▼7.71
Dashboard /wp-admin2,213 ▲254.83 ▼0.10102.47 ▼10.6141.61 ▼2.19
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0039.67 ▼1.4935.28 ▼0.63
Add New Post /wp-admin/post-new.php1,545 ▲2818.71 ▲1.18614.87 ▼16.9555.54 ▲5.08
Media Library /wp-admin/upload.php1,392 ▲104.17 ▼0.0294.64 ▲2.4142.62 ▲3.69
LH Tools /wp-admin/lh-tools.php260.440.1513.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > 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.
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% 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 no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lh-tools/ping.php
  • 100× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ARC2' not found in wp-content/plugins/lh-tools/arc/serializers/ARC2_RSS10Serializer.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\db_adapter_depended\\sparql_1_1_tests\\ComplianceTest' not found in wp-content/plugins/lh-tools/arc/tests/db_adapter_depended/sparql_1_1_tests/DropTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/lh-tools/arc/tests/ARC2_TestCase.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'ARC2' not found in wp-content/plugins/lh-tools/arc/parsers/ARC2_LegacyXMLParser.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\ARC2_TestCase' not found in wp-content/plugins/lh-tools/arc/tests/db_adapter_depended/store/query/InsertIntoQueryTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ARC2' not found in wp-content/plugins/lh-tools/arc/extractors/ARC2_RdfaExtractor.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ARC2' not found in wp-content/plugins/lh-tools/arc/serializers/ARC2_TurtleSerializer.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ARC2' not found in wp-content/plugins/lh-tools/arc/parsers/ARC2_SemHTMLParser.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\ARC2_TestCase' not found in wp-content/plugins/lh-tools/arc/tests/db_adapter_depended/store/ARC2_StoreInsertQueryHandlerTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\ARC2_TestCase' not found in wp-content/plugins/lh-tools/arc/tests/unit/store/ARC2_StoreEndpointTest.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/lh-tools.php
    • > Network (severe)
    wp-admin/lh-tools.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: json, skos, sparql, rdf, api...

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

The main PHP file in "LH Tools" ver. 0.15 adds more information about the plugin and also serves as the entry point for this plugin
55 characters long description:
RDF Storage and related tools. Requires the ARC Toolkit

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin23,693 lines of code in 240 files:
LanguageFilesBlank linesComment linesLines of code
PHP1093,4102,77919,933
XML258461,895
JavaScript21252598
YAML119710447
Ruby812822353
Markdown4830180
JSON290132
HTML1710100
Ant15017
Dockerfile18515
make13013
INI12218
SQL1002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity35.22
▷ Minimum class complexity1.00
▷ Maximum class complexity476.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity73.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes99
▷ Abstract classes33.03%
▷ Concrete classes9696.97%
▷ Final classes00.00%
Methods1,308
▷ Static methods483.67%
▷ Public methods1,24495.11%
▷ Protected methods644.89%
▷ Private methods00.00%
Functions47
▷ Named functions3982.98%
▷ Anonymous functions817.02%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/magnify_icon.png1.22KB0.79KB▼ 34.86%
images/question_mark_thumbnail-150x150.png7.79KB3.94KB▼ 49.42%