84% related-posts-by-taxonomy

Code Review | Related Posts by Taxonomy

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

About plugin

  • Plugin page: related-posts-by-...
  • Plugin version: 2.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4
  • WordPress version: 6.3.1
  • First release: May 10, 2013
  • Latest release: Nov 14, 2023
  • Number of updates: 150
  • Update frequency: every 25.6 days
  • Top authors: keesiemeijer (100%)

Code review

54 tests

User reviews

75 reviews

Install metrics

20,000+ active /258,144 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.37MB] [CPU: ▼1.30ms] Passed 4 tests

An overview of server-side resources used by Related Posts by Taxonomy
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3743.70 ▲9.05
Dashboard /wp-admin3.71 ▲0.4051.49 ▲4.16
Posts /wp-admin/edit.php3.76 ▲0.4048.54 ▲0.75
Add New Post /wp-admin/post-new.php6.27 ▲0.3882.98 ▼15.41
Media Library /wp-admin/upload.php3.57 ▲0.3437.45 ▲5.31

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 51 new files
Database: no new tables, 7 new options
New WordPress options
widget_related-posts-by-taxonomy
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

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 /2,792 ▲4514.67 ▲0.431.68 ▲0.0144.65 ▼0.67
Dashboard /wp-admin2,192 ▲115.60 ▼0.1195.68 ▼5.7647.82 ▲8.06
Posts /wp-admin/edit.php2,100 ▲31.94 ▼0.0240.20 ▼0.0332.54 ▼6.23
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.26668.34 ▲12.8451.05 ▼6.14
Media Library /wp-admin/upload.php1,400 ▲34.18 ▼0.01101.00 ▲0.8242.63 ▼0.69

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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_related-posts-by-taxonomy
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 27× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/posts-per-page.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 Notice
      Undefined variable: related_posts in wp-content/plugins/related-posts-by-taxonomy/templates/related-posts-thumbnails.php on line 34
    • > PHP Notice
      Undefined variable: style in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/post-types.php on line 2
    • > PHP Notice
      Undefined variable: style in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/image-size.php on line 1
    • > 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: related_posts in wp-content/plugins/related-posts-by-taxonomy/templates/related-posts-posts.php on line 31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function checked() in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/random.php: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/post-id.php:2
    • > PHP Notice
      Undefined variable: style in wp-content/plugins/related-posts-by-taxonomy/includes/assets/partials/widget/singular-template.php on line 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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 20 tag instead of maximum 10
Please take inspiration from this readme.txt

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

"Related Posts by Taxonomy" version 2.7.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 158 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin3,110 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP348012,3942,626
PO File5150171428
JavaScript291439
CSS11017

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
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.94
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods88
▷ Static methods22.27%
▷ Public methods8293.18%
▷ Protected methods00.00%
▷ Private methods66.82%
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
There were not PNG files found in your plugin