84% related-posts-by-taxonomy

Code Review | Related Posts by Taxonomy

WordPress plugin Related Posts by Taxonomy scored 84% from 54 tests.

About plugin

  • Plugin page: related-posts-by-...
  • Plugin version: 2.7.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5
  • WordPress version: 5.9.2
  • First release: May 10, 2013
  • Latest release: Sep 2, 2020
  • Number of updates: 148
  • Update frequency: every 18.1 days
  • Top authors: keesiemeijer (100%)

Code review

54 tests

User reviews

73 reviews

Install metrics

20,000+ active / 238,036 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
Installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼292.20ms] Passed 4 tests

This is a short check of server-side resources used by Related Posts by Taxonomy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4155.64 ▲6.20
Dashboard /wp-admin3.75 ▲0.3435.71 ▲0.75
Posts /wp-admin/edit.php3.98 ▲0.3440.85 ▲1.54
Add New Post /wp-admin/post-new.php7.35 ▲0.36101.46 ▼1,173.96
Media Library /wp-admin/upload.php3.70 ▲0.4026.57 ▲2.87

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 51 new files
Database: no new tables, 1 new option
New WordPress options
widget_related-posts-by-taxonomy

Browser metrics Passed 4 tests

This is an overview of browser requirements for Related Posts by Taxonomy
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,796 ▲4216.22 ▲0.206.04 ▼0.542.95 ▲0.42
Dashboard /wp-admin2,895 ▲346.05 ▼0.10121.05 ▼15.36164.33 ▲0.41
Posts /wp-admin/edit.php2,691 ▼03.23 ▼0.0164.71 ▲0.98139.93 ▼0.41
Add New Post /wp-admin/post-new.php1,711 ▲5021.18 ▲4.97434.40 ▲0.18172.12 ▲12.10
Media Library /wp-admin/upload.php1,698 ▼05.53 ▲0.02144.53 ▼1.46188.48 ▲4.83

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
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_related-posts-by-taxonomy

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 27× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/taxonomies.php:10
    • > PHP Notice
      Undefined variable: style in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/format.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/format.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/taxonomies.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/title.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/post-types.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function km_rpbt_no_posts_found_notice() in wp-content/plugins/related-posts-by-taxonomy/templates/related-posts-links.php:49
    • > PHP Notice
      Undefined variable: i in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/taxonomies.php on line 2
    • > PHP Notice
      Undefined variable: related_posts in wp-content/plugins/related-posts-by-taxonomy/templates/related-posts-excerpts.php on line 30
    • > PHP Notice
      Undefined variable: style in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/post-types.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
The official readme.txt is a good inspiration

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

The main PHP script in "Related Posts by Taxonomy" version 2.7.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected3,093 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP347982,3812,609
PO File5150171428
JavaScript2101439
CSS11017

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity25.43
▷ Minimum class complexity7.00
▷ Maximum class complexity50.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods87
▷ Static methods22.30%
▷ Public methods8193.10%
▷ Protected methods00.00%
▷ Private methods66.90%
Functions65
▷ Named functions65100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected