78% lh-jetpack-related-posts

Code Review | LH Jetpack Related Posts

WordPress plugin LH Jetpack Related Posts scored78%from 54 tests.

About plugin

  • Plugin page: lh-jetpack-relate...
  • Plugin version: 1.07
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Jun 9, 2016
  • Latest release: Jan 15, 2018
  • Number of updates: 8
  • Update frequency: every 73.1 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,687 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.12MB] [CPU: ▼12.41ms] Passed 4 tests

Analyzing server-side resources used by LH Jetpack Related Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0739.31 ▼14.60
Dashboard /wp-admin3.38 ▲0.0746.86 ▼4.91
Posts /wp-admin/edit.php3.49 ▲0.1345.73 ▼2.90
Add New Post /wp-admin/post-new.php5.21 ▼0.6865.33 ▼27.22
Media Library /wp-admin/upload.php3.30 ▲0.0737.40 ▲2.65
Related Posts /wp-admin/options-general.php?page=lh-jetpack-related-posts/lh-jetpack-related-posts.php3.3037.15

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by LH Jetpack Related Posts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.64 ▼0.741.67 ▼0.2339.41 ▼13.83
Dashboard /wp-admin2,210 ▲195.84 ▲0.97100.74 ▼8.4244.09 ▼0.76
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0335.03 ▼0.1135.85 ▼1.17
Add New Post /wp-admin/post-new.php1,540 ▲723.13 ▼0.23670.00 ▼12.4760.51 ▼7.43
Media Library /wp-admin/upload.php1,392 ▲14.22 ▼0.17103.66 ▲0.9944.61 ▼4.73
Related Posts /wp-admin/options-general.php?page=lh-jetpack-related-posts/lh-jetpack-related-posts.php1,0243.2556.3226.84

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-jetpack-related-posts/lh-jetpack-related-posts.php
    • > Notice in wp-content/plugins/lh-jetpack-related-posts/partials/option-settings.php+66
    Trying to access array offset on value of type bool
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lh-jetpack-related-posts/lh-jetpack-related-posts.php
    • > Warning in wp-content/plugins/lh-jetpack-related-posts/partials/option-settings.php+45
    in_array() expects parameter 2 to be array, null given

SRP 50% 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
Please fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/lh-jetpack-related-posts/lh-jetpack-related-posts.php:435
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/lh-jetpack-related-posts/partials/option-settings.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
3 plugin tags: jetpack, related posts, posts 2 posts

lh-jetpack-related-posts/lh-jetpack-related-posts.php 92% from 13 tests

Analyzing the main PHP file in "LH Jetpack Related Posts" version 1.07
The following require your attention:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
Everything looks great! No dangerous files found in this plugin296 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP225126273
JavaScript16623

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods15.26%
▷ Public methods1894.74%
▷ Protected methods00.00%
▷ Private methods15.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin