84% lh-related-posts-by-taxonomy

Code Review | LH Related Posts by Taxonomy

WordPress plugin LH Related Posts by Taxonomy scored84%from 54 tests.

About plugin

  • Plugin page: lh-related-posts-...
  • Plugin version: 1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Feb 20, 2020
  • Latest release: Aug 9, 2022
  • Number of updates: 5
  • Update frequency: every 184.8 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /478 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.91ms] Passed 4 tests

An overview of server-side resources used by LH Related Posts by Taxonomy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.72 ▼1.95
Dashboard /wp-admin3.31 ▼0.0342.96 ▼14.28
Posts /wp-admin/edit.php3.43 ▲0.0744.95 ▼3.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0178.69 ▼12.22
Media Library /wp-admin/upload.php3.24 ▲0.0135.46 ▲2.73

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for LH Related Posts by Taxonomy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲4514.40 ▲0.451.71 ▲0.1437.53 ▼4.56
Dashboard /wp-admin2,195 ▲145.58 ▼0.1492.27 ▼3.8136.32 ▼3.29
Posts /wp-admin/edit.php2,103 ▲32.01 ▲0.0439.37 ▲1.0437.25 ▲2.60
Add New Post /wp-admin/post-new.php1,526 ▼023.09 ▼0.44680.13 ▼66.6359.33 ▼4.76
Media Library /wp-admin/upload.php1,397 ▼34.15 ▼0.0394.07 ▼13.9642.65 ▼6.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/lh-related-posts-by-taxonomy/lh_rpbt-templates/default-template.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: posts, related posts, similar, thumbnails, related

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

The main PHP script in "LH Related Posts by Taxonomy" version 1.00 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

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
Success! There were no dangerous files found in this plugin811 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6481350776
CSS113035

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity38.00
▷ Minimum class complexity10.00
▷ Maximum class complexity61.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods54
▷ Static methods1425.93%
▷ Public methods5398.15%
▷ Protected methods11.85%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected